@decocms/mesh 2.4.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/client/assets/{AlertCircle-CZPV4eTQ.js → AlertCircle-DAyHhLS6.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DQOG1GuJ.js → ArrowLeft-Bpp_SsGd.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-Cdy__m-8.js → ChevronDown-CsOv8W2I.js} +1 -1
  4. package/dist/client/assets/{ChevronRight-SzPzGSNO.js → ChevronRight-Boh94iyZ.js} +1 -1
  5. package/dist/client/assets/{Copy01-DS49wIzW.js → Copy01-BrkhNqAw.js} +1 -1
  6. package/dist/client/assets/{DotsHorizontal-BSoB0mo2.js → DotsHorizontal-Bv4IcguS.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-eZBspOrA.js → DotsVertical-cXTBD68H.js} +1 -1
  8. package/dist/client/assets/{File06-CUqAuIUq.js → File06-l4-3IHqa.js} +1 -1
  9. package/dist/client/assets/{FilterLines-BTBF9JAn.js → FilterLines-D2prJuZ_.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-BRcPqCms.js → FlipBackward-Cuwh5H4e.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-DovnqKJf.js → GitBranch01-DDKUuZMu.js} +1 -1
  12. package/dist/client/assets/{Grid01-R-k411L-.js → Grid01-COCXYn3t.js} +1 -1
  13. package/dist/client/assets/{Inbox01-bvdCozgs.js → Inbox01-CEyXxA8m.js} +1 -1
  14. package/dist/client/assets/{InfoCircle-r2yyYHHv.js → InfoCircle-C2iaXmlJ.js} +1 -1
  15. package/dist/client/assets/{Key01-BWe_1dg2.js → Key01-CcMWzP51.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BklnopGx.js → LinkExternal01-31BeOzKc.js} +1 -1
  17. package/dist/client/assets/{Loading01-C0_l8AxO.js → Loading01-BqUL1Os2.js} +1 -1
  18. package/dist/client/assets/{Lock01-C7_8eECJ.js → Lock01-BfDepLwB.js} +1 -1
  19. package/dist/client/assets/{Play-CWJY4nY_.js → Play-DqaoplmY.js} +1 -1
  20. package/dist/client/assets/{Plus-KTlOMNSY.js → Plus-CJASgavw.js} +1 -1
  21. package/dist/client/assets/Stop-CRrts02X.js +1 -0
  22. package/dist/client/assets/{Terminal-DDfP4x2i.js → Terminal-e-eRty6Q.js} +1 -1
  23. package/dist/client/assets/{Trash01-BMJLKtdF.js → Trash01-C3O36hTP.js} +1 -1
  24. package/dist/client/assets/{X-BFdZnqth.js → X-D4fwyn55.js} +1 -1
  25. package/dist/client/assets/{XClose-DTyQuBBY.js → XClose-Bfbqr-bg.js} +1 -1
  26. package/dist/client/assets/{alert-dialog-Dz8Vs8_m.js → alert-dialog-F5nkQKBj.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-qU76xBKm.js → auth-catchall-BAZuaH8l.js} +1 -1
  28. package/dist/client/assets/{auth-CJNQiaii.js → auth-m66JRmI1.js} +1 -1
  29. package/dist/client/assets/{avatar-D4SXwEgs.js → avatar-MdaY7dDq.js} +1 -1
  30. package/dist/client/assets/{badge-99kEJDtp.js → badge-BRpJ4D36.js} +1 -1
  31. package/dist/client/assets/{card-DZuxbKf1.js → card-DPsjHi5_.js} +1 -1
  32. package/dist/client/assets/{checkbox-Bp9oZUjM.js → checkbox-dB50xYpN.js} +1 -1
  33. package/dist/client/assets/{collection-detail-BB7cjHq1.js → collection-detail-glRN62L4.js} +3 -3
  34. package/dist/client/assets/{collection-display-button-CqzsQ6A1.js → collection-display-button-BEkWecO6.js} +1 -1
  35. package/dist/client/assets/{collection-header-BQqQNO9q.js → collection-header-DS84Dz-Z.js} +1 -1
  36. package/dist/client/assets/{collection-page-DlOERJnr.js → collection-page-Dw7iXEq1.js} +1 -1
  37. package/dist/client/assets/{collection-search-CIs95Rnw.js → collection-search-Dwhflp6J.js} +1 -1
  38. package/dist/client/assets/{collection-tab-BPPicFWO.js → collection-tab-CQ_V1h26.js} +1 -1
  39. package/dist/client/assets/{collection-table-wrapper-D1OlmFUL.js → collection-table-wrapper-Tc6aoQU4.js} +1 -1
  40. package/dist/client/assets/{connection-card-Dm43-Wul.js → connection-card-BOHNc6OM.js} +1 -1
  41. package/dist/client/assets/connection-detail-yed7lEwn.js +1 -0
  42. package/dist/client/assets/{connections-BB4IEP_5.js → connections-Cyw4vKCR.js} +1 -1
  43. package/dist/client/assets/constants-DgMd8oVj.js +1 -0
  44. package/dist/client/assets/{create-organization-dialog-miyo8zQR.js → create-organization-dialog-BW64m1n3.js} +1 -1
  45. package/dist/client/assets/{dialog-DK6VaggX.js → dialog-dVO4tnyX.js} +1 -1
  46. package/dist/client/assets/{dropdown-menu-DTGJCwi0.js → dropdown-menu-Dl6PURsy.js} +1 -1
  47. package/dist/client/assets/{empty-state-DVGQ1BWZ.js → empty-state-Ctkb5o27.js} +1 -1
  48. package/dist/client/assets/{env-vars-editor-BG99RDNZ.js → env-vars-editor-BH1jNoL-.js} +1 -1
  49. package/dist/client/assets/{error-boundary-9rVpFVah.js → error-boundary-NRHN5Y9-.js} +1 -1
  50. package/dist/client/assets/{extract-connection-data-E0zDRO9-.js → extract-connection-data-BaLXzQ_k.js} +1 -1
  51. package/dist/client/assets/{form-BGufVhpJ.js → form-BYRg0fLZ.js} +1 -1
  52. package/dist/client/assets/{gateway-detail-IUdVxLB4.js → gateway-detail-BfXnCLYA.js} +1 -1
  53. package/dist/client/assets/gateway-selector-DAEirbF5.js +1 -0
  54. package/dist/client/assets/{gateways-BA7lpBES.js → gateways-BJBU4jqZ.js} +1 -1
  55. package/dist/client/assets/{home-B5o9i0BD.js → home-4Azy8yCf.js} +1 -1
  56. package/dist/client/assets/{index-CaBiIG-r.js → index-CiFNe-N2.js} +1 -1
  57. package/dist/client/assets/index-DJlsJ8uo.js +25 -0
  58. package/dist/client/assets/{index-DHr9tFb0.js → index-DsWTyaMI.js} +31 -31
  59. package/dist/client/assets/{input-C4WvdKkR.js → input-Bjw47IqN.js} +1 -1
  60. package/dist/client/assets/{layout-9R3rtCy3.js → layout-CSrwjVH6.js} +1 -1
  61. package/dist/client/assets/{lazy-highlighter-rNRrmjMV.js → lazy-highlighter-3jMk7DX6.js} +1 -1
  62. package/dist/client/assets/{localstorage-keys-DrIZl-Oa.js → localstorage-keys-mgwVhAgB.js} +1 -1
  63. package/dist/client/assets/{login-CaUUYoaL.js → login-B4k1yizo.js} +1 -1
  64. package/dist/client/assets/{mcp-oauth-BPterAhB.js → mcp-oauth-CYe4lbkF.js} +1 -1
  65. package/dist/client/assets/{mcp-server-detail-BmtUegeN.js → mcp-server-detail-BncapnIe.js} +1 -1
  66. package/dist/client/assets/{members-Dha-TTi3.js → members-CvcRBE7N.js} +1 -1
  67. package/dist/client/assets/{monaco-editor-fWj67pSD.js → monaco-editor-CiWfYNhn.js} +1 -1
  68. package/dist/client/assets/{monitoring-BHqKCRpc.js → monitoring-C2NQS-B1.js} +1 -1
  69. package/dist/client/assets/{oauth-callback-C8SrcUYM.js → oauth-callback-CVfImHX4.js} +1 -1
  70. package/dist/client/assets/{page-D_pWRusE.js → page-4Om70maF.js} +1 -1
  71. package/dist/client/assets/{page-CB2Kbqif.js → page-DWpNpeBI.js} +2 -2
  72. package/dist/client/assets/{pin-to-sidebar-button-Bau5uIKK.js → pin-to-sidebar-button-B_8L8Vb0.js} +1 -1
  73. package/dist/client/assets/{popover-B1hj_ypq.js → popover-BAqz8iCu.js} +1 -1
  74. package/dist/client/assets/project-context-provider-4_jnbmhf.js +1 -0
  75. package/dist/client/assets/{resizable-oOXY1Kb2.js → resizable-BQxIvKty.js} +1 -1
  76. package/dist/client/assets/{resource-tabs-DXcOsIua.js → resource-tabs-N7R8QmbK.js} +1 -1
  77. package/dist/client/assets/{select-58kzPmSH.js → select-D0sx2072.js} +1 -1
  78. package/dist/client/assets/{settings-C8uZUL9P.js → settings-DBVtWxtX.js} +1 -1
  79. package/dist/client/assets/shell-layout-yGeudWHM.js +1 -0
  80. package/dist/client/assets/{spinner-BmiYLJkt.js → spinner-DZG16LrV.js} +1 -1
  81. package/dist/client/assets/{switch-D3qS-cJT.js → switch-BRK3ymGn.js} +1 -1
  82. package/dist/client/assets/{textarea-KpHZNzGY.js → textarea-Ct5hMebK.js} +1 -1
  83. package/dist/client/assets/{thread-history-popover-DrZ24omE.js → thread-history-popover-CUQ7xqpL.js} +65 -65
  84. package/dist/client/assets/{tools-list-BQ6I_zS0.js → tools-list-B6Grd2aY.js} +1 -1
  85. package/dist/client/assets/{use-binding-DxCldqD_.js → use-binding-CocjKJdo.js} +1 -1
  86. package/dist/client/assets/{use-connection-gZqQ1FAI.js → use-connection-BRzCmTOd.js} +1 -1
  87. package/dist/client/assets/{use-connection-resources-CBnleHDw.js → use-connection-resources-AWPWi-RH.js} +1 -1
  88. package/dist/client/assets/{use-gateway-BAeublLm.js → use-gateway-LBTVY8TW.js} +1 -1
  89. package/dist/client/assets/{use-gateway-system-prompt-DcPNvMKK.js → use-gateway-system-prompt-DscZjM_A.js} +1 -1
  90. package/dist/client/assets/{use-list-state-_DXZxdCV.js → use-list-state-C9bMHTQK.js} +1 -1
  91. package/dist/client/assets/{use-mcp-DVQixgJB.js → use-mcp-Xq1C6Xb8.js} +1 -1
  92. package/dist/client/assets/{use-members-Ba-WS8jO.js → use-members-DwaDlN2k.js} +1 -1
  93. package/dist/client/assets/{use-mobile-CXfyAVoY.js → use-mobile-b2I183jd.js} +1 -1
  94. package/dist/client/assets/{use-organization-settings-g1OUF8Uc.js → use-organization-settings-D21MRe-D.js} +1 -1
  95. package/dist/client/assets/{use-tool-call-DYbV_cs9.js → use-tool-call-DWmlWS7M.js} +1 -1
  96. package/dist/client/assets/{useQueries-DAJGlQiv.js → useQueries-BLLM0cVq.js} +1 -1
  97. package/dist/client/assets/useQuery-BXYZ1U8o.js +1 -0
  98. package/dist/client/assets/{value-DqDh9HyF.js → value-D6kCdY90.js} +1 -1
  99. package/dist/client/assets/{view-mode-toggle-DAKbBF5Z.js → view-mode-toggle-DlhHZSZ6.js} +1 -1
  100. package/dist/client/assets/{workflow-BO9cHs1L.js → workflow-DufdLkFQ.js} +1 -1
  101. package/dist/client/index.html +1 -1
  102. package/dist/server/cli.js +89 -89
  103. package/dist/server/server.js +88 -88
  104. package/package.json +1 -1
  105. package/dist/client/assets/connection-detail-DXNZMYLL.js +0 -1
  106. package/dist/client/assets/constants-BSLIcG1u.js +0 -1
  107. package/dist/client/assets/gateway-selector-CuwGVcxw.js +0 -1
  108. package/dist/client/assets/index-Rcp5vvtf.js +0 -25
  109. package/dist/client/assets/project-context-provider-SYQQWwHt.js +0 -1
  110. package/dist/client/assets/shell-layout-BXan9A9l.js +0 -1
  111. package/dist/client/assets/useQuery--jXLy0yb.js +0 -1
@@ -1 +1 @@
1
- import{K as B,j as t,c as O,h as Q,r as k}from"./index-DHr9tFb0.js";import{u as U}from"./useQuery--jXLy0yb.js";import{i as W}from"./File06-CUqAuIUq.js";import{i as Y}from"./Loading01-C0_l8AxO.js";import{e as J}from"./github-icon-Dp3wHhYE.js";import{C as P}from"./collection-display-button-CqzsQ6A1.js";import{C as X}from"./collection-search-CIs95Rnw.js";import{C as Z}from"./collection-table-wrapper-D1OlmFUL.js";import{E as z,I as ee}from"./use-connection-gZqQ1FAI.js";import{C as te}from"./card-DZuxbKf1.js";import{V as se}from"./layout-9R3rtCy3.js";function oe(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function re(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ne(s){let e=oe(s);return e=re(e),e}function we({repository:s}){const e=s?J(s):null,{data:i,isLoading:c}=U({queryKey:B.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ne(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(W,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function ve(s){const e=O.c(39),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:L,emptyMessage:M}=s,D=L===void 0?!0:L,j=M===void 0?"This connection doesn't have any tools yet.":M,I=Q(),[n,$]=k.useState(""),[d,H]=k.useState("table"),[r,A]=k.useState("name"),[a,_]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(_(me),a==="desc"&&A(void 0)):(A(o),_("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const q=R[r]||"",G=b[r]||"",K=String(q).localeCompare(String(G));return a==="asc"?K:-K}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:ce,sortable:!0},{id:"description",header:"Description",render:le,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const V=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=V.filter(ie).map(ae),e[14]=S):S=e[14];const F=S;let f;e[15]!==u||e[16]!==D||e[17]!==a||e[18]!==r||e[19]!==d?(f=D&&t.jsx(se,{children:t.jsx(P,{viewMode:d,onViewModeChange:H,sortKey:r,sortDirection:a,onSort:u,sortOptions:F})}),e[15]=u,e[16]=D,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&($(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(X,{value:n,onChange:$,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==n||e[28]!==a||e[29]!==r||e[30]!==g||e[31]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(Z,{columns:V,data:g,isLoading:!1,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=n,e[28]=a,e[29]=r,e[30]=g,e[31]=d,e[32]=h):h=e[32];let x;e[33]!==p||e[34]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[33]=p,e[34]=h,e[35]=x):x=e[35];let T;return e[36]!==x||e[37]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[36]=x,e[37]=f,e[38]=T):T=e[38],T}function ae(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ie(s){return s.sortable}function le(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ce(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function me(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{we as R,ve as T};
1
+ import{K as B,j as t,c as O,h as Q,r as k}from"./index-DsWTyaMI.js";import{u as U}from"./useQuery-BXYZ1U8o.js";import{i as W}from"./File06-l4-3IHqa.js";import{i as Y}from"./Loading01-BqUL1Os2.js";import{e as J}from"./github-icon-Dp3wHhYE.js";import{C as P}from"./collection-display-button-BEkWecO6.js";import{C as X}from"./collection-search-Dwhflp6J.js";import{C as Z}from"./collection-table-wrapper-Tc6aoQU4.js";import{E as z,I as ee}from"./use-connection-BRzCmTOd.js";import{C as te}from"./card-DPsjHi5_.js";import{V as se}from"./layout-CSrwjVH6.js";function oe(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function re(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ne(s){let e=oe(s);return e=re(e),e}function we({repository:s}){const e=s?J(s):null,{data:i,isLoading:c}=U({queryKey:B.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ne(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(W,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function ve(s){const e=O.c(39),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:L,emptyMessage:M}=s,D=L===void 0?!0:L,j=M===void 0?"This connection doesn't have any tools yet.":M,I=Q(),[n,$]=k.useState(""),[d,H]=k.useState("table"),[r,A]=k.useState("name"),[a,_]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(_(me),a==="desc"&&A(void 0)):(A(o),_("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const q=R[r]||"",G=b[r]||"",K=String(q).localeCompare(String(G));return a==="asc"?K:-K}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:ce,sortable:!0},{id:"description",header:"Description",render:le,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const V=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=V.filter(ie).map(ae),e[14]=S):S=e[14];const F=S;let f;e[15]!==u||e[16]!==D||e[17]!==a||e[18]!==r||e[19]!==d?(f=D&&t.jsx(se,{children:t.jsx(P,{viewMode:d,onViewModeChange:H,sortKey:r,sortDirection:a,onSort:u,sortOptions:F})}),e[15]=u,e[16]=D,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&($(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(X,{value:n,onChange:$,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==n||e[28]!==a||e[29]!==r||e[30]!==g||e[31]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(Z,{columns:V,data:g,isLoading:!1,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=n,e[28]=a,e[29]=r,e[30]=g,e[31]=d,e[32]=h):h=e[32];let x;e[33]!==p||e[34]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[33]=p,e[34]=h,e[35]=x):x=e[35];let T;return e[36]!==x||e[37]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[36]=x,e[37]=f,e[38]=T):T=e[38],T}function ae(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ie(s){return s.sortable}function le(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ce(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function me(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{we as R,ve as T};
@@ -1,4 +1,4 @@
1
- import{bj as oe,bk as rs,v as P,M as J,Q as fe,L as yr,W as B,I as sa,H as be,X as te,a0 as Pe,bl as it,bm as na,s as A,bn as Jr,bo as ss,bp as aa,bq as Nn,br as oa,bs as ia,bt as ca,a1 as qn,J as Br,Y as ye,V as we,bu as ua,bv as la}from"./index-DHr9tFb0.js";import{C as da,P as fa,a as ha,G as pa,M as G,E as Z,b as ma,L as ya,c as ga,i as ft,d as _a,e as Lr,f as va,R as Ye,g as ba,h as Ur,j as wa,k as Sa,l as $a,T as ns,m as Mn,n as Ea,o as Ta,p as ka,q as Pa,I as Ia,S as Oa,r as bt,s as Ra,t as Ca,u as Na,v as qa,w as Ma,x as ja,y as jn,z as Aa,A as Da,B as La,D as Ua,F as Ha,U as Ne,H as Je,J as lr,K as mt,N as Va}from"./auth-CJNQiaii.js";var Fa=class{apply(t,e){if(!e.type)return;const r=Array.isArray(e.type)?e.type:[e.type],s=new Set(r);if(s.has("string")||(t.string=!1),!s.has("number")&&!s.has("integer")&&(t.number=!1),s.has("boolean")||(t.boolean=!1),s.has("null")||(t.null=!1),s.has("array")||(t.array=!1),s.has("object")||(t.object=!1),s.has("integer")&&t.number!==!1){const a=t.number||J();a instanceof it&&(t.number=a.int())}}},xa=class{apply(t,e){if(e.const===void 0)return;const r=e.const;t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1,typeof r=="string"?t.string=te(r):typeof r=="number"?t.number=te(r):typeof r=="boolean"?t.boolean=te(r):r===null?t.null=yr():Array.isArray(r)?t.array=void 0:typeof r=="object"&&(t.object=void 0)}},za=class{apply(t,e){if(!e.enum)return;if(e.enum.length===0){e.type||(t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1);return}const r={string:e.enum.filter(s=>typeof s=="string"),number:e.enum.filter(s=>typeof s=="number"),boolean:e.enum.filter(s=>typeof s=="boolean"),null:e.enum.filter(s=>s===null),array:e.enum.filter(s=>Array.isArray(s)),object:e.enum.filter(s=>typeof s=="object"&&s!==null&&!Array.isArray(s))};t.string=this.createTypeSchema(r.string,"string"),t.number=this.createTypeSchema(r.number,"number"),t.boolean=this.createTypeSchema(r.boolean,"boolean"),t.null=r.null.length>0?yr():!1,t.array=r.array.length>0?void 0:!1,t.object=r.object.length>0?void 0:!1}createTypeSchema(t,e){if(t.length===0)return!1;if(t.length===1)return te(t[0]);if(e==="string")return Pe(t);if(e==="number"){const[r,s,...a]=t;return be([te(r),te(s),...a.map(n=>te(n))])}return e==="boolean"?be([te(!0),te(!1)]):!1}},Ka=class{apply(t,e){const r=e;if(r.type==="string"&&r.format==="binary"&&r.contentEncoding==="binary"){let s=na();r.minLength!==void 0&&(s=s.min(r.minLength)),r.maxLength!==void 0&&(s=s.max(r.maxLength)),r.contentMediaType!==void 0&&(s=s.mime(r.contentMediaType)),t.file=s,t.string=!1}}},Wa=class{apply(t,e){const r=e;e.type===void 0&&(r.minLength!==void 0||r.maxLength!==void 0||r.pattern!==void 0)&&t.string===void 0&&(t.string=P())}},Ga=class{apply(t,e){const r=e;if(r.minLength!==void 0&&t.string!==!1){const s=t.string||P();s instanceof Jr&&(t.string=s.refine(a=>Array.from(a).length>=r.minLength,{message:`String must be at least ${r.minLength} characters long`}))}}},Ja=class{apply(t,e){const r=e;if(r.maxLength!==void 0&&t.string!==!1){const s=t.string||P();s instanceof Jr&&(t.string=s.refine(a=>Array.from(a).length<=r.maxLength,{message:`String must be at most ${r.maxLength} characters long`}))}}},Ba=class{apply(t,e){const r=e;if(r.pattern&&t.string!==!1){const s=t.string||P();if(s instanceof Jr){const a=new RegExp(r.pattern);t.string=s.regex(a)}}}},Qa=class{apply(t,e){const r=e;if(r.minimum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(t.number=s.min(r.minimum))}}},Za=class{apply(t,e){const r=e;if(r.maximum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(t.number=s.max(r.maximum))}}},Ya=class{apply(t,e){const r=e;if(r.exclusiveMinimum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(typeof r.exclusiveMinimum=="number"?t.number=s.gt(r.exclusiveMinimum):t.number=!1)}}},Xa=class{apply(t,e){const r=e;if(r.exclusiveMaximum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(typeof r.exclusiveMaximum=="number"?t.number=s.lt(r.exclusiveMaximum):t.number=!1)}}},eo=class{apply(t,e){const r=e;if(r.multipleOf!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(t.number=s.refine(a=>{if(r.multipleOf===0)return!1;const n=a/r.multipleOf,i=Math.round(n),o=Math.min(Math.abs(a)*Number.EPSILON*10,Math.abs(r.multipleOf)*Number.EPSILON*10);return Math.abs(n-i)<=o/Math.abs(r.multipleOf)},{message:`Must be a multiple of ${r.multipleOf}`}))}}},to=class{apply(t,e){const r=e;e.type===void 0&&(r.minItems!==void 0||r.maxItems!==void 0||r.items!==void 0||r.prefixItems!==void 0)&&t.array===void 0&&(t.array=B(oe()))}},ro=class{apply(t,e){const r=e;r.minItems!==void 0&&t.array!==!1&&(t.array=(t.array||B(oe())).min(r.minItems))}},so=class{apply(t,e){const r=e;r.maxItems!==void 0&&t.array!==!1&&(t.array=(t.array||B(oe())).max(r.maxItems))}},no=class{apply(t,e){const r=e;if(t.array!==!1)if(Array.isArray(r.items))t.array=t.array||B(oe());else if(r.items&&typeof r.items!="boolean"&&!r.prefixItems){const s=de(r.items);let a=B(s);if(t.array&&t.array instanceof aa){const n=t.array._def;n.checks&&n.checks.forEach(i=>{if(i._zod&&i._zod.def){const o=i._zod.def;o.check==="min_length"&&o.minimum!==void 0?a=a.min(o.minimum):o.check==="max_length"&&o.maximum!==void 0&&(a=a.max(o.maximum))}})}t.array=a}else typeof r.items=="boolean"&&r.items===!1?r.prefixItems?t.array=t.array||B(oe()):t.array=B(oe()).max(0):typeof r.items=="boolean"&&r.items===!0?t.array=t.array||B(oe()):r.prefixItems&&(t.array=t.array||B(oe()))}},ao=class{apply(t,e){if(e.type!=="array")return;const r=e;if(!Array.isArray(r.items)||t.array===!1)return;const s=r.items.map(n=>de(n));let a;s.length===0?a=ss([]):a=ss(s),r.minItems!==void 0&&r.minItems>s.length&&(a=!1),r.maxItems!==void 0&&r.maxItems<s.length&&(a=!1),t.tuple=a,t.array=!1}},oo=class{apply(t,e){const r=e;t.object!==!1&&(r.properties||r.required||r.additionalProperties!==void 0)&&(t.object=t.object||A({}).passthrough())}},io=class{apply(t,e){const r=e;e.type===void 0&&(r.maxProperties!==void 0||r.minProperties!==void 0)&&t.object===void 0&&(t.object=A({}).passthrough())}},co=class{apply(t,e){const r=e;if(r.maxProperties!==void 0&&t.object!==!1){const s=t.object||A({}).passthrough();t.object=s.refine(a=>Object.keys(a).length<=r.maxProperties,{message:`Object must have at most ${r.maxProperties} properties`})}}},uo=class{apply(t,e){const r=e;if(r.minProperties!==void 0&&t.object!==!1){const s=t.object||A({}).passthrough();t.object=s.refine(a=>Object.keys(a).length>=r.minProperties,{message:`Object must have at least ${r.minProperties} properties`})}}};function _t(t,e){if(t===e)return!0;if(t==null||e==null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((r,s)=>_t(r,e[s]));if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),s=Object.keys(e);return r.length!==s.length?!1:r.every(a=>s.includes(a)&&_t(t[a],e[a]))}return!1}function lo(){return t=>{if(!Array.isArray(t))return!0;const e=[];return t.every(r=>e.some(a=>_t(r,a))?!1:(e.push(r),!0))}}function dr(t,e){return t.safeParse(e).success}var fo=class{apply(t,e){if(!e.not)return t;const r=de(e.not);return t.refine(s=>!dr(r,s),{message:"Value must not match the 'not' schema"})}},ho=class{apply(t,e){return e.uniqueItems!==!0?t:t.refine(lo(),{message:"Array items must be unique"})}},po=class{apply(t,e){return!e.allOf||e.allOf.length===0?t:e.allOf.map(s=>de(s)).reduce((s,a)=>Nn(s,a),t)}},mo=class{apply(t,e){if(!e.anyOf||e.anyOf.length===0)return t;const r=e.anyOf.length===1?de(e.anyOf[0]):be([de(e.anyOf[0]),de(e.anyOf[1]),...e.anyOf.slice(2).map(s=>de(s))]);return Nn(t,r)}},yo=class{apply(t,e){if(!e.oneOf||e.oneOf.length===0)return t;const r=e.oneOf.map(s=>de(s));return t.refine(s=>{let a=0;for(const n of r)if(n.safeParse(s).success&&(a++,a>1))return!1;return a===1},{message:"Value must match exactly one of the oneOf schemas"})}},go=class{apply(t,e){const r=e;if(r.prefixItems&&Array.isArray(r.prefixItems)){const a=r.prefixItems.map(n=>de(n));return t.refine(n=>{if(!Array.isArray(n))return!0;for(let i=0;i<Math.min(n.length,a.length);i++)if(!dr(a[i],n[i]))return!1;if(n.length>a.length){if(typeof r.items=="boolean"&&r.items===!1)return!1;if(r.items&&typeof r.items=="object"&&!Array.isArray(r.items)){const i=de(r.items);for(let o=a.length;o<n.length;o++)if(!dr(i,n[o]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return t}},_o=class{apply(t,e){const r=e;if(!r.properties&&!r.required&&r.additionalProperties!==!1)return t;if(t instanceof oa||t instanceof ia){const s={};if(r.properties)for(const[a,n]of Object.entries(r.properties))n!==void 0&&(s[a]=de(n));if(r.required&&Array.isArray(r.required)){const a=new Set(r.required);for(const n of Object.keys(s))a.has(n)||(s[n]=s[n].optional())}else for(const a of Object.keys(s))s[a]=s[a].optional();return r.additionalProperties===!1?A(s):A(s).passthrough()}return t.refine(s=>{if(typeof s!="object"||s===null||Array.isArray(s))return!0;if(r.properties){for(const[a,n]of Object.entries(r.properties))if(n!==void 0&&Object.getOwnPropertyDescriptor(s,a)!==void 0&&!de(n).safeParse(s[a]).success)return!1}if(r.required&&Array.isArray(r.required)){for(const a of r.required)if(!(Object.getOwnPropertyDescriptor(s,a)!==void 0))return!1}if(r.additionalProperties===!1&&r.properties){const a=new Set(Object.keys(r.properties));for(const n in s)if(!a.has(n))return!1}return!0},{message:"Object constraints validation failed"})}},vo=class{apply(t,e){if(!e.enum||e.enum.length===0)return t;const r=e.enum.filter(s=>Array.isArray(s)||typeof s=="object"&&s!==null);return r.length===0?t:t.refine(s=>typeof s!="object"||s===null?!0:r.some(a=>_t(s,a)),{message:"Value must match one of the enum values"})}},bo=class{apply(t,e){if(e.const===void 0)return t;const r=e.const;return typeof r!="object"||r===null?t:t.refine(s=>_t(s,r),{message:"Value must equal the const value"})}},wo=class{apply(t,e){return e.description&&(t=t.describe(e.description)),t}},So=class{apply(t,e){var r;const s=e;return!((r=s.required)!=null&&r.includes("__proto__"))||e.type!==void 0?t:oe().refine(a=>this.validateRequired(a,s.required),{message:"Missing required properties"})}validateRequired(t,e){return typeof t!="object"||t===null||Array.isArray(t)?!0:e.every(r=>Object.prototype.hasOwnProperty.call(t,r))}},$o=class{apply(t,e){var r;const s=e;if(s.contains===void 0)return t;const a=de(s.contains),n=(r=s.minContains)!=null?r:1,i=s.maxContains;return t.refine(o=>{if(!Array.isArray(o))return!0;let u=0;for(const m of o)dr(a,m)&&u++;return!(u<n||i!==void 0&&u>i)},{message:"Array must contain required items matching the schema"})}},Eo=class{apply(t,e){const{default:r}=e;return r===void 0||!t.safeParse(r).success?t:t.default(r)}},To=[new xa,new za,new Fa,new Ka,new Wa,new to,new io,new Ga,new Ja,new Ba,new Qa,new Za,new Ya,new Xa,new eo,new ao,new ro,new so,new no,new co,new uo,new oo],ko=[new So,new vo,new bo,new po,new mo,new yo,new go,new _o,new $o,new fo,new ho,new Eo,new wo];function de(t){if(typeof t=="boolean")return t?oe():rs();const e={};for(const a of To)a.apply(e,t);const r=[];if(e.string!==!1&&r.push(e.string||P()),e.number!==!1&&r.push(e.number||J()),e.boolean!==!1&&r.push(e.boolean||fe()),e.null!==!1&&r.push(e.null||yr()),e.array!==!1&&r.push(e.array||B(oe())),e.tuple!==!1&&e.tuple!==void 0&&r.push(e.tuple),e.object!==!1)if(e.object)r.push(e.object);else{const a=sa(n=>typeof n=="object"&&n!==null&&!Array.isArray(n),"Must be an object, not an array");r.push(a)}e.file!==!1&&e.file!==void 0&&r.push(e.file);let s;r.length===0?s=rs():r.length===1?s=r[0]:Object.keys(t).some(n=>n!=="$schema"&&n!=="title"&&n!=="description")?s=be(r):s=oe();for(const a of ko)s=a.apply(s,t);return s}function gr(t){return!!t._zod}function He(t,e){return gr(t)?ca(t,e):t.safeParse(e)}function An(t){if(!t)return;let e;if(gr(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Po(t){if(gr(t)){const n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}const r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}const s=t.value;if(s!==void 0)return s}function xe(t){return t==="completed"||t==="failed"||t==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function as(t){const r=An(t)?.method;if(!r)throw new Error("Schema is missing a method literal");const s=Po(r);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function os(t,e){const r=He(t,e);if(!r.success)throw r.error;return r.data}const Io=6e4;class Oo{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(da,r=>{this._oncancel(r)}),this.setNotificationHandler(fa,r=>{this._onprogress(r)}),this.setRequestHandler(ha,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pa,async(r,s)=>{const a=await this._taskStore.getTask(r.params.taskId,s.sessionId);if(!a)throw new G(Z.InvalidParams,"Failed to retrieve task: Task not found");return{...a}}),this.setRequestHandler(ma,async(r,s)=>{const a=async()=>{const n=r.params.taskId;if(this._taskMessageQueue){let o;for(;o=await this._taskMessageQueue.dequeue(n,s.sessionId);){if(o.type==="response"||o.type==="error"){const u=o.message,m=u.id,h=this._requestResolvers.get(m);if(h)if(this._requestResolvers.delete(m),o.type==="response")h(u);else{const $=u,g=new G($.error.code,$.error.message,$.error.data);h(g)}else{const $=o.type==="response"?"Response":"Error";this._onerror(new Error(`${$} handler missing for request ${m}`))}continue}await this._transport?.send(o.message,{relatedRequestId:s.requestId})}}const i=await this._taskStore.getTask(n,s.sessionId);if(!i)throw new G(Z.InvalidParams,`Task not found: ${n}`);if(!xe(i.status))return await this._waitForTaskUpdate(n,s.signal),await a();if(xe(i.status)){const o=await this._taskStore.getTaskResult(n,s.sessionId);return this._clearTaskQueue(n),{...o,_meta:{...o._meta,[Ye]:{taskId:n}}}}return await a()};return await a()}),this.setRequestHandler(ya,async(r,s)=>{try{const{tasks:a,nextCursor:n}=await this._taskStore.listTasks(r.params?.cursor,s.sessionId);return{tasks:a,nextCursor:n,_meta:{}}}catch(a){throw new G(Z.InvalidParams,`Failed to list tasks: ${a instanceof Error?a.message:String(a)}`)}}),this.setRequestHandler(ga,async(r,s)=>{try{const a=await this._taskStore.getTask(r.params.taskId,s.sessionId);if(!a)throw new G(Z.InvalidParams,`Task not found: ${r.params.taskId}`);if(xe(a.status))throw new G(Z.InvalidParams,`Cannot cancel task in terminal status: ${a.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(r.params.taskId);const n=await this._taskStore.getTask(r.params.taskId,s.sessionId);if(!n)throw new G(Z.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...n}}catch(a){throw a instanceof G?a:new G(Z.InvalidRequest,`Failed to cancel task: ${a instanceof Error?a.message:String(a)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,s,a,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,r),startTime:Date.now(),timeout:r,maxTotalTimeout:s,resetTimeoutOnProgress:n,onTimeout:a})}_resetTimeout(e){const r=this._timeoutInfo.get(e);if(!r)return!1;const s=Date.now()-r.startTime;if(r.maxTotalTimeout&&s>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),G.fromError(Z.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:s});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){const r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;const r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=n=>{s?.(n),this._onerror(n)};const a=this._transport?.onmessage;this._transport.onmessage=(n,i)=>{a?.(n,i),ft(n)||_a(n)?this._onresponse(n):Lr(n)?this._onrequest(n,i):va(n)?this._onnotification(n):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const r=G.fromError(Z.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){const r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,r){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,a=this._transport,n=e.params?._meta?.[Ye]?.taskId;if(s===void 0){const h={jsonrpc:"2.0",id:e.id,error:{code:Z.MethodNotFound,message:"Method not found"}};n&&this._taskMessageQueue?this._enqueueTaskMessage(n,{type:"error",message:h,timestamp:Date.now()},a?.sessionId).catch($=>this._onerror(new Error(`Failed to enqueue error response: ${$}`))):a?.send(h).catch($=>this._onerror(new Error(`Failed to send an error response: ${$}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);const o=ba(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,a?.sessionId):void 0,m={signal:i.signal,sessionId:a?.sessionId,_meta:e.params?._meta,sendNotification:async h=>{const $={relatedRequestId:e.id};n&&($.relatedTask={taskId:n}),await this.notification(h,$)},sendRequest:async(h,$,g)=>{const y={...g,relatedRequestId:e.id};n&&!y.relatedTask&&(y.relatedTask={taskId:n});const v=y.relatedTask?.taskId??n;return v&&u&&await u.updateTaskStatus(v,"input_required"),await this.request(h,$,y)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:n,taskStore:u,taskRequestedTtl:o?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,m)).then(async h=>{if(i.signal.aborted)return;const $={result:h,jsonrpc:"2.0",id:e.id};n&&this._taskMessageQueue?await this._enqueueTaskMessage(n,{type:"response",message:$,timestamp:Date.now()},a?.sessionId):await a?.send($)},async h=>{if(i.signal.aborted)return;const $={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(h.code)?h.code:Z.InternalError,message:h.message??"Internal error",...h.data!==void 0&&{data:h.data}}};n&&this._taskMessageQueue?await this._enqueueTaskMessage(n,{type:"error",message:$,timestamp:Date.now()},a?.sessionId):await a?.send($)}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:r,...s}=e.params,a=Number(r),n=this._progressHandlers.get(a);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const i=this._responseHandlers.get(a),o=this._timeoutInfo.get(a);if(o&&i&&o.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(u){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),i(u);return}n(s)}_onresponse(e){const r=Number(e.id),s=this._requestResolvers.get(r);if(s){if(this._requestResolvers.delete(r),ft(e))s(e);else{const i=new G(e.error.code,e.error.message,e.error.data);s(i)}return}const a=this._responseHandlers.get(r);if(a===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let n=!1;if(ft(e)&&e.result&&typeof e.result=="object"){const i=e.result;if(i.task&&typeof i.task=="object"){const o=i.task;typeof o.taskId=="string"&&(n=!0,this._taskProgressTokens.set(o.taskId,r))}}if(n||this._progressHandlers.delete(r),ft(e))a(e);else{const i=G.fromError(e.error.code,e.error.message,e.error.data);a(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,s){const{task:a}=s??{};if(!a){try{yield{type:"result",result:await this.request(e,r,s)}}catch(i){yield{type:"error",error:i instanceof G?i:new G(Z.InternalError,String(i))}}return}let n;try{const i=await this.request(e,Ur,s);if(i.task)n=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new G(Z.InternalError,"Task creation did not return a task");for(;;){const o=await this.getTask({taskId:n},s);if(yield{type:"taskStatus",task:o},xe(o.status)){o.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:n},r,s)}:o.status==="failed"?yield{type:"error",error:new G(Z.InternalError,`Task ${n} failed`)}:o.status==="cancelled"&&(yield{type:"error",error:new G(Z.InternalError,`Task ${n} was cancelled`)});return}if(o.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:n},r,s)};return}const u=o.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(m=>setTimeout(m,u)),s?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof G?i:new G(Z.InternalError,String(i))}}}request(e,r,s){const{relatedRequestId:a,resumptionToken:n,onresumptiontoken:i,task:o,relatedTask:u}=s??{};return new Promise((m,h)=>{const $=c=>{h(c)};if(!this._transport){$(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(c){$(c);return}s?.signal?.throwIfAborted();const g=this._requestMessageId++,y={...e,jsonrpc:"2.0",id:g};s?.onprogress&&(this._progressHandlers.set(g,s.onprogress),y.params={...e.params,_meta:{...e.params?._meta||{},progressToken:g}}),o&&(y.params={...y.params,task:o}),u&&(y.params={...y.params,_meta:{...y.params?._meta||{},[Ye]:u}});const v=c=>{this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(c)}},{relatedRequestId:a,resumptionToken:n,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));const d=c instanceof G?c:new G(Z.RequestTimeout,String(c));h(d)};this._responseHandlers.set(g,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return h(c);try{const d=He(r,c.result);d.success?m(d.data):h(d.error)}catch(d){h(d)}}}),s?.signal?.addEventListener("abort",()=>{v(s?.signal?.reason)});const w=s?.timeout??Io,l=()=>v(G.fromError(Z.RequestTimeout,"Request timed out",{timeout:w}));this._setupTimeout(g,w,s?.maxTotalTimeout,l,s?.resetTimeoutOnProgress??!1);const p=u?.taskId;if(p){const c=d=>{const S=this._responseHandlers.get(g);S?S(d):this._onerror(new Error(`Response handler missing for side-channeled request ${g}`))};this._requestResolvers.set(g,c),this._enqueueTaskMessage(p,{type:"request",message:y,timestamp:Date.now()}).catch(d=>{this._cleanupTimeout(g),h(d)})}else this._transport.send(y,{relatedRequestId:a,resumptionToken:n,onresumptiontoken:i}).catch(c=>{this._cleanupTimeout(g),h(c)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},wa,r)}async getTaskResult(e,r,s){return this.request({method:"tasks/result",params:e},r,s)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Sa,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},$a,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=r?.relatedTask?.taskId;if(s){const o={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Ye]:r.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:o,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Ye]:r.relatedTask}}}),this._transport?.send(o,r).catch(u=>this._onerror(u))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[Ye]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){const s=as(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(a,n)=>{const i=os(e,a);return Promise.resolve(r(i,n))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){const s=as(e);this._notificationHandlers.set(s,a=>{const n=os(e,a);return Promise.resolve(r(n))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const a=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,s,a)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,r);for(const a of s)if(a.type==="request"&&Lr(a.message)){const n=a.message.id,i=this._requestResolvers.get(n);i?(i(new G(Z.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(n)):this._onerror(new Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let s=this._options?.defaultTaskPollInterval??1e3;try{const a=await this._taskStore?.getTask(e);a?.pollInterval&&(s=a.pollInterval)}catch{}return new Promise((a,n)=>{if(r.aborted){n(new G(Z.InvalidRequest,"Request cancelled"));return}const i=setTimeout(a,s);r.addEventListener("abort",()=>{clearTimeout(i),n(new G(Z.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async a=>{if(!e)throw new Error("No request provided");return await s.createTask(a,e.id,{method:e.method,params:e.params},r)},getTask:async a=>{const n=await s.getTask(a,r);if(!n)throw new G(Z.InvalidParams,"Failed to retrieve task: Task not found");return n},storeTaskResult:async(a,n,i)=>{await s.storeTaskResult(a,n,i,r);const o=await s.getTask(a,r);if(o){const u=ns.parse({method:"notifications/tasks/status",params:o});await this.notification(u),xe(o.status)&&this._cleanupTaskProgressHandler(a)}},getTaskResult:a=>s.getTaskResult(a,r),updateTaskStatus:async(a,n,i)=>{const o=await s.getTask(a,r);if(!o)throw new G(Z.InvalidParams,`Task "${a}" not found - it may have been cleaned up`);if(xe(o.status))throw new G(Z.InvalidParams,`Cannot update task "${a}" from terminal status "${o.status}" to "${n}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(a,n,i,r);const u=await s.getTask(a,r);if(u){const m=ns.parse({method:"notifications/tasks/status",params:u});await this.notification(m),xe(u.status)&&this._cleanupTaskProgressHandler(a)}},listTasks:a=>s.listTasks(a,r)}}}function is(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Ro(t,e){const r={...t};for(const s in e){const a=s,n=e[a];if(n===void 0)continue;const i=r[a];is(i)&&is(n)?r[a]={...i,...n}:r[a]=n}return r}var wt={exports:{}},Tr={},Me={},ze={},kr={},Pr={},Ir={},cs;function fr(){return cs||(cs=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(c){if(super(),!t.IDENTIFIER.test(c))throw new Error("CodeGen: name must be a valid identifier");this.str=c}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class s extends e{constructor(c){super(),this._items=typeof c=="string"?[c]:c}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const c=this._items[0];return c===""||c==='""'}get str(){var c;return(c=this._str)!==null&&c!==void 0?c:this._str=this._items.reduce((d,S)=>`${d}${S}`,"")}get names(){var c;return(c=this._names)!==null&&c!==void 0?c:this._names=this._items.reduce((d,S)=>(S instanceof r&&(d[S.str]=(d[S.str]||0)+1),d),{})}}t._Code=s,t.nil=new s("");function a(p,...c){const d=[p[0]];let S=0;for(;S<c.length;)o(d,c[S]),d.push(p[++S]);return new s(d)}t._=a;const n=new s("+");function i(p,...c){const d=[y(p[0])];let S=0;for(;S<c.length;)d.push(n),o(d,c[S]),d.push(n,y(p[++S]));return u(d),new s(d)}t.str=i;function o(p,c){c instanceof s?p.push(...c._items):c instanceof r?p.push(c):p.push($(c))}t.addCodeArg=o;function u(p){let c=1;for(;c<p.length-1;){if(p[c]===n){const d=m(p[c-1],p[c+1]);if(d!==void 0){p.splice(c-1,3,d);continue}p[c++]="+"}c++}}function m(p,c){if(c==='""')return p;if(p==='""')return c;if(typeof p=="string")return c instanceof r||p[p.length-1]!=='"'?void 0:typeof c!="string"?`${p.slice(0,-1)}${c}"`:c[0]==='"'?p.slice(0,-1)+c.slice(1):void 0;if(typeof c=="string"&&c[0]==='"'&&!(p instanceof r))return`"${p}${c.slice(1)}`}function h(p,c){return c.emptyStr()?p:p.emptyStr()?c:i`${p}${c}`}t.strConcat=h;function $(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:y(Array.isArray(p)?p.join(","):p)}function g(p){return new s(y(p))}t.stringify=g;function y(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=y;function v(p){return typeof p=="string"&&t.IDENTIFIER.test(p)?new s(`.${p}`):a`[${p}]`}t.getProperty=v;function w(p){if(typeof p=="string"&&t.IDENTIFIER.test(p))return new s(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}t.getEsmExportName=w;function l(p){return new s(p.toString())}t.regexpCode=l})(Ir)),Ir}var Or={},us;function ls(){return us||(us=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=fr();class r extends Error{constructor(m){super(`CodeGen: "code" for ${m} not defined`),this.value=m.value}}var s;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(s||(t.UsedValueState=s={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class a{constructor({prefixes:m,parent:h}={}){this._names={},this._prefixes=m,this._parent=h}toName(m){return m instanceof e.Name?m:this.name(m)}name(m){return new e.Name(this._newName(m))}_newName(m){const h=this._names[m]||this._nameGroup(m);return`${m}${h.index++}`}_nameGroup(m){var h,$;if(!(($=(h=this._parent)===null||h===void 0?void 0:h._prefixes)===null||$===void 0)&&$.has(m)||this._prefixes&&!this._prefixes.has(m))throw new Error(`CodeGen: prefix "${m}" is not allowed in this scope`);return this._names[m]={prefix:m,index:0}}}t.Scope=a;class n extends e.Name{constructor(m,h){super(h),this.prefix=m}setValue(m,{property:h,itemIndex:$}){this.value=m,this.scopePath=(0,e._)`.${new e.Name(h)}[${$}]`}}t.ValueScopeName=n;const i=(0,e._)`\n`;class o extends a{constructor(m){super(m),this._values={},this._scope=m.scope,this.opts={...m,_n:m.lines?i:e.nil}}get(){return this._scope}name(m){return new n(m,this._newName(m))}value(m,h){var $;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(m),{prefix:y}=g,v=($=h.key)!==null&&$!==void 0?$:h.ref;let w=this._values[y];if(w){const c=w.get(v);if(c)return c}else w=this._values[y]=new Map;w.set(v,g);const l=this._scope[y]||(this._scope[y]=[]),p=l.length;return l[p]=h.ref,g.setValue(h,{property:y,itemIndex:p}),g}getValue(m,h){const $=this._values[m];if($)return $.get(h)}scopeRefs(m,h=this._values){return this._reduceValues(h,$=>{if($.scopePath===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return(0,e._)`${m}${$.scopePath}`})}scopeCode(m=this._values,h,$){return this._reduceValues(m,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},h,$)}_reduceValues(m,h,$={},g){let y=e.nil;for(const v in m){const w=m[v];if(!w)continue;const l=$[v]=$[v]||new Map;w.forEach(p=>{if(l.has(p))return;l.set(p,s.Started);let c=h(p);if(c){const d=this.opts.es5?t.varKinds.var:t.varKinds.const;y=(0,e._)`${y}${d} ${p} = ${c};${this.opts._n}`}else if(c=g?.(p))y=(0,e._)`${y}${c}${this.opts._n}`;else throw new r(p);l.set(p,s.Completed)})}return y}}t.ValueScope=o})(Or)),Or}var ds;function Y(){return ds||(ds=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=fr(),r=ls();var s=fr();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}});var a=ls();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class n{optimizeNodes(){return this}optimizeNames(_,T){return this}}class i extends n{constructor(_,T,N){super(),this.varKind=_,this.name=T,this.rhs=N}render({es5:_,_n:T}){const N=_?r.varKinds.var:this.varKind,z=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${z};`+T}optimizeNames(_,T){if(_[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,_,T)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class o extends n{constructor(_,T,N){super(),this.lhs=_,this.rhs=T,this.sideEffects=N}render({_n:_}){return`${this.lhs} = ${this.rhs};`+_}optimizeNames(_,T){if(!(this.lhs instanceof e.Name&&!_[this.lhs.str]&&!this.sideEffects))return this.rhs=x(this.rhs,_,T),this}get names(){const _=this.lhs instanceof e.Name?{}:{...this.lhs.names};return F(_,this.rhs)}}class u extends o{constructor(_,T,N,z){super(_,N,z),this.op=T}render({_n:_}){return`${this.lhs} ${this.op}= ${this.rhs};`+_}}class m extends n{constructor(_){super(),this.label=_,this.names={}}render({_n:_}){return`${this.label}:`+_}}class h extends n{constructor(_){super(),this.label=_,this.names={}}render({_n:_}){return`break${this.label?` ${this.label}`:""};`+_}}class $ extends n{constructor(_){super(),this.error=_}render({_n:_}){return`throw ${this.error};`+_}get names(){return this.error.names}}class g extends n{constructor(_){super(),this.code=_}render({_n:_}){return`${this.code};`+_}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(_,T){return this.code=x(this.code,_,T),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class y extends n{constructor(_=[]){super(),this.nodes=_}render(_){return this.nodes.reduce((T,N)=>T+N.render(_),"")}optimizeNodes(){const{nodes:_}=this;let T=_.length;for(;T--;){const N=_[T].optimizeNodes();Array.isArray(N)?_.splice(T,1,...N):N?_[T]=N:_.splice(T,1)}return _.length>0?this:void 0}optimizeNames(_,T){const{nodes:N}=this;let z=N.length;for(;z--;){const W=N[z];W.optimizeNames(_,T)||(ae(_,W.names),N.splice(z,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((_,T)=>H(_,T.names),{})}}class v extends y{render(_){return"{"+_._n+super.render(_)+"}"+_._n}}class w extends y{}class l extends v{}l.kind="else";class p extends v{constructor(_,T){super(T),this.condition=_}render(_){let T=`if(${this.condition})`+super.render(_);return this.else&&(T+="else "+this.else.render(_)),T}optimizeNodes(){super.optimizeNodes();const _=this.condition;if(_===!0)return this.nodes;let T=this.else;if(T){const N=T.optimizeNodes();T=this.else=Array.isArray(N)?new l(N):N}if(T)return _===!1?T instanceof p?T:T.nodes:this.nodes.length?this:new p(ge(_),T instanceof p?[T]:T.nodes);if(!(_===!1||!this.nodes.length))return this}optimizeNames(_,T){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(_,T),!!(super.optimizeNames(_,T)||this.else))return this.condition=x(this.condition,_,T),this}get names(){const _=super.names;return F(_,this.condition),this.else&&H(_,this.else.names),_}}p.kind="if";class c extends v{}c.kind="for";class d extends c{constructor(_){super(),this.iteration=_}render(_){return`for(${this.iteration})`+super.render(_)}optimizeNames(_,T){if(super.optimizeNames(_,T))return this.iteration=x(this.iteration,_,T),this}get names(){return H(super.names,this.iteration.names)}}class S extends c{constructor(_,T,N,z){super(),this.varKind=_,this.name=T,this.from=N,this.to=z}render(_){const T=_.es5?r.varKinds.var:this.varKind,{name:N,from:z,to:W}=this;return`for(${T} ${N}=${z}; ${N}<${W}; ${N}++)`+super.render(_)}get names(){const _=F(super.names,this.from);return F(_,this.to)}}class f extends c{constructor(_,T,N,z){super(),this.loop=_,this.varKind=T,this.name=N,this.iterable=z}render(_){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(_)}optimizeNames(_,T){if(super.optimizeNames(_,T))return this.iterable=x(this.iterable,_,T),this}get names(){return H(super.names,this.iterable.names)}}class b extends v{constructor(_,T,N){super(),this.name=_,this.args=T,this.async=N}render(_){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(_)}}b.kind="func";class E extends y{render(_){return"return "+super.render(_)}}E.kind="return";class C extends v{render(_){let T="try"+super.render(_);return this.catch&&(T+=this.catch.render(_)),this.finally&&(T+=this.finally.render(_)),T}optimizeNodes(){var _,T;return super.optimizeNodes(),(_=this.catch)===null||_===void 0||_.optimizeNodes(),(T=this.finally)===null||T===void 0||T.optimizeNodes(),this}optimizeNames(_,T){var N,z;return super.optimizeNames(_,T),(N=this.catch)===null||N===void 0||N.optimizeNames(_,T),(z=this.finally)===null||z===void 0||z.optimizeNames(_,T),this}get names(){const _=super.names;return this.catch&&H(_,this.catch.names),this.finally&&H(_,this.finally.names),_}}class D extends v{constructor(_){super(),this.error=_}render(_){return`catch(${this.error})`+super.render(_)}}D.kind="catch";class V extends v{render(_){return"finally"+super.render(_)}}V.kind="finally";class q{constructor(_,T={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...T,_n:T.lines?`
1
+ import{bj as oe,bk as rs,v as P,M as J,Q as fe,L as yr,W as B,I as sa,H as be,X as te,a0 as Pe,bl as it,bm as na,s as A,bn as Jr,bo as ss,bp as aa,bq as Nn,br as oa,bs as ia,bt as ca,a1 as qn,J as Br,Y as ye,V as we,bu as ua,bv as la}from"./index-DsWTyaMI.js";import{C as da,P as fa,a as ha,G as pa,M as G,E as Z,b as ma,L as ya,c as ga,i as ft,d as _a,e as Lr,f as va,R as Ye,g as ba,h as Ur,j as wa,k as Sa,l as $a,T as ns,m as Mn,n as Ea,o as Ta,p as ka,q as Pa,I as Ia,S as Oa,r as bt,s as Ra,t as Ca,u as Na,v as qa,w as Ma,x as ja,y as jn,z as Aa,A as Da,B as La,D as Ua,F as Ha,U as Ne,H as Je,J as lr,K as mt,N as Va}from"./auth-m66JRmI1.js";var Fa=class{apply(t,e){if(!e.type)return;const r=Array.isArray(e.type)?e.type:[e.type],s=new Set(r);if(s.has("string")||(t.string=!1),!s.has("number")&&!s.has("integer")&&(t.number=!1),s.has("boolean")||(t.boolean=!1),s.has("null")||(t.null=!1),s.has("array")||(t.array=!1),s.has("object")||(t.object=!1),s.has("integer")&&t.number!==!1){const a=t.number||J();a instanceof it&&(t.number=a.int())}}},xa=class{apply(t,e){if(e.const===void 0)return;const r=e.const;t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1,typeof r=="string"?t.string=te(r):typeof r=="number"?t.number=te(r):typeof r=="boolean"?t.boolean=te(r):r===null?t.null=yr():Array.isArray(r)?t.array=void 0:typeof r=="object"&&(t.object=void 0)}},za=class{apply(t,e){if(!e.enum)return;if(e.enum.length===0){e.type||(t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1);return}const r={string:e.enum.filter(s=>typeof s=="string"),number:e.enum.filter(s=>typeof s=="number"),boolean:e.enum.filter(s=>typeof s=="boolean"),null:e.enum.filter(s=>s===null),array:e.enum.filter(s=>Array.isArray(s)),object:e.enum.filter(s=>typeof s=="object"&&s!==null&&!Array.isArray(s))};t.string=this.createTypeSchema(r.string,"string"),t.number=this.createTypeSchema(r.number,"number"),t.boolean=this.createTypeSchema(r.boolean,"boolean"),t.null=r.null.length>0?yr():!1,t.array=r.array.length>0?void 0:!1,t.object=r.object.length>0?void 0:!1}createTypeSchema(t,e){if(t.length===0)return!1;if(t.length===1)return te(t[0]);if(e==="string")return Pe(t);if(e==="number"){const[r,s,...a]=t;return be([te(r),te(s),...a.map(n=>te(n))])}return e==="boolean"?be([te(!0),te(!1)]):!1}},Ka=class{apply(t,e){const r=e;if(r.type==="string"&&r.format==="binary"&&r.contentEncoding==="binary"){let s=na();r.minLength!==void 0&&(s=s.min(r.minLength)),r.maxLength!==void 0&&(s=s.max(r.maxLength)),r.contentMediaType!==void 0&&(s=s.mime(r.contentMediaType)),t.file=s,t.string=!1}}},Wa=class{apply(t,e){const r=e;e.type===void 0&&(r.minLength!==void 0||r.maxLength!==void 0||r.pattern!==void 0)&&t.string===void 0&&(t.string=P())}},Ga=class{apply(t,e){const r=e;if(r.minLength!==void 0&&t.string!==!1){const s=t.string||P();s instanceof Jr&&(t.string=s.refine(a=>Array.from(a).length>=r.minLength,{message:`String must be at least ${r.minLength} characters long`}))}}},Ja=class{apply(t,e){const r=e;if(r.maxLength!==void 0&&t.string!==!1){const s=t.string||P();s instanceof Jr&&(t.string=s.refine(a=>Array.from(a).length<=r.maxLength,{message:`String must be at most ${r.maxLength} characters long`}))}}},Ba=class{apply(t,e){const r=e;if(r.pattern&&t.string!==!1){const s=t.string||P();if(s instanceof Jr){const a=new RegExp(r.pattern);t.string=s.regex(a)}}}},Qa=class{apply(t,e){const r=e;if(r.minimum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(t.number=s.min(r.minimum))}}},Za=class{apply(t,e){const r=e;if(r.maximum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(t.number=s.max(r.maximum))}}},Ya=class{apply(t,e){const r=e;if(r.exclusiveMinimum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(typeof r.exclusiveMinimum=="number"?t.number=s.gt(r.exclusiveMinimum):t.number=!1)}}},Xa=class{apply(t,e){const r=e;if(r.exclusiveMaximum!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(typeof r.exclusiveMaximum=="number"?t.number=s.lt(r.exclusiveMaximum):t.number=!1)}}},eo=class{apply(t,e){const r=e;if(r.multipleOf!==void 0&&t.number!==!1){const s=t.number||J();s instanceof it&&(t.number=s.refine(a=>{if(r.multipleOf===0)return!1;const n=a/r.multipleOf,i=Math.round(n),o=Math.min(Math.abs(a)*Number.EPSILON*10,Math.abs(r.multipleOf)*Number.EPSILON*10);return Math.abs(n-i)<=o/Math.abs(r.multipleOf)},{message:`Must be a multiple of ${r.multipleOf}`}))}}},to=class{apply(t,e){const r=e;e.type===void 0&&(r.minItems!==void 0||r.maxItems!==void 0||r.items!==void 0||r.prefixItems!==void 0)&&t.array===void 0&&(t.array=B(oe()))}},ro=class{apply(t,e){const r=e;r.minItems!==void 0&&t.array!==!1&&(t.array=(t.array||B(oe())).min(r.minItems))}},so=class{apply(t,e){const r=e;r.maxItems!==void 0&&t.array!==!1&&(t.array=(t.array||B(oe())).max(r.maxItems))}},no=class{apply(t,e){const r=e;if(t.array!==!1)if(Array.isArray(r.items))t.array=t.array||B(oe());else if(r.items&&typeof r.items!="boolean"&&!r.prefixItems){const s=de(r.items);let a=B(s);if(t.array&&t.array instanceof aa){const n=t.array._def;n.checks&&n.checks.forEach(i=>{if(i._zod&&i._zod.def){const o=i._zod.def;o.check==="min_length"&&o.minimum!==void 0?a=a.min(o.minimum):o.check==="max_length"&&o.maximum!==void 0&&(a=a.max(o.maximum))}})}t.array=a}else typeof r.items=="boolean"&&r.items===!1?r.prefixItems?t.array=t.array||B(oe()):t.array=B(oe()).max(0):typeof r.items=="boolean"&&r.items===!0?t.array=t.array||B(oe()):r.prefixItems&&(t.array=t.array||B(oe()))}},ao=class{apply(t,e){if(e.type!=="array")return;const r=e;if(!Array.isArray(r.items)||t.array===!1)return;const s=r.items.map(n=>de(n));let a;s.length===0?a=ss([]):a=ss(s),r.minItems!==void 0&&r.minItems>s.length&&(a=!1),r.maxItems!==void 0&&r.maxItems<s.length&&(a=!1),t.tuple=a,t.array=!1}},oo=class{apply(t,e){const r=e;t.object!==!1&&(r.properties||r.required||r.additionalProperties!==void 0)&&(t.object=t.object||A({}).passthrough())}},io=class{apply(t,e){const r=e;e.type===void 0&&(r.maxProperties!==void 0||r.minProperties!==void 0)&&t.object===void 0&&(t.object=A({}).passthrough())}},co=class{apply(t,e){const r=e;if(r.maxProperties!==void 0&&t.object!==!1){const s=t.object||A({}).passthrough();t.object=s.refine(a=>Object.keys(a).length<=r.maxProperties,{message:`Object must have at most ${r.maxProperties} properties`})}}},uo=class{apply(t,e){const r=e;if(r.minProperties!==void 0&&t.object!==!1){const s=t.object||A({}).passthrough();t.object=s.refine(a=>Object.keys(a).length>=r.minProperties,{message:`Object must have at least ${r.minProperties} properties`})}}};function _t(t,e){if(t===e)return!0;if(t==null||e==null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((r,s)=>_t(r,e[s]));if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),s=Object.keys(e);return r.length!==s.length?!1:r.every(a=>s.includes(a)&&_t(t[a],e[a]))}return!1}function lo(){return t=>{if(!Array.isArray(t))return!0;const e=[];return t.every(r=>e.some(a=>_t(r,a))?!1:(e.push(r),!0))}}function dr(t,e){return t.safeParse(e).success}var fo=class{apply(t,e){if(!e.not)return t;const r=de(e.not);return t.refine(s=>!dr(r,s),{message:"Value must not match the 'not' schema"})}},ho=class{apply(t,e){return e.uniqueItems!==!0?t:t.refine(lo(),{message:"Array items must be unique"})}},po=class{apply(t,e){return!e.allOf||e.allOf.length===0?t:e.allOf.map(s=>de(s)).reduce((s,a)=>Nn(s,a),t)}},mo=class{apply(t,e){if(!e.anyOf||e.anyOf.length===0)return t;const r=e.anyOf.length===1?de(e.anyOf[0]):be([de(e.anyOf[0]),de(e.anyOf[1]),...e.anyOf.slice(2).map(s=>de(s))]);return Nn(t,r)}},yo=class{apply(t,e){if(!e.oneOf||e.oneOf.length===0)return t;const r=e.oneOf.map(s=>de(s));return t.refine(s=>{let a=0;for(const n of r)if(n.safeParse(s).success&&(a++,a>1))return!1;return a===1},{message:"Value must match exactly one of the oneOf schemas"})}},go=class{apply(t,e){const r=e;if(r.prefixItems&&Array.isArray(r.prefixItems)){const a=r.prefixItems.map(n=>de(n));return t.refine(n=>{if(!Array.isArray(n))return!0;for(let i=0;i<Math.min(n.length,a.length);i++)if(!dr(a[i],n[i]))return!1;if(n.length>a.length){if(typeof r.items=="boolean"&&r.items===!1)return!1;if(r.items&&typeof r.items=="object"&&!Array.isArray(r.items)){const i=de(r.items);for(let o=a.length;o<n.length;o++)if(!dr(i,n[o]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return t}},_o=class{apply(t,e){const r=e;if(!r.properties&&!r.required&&r.additionalProperties!==!1)return t;if(t instanceof oa||t instanceof ia){const s={};if(r.properties)for(const[a,n]of Object.entries(r.properties))n!==void 0&&(s[a]=de(n));if(r.required&&Array.isArray(r.required)){const a=new Set(r.required);for(const n of Object.keys(s))a.has(n)||(s[n]=s[n].optional())}else for(const a of Object.keys(s))s[a]=s[a].optional();return r.additionalProperties===!1?A(s):A(s).passthrough()}return t.refine(s=>{if(typeof s!="object"||s===null||Array.isArray(s))return!0;if(r.properties){for(const[a,n]of Object.entries(r.properties))if(n!==void 0&&Object.getOwnPropertyDescriptor(s,a)!==void 0&&!de(n).safeParse(s[a]).success)return!1}if(r.required&&Array.isArray(r.required)){for(const a of r.required)if(!(Object.getOwnPropertyDescriptor(s,a)!==void 0))return!1}if(r.additionalProperties===!1&&r.properties){const a=new Set(Object.keys(r.properties));for(const n in s)if(!a.has(n))return!1}return!0},{message:"Object constraints validation failed"})}},vo=class{apply(t,e){if(!e.enum||e.enum.length===0)return t;const r=e.enum.filter(s=>Array.isArray(s)||typeof s=="object"&&s!==null);return r.length===0?t:t.refine(s=>typeof s!="object"||s===null?!0:r.some(a=>_t(s,a)),{message:"Value must match one of the enum values"})}},bo=class{apply(t,e){if(e.const===void 0)return t;const r=e.const;return typeof r!="object"||r===null?t:t.refine(s=>_t(s,r),{message:"Value must equal the const value"})}},wo=class{apply(t,e){return e.description&&(t=t.describe(e.description)),t}},So=class{apply(t,e){var r;const s=e;return!((r=s.required)!=null&&r.includes("__proto__"))||e.type!==void 0?t:oe().refine(a=>this.validateRequired(a,s.required),{message:"Missing required properties"})}validateRequired(t,e){return typeof t!="object"||t===null||Array.isArray(t)?!0:e.every(r=>Object.prototype.hasOwnProperty.call(t,r))}},$o=class{apply(t,e){var r;const s=e;if(s.contains===void 0)return t;const a=de(s.contains),n=(r=s.minContains)!=null?r:1,i=s.maxContains;return t.refine(o=>{if(!Array.isArray(o))return!0;let u=0;for(const m of o)dr(a,m)&&u++;return!(u<n||i!==void 0&&u>i)},{message:"Array must contain required items matching the schema"})}},Eo=class{apply(t,e){const{default:r}=e;return r===void 0||!t.safeParse(r).success?t:t.default(r)}},To=[new xa,new za,new Fa,new Ka,new Wa,new to,new io,new Ga,new Ja,new Ba,new Qa,new Za,new Ya,new Xa,new eo,new ao,new ro,new so,new no,new co,new uo,new oo],ko=[new So,new vo,new bo,new po,new mo,new yo,new go,new _o,new $o,new fo,new ho,new Eo,new wo];function de(t){if(typeof t=="boolean")return t?oe():rs();const e={};for(const a of To)a.apply(e,t);const r=[];if(e.string!==!1&&r.push(e.string||P()),e.number!==!1&&r.push(e.number||J()),e.boolean!==!1&&r.push(e.boolean||fe()),e.null!==!1&&r.push(e.null||yr()),e.array!==!1&&r.push(e.array||B(oe())),e.tuple!==!1&&e.tuple!==void 0&&r.push(e.tuple),e.object!==!1)if(e.object)r.push(e.object);else{const a=sa(n=>typeof n=="object"&&n!==null&&!Array.isArray(n),"Must be an object, not an array");r.push(a)}e.file!==!1&&e.file!==void 0&&r.push(e.file);let s;r.length===0?s=rs():r.length===1?s=r[0]:Object.keys(t).some(n=>n!=="$schema"&&n!=="title"&&n!=="description")?s=be(r):s=oe();for(const a of ko)s=a.apply(s,t);return s}function gr(t){return!!t._zod}function He(t,e){return gr(t)?ca(t,e):t.safeParse(e)}function An(t){if(!t)return;let e;if(gr(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Po(t){if(gr(t)){const n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}const r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}const s=t.value;if(s!==void 0)return s}function xe(t){return t==="completed"||t==="failed"||t==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function as(t){const r=An(t)?.method;if(!r)throw new Error("Schema is missing a method literal");const s=Po(r);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function os(t,e){const r=He(t,e);if(!r.success)throw r.error;return r.data}const Io=6e4;class Oo{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(da,r=>{this._oncancel(r)}),this.setNotificationHandler(fa,r=>{this._onprogress(r)}),this.setRequestHandler(ha,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pa,async(r,s)=>{const a=await this._taskStore.getTask(r.params.taskId,s.sessionId);if(!a)throw new G(Z.InvalidParams,"Failed to retrieve task: Task not found");return{...a}}),this.setRequestHandler(ma,async(r,s)=>{const a=async()=>{const n=r.params.taskId;if(this._taskMessageQueue){let o;for(;o=await this._taskMessageQueue.dequeue(n,s.sessionId);){if(o.type==="response"||o.type==="error"){const u=o.message,m=u.id,h=this._requestResolvers.get(m);if(h)if(this._requestResolvers.delete(m),o.type==="response")h(u);else{const $=u,g=new G($.error.code,$.error.message,$.error.data);h(g)}else{const $=o.type==="response"?"Response":"Error";this._onerror(new Error(`${$} handler missing for request ${m}`))}continue}await this._transport?.send(o.message,{relatedRequestId:s.requestId})}}const i=await this._taskStore.getTask(n,s.sessionId);if(!i)throw new G(Z.InvalidParams,`Task not found: ${n}`);if(!xe(i.status))return await this._waitForTaskUpdate(n,s.signal),await a();if(xe(i.status)){const o=await this._taskStore.getTaskResult(n,s.sessionId);return this._clearTaskQueue(n),{...o,_meta:{...o._meta,[Ye]:{taskId:n}}}}return await a()};return await a()}),this.setRequestHandler(ya,async(r,s)=>{try{const{tasks:a,nextCursor:n}=await this._taskStore.listTasks(r.params?.cursor,s.sessionId);return{tasks:a,nextCursor:n,_meta:{}}}catch(a){throw new G(Z.InvalidParams,`Failed to list tasks: ${a instanceof Error?a.message:String(a)}`)}}),this.setRequestHandler(ga,async(r,s)=>{try{const a=await this._taskStore.getTask(r.params.taskId,s.sessionId);if(!a)throw new G(Z.InvalidParams,`Task not found: ${r.params.taskId}`);if(xe(a.status))throw new G(Z.InvalidParams,`Cannot cancel task in terminal status: ${a.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(r.params.taskId);const n=await this._taskStore.getTask(r.params.taskId,s.sessionId);if(!n)throw new G(Z.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...n}}catch(a){throw a instanceof G?a:new G(Z.InvalidRequest,`Failed to cancel task: ${a instanceof Error?a.message:String(a)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,s,a,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,r),startTime:Date.now(),timeout:r,maxTotalTimeout:s,resetTimeoutOnProgress:n,onTimeout:a})}_resetTimeout(e){const r=this._timeoutInfo.get(e);if(!r)return!1;const s=Date.now()-r.startTime;if(r.maxTotalTimeout&&s>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),G.fromError(Z.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:s});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){const r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;const r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=n=>{s?.(n),this._onerror(n)};const a=this._transport?.onmessage;this._transport.onmessage=(n,i)=>{a?.(n,i),ft(n)||_a(n)?this._onresponse(n):Lr(n)?this._onrequest(n,i):va(n)?this._onnotification(n):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const r=G.fromError(Z.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){const r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,r){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,a=this._transport,n=e.params?._meta?.[Ye]?.taskId;if(s===void 0){const h={jsonrpc:"2.0",id:e.id,error:{code:Z.MethodNotFound,message:"Method not found"}};n&&this._taskMessageQueue?this._enqueueTaskMessage(n,{type:"error",message:h,timestamp:Date.now()},a?.sessionId).catch($=>this._onerror(new Error(`Failed to enqueue error response: ${$}`))):a?.send(h).catch($=>this._onerror(new Error(`Failed to send an error response: ${$}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);const o=ba(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,a?.sessionId):void 0,m={signal:i.signal,sessionId:a?.sessionId,_meta:e.params?._meta,sendNotification:async h=>{const $={relatedRequestId:e.id};n&&($.relatedTask={taskId:n}),await this.notification(h,$)},sendRequest:async(h,$,g)=>{const y={...g,relatedRequestId:e.id};n&&!y.relatedTask&&(y.relatedTask={taskId:n});const v=y.relatedTask?.taskId??n;return v&&u&&await u.updateTaskStatus(v,"input_required"),await this.request(h,$,y)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:n,taskStore:u,taskRequestedTtl:o?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,m)).then(async h=>{if(i.signal.aborted)return;const $={result:h,jsonrpc:"2.0",id:e.id};n&&this._taskMessageQueue?await this._enqueueTaskMessage(n,{type:"response",message:$,timestamp:Date.now()},a?.sessionId):await a?.send($)},async h=>{if(i.signal.aborted)return;const $={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(h.code)?h.code:Z.InternalError,message:h.message??"Internal error",...h.data!==void 0&&{data:h.data}}};n&&this._taskMessageQueue?await this._enqueueTaskMessage(n,{type:"error",message:$,timestamp:Date.now()},a?.sessionId):await a?.send($)}).catch(h=>this._onerror(new Error(`Failed to send response: ${h}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:r,...s}=e.params,a=Number(r),n=this._progressHandlers.get(a);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const i=this._responseHandlers.get(a),o=this._timeoutInfo.get(a);if(o&&i&&o.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(u){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),i(u);return}n(s)}_onresponse(e){const r=Number(e.id),s=this._requestResolvers.get(r);if(s){if(this._requestResolvers.delete(r),ft(e))s(e);else{const i=new G(e.error.code,e.error.message,e.error.data);s(i)}return}const a=this._responseHandlers.get(r);if(a===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let n=!1;if(ft(e)&&e.result&&typeof e.result=="object"){const i=e.result;if(i.task&&typeof i.task=="object"){const o=i.task;typeof o.taskId=="string"&&(n=!0,this._taskProgressTokens.set(o.taskId,r))}}if(n||this._progressHandlers.delete(r),ft(e))a(e);else{const i=G.fromError(e.error.code,e.error.message,e.error.data);a(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,s){const{task:a}=s??{};if(!a){try{yield{type:"result",result:await this.request(e,r,s)}}catch(i){yield{type:"error",error:i instanceof G?i:new G(Z.InternalError,String(i))}}return}let n;try{const i=await this.request(e,Ur,s);if(i.task)n=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new G(Z.InternalError,"Task creation did not return a task");for(;;){const o=await this.getTask({taskId:n},s);if(yield{type:"taskStatus",task:o},xe(o.status)){o.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:n},r,s)}:o.status==="failed"?yield{type:"error",error:new G(Z.InternalError,`Task ${n} failed`)}:o.status==="cancelled"&&(yield{type:"error",error:new G(Z.InternalError,`Task ${n} was cancelled`)});return}if(o.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:n},r,s)};return}const u=o.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(m=>setTimeout(m,u)),s?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof G?i:new G(Z.InternalError,String(i))}}}request(e,r,s){const{relatedRequestId:a,resumptionToken:n,onresumptiontoken:i,task:o,relatedTask:u}=s??{};return new Promise((m,h)=>{const $=c=>{h(c)};if(!this._transport){$(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(c){$(c);return}s?.signal?.throwIfAborted();const g=this._requestMessageId++,y={...e,jsonrpc:"2.0",id:g};s?.onprogress&&(this._progressHandlers.set(g,s.onprogress),y.params={...e.params,_meta:{...e.params?._meta||{},progressToken:g}}),o&&(y.params={...y.params,task:o}),u&&(y.params={...y.params,_meta:{...y.params?._meta||{},[Ye]:u}});const v=c=>{this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(c)}},{relatedRequestId:a,resumptionToken:n,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));const d=c instanceof G?c:new G(Z.RequestTimeout,String(c));h(d)};this._responseHandlers.set(g,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return h(c);try{const d=He(r,c.result);d.success?m(d.data):h(d.error)}catch(d){h(d)}}}),s?.signal?.addEventListener("abort",()=>{v(s?.signal?.reason)});const w=s?.timeout??Io,l=()=>v(G.fromError(Z.RequestTimeout,"Request timed out",{timeout:w}));this._setupTimeout(g,w,s?.maxTotalTimeout,l,s?.resetTimeoutOnProgress??!1);const p=u?.taskId;if(p){const c=d=>{const S=this._responseHandlers.get(g);S?S(d):this._onerror(new Error(`Response handler missing for side-channeled request ${g}`))};this._requestResolvers.set(g,c),this._enqueueTaskMessage(p,{type:"request",message:y,timestamp:Date.now()}).catch(d=>{this._cleanupTimeout(g),h(d)})}else this._transport.send(y,{relatedRequestId:a,resumptionToken:n,onresumptiontoken:i}).catch(c=>{this._cleanupTimeout(g),h(c)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},wa,r)}async getTaskResult(e,r,s){return this.request({method:"tasks/result",params:e},r,s)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Sa,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},$a,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=r?.relatedTask?.taskId;if(s){const o={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Ye]:r.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:o,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Ye]:r.relatedTask}}}),this._transport?.send(o,r).catch(u=>this._onerror(u))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[Ye]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){const s=as(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(a,n)=>{const i=os(e,a);return Promise.resolve(r(i,n))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){const s=as(e);this._notificationHandlers.set(s,a=>{const n=os(e,a);return Promise.resolve(r(n))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const a=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,s,a)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,r);for(const a of s)if(a.type==="request"&&Lr(a.message)){const n=a.message.id,i=this._requestResolvers.get(n);i?(i(new G(Z.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(n)):this._onerror(new Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let s=this._options?.defaultTaskPollInterval??1e3;try{const a=await this._taskStore?.getTask(e);a?.pollInterval&&(s=a.pollInterval)}catch{}return new Promise((a,n)=>{if(r.aborted){n(new G(Z.InvalidRequest,"Request cancelled"));return}const i=setTimeout(a,s);r.addEventListener("abort",()=>{clearTimeout(i),n(new G(Z.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async a=>{if(!e)throw new Error("No request provided");return await s.createTask(a,e.id,{method:e.method,params:e.params},r)},getTask:async a=>{const n=await s.getTask(a,r);if(!n)throw new G(Z.InvalidParams,"Failed to retrieve task: Task not found");return n},storeTaskResult:async(a,n,i)=>{await s.storeTaskResult(a,n,i,r);const o=await s.getTask(a,r);if(o){const u=ns.parse({method:"notifications/tasks/status",params:o});await this.notification(u),xe(o.status)&&this._cleanupTaskProgressHandler(a)}},getTaskResult:a=>s.getTaskResult(a,r),updateTaskStatus:async(a,n,i)=>{const o=await s.getTask(a,r);if(!o)throw new G(Z.InvalidParams,`Task "${a}" not found - it may have been cleaned up`);if(xe(o.status))throw new G(Z.InvalidParams,`Cannot update task "${a}" from terminal status "${o.status}" to "${n}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(a,n,i,r);const u=await s.getTask(a,r);if(u){const m=ns.parse({method:"notifications/tasks/status",params:u});await this.notification(m),xe(u.status)&&this._cleanupTaskProgressHandler(a)}},listTasks:a=>s.listTasks(a,r)}}}function is(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Ro(t,e){const r={...t};for(const s in e){const a=s,n=e[a];if(n===void 0)continue;const i=r[a];is(i)&&is(n)?r[a]={...i,...n}:r[a]=n}return r}var wt={exports:{}},Tr={},Me={},ze={},kr={},Pr={},Ir={},cs;function fr(){return cs||(cs=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(c){if(super(),!t.IDENTIFIER.test(c))throw new Error("CodeGen: name must be a valid identifier");this.str=c}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class s extends e{constructor(c){super(),this._items=typeof c=="string"?[c]:c}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const c=this._items[0];return c===""||c==='""'}get str(){var c;return(c=this._str)!==null&&c!==void 0?c:this._str=this._items.reduce((d,S)=>`${d}${S}`,"")}get names(){var c;return(c=this._names)!==null&&c!==void 0?c:this._names=this._items.reduce((d,S)=>(S instanceof r&&(d[S.str]=(d[S.str]||0)+1),d),{})}}t._Code=s,t.nil=new s("");function a(p,...c){const d=[p[0]];let S=0;for(;S<c.length;)o(d,c[S]),d.push(p[++S]);return new s(d)}t._=a;const n=new s("+");function i(p,...c){const d=[y(p[0])];let S=0;for(;S<c.length;)d.push(n),o(d,c[S]),d.push(n,y(p[++S]));return u(d),new s(d)}t.str=i;function o(p,c){c instanceof s?p.push(...c._items):c instanceof r?p.push(c):p.push($(c))}t.addCodeArg=o;function u(p){let c=1;for(;c<p.length-1;){if(p[c]===n){const d=m(p[c-1],p[c+1]);if(d!==void 0){p.splice(c-1,3,d);continue}p[c++]="+"}c++}}function m(p,c){if(c==='""')return p;if(p==='""')return c;if(typeof p=="string")return c instanceof r||p[p.length-1]!=='"'?void 0:typeof c!="string"?`${p.slice(0,-1)}${c}"`:c[0]==='"'?p.slice(0,-1)+c.slice(1):void 0;if(typeof c=="string"&&c[0]==='"'&&!(p instanceof r))return`"${p}${c.slice(1)}`}function h(p,c){return c.emptyStr()?p:p.emptyStr()?c:i`${p}${c}`}t.strConcat=h;function $(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:y(Array.isArray(p)?p.join(","):p)}function g(p){return new s(y(p))}t.stringify=g;function y(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=y;function v(p){return typeof p=="string"&&t.IDENTIFIER.test(p)?new s(`.${p}`):a`[${p}]`}t.getProperty=v;function w(p){if(typeof p=="string"&&t.IDENTIFIER.test(p))return new s(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}t.getEsmExportName=w;function l(p){return new s(p.toString())}t.regexpCode=l})(Ir)),Ir}var Or={},us;function ls(){return us||(us=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=fr();class r extends Error{constructor(m){super(`CodeGen: "code" for ${m} not defined`),this.value=m.value}}var s;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(s||(t.UsedValueState=s={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class a{constructor({prefixes:m,parent:h}={}){this._names={},this._prefixes=m,this._parent=h}toName(m){return m instanceof e.Name?m:this.name(m)}name(m){return new e.Name(this._newName(m))}_newName(m){const h=this._names[m]||this._nameGroup(m);return`${m}${h.index++}`}_nameGroup(m){var h,$;if(!(($=(h=this._parent)===null||h===void 0?void 0:h._prefixes)===null||$===void 0)&&$.has(m)||this._prefixes&&!this._prefixes.has(m))throw new Error(`CodeGen: prefix "${m}" is not allowed in this scope`);return this._names[m]={prefix:m,index:0}}}t.Scope=a;class n extends e.Name{constructor(m,h){super(h),this.prefix=m}setValue(m,{property:h,itemIndex:$}){this.value=m,this.scopePath=(0,e._)`.${new e.Name(h)}[${$}]`}}t.ValueScopeName=n;const i=(0,e._)`\n`;class o extends a{constructor(m){super(m),this._values={},this._scope=m.scope,this.opts={...m,_n:m.lines?i:e.nil}}get(){return this._scope}name(m){return new n(m,this._newName(m))}value(m,h){var $;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(m),{prefix:y}=g,v=($=h.key)!==null&&$!==void 0?$:h.ref;let w=this._values[y];if(w){const c=w.get(v);if(c)return c}else w=this._values[y]=new Map;w.set(v,g);const l=this._scope[y]||(this._scope[y]=[]),p=l.length;return l[p]=h.ref,g.setValue(h,{property:y,itemIndex:p}),g}getValue(m,h){const $=this._values[m];if($)return $.get(h)}scopeRefs(m,h=this._values){return this._reduceValues(h,$=>{if($.scopePath===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return(0,e._)`${m}${$.scopePath}`})}scopeCode(m=this._values,h,$){return this._reduceValues(m,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},h,$)}_reduceValues(m,h,$={},g){let y=e.nil;for(const v in m){const w=m[v];if(!w)continue;const l=$[v]=$[v]||new Map;w.forEach(p=>{if(l.has(p))return;l.set(p,s.Started);let c=h(p);if(c){const d=this.opts.es5?t.varKinds.var:t.varKinds.const;y=(0,e._)`${y}${d} ${p} = ${c};${this.opts._n}`}else if(c=g?.(p))y=(0,e._)`${y}${c}${this.opts._n}`;else throw new r(p);l.set(p,s.Completed)})}return y}}t.ValueScope=o})(Or)),Or}var ds;function Y(){return ds||(ds=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=fr(),r=ls();var s=fr();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}});var a=ls();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class n{optimizeNodes(){return this}optimizeNames(_,T){return this}}class i extends n{constructor(_,T,N){super(),this.varKind=_,this.name=T,this.rhs=N}render({es5:_,_n:T}){const N=_?r.varKinds.var:this.varKind,z=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${z};`+T}optimizeNames(_,T){if(_[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,_,T)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class o extends n{constructor(_,T,N){super(),this.lhs=_,this.rhs=T,this.sideEffects=N}render({_n:_}){return`${this.lhs} = ${this.rhs};`+_}optimizeNames(_,T){if(!(this.lhs instanceof e.Name&&!_[this.lhs.str]&&!this.sideEffects))return this.rhs=x(this.rhs,_,T),this}get names(){const _=this.lhs instanceof e.Name?{}:{...this.lhs.names};return F(_,this.rhs)}}class u extends o{constructor(_,T,N,z){super(_,N,z),this.op=T}render({_n:_}){return`${this.lhs} ${this.op}= ${this.rhs};`+_}}class m extends n{constructor(_){super(),this.label=_,this.names={}}render({_n:_}){return`${this.label}:`+_}}class h extends n{constructor(_){super(),this.label=_,this.names={}}render({_n:_}){return`break${this.label?` ${this.label}`:""};`+_}}class $ extends n{constructor(_){super(),this.error=_}render({_n:_}){return`throw ${this.error};`+_}get names(){return this.error.names}}class g extends n{constructor(_){super(),this.code=_}render({_n:_}){return`${this.code};`+_}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(_,T){return this.code=x(this.code,_,T),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class y extends n{constructor(_=[]){super(),this.nodes=_}render(_){return this.nodes.reduce((T,N)=>T+N.render(_),"")}optimizeNodes(){const{nodes:_}=this;let T=_.length;for(;T--;){const N=_[T].optimizeNodes();Array.isArray(N)?_.splice(T,1,...N):N?_[T]=N:_.splice(T,1)}return _.length>0?this:void 0}optimizeNames(_,T){const{nodes:N}=this;let z=N.length;for(;z--;){const W=N[z];W.optimizeNames(_,T)||(ae(_,W.names),N.splice(z,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((_,T)=>H(_,T.names),{})}}class v extends y{render(_){return"{"+_._n+super.render(_)+"}"+_._n}}class w extends y{}class l extends v{}l.kind="else";class p extends v{constructor(_,T){super(T),this.condition=_}render(_){let T=`if(${this.condition})`+super.render(_);return this.else&&(T+="else "+this.else.render(_)),T}optimizeNodes(){super.optimizeNodes();const _=this.condition;if(_===!0)return this.nodes;let T=this.else;if(T){const N=T.optimizeNodes();T=this.else=Array.isArray(N)?new l(N):N}if(T)return _===!1?T instanceof p?T:T.nodes:this.nodes.length?this:new p(ge(_),T instanceof p?[T]:T.nodes);if(!(_===!1||!this.nodes.length))return this}optimizeNames(_,T){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(_,T),!!(super.optimizeNames(_,T)||this.else))return this.condition=x(this.condition,_,T),this}get names(){const _=super.names;return F(_,this.condition),this.else&&H(_,this.else.names),_}}p.kind="if";class c extends v{}c.kind="for";class d extends c{constructor(_){super(),this.iteration=_}render(_){return`for(${this.iteration})`+super.render(_)}optimizeNames(_,T){if(super.optimizeNames(_,T))return this.iteration=x(this.iteration,_,T),this}get names(){return H(super.names,this.iteration.names)}}class S extends c{constructor(_,T,N,z){super(),this.varKind=_,this.name=T,this.from=N,this.to=z}render(_){const T=_.es5?r.varKinds.var:this.varKind,{name:N,from:z,to:W}=this;return`for(${T} ${N}=${z}; ${N}<${W}; ${N}++)`+super.render(_)}get names(){const _=F(super.names,this.from);return F(_,this.to)}}class f extends c{constructor(_,T,N,z){super(),this.loop=_,this.varKind=T,this.name=N,this.iterable=z}render(_){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(_)}optimizeNames(_,T){if(super.optimizeNames(_,T))return this.iterable=x(this.iterable,_,T),this}get names(){return H(super.names,this.iterable.names)}}class b extends v{constructor(_,T,N){super(),this.name=_,this.args=T,this.async=N}render(_){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(_)}}b.kind="func";class E extends y{render(_){return"return "+super.render(_)}}E.kind="return";class C extends v{render(_){let T="try"+super.render(_);return this.catch&&(T+=this.catch.render(_)),this.finally&&(T+=this.finally.render(_)),T}optimizeNodes(){var _,T;return super.optimizeNodes(),(_=this.catch)===null||_===void 0||_.optimizeNodes(),(T=this.finally)===null||T===void 0||T.optimizeNodes(),this}optimizeNames(_,T){var N,z;return super.optimizeNames(_,T),(N=this.catch)===null||N===void 0||N.optimizeNames(_,T),(z=this.finally)===null||z===void 0||z.optimizeNames(_,T),this}get names(){const _=super.names;return this.catch&&H(_,this.catch.names),this.finally&&H(_,this.finally.names),_}}class D extends v{constructor(_){super(),this.error=_}render(_){return`catch(${this.error})`+super.render(_)}}D.kind="catch";class V extends v{render(_){return"finally"+super.render(_)}}V.kind="finally";class q{constructor(_,T={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...T,_n:T.lines?`
2
2
  `:""},this._extScope=_,this._scope=new r.Scope({parent:_}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(_){return this._scope.name(_)}scopeName(_){return this._extScope.name(_)}scopeValue(_,T){const N=this._extScope.value(_,T);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(_,T){return this._extScope.getValue(_,T)}scopeRefs(_){return this._extScope.scopeRefs(_,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(_,T,N,z){const W=this._scope.toName(T);return N!==void 0&&z&&(this._constants[W.str]=N),this._leafNode(new i(_,W,N)),W}const(_,T,N){return this._def(r.varKinds.const,_,T,N)}let(_,T,N){return this._def(r.varKinds.let,_,T,N)}var(_,T,N){return this._def(r.varKinds.var,_,T,N)}assign(_,T,N){return this._leafNode(new o(_,T,N))}add(_,T){return this._leafNode(new u(_,t.operators.ADD,T))}code(_){return typeof _=="function"?_():_!==e.nil&&this._leafNode(new g(_)),this}object(..._){const T=["{"];for(const[N,z]of _)T.length>1&&T.push(","),T.push(N),(N!==z||this.opts.es5)&&(T.push(":"),(0,e.addCodeArg)(T,z));return T.push("}"),new e._Code(T)}if(_,T,N){if(this._blockNode(new p(_)),T&&N)this.code(T).else().code(N).endIf();else if(T)this.code(T).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(_){return this._elseNode(new p(_))}else(){return this._elseNode(new l)}endIf(){return this._endBlockNode(p,l)}_for(_,T){return this._blockNode(_),T&&this.code(T).endFor(),this}for(_,T){return this._for(new d(_),T)}forRange(_,T,N,z,W=this.opts.es5?r.varKinds.var:r.varKinds.let){const ne=this._scope.toName(_);return this._for(new S(W,ne,T,N),()=>z(ne))}forOf(_,T,N,z=r.varKinds.const){const W=this._scope.toName(_);if(this.opts.es5){const ne=T instanceof e.Name?T:this.var("_arr",T);return this.forRange("_i",0,(0,e._)`${ne}.length`,re=>{this.var(W,(0,e._)`${ne}[${re}]`),N(W)})}return this._for(new f("of",z,W,T),()=>N(W))}forIn(_,T,N,z=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(_,(0,e._)`Object.keys(${T})`,N);const W=this._scope.toName(_);return this._for(new f("in",z,W,T),()=>N(W))}endFor(){return this._endBlockNode(c)}label(_){return this._leafNode(new m(_))}break(_){return this._leafNode(new h(_))}return(_){const T=new E;if(this._blockNode(T),this.code(_),T.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(_,T,N){if(!T&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const z=new C;if(this._blockNode(z),this.code(_),T){const W=this.name("e");this._currNode=z.catch=new D(W),T(W)}return N&&(this._currNode=z.finally=new V,this.code(N)),this._endBlockNode(D,V)}throw(_){return this._leafNode(new $(_))}block(_,T){return this._blockStarts.push(this._nodes.length),_&&this.code(_).endBlock(T),this}endBlock(_){const T=this._blockStarts.pop();if(T===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-T;if(N<0||_!==void 0&&N!==_)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${_} expected`);return this._nodes.length=T,this}func(_,T=e.nil,N,z){return this._blockNode(new b(_,T,N)),z&&this.code(z).endFunc(),this}endFunc(){return this._endBlockNode(b)}optimize(_=1){for(;_-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(_){return this._currNode.nodes.push(_),this}_blockNode(_){this._currNode.nodes.push(_),this._nodes.push(_)}_endBlockNode(_,T){const N=this._currNode;if(N instanceof _||T&&N instanceof T)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${T?`${_.kind}/${T.kind}`:_.kind}"`)}_elseNode(_){const T=this._currNode;if(!(T instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=T.else=_,this}get _root(){return this._nodes[0]}get _currNode(){const _=this._nodes;return _[_.length-1]}set _currNode(_){const T=this._nodes;T[T.length-1]=_}}t.CodeGen=q;function H(R,_){for(const T in _)R[T]=(R[T]||0)+(_[T]||0);return R}function F(R,_){return _ instanceof e._CodeOrName?H(R,_.names):R}function x(R,_,T){if(R instanceof e.Name)return N(R);if(!z(R))return R;return new e._Code(R._items.reduce((W,ne)=>(ne instanceof e.Name&&(ne=N(ne)),ne instanceof e._Code?W.push(...ne._items):W.push(ne),W),[]));function N(W){const ne=T[W.str];return ne===void 0||_[W.str]!==1?W:(delete _[W.str],ne)}function z(W){return W instanceof e._Code&&W._items.some(ne=>ne instanceof e.Name&&_[ne.str]===1&&T[ne.str]!==void 0)}}function ae(R,_){for(const T in _)R[T]=(R[T]||0)-(_[T]||0)}function ge(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,e._)`!${j(R)}`}t.not=ge;const _e=I(t.operators.AND);function ce(...R){return R.reduce(_e)}t.and=ce;const Ie=I(t.operators.OR);function L(...R){return R.reduce(Ie)}t.or=L;function I(R){return(_,T)=>_===e.nil?T:T===e.nil?_:(0,e._)`${j(_)} ${R} ${j(T)}`}function j(R){return R instanceof e.Name?R:(0,e._)`(${R})`}})(Pr)),Pr}var Q={},fs;function se(){if(fs)return Q;fs=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.checkStrictMode=Q.getErrorPath=Q.Type=Q.useFunc=Q.setEvaluated=Q.evaluatedPropsToName=Q.mergeEvaluated=Q.eachItem=Q.unescapeJsonPointer=Q.escapeJsonPointer=Q.escapeFragment=Q.unescapeFragment=Q.schemaRefOrVal=Q.schemaHasRulesButRef=Q.schemaHasRules=Q.checkUnknownRules=Q.alwaysValidSchema=Q.toHash=void 0;const t=Y(),e=fr();function r(f){const b={};for(const E of f)b[E]=!0;return b}Q.toHash=r;function s(f,b){return typeof b=="boolean"?b:Object.keys(b).length===0?!0:(a(f,b),!n(b,f.self.RULES.all))}Q.alwaysValidSchema=s;function a(f,b=f.schema){const{opts:E,self:C}=f;if(!E.strictSchema||typeof b=="boolean")return;const D=C.RULES.keywords;for(const V in b)D[V]||S(f,`unknown keyword: "${V}"`)}Q.checkUnknownRules=a;function n(f,b){if(typeof f=="boolean")return!f;for(const E in f)if(b[E])return!0;return!1}Q.schemaHasRules=n;function i(f,b){if(typeof f=="boolean")return!f;for(const E in f)if(E!=="$ref"&&b.all[E])return!0;return!1}Q.schemaHasRulesButRef=i;function o({topSchemaRef:f,schemaPath:b},E,C,D){if(!D){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,t._)`${E}`}return(0,t._)`${f}${b}${(0,t.getProperty)(C)}`}Q.schemaRefOrVal=o;function u(f){return $(decodeURIComponent(f))}Q.unescapeFragment=u;function m(f){return encodeURIComponent(h(f))}Q.escapeFragment=m;function h(f){return typeof f=="number"?`${f}`:f.replace(/~/g,"~0").replace(/\//g,"~1")}Q.escapeJsonPointer=h;function $(f){return f.replace(/~1/g,"/").replace(/~0/g,"~")}Q.unescapeJsonPointer=$;function g(f,b){if(Array.isArray(f))for(const E of f)b(E);else b(f)}Q.eachItem=g;function y({mergeNames:f,mergeToName:b,mergeValues:E,resultToName:C}){return(D,V,q,H)=>{const F=q===void 0?V:q instanceof t.Name?(V instanceof t.Name?f(D,V,q):b(D,V,q),q):V instanceof t.Name?(b(D,q,V),V):E(V,q);return H===t.Name&&!(F instanceof t.Name)?C(D,F):F}}Q.mergeEvaluated={props:y({mergeNames:(f,b,E)=>f.if((0,t._)`${E} !== true && ${b} !== undefined`,()=>{f.if((0,t._)`${b} === true`,()=>f.assign(E,!0),()=>f.assign(E,(0,t._)`${E} || {}`).code((0,t._)`Object.assign(${E}, ${b})`))}),mergeToName:(f,b,E)=>f.if((0,t._)`${E} !== true`,()=>{b===!0?f.assign(E,!0):(f.assign(E,(0,t._)`${E} || {}`),w(f,E,b))}),mergeValues:(f,b)=>f===!0?!0:{...f,...b},resultToName:v}),items:y({mergeNames:(f,b,E)=>f.if((0,t._)`${E} !== true && ${b} !== undefined`,()=>f.assign(E,(0,t._)`${b} === true ? true : ${E} > ${b} ? ${E} : ${b}`)),mergeToName:(f,b,E)=>f.if((0,t._)`${E} !== true`,()=>f.assign(E,b===!0?!0:(0,t._)`${E} > ${b} ? ${E} : ${b}`)),mergeValues:(f,b)=>f===!0?!0:Math.max(f,b),resultToName:(f,b)=>f.var("items",b)})};function v(f,b){if(b===!0)return f.var("props",!0);const E=f.var("props",(0,t._)`{}`);return b!==void 0&&w(f,E,b),E}Q.evaluatedPropsToName=v;function w(f,b,E){Object.keys(E).forEach(C=>f.assign((0,t._)`${b}${(0,t.getProperty)(C)}`,!0))}Q.setEvaluated=w;const l={};function p(f,b){return f.scopeValue("func",{ref:b,code:l[b.code]||(l[b.code]=new e._Code(b.code))})}Q.useFunc=p;var c;(function(f){f[f.Num=0]="Num",f[f.Str=1]="Str"})(c||(Q.Type=c={}));function d(f,b,E){if(f instanceof t.Name){const C=b===c.Num;return E?C?(0,t._)`"[" + ${f} + "]"`:(0,t._)`"['" + ${f} + "']"`:C?(0,t._)`"/" + ${f}`:(0,t._)`"/" + ${f}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(f).toString():"/"+h(f)}Q.getErrorPath=d;function S(f,b,E=f.opts.strictSchema){if(E){if(b=`strict mode: ${b}`,E===!0)throw new Error(b);f.self.logger.warn(b)}}return Q.checkStrictMode=S,Q}var St={},hs;function Fe(){if(hs)return St;hs=1,Object.defineProperty(St,"__esModule",{value:!0});const t=Y(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return St.default=e,St}var ps;function _r(){return ps||(ps=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=Y(),r=se(),s=Fe();t.keywordError={message:({keyword:l})=>(0,e.str)`must pass "${l}" keyword validation`},t.keyword$DataError={message:({keyword:l,schemaType:p})=>p?(0,e.str)`"${l}" keyword must be ${p} ($data)`:(0,e.str)`"${l}" keyword is invalid ($data)`};function a(l,p=t.keywordError,c,d){const{it:S}=l,{gen:f,compositeRule:b,allErrors:E}=S,C=$(l,p,c);d??(b||E)?u(f,C):m(S,(0,e._)`[${C}]`)}t.reportError=a;function n(l,p=t.keywordError,c){const{it:d}=l,{gen:S,compositeRule:f,allErrors:b}=d,E=$(l,p,c);u(S,E),f||b||m(d,s.default.vErrors)}t.reportExtraError=n;function i(l,p){l.assign(s.default.errors,p),l.if((0,e._)`${s.default.vErrors} !== null`,()=>l.if(p,()=>l.assign((0,e._)`${s.default.vErrors}.length`,p),()=>l.assign(s.default.vErrors,null)))}t.resetErrorsCount=i;function o({gen:l,keyword:p,schemaValue:c,data:d,errsCount:S,it:f}){if(S===void 0)throw new Error("ajv implementation error");const b=l.name("err");l.forRange("i",S,s.default.errors,E=>{l.const(b,(0,e._)`${s.default.vErrors}[${E}]`),l.if((0,e._)`${b}.instancePath === undefined`,()=>l.assign((0,e._)`${b}.instancePath`,(0,e.strConcat)(s.default.instancePath,f.errorPath))),l.assign((0,e._)`${b}.schemaPath`,(0,e.str)`${f.errSchemaPath}/${p}`),f.opts.verbose&&(l.assign((0,e._)`${b}.schema`,c),l.assign((0,e._)`${b}.data`,d))})}t.extendErrors=o;function u(l,p){const c=l.const("err",p);l.if((0,e._)`${s.default.vErrors} === null`,()=>l.assign(s.default.vErrors,(0,e._)`[${c}]`),(0,e._)`${s.default.vErrors}.push(${c})`),l.code((0,e._)`${s.default.errors}++`)}function m(l,p){const{gen:c,validateName:d,schemaEnv:S}=l;S.$async?c.throw((0,e._)`new ${l.ValidationError}(${p})`):(c.assign((0,e._)`${d}.errors`,p),c.return(!1))}const h={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function $(l,p,c){const{createErrors:d}=l.it;return d===!1?(0,e._)`{}`:g(l,p,c)}function g(l,p,c={}){const{gen:d,it:S}=l,f=[y(S,c),v(l,c)];return w(l,p,f),d.object(...f)}function y({errorPath:l},{instancePath:p}){const c=p?(0,e.str)`${l}${(0,r.getErrorPath)(p,r.Type.Str)}`:l;return[s.default.instancePath,(0,e.strConcat)(s.default.instancePath,c)]}function v({keyword:l,it:{errSchemaPath:p}},{schemaPath:c,parentSchema:d}){let S=d?p:(0,e.str)`${p}/${l}`;return c&&(S=(0,e.str)`${S}${(0,r.getErrorPath)(c,r.Type.Str)}`),[h.schemaPath,S]}function w(l,{params:p,message:c},d){const{keyword:S,data:f,schemaValue:b,it:E}=l,{opts:C,propertyName:D,topSchemaRef:V,schemaPath:q}=E;d.push([h.keyword,S],[h.params,typeof p=="function"?p(l):p||(0,e._)`{}`]),C.messages&&d.push([h.message,typeof c=="function"?c(l):c]),C.verbose&&d.push([h.schema,b],[h.parentSchema,(0,e._)`${V}${q}`],[s.default.data,f]),D&&d.push([h.propertyName,D])}})(kr)),kr}var ms;function Co(){if(ms)return ze;ms=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.boolOrEmptySchema=ze.topBoolOrEmptySchema=void 0;const t=_r(),e=Y(),r=Fe(),s={message:"boolean schema is false"};function a(o){const{gen:u,schema:m,validateName:h}=o;m===!1?i(o,!1):typeof m=="object"&&m.$async===!0?u.return(r.default.data):(u.assign((0,e._)`${h}.errors`,null),u.return(!0))}ze.topBoolOrEmptySchema=a;function n(o,u){const{gen:m,schema:h}=o;h===!1?(m.var(u,!1),i(o)):m.var(u,!0)}ze.boolOrEmptySchema=n;function i(o,u){const{gen:m,data:h}=o,$={gen:m,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,t.reportError)($,s,void 0,u)}return ze}var me={},Ke={},ys;function Dn(){if(ys)return Ke;ys=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getRules=Ke.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function r(a){return typeof a=="string"&&e.has(a)}Ke.isJSONType=r;function s(){const a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}return Ke.getRules=s,Ke}var je={},gs;function Ln(){if(gs)return je;gs=1,Object.defineProperty(je,"__esModule",{value:!0}),je.shouldUseRule=je.shouldUseGroup=je.schemaHasRulesForType=void 0;function t({schema:s,self:a},n){const i=a.RULES.types[n];return i&&i!==!0&&e(s,i)}je.schemaHasRulesForType=t;function e(s,a){return a.rules.some(n=>r(s,n))}je.shouldUseGroup=e;function r(s,a){var n;return s[a.keyword]!==void 0||((n=a.definition.implements)===null||n===void 0?void 0:n.some(i=>s[i]!==void 0))}return je.shouldUseRule=r,je}var _s;function hr(){if(_s)return me;_s=1,Object.defineProperty(me,"__esModule",{value:!0}),me.reportTypeError=me.checkDataTypes=me.checkDataType=me.coerceAndCheckDataType=me.getJSONTypes=me.getSchemaTypes=me.DataType=void 0;const t=Dn(),e=Ln(),r=_r(),s=Y(),a=se();var n;(function(c){c[c.Correct=0]="Correct",c[c.Wrong=1]="Wrong"})(n||(me.DataType=n={}));function i(c){const d=o(c.type);if(d.includes("null")){if(c.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!d.length&&c.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');c.nullable===!0&&d.push("null")}return d}me.getSchemaTypes=i;function o(c){const d=Array.isArray(c)?c:c?[c]:[];if(d.every(t.isJSONType))return d;throw new Error("type must be JSONType or JSONType[]: "+d.join(","))}me.getJSONTypes=o;function u(c,d){const{gen:S,data:f,opts:b}=c,E=h(d,b.coerceTypes),C=d.length>0&&!(E.length===0&&d.length===1&&(0,e.schemaHasRulesForType)(c,d[0]));if(C){const D=v(d,f,b.strictNumbers,n.Wrong);S.if(D,()=>{E.length?$(c,d,E):l(c)})}return C}me.coerceAndCheckDataType=u;const m=new Set(["string","number","integer","boolean","null"]);function h(c,d){return d?c.filter(S=>m.has(S)||d==="array"&&S==="array"):[]}function $(c,d,S){const{gen:f,data:b,opts:E}=c,C=f.let("dataType",(0,s._)`typeof ${b}`),D=f.let("coerced",(0,s._)`undefined`);E.coerceTypes==="array"&&f.if((0,s._)`${C} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>f.assign(b,(0,s._)`${b}[0]`).assign(C,(0,s._)`typeof ${b}`).if(v(d,b,E.strictNumbers),()=>f.assign(D,b))),f.if((0,s._)`${D} !== undefined`);for(const q of S)(m.has(q)||q==="array"&&E.coerceTypes==="array")&&V(q);f.else(),l(c),f.endIf(),f.if((0,s._)`${D} !== undefined`,()=>{f.assign(b,D),g(c,D)});function V(q){switch(q){case"string":f.elseIf((0,s._)`${C} == "number" || ${C} == "boolean"`).assign(D,(0,s._)`"" + ${b}`).elseIf((0,s._)`${b} === null`).assign(D,(0,s._)`""`);return;case"number":f.elseIf((0,s._)`${C} == "boolean" || ${b} === null
3
3
  || (${C} == "string" && ${b} && ${b} == +${b})`).assign(D,(0,s._)`+${b}`);return;case"integer":f.elseIf((0,s._)`${C} === "boolean" || ${b} === null
4
4
  || (${C} === "string" && ${b} && ${b} == +${b} && !(${b} % 1))`).assign(D,(0,s._)`+${b}`);return;case"boolean":f.elseIf((0,s._)`${b} === "false" || ${b} === 0 || ${b} === null`).assign(D,!1).elseIf((0,s._)`${b} === "true" || ${b} === 1`).assign(D,!0);return;case"null":f.elseIf((0,s._)`${b} === "" || ${b} === 0 || ${b} === false`),f.assign(D,null);return;case"array":f.elseIf((0,s._)`${C} === "string" || ${C} === "number"
@@ -1,2 +1,2 @@
1
- import{r as b,c as v,j as w,K as $,p as A,B as W,t as O}from"./index-DHr9tFb0.js";import{c as I,u as F}from"./input-C4WvdKkR.js";import{u as L}from"./project-context-provider-SYQQWwHt.js";const U=({size:n=24,color:e="currentColor",...r})=>b.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},b.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));U.displayName="Container";const B=({size:n=24,color:e="currentColor",...r})=>b.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},b.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));B.displayName="SearchMd";const D="UNKNOWN_CONNECTION_ID",M=async n=>{const r=(await n.text()).split(`
1
+ import{r as b,c as v,j as w,K as $,p as A,B as W,t as O}from"./index-DsWTyaMI.js";import{c as I,u as F}from"./input-Bjw47IqN.js";import{u as L}from"./project-context-provider-4_jnbmhf.js";const U=({size:n=24,color:e="currentColor",...r})=>b.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},b.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));U.displayName="Container";const B=({size:n=24,color:e="currentColor",...r})=>b.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},b.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));B.displayName="SearchMd";const D="UNKNOWN_CONNECTION_ID",M=async n=>{const r=(await n.text()).split(`
2
2
  `).find(s=>s.startsWith("data: "));if(!r)throw new Error("No data received from the server");return JSON.parse(r.replace("data: ",""))};function q(n){if(n===D)return(async()=>{});const e=n?`/mcp/${n}`:"/mcp";return async(r,t)=>{const s=await fetch(e,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:r,arguments:t}}),headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},credentials:"include"});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const o=s.headers.get("Content-Type")==="application/json"?await s.json():await M(s);if(o.result?.isError)throw new Error(o.result.content?.[0]?.text||"Tool call failed");return o.result?.structuredContent||o.result}}function Q(){const n=v.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=w.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),n[0]=e):e=n[0],e}function ie(n){const e=v.c(24),{image:r,title:t,description:s,actions:o,className:i,descriptionClassName:m,actionsClassName:p}=n;let c;e[0]!==i?(c=I("flex flex-1 flex-col items-center justify-center gap-8 p-4",i),e[0]=i,e[1]=c):c=e[1];let u;e[2]!==r?(u=r!==null&&w.jsx("div",{className:"flex items-center justify-center",children:r??w.jsx(Q,{})}),e[2]=r,e[3]=u):u=e[3];let a;e[4]!==t?(a=w.jsx("h3",{className:"text-lg font-medium text-foreground",children:t}),e[4]=t,e[5]=a):a=e[5];let d;e[6]!==m?(d=I("text-sm text-muted-foreground text-center max-w-[300px]",m),e[6]=m,e[7]=d):d=e[7];let f;e[8]!==s||e[9]!==d?(f=w.jsx("div",{className:d,children:s}),e[8]=s,e[9]=d,e[10]=f):f=e[10];let N;e[11]!==a||e[12]!==f?(N=w.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a,f]}),e[11]=a,e[12]=f,e[13]=N):N=e[13];let h;e[14]!==o||e[15]!==p?(h=o&&w.jsx("div",{className:I("flex items-center gap-2",p),children:o}),e[14]=o,e[15]=p,e[16]=h):h=e[16];let l;e[17]!==N||e[18]!==h?(l=w.jsxs("div",{className:"flex flex-col items-center gap-4",children:[N,h]}),e[17]=N,e[18]=h,e[19]=l):l=e[19];let g;return e[20]!==c||e[21]!==u||e[22]!==l?(g=w.jsxs("div",{className:c,children:[u,l]}),e[20]=c,e[21]=u,e[22]=l,e[23]=g):g=e[23],g}const J={xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},P={xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},R={xs:12,sm:16,md:24,lg:32};function ce(n){const e=v.c(7),{icon:r,name:t,size:s,className:o,fallbackIcon:i}=n,m=s===void 0?"md":s,p=r??"no-icon";let c;return e[0]!==o||e[1]!==i||e[2]!==r||e[3]!==t||e[4]!==m||e[5]!==p?(c=w.jsx(Z,{icon:r,name:t,size:m,className:o,fallbackIcon:i},p),e[0]=o,e[1]=i,e[2]=r,e[3]=t,e[4]=m,e[5]=p,e[6]=c):c=e[6],c}function Z(n){const e=v.c(24),{icon:r,name:t,size:s,className:o,fallbackIcon:i}=n,m=s===void 0?"md":s,[p,c]=b.useState(!1),u=!!r&&p,a=J[m],d=P[m];let f;e[0]!==o||e[1]!==a||e[2]!==d?(f=I("rounded-lg border border-border shrink-0 overflow-hidden",a,d,o),e[0]=o,e[1]=a,e[2]=d,e[3]=f):f=e[3];const N=r||void 0,h=!u&&"hidden";let l;e[4]!==h?(l=I("h-full w-full object-cover",h),e[4]=h,e[5]=l):l=e[5];let g,j;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=()=>c(!1),j=()=>c(!0),e[6]=g,e[7]=j):(g=e[6],j=e[7]);let x;e[8]!==t||e[9]!==N||e[10]!==l?(x=w.jsx("img",{src:N,alt:t,className:l,onError:g,onLoad:j}),e[8]=t,e[9]=N,e[10]=l,e[11]=x):x=e[11];const y=u&&"hidden";let E;e[12]!==y?(E=I("h-full w-full flex items-center justify-center bg-muted/20",y),e[12]=y,e[13]=E):E=e[13];let _;e[14]!==i||e[15]!==m?(_=i??w.jsx(U,{size:R[m],className:"text-muted-foreground"}),e[14]=i,e[15]=m,e[16]=_):_=e[16];let C;e[17]!==E||e[18]!==_?(C=w.jsx("div",{className:E,children:_}),e[17]=E,e[18]=_,e[19]=C):C=e[19];let S;return e[20]!==x||e[21]!==C||e[22]!==f?(S=w.jsxs("div",{className:f,children:[x,C]}),e[20]=x,e[21]=C,e[22]=f,e[23]=S):S=e[23],S}function K(n,e,r){const t=[];if(n?.trim()){const s=n.trim(),o=r.map(i=>({field:[String(i)],operator:"contains",value:s}));o.length===1&&o[0]?t.push(o[0]):o.length>1&&t.push({operator:"or",conditions:o})}if(e&&e.length>0)for(const s of e)t.push({field:[s.column],operator:"eq",value:s.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function H(n,e,r){const t=n??r,s=e??"asc";return[{field:[String(t)],direction:s}]}function G(n,e,r,t){const s=v.c(14),{org:o}=L();let i;s[0]!==e?(i=e.toUpperCase(),s[0]=e,s[1]=i):i=s[1];const p=`COLLECTION_${i}_GET`;let c;s[2]!==e||s[3]!==r||s[4]!==o.slug||s[5]!==n?(c=$.collectionItem(o.slug,n,e,r??""),s[2]=e,s[3]=r,s[4]=o.slug,s[5]=n,s[6]=c):c=s[6];let u;s[7]!==p||s[8]!==r||s[9]!==t?(u=async()=>r?await t(p,{id:r}):{item:null},s[7]=p,s[8]=r,s[9]=t,s[10]=u):u=s[10];let a;s[11]!==c||s[12]!==u?(a={queryKey:c,queryFn:u,staleTime:6e4},s[11]=c,s[12]=u,s[13]=a):a=s[13];const{data:d}=A(a);return d.item}function V(n,e,r,t){const s=v.c(11),o=t===void 0?{}:t,{org:i}=L(),{searchTerm:m,filters:p,sortKey:c,sortDirection:u,searchFields:a,defaultSortKey:d,pageSize:f}=o,N=a===void 0?["title","description"]:a,h=d===void 0?"updated_at":d,l=f===void 0?100:f;let g;s[0]!==e?(g=e.toUpperCase(),s[0]=e,s[1]=g):g=s[1];const x=`COLLECTION_${g}_LIST`,y=K(m,p,N),E=H(c,u,h),_=JSON.stringify({where:y,orderBy:E,limit:l}),C=$.collectionList(i.slug,n,e,_);let S;s[2]!==x||s[3]!==E||s[4]!==l||s[5]!==r||s[6]!==y?(S=async()=>{const z={...y&&{where:y},...E&&{orderBy:E},limit:l,offset:0};return(await r(x,z))?.items??[]},s[2]=x,s[3]=E,s[4]=l,s[5]=r,s[6]=y,s[7]=S):S=s[7];let T;s[8]!==C||s[9]!==S?(T={queryKey:C,queryFn:S},s[8]=C,s[9]=S,s[10]=T):T=s[10];const{data:k}=A(T);return k}function Y(n,e,r){const t=v.c(39),{org:s}=L(),o=W();let i;t[0]!==e?(i=e.toUpperCase(),t[0]=e,t[1]=i):i=t[1];const m=i,p=`COLLECTION_${m}_CREATE`,c=`COLLECTION_${m}_UPDATE`,u=`COLLECTION_${m}_DELETE`;let a;t[2]!==p||t[3]!==r?(a=async S=>(await r(p,{data:S})).item,t[2]=p,t[3]=r,t[4]=a):a=t[4];let d;t[5]!==e||t[6]!==s||t[7]!==o||t[8]!==n?(d=()=>{o.invalidateQueries({queryKey:$.collection(s.slug,n,e)}),O.success("Item created successfully")},t[5]=e,t[6]=s,t[7]=o,t[8]=n,t[9]=d):d=t[9];let f;t[10]!==a||t[11]!==d?(f={mutationFn:a,onSuccess:d,onError:te},t[10]=a,t[11]=d,t[12]=f):f=t[12];const N=F(f);let h;t[13]!==r||t[14]!==c?(h=async S=>{const{id:T,data:k}=S;return(await r(c,{id:T,data:k})).item},t[13]=r,t[14]=c,t[15]=h):h=t[15];let l;t[16]!==e||t[17]!==s||t[18]!==o||t[19]!==n?(l=()=>{o.invalidateQueries({queryKey:$.collection(s.slug,n,e)}),O.success("Item updated successfully")},t[16]=e,t[17]=s,t[18]=o,t[19]=n,t[20]=l):l=t[20];let g;t[21]!==h||t[22]!==l?(g={mutationFn:h,onSuccess:l,onError:ee},t[21]=h,t[22]=l,t[23]=g):g=t[23];const j=F(g);let x;t[24]!==u||t[25]!==r?(x=async S=>(await r(u,{id:S})).item.id,t[24]=u,t[25]=r,t[26]=x):x=t[26];let y;t[27]!==e||t[28]!==s||t[29]!==o||t[30]!==n?(y=()=>{o.invalidateQueries({queryKey:$.collection(s.slug,n,e)}),O.success("Item deleted successfully")},t[27]=e,t[28]=s,t[29]=o,t[30]=n,t[31]=y):y=t[31];let E;t[32]!==x||t[33]!==y?(E={mutationFn:x,onSuccess:y,onError:X},t[32]=x,t[33]=y,t[34]=E):E=t[34];const _=F(E);let C;return t[35]!==N||t[36]!==_||t[37]!==j?(C={create:N,update:j,delete:_},t[35]=N,t[36]=_,t[37]=j,t[38]=C):C=t[38],C}function X(n){const e=n instanceof Error?n.message:String(n);O.error(`Failed to delete item: ${e}`)}function ee(n){const e=n instanceof Error?n.message:String(n);O.error(`Failed to update item: ${e}`)}function te(n){const e=n instanceof Error?n.message:String(n);O.error(`Failed to create item: ${e}`)}function ae(n){const e=v.c(3);let r;e[0]!==n?(r=n===void 0?{}:n,e[0]=n,e[1]=r):r=e[1];const t=r,{org:s}=L();let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=q(),e[2]=o):o=e[2];const i=o;return V(s.slug,"CONNECTIONS",i,t)}function le(n){const e=v.c(1),{org:r}=L();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=q(),e[0]=t):t=e[0];const s=t;return G(r.slug,"CONNECTIONS",n,s)}function ue(){const n=v.c(1),{org:e}=L();let r;n[0]===Symbol.for("react.memo_cache_sentinel")?(r=q(),n[0]=r):r=n[0];const t=r;return Y(e.slug,"CONNECTIONS",t)}export{ie as E,ce as I,D as U,V as a,ue as b,q as c,le as d,G as e,Y as f,B as i,U as n,ae as u};
@@ -1 +1 @@
1
- import{c as f,K as l}from"./index-DHr9tFb0.js";import{u as y}from"./useQueries-DAJGlQiv.js";async function h(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-prompts",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.prompts||[]}catch{return[]}}function P(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(q),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(j),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(d)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={promptsMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function d(t){return{name:t.name,description:t.description}}function j(t){return t.isLoading}function q(t){return{queryKey:l.connectionPrompts(t),queryFn:()=>h(t),staleTime:6e4,retry:!1}}async function w(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-resources",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"resources/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.resources||[]}catch{return[]}}function $(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(O),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(g),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(S)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={resourcesMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function S(t){return{uri:t.uri,name:t.name,description:t.description}}function g(t){return t.isLoading}function O(t){return{queryKey:l.connectionResources(t),queryFn:()=>w(t),staleTime:6e4,retry:!1}}export{$ as a,P as u};
1
+ import{c as f,K as l}from"./index-DsWTyaMI.js";import{u as y}from"./useQueries-BLLM0cVq.js";async function h(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-prompts",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.prompts||[]}catch{return[]}}function P(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(q),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(j),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(d)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={promptsMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function d(t){return{name:t.name,description:t.description}}function j(t){return t.isLoading}function q(t){return{queryKey:l.connectionPrompts(t),queryFn:()=>h(t),staleTime:6e4,retry:!1}}async function w(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-resources",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"resources/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.resources||[]}catch{return[]}}function $(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(O),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(g),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(S)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={resourcesMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function S(t){return{uri:t.uri,name:t.name,description:t.description}}function g(t){return t.isLoading}function O(t){return{queryKey:l.connectionResources(t),queryFn:()=>w(t),staleTime:6e4,retry:!1}}export{$ as a,P as u};
@@ -1 +1 @@
1
- import{r as i,c as n}from"./index-DHr9tFb0.js";import{a as u,f,e as h,c as l}from"./use-connection-gZqQ1FAI.js";import{u as a}from"./project-context-provider-SYQQWwHt.js";const C=({size:o=24,color:e="currentColor",...t})=>i.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},i.createElement("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3m4-13h3m-3 5h3M2 9h3m-3 5h3m4.8 5h4.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C19 16.72 19 15.88 19 14.2V9.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C16.72 5 15.88 5 14.2 5H9.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C5 7.28 5 8.12 5 9.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C7.28 19 8.12 19 9.8 19Z"}));C.displayName="CpuChip02";function v(o){const e=n.c(3);let t;e[0]!==o?(t=o===void 0?{}:o,e[0]=o,e[1]=t):t=e[1];const s=t,{org:r}=a();let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=l(),e[2]=c):c=e[2];const m=c;return u(r.slug,"GATEWAY",m,s)}function A(o){const e=n.c(1),{org:t}=a();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l(),e[0]=s):s=e[0];const r=s;return h(t.slug,"GATEWAY",o,r)}function y(){const o=n.c(1),{org:e}=a();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=l(),o[0]=t):t=o[0];const s=t;return f(e.slug,"GATEWAY",s)}export{y as a,A as b,C as i,v as u};
1
+ import{r as i,c as n}from"./index-DsWTyaMI.js";import{a as u,f,e as h,c as l}from"./use-connection-BRzCmTOd.js";import{u as a}from"./project-context-provider-4_jnbmhf.js";const C=({size:o=24,color:e="currentColor",...t})=>i.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},i.createElement("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3m4-13h3m-3 5h3M2 9h3m-3 5h3m4.8 5h4.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C19 16.72 19 15.88 19 14.2V9.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C16.72 5 15.88 5 14.2 5H9.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C5 7.28 5 8.12 5 9.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C7.28 19 8.12 19 9.8 19Z"}));C.displayName="CpuChip02";function v(o){const e=n.c(3);let t;e[0]!==o?(t=o===void 0?{}:o,e[0]=o,e[1]=t):t=e[1];const s=t,{org:r}=a();let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=l(),e[2]=c):c=e[2];const m=c;return u(r.slug,"GATEWAY",m,s)}function A(o){const e=n.c(1),{org:t}=a();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l(),e[0]=s):s=e[0];const r=s;return h(t.slug,"GATEWAY",o,r)}function y(){const o=n.c(1),{org:e}=a();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=l(),o[0]=t):t=o[0];const s=t;return f(e.slug,"GATEWAY",s)}export{y as a,A as b,C as i,v as u};
@@ -1 +1 @@
1
- import{c as a}from"./index-DHr9tFb0.js";import{u as S}from"./project-context-provider-SYQQWwHt.js";import{u as L,L as x}from"./localstorage-keys-DrIZl-Oa.js";function A(e){const t=a.c(9),{locator:c}=S();let o;t[0]!==c?(o=x.gatewaySystemPrompts(c),t[0]=c,t[1]=o):o=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s={},t[2]=s):s=t[2];const[u,l]=L(o,s),n=e?u[e]??"":"";let r;t[3]!==e||t[4]!==l?(r=f=>{e&&l(p=>({...p,[e]:f}))},t[3]=e,t[4]=l,t[5]=r):r=t[5];const i=r;let m;return t[6]!==i||t[7]!==n?(m=[n,i],t[6]=i,t[7]=n,t[8]=m):m=t[8],m}export{A as u};
1
+ import{c as a}from"./index-DsWTyaMI.js";import{u as S}from"./project-context-provider-4_jnbmhf.js";import{u as L,L as x}from"./localstorage-keys-mgwVhAgB.js";function A(e){const t=a.c(9),{locator:c}=S();let o;t[0]!==c?(o=x.gatewaySystemPrompts(c),t[0]=c,t[1]=o):o=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s={},t[2]=s):s=t[2];const[u,l]=L(o,s),n=e?u[e]??"":"";let r;t[3]!==e||t[4]!==l?(r=f=>{e&&l(p=>({...p,[e]:f}))},t[3]=e,t[4]=l,t[5]=r):r=t[5];const i=r;let m;return t[6]!==i||t[7]!==n?(m=[n,i],t[6]=i,t[7]=n,t[8]=m):m=t[8],m}export{A as u};
@@ -1 +1 @@
1
- import{r as a,c as T}from"./index-DHr9tFb0.js";import{u as D}from"./use-mobile-CXfyAVoY.js";const W=({size:l=24,color:e="currentColor",...t})=>a.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},a.createElement("path",{d:"M2.42 12.713c-.136-.215-.204-.323-.242-.49a1.173 1.173 0 0 1 0-.446c.038-.167.106-.274.242-.49C3.546 9.505 6.895 5 12 5s8.455 4.505 9.58 6.287c.137.215.205.323.243.49.029.125.029.322 0 .446-.038.167-.106.274-.242.49C20.455 14.495 17.105 19 12 19c-5.106 0-8.455-4.505-9.58-6.287Z"}),a.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));W.displayName="Eye";function k(l){const e=`deco-filters-${l}`,[t,c]=a.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[t,o=>{c(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function C(l){const e=T.c(7),[t,c]=a.useState(l),[s,o]=a.useState(l?"desc":null);let i;e[0]!==s||e[1]!==t?(i=h=>{t!==h?(c(h),o("asc")):s==="asc"?o("desc"):s==="desc"&&(c(void 0),o(null))},e[0]=s,e[1]=t,e[2]=i):i=e[2];const u=i;let r;return e[3]!==u||e[4]!==s||e[5]!==t?(r={sortKey:t,sortDirection:s,handleSort:u},e[3]=u,e[4]=s,e[5]=t,e[6]=r):r=e[6],r}function L(l,e){const t=T.c(12),c=e===void 0?"cards":e,s=D(),o=a.useRef(s),i=l?`deco-view-mode-${l}`:"deco-view-mode";let u;t[0]!==c||t[1]!==i?(u=()=>{const d=globalThis.localStorage?.getItem(i);return d==="cards"||d==="table"?d:c},t[0]=c,t[1]=i,t[2]=u):u=t[2];const[r,h]=a.useState(u);let f;t[3]!==i?(f=d=>{h(d),globalThis.localStorage?.setItem(i,d)},t[3]=i,t[4]=f):f=t[4];const p=f;let S,g;t[5]!==s||t[6]!==r?(S=()=>{!o.current&&s&&r==="table"&&h("cards"),o.current=s},g=[s,r],t[5]=s,t[6]=r,t[7]=S,t[8]=g):(S=t[7],g=t[8]),a.useEffect(S,g);let n;return t[9]!==p||t[10]!==r?(n=[r,p],t[9]=p,t[10]=r,t[11]=n):n=t[11],n}function O(l){const e=T.c(20),{namespace:t,resource:c,defaultSortKey:s,defaultViewMode:o}=l,i=s===void 0?"title":s,u=o===void 0?"table":o,[r,h]=a.useState(""),f=a.useDeferredValue(r),p=`${t}-${c}`,[S,g]=k(p),n=`mesh-${c}-filter-visible-${t}`;let d;e[0]!==n?(d=()=>globalThis.localStorage?.getItem(n)==="true",e[0]=n,e[1]=d):d=e[1];const[m,B]=a.useState(d);let y;e[2]!==n?(y=I=>{B(I),globalThis.localStorage?.setItem(n,String(I))},e[2]=n,e[3]=y):y=e[3];const b=y;let M;e[4]!==m||e[5]!==b?(M=()=>{b(!m)},e[4]=m,e[5]=b,e[6]=M):M=e[6];const w=M,[V,$]=L(`mesh-${c}-${t}`,u),{sortKey:x,sortDirection:F,handleSort:K}=C(i),E=x;let v;return e[7]!==m||e[8]!==S||e[9]!==K||e[10]!==r||e[11]!==f||e[12]!==b||e[13]!==g||e[14]!==$||e[15]!==F||e[16]!==E||e[17]!==w||e[18]!==V?(v={search:r,searchTerm:f,setSearch:h,filters:S,setFilters:g,filterBarVisible:m,setFilterBarVisible:b,toggleFilterBar:w,viewMode:V,setViewMode:$,sortKey:E,sortDirection:F,handleSort:K},e[7]=m,e[8]=S,e[9]=K,e[10]=r,e[11]=f,e[12]=b,e[13]=g,e[14]=$,e[15]=F,e[16]=E,e[17]=w,e[18]=V,e[19]=v):v=e[19],v}export{W as s,O as u};
1
+ import{r as a,c as T}from"./index-DsWTyaMI.js";import{u as D}from"./use-mobile-b2I183jd.js";const W=({size:l=24,color:e="currentColor",...t})=>a.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},a.createElement("path",{d:"M2.42 12.713c-.136-.215-.204-.323-.242-.49a1.173 1.173 0 0 1 0-.446c.038-.167.106-.274.242-.49C3.546 9.505 6.895 5 12 5s8.455 4.505 9.58 6.287c.137.215.205.323.243.49.029.125.029.322 0 .446-.038.167-.106.274-.242.49C20.455 14.495 17.105 19 12 19c-5.106 0-8.455-4.505-9.58-6.287Z"}),a.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));W.displayName="Eye";function k(l){const e=`deco-filters-${l}`,[t,c]=a.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[t,o=>{c(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function C(l){const e=T.c(7),[t,c]=a.useState(l),[s,o]=a.useState(l?"desc":null);let i;e[0]!==s||e[1]!==t?(i=h=>{t!==h?(c(h),o("asc")):s==="asc"?o("desc"):s==="desc"&&(c(void 0),o(null))},e[0]=s,e[1]=t,e[2]=i):i=e[2];const u=i;let r;return e[3]!==u||e[4]!==s||e[5]!==t?(r={sortKey:t,sortDirection:s,handleSort:u},e[3]=u,e[4]=s,e[5]=t,e[6]=r):r=e[6],r}function L(l,e){const t=T.c(12),c=e===void 0?"cards":e,s=D(),o=a.useRef(s),i=l?`deco-view-mode-${l}`:"deco-view-mode";let u;t[0]!==c||t[1]!==i?(u=()=>{const d=globalThis.localStorage?.getItem(i);return d==="cards"||d==="table"?d:c},t[0]=c,t[1]=i,t[2]=u):u=t[2];const[r,h]=a.useState(u);let f;t[3]!==i?(f=d=>{h(d),globalThis.localStorage?.setItem(i,d)},t[3]=i,t[4]=f):f=t[4];const p=f;let S,g;t[5]!==s||t[6]!==r?(S=()=>{!o.current&&s&&r==="table"&&h("cards"),o.current=s},g=[s,r],t[5]=s,t[6]=r,t[7]=S,t[8]=g):(S=t[7],g=t[8]),a.useEffect(S,g);let n;return t[9]!==p||t[10]!==r?(n=[r,p],t[9]=p,t[10]=r,t[11]=n):n=t[11],n}function O(l){const e=T.c(20),{namespace:t,resource:c,defaultSortKey:s,defaultViewMode:o}=l,i=s===void 0?"title":s,u=o===void 0?"table":o,[r,h]=a.useState(""),f=a.useDeferredValue(r),p=`${t}-${c}`,[S,g]=k(p),n=`mesh-${c}-filter-visible-${t}`;let d;e[0]!==n?(d=()=>globalThis.localStorage?.getItem(n)==="true",e[0]=n,e[1]=d):d=e[1];const[m,B]=a.useState(d);let y;e[2]!==n?(y=I=>{B(I),globalThis.localStorage?.setItem(n,String(I))},e[2]=n,e[3]=y):y=e[3];const b=y;let M;e[4]!==m||e[5]!==b?(M=()=>{b(!m)},e[4]=m,e[5]=b,e[6]=M):M=e[6];const w=M,[V,$]=L(`mesh-${c}-${t}`,u),{sortKey:x,sortDirection:F,handleSort:K}=C(i),E=x;let v;return e[7]!==m||e[8]!==S||e[9]!==K||e[10]!==r||e[11]!==f||e[12]!==b||e[13]!==g||e[14]!==$||e[15]!==F||e[16]!==E||e[17]!==w||e[18]!==V?(v={search:r,searchTerm:f,setSearch:h,filters:S,setFilters:g,filterBarVisible:m,setFilterBarVisible:b,toggleFilterBar:w,viewMode:V,setViewMode:$,sortKey:E,sortDirection:F,handleSort:K},e[7]=m,e[8]=S,e[9]=K,e[10]=r,e[11]=f,e[12]=b,e[13]=g,e[14]=$,e[15]=F,e[16]=E,e[17]=w,e[18]=V,e[19]=v):v=e[19],v}export{W as s,O as u};
@@ -1 +1 @@
1
- import{c as E,K as b}from"./index-DHr9tFb0.js";import{u as j}from"./useQuery--jXLy0yb.js";function T(g){const e=E.c(18),{url:o,token:r,enabled:w}=g,$=w===void 0?!0:w;let i;e[0]!==r||e[1]!==o?(i=b.mcpTools(o,r),e[0]=r,e[1]=o,e[2]=i):i=e[2];let s;e[3]!==r||e[4]!==o?(s=async()=>{if(!o)return[];const m={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};r&&(m.Authorization=`Bearer ${r}`);const u=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-mcp",version:"1.0.0"}}})});if(!u.ok)throw new Error(`MCP initialization failed: ${u.status}`);const h=await u.json();if(h.error)throw new Error(`MCP initialization error: ${h.error.message} (code: ${h.error.code})`);const y=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"tools/list",params:{}})});if(!y.ok)throw new Error(`Failed to list tools: ${y.status}`);const l=await y.json();if(l.error)throw new Error(`Failed to list tools: ${l.error.message} (code: ${l.error.code})`);return l.result?.tools||[]},e[3]=r,e[4]=o,e[5]=s):s=e[5];const d=$&&!!o;let a;e[6]!==i||e[7]!==s||e[8]!==d?(a={queryKey:i,queryFn:s,enabled:d,staleTime:3e4,retry:!1},e[6]=i,e[7]=s,e[8]=d,e[9]=a):a=e[9];const t=j(a),f=o?t.isLoading?"connecting":t.isError?"error":"ready":"disconnected";let n;e[10]!==t.data?(n=t.data||[],e[10]=t.data,e[11]=n):n=e[11];const p=t.error;let c;return e[12]!==t.isLoading||e[13]!==t.refetch||e[14]!==f||e[15]!==n||e[16]!==p?(c={tools:n,state:f,error:p,isLoading:t.isLoading,refetch:t.refetch},e[12]=t.isLoading,e[13]=t.refetch,e[14]=f,e[15]=n,e[16]=p,e[17]=c):c=e[17],c}export{T as u};
1
+ import{c as E,K as b}from"./index-DsWTyaMI.js";import{u as j}from"./useQuery-BXYZ1U8o.js";function T(g){const e=E.c(18),{url:o,token:r,enabled:w}=g,$=w===void 0?!0:w;let i;e[0]!==r||e[1]!==o?(i=b.mcpTools(o,r),e[0]=r,e[1]=o,e[2]=i):i=e[2];let s;e[3]!==r||e[4]!==o?(s=async()=>{if(!o)return[];const m={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};r&&(m.Authorization=`Bearer ${r}`);const u=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-mcp",version:"1.0.0"}}})});if(!u.ok)throw new Error(`MCP initialization failed: ${u.status}`);const h=await u.json();if(h.error)throw new Error(`MCP initialization error: ${h.error.message} (code: ${h.error.code})`);const y=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"tools/list",params:{}})});if(!y.ok)throw new Error(`Failed to list tools: ${y.status}`);const l=await y.json();if(l.error)throw new Error(`Failed to list tools: ${l.error.message} (code: ${l.error.code})`);return l.result?.tools||[]},e[3]=r,e[4]=o,e[5]=s):s=e[5];const d=$&&!!o;let a;e[6]!==i||e[7]!==s||e[8]!==d?(a={queryKey:i,queryFn:s,enabled:d,staleTime:3e4,retry:!1},e[6]=i,e[7]=s,e[8]=d,e[9]=a):a=e[9];const t=j(a),f=o?t.isLoading?"connecting":t.isError?"error":"ready":"disconnected";let n;e[10]!==t.data?(n=t.data||[],e[10]=t.data,e[11]=n):n=e[11];const p=t.error;let c;return e[12]!==t.isLoading||e[13]!==t.refetch||e[14]!==f||e[15]!==n||e[16]!==p?(c={tools:n,state:f,error:p,isLoading:t.isLoading,refetch:t.refetch},e[12]=t.isLoading,e[13]=t.refetch,e[14]=f,e[15]=n,e[16]=p,e[17]=c):c=e[17],c}export{T as u};
@@ -1 +1 @@
1
- import{c as o,p as n,K as u,a as i}from"./index-DHr9tFb0.js";import{u as a}from"./project-context-provider-SYQQWwHt.js";function p(){const e=o.c(4),{locator:s}=a();let t;e[0]!==s?(t=u.members(s),e[0]=s,e[1]=t):t=e[1];let r;return e[2]!==t?(r={queryKey:t,queryFn:m},e[2]=t,e[3]=r):r=e[3],n(r)}function m(){return i.organization.listMembers()}export{p as u};
1
+ import{c as o,p as n,K as u,a as i}from"./index-DsWTyaMI.js";import{u as a}from"./project-context-provider-4_jnbmhf.js";function p(){const e=o.c(4),{locator:s}=a();let t;e[0]!==s?(t=u.members(s),e[0]=s,e[1]=t):t=e[1];let r;return e[2]!==t?(r={queryKey:t,queryFn:m},e[2]=t,e[3]=r):r=e[3],n(r)}function m(){return i.organization.listMembers()}export{p as u};
@@ -1 +1 @@
1
- import{c as m,r}from"./index-DHr9tFb0.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-DsWTyaMI.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{c as o,p as y,B as p,K as f}from"./index-DHr9tFb0.js";import{u as T}from"./input-C4WvdKkR.js";import{c as m}from"./use-connection-gZqQ1FAI.js";function N(t){const e=o.c(8);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m(),e[0]=n):n=e[0];const c=n;let r;e[1]!==t?(r=f.organizationSettings(t),e[1]=t,e[2]=r):r=e[2];let s;e[3]!==t?(s=async()=>{const u=await c("ORGANIZATION_SETTINGS_GET",{});return u||{organizationId:t,sidebar_items:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},e[3]=t,e[4]=s):s=e[4];let l;e[5]!==r||e[6]!==s?(l={queryKey:r,queryFn:s,staleTime:6e4},e[5]=r,e[6]=s,e[7]=l):l=e[7];const{data:i}=y(l);return i}function C(t){const e=o.c(11),n=p();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=m(),e[0]=c):c=e[0];const r=c;let s;e[1]!==t?(s=async S=>await r("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t,...S}),e[1]=t,e[2]=s):s=e[2];let l;e[3]!==t||e[4]!==n?(l=()=>{n.invalidateQueries({queryKey:f.organizationSettings(t)})},e[3]=t,e[4]=n,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==l?(i={mutationFn:s,onSuccess:l},e[6]=s,e[7]=l,e[8]=i):i=e[8];const u=T(i);let a;return e[9]!==u?(a={update:u},e[9]=u,e[10]=a):a=e[10],a}export{C as a,N as u};
1
+ import{c as o,p as y,B as p,K as f}from"./index-DsWTyaMI.js";import{u as T}from"./input-Bjw47IqN.js";import{c as m}from"./use-connection-BRzCmTOd.js";function N(t){const e=o.c(8);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m(),e[0]=n):n=e[0];const c=n;let r;e[1]!==t?(r=f.organizationSettings(t),e[1]=t,e[2]=r):r=e[2];let s;e[3]!==t?(s=async()=>{const u=await c("ORGANIZATION_SETTINGS_GET",{});return u||{organizationId:t,sidebar_items:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},e[3]=t,e[4]=s):s=e[4];let l;e[5]!==r||e[6]!==s?(l={queryKey:r,queryFn:s,staleTime:6e4},e[5]=r,e[6]=s,e[7]=l):l=e[7];const{data:i}=y(l);return i}function C(t){const e=o.c(11),n=p();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=m(),e[0]=c):c=e[0];const r=c;let s;e[1]!==t?(s=async S=>await r("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t,...S}),e[1]=t,e[2]=s):s=e[2];let l;e[3]!==t||e[4]!==n?(l=()=>{n.invalidateQueries({queryKey:f.organizationSettings(t)})},e[3]=t,e[4]=n,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==l?(i={mutationFn:s,onSuccess:l},e[6]=s,e[7]=l,e[8]=i):i=e[8];const u=T(i);let a;return e[9]!==u?(a={update:u},e[9]=u,e[10]=a):a=e[10],a}export{C as a,N as u};
@@ -1 +1 @@
1
- import{c as y,K as C,p as T}from"./index-DHr9tFb0.js";import{u as q}from"./useQuery--jXLy0yb.js";import{u as K}from"./input-C4WvdKkR.js";function F(a){const e=y.c(23);let o,l,t,s,r;e[0]!==a?({toolCaller:t,toolName:r,toolInputParams:s,scope:l,...o}=a,e[0]=a,e[1]=o,e[2]=l,e[3]=t,e[4]=s,e[5]=r):(o=e[1],l=e[2],t=e[3],s=e[4],r=e[5]);let i,c,m,u;if(e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==r){const p=JSON.stringify(s);u=T,i=o,c=o.staleTime??6e4,m=C.toolCall(l,r,p),e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=c,e[12]=m,e[13]=u}else i=e[10],c=e[11],m=e[12],u=e[13];let n;e[14]!==t||e[15]!==s||e[16]!==r?(n=async()=>await t(r,s),e[14]=t,e[15]=s,e[16]=r,e[17]=n):n=e[17];let f;return e[18]!==i||e[19]!==c||e[20]!==m||e[21]!==n?(f={...i,staleTime:c,queryKey:m,queryFn:n},e[18]=i,e[19]=c,e[20]=m,e[21]=n,e[22]=f):f=e[22],u(f)}function I(a){const e=y.c(3),{toolCaller:o,toolName:l}=a;let t;return e[0]!==o||e[1]!==l?(t={mutationFn:async s=>await o(l,s),onSuccess:S,onError:N},e[0]=o,e[1]=l,e[2]=t):t=e[2],K(t)}function N(a){console.error("tool call mutation error",a)}function S(a){console.log("tool call mutation success",a)}function O(a){const e=y.c(14),{toolCaller:o,toolName:l,toolInputParams:t,scope:s,staleTime:r,refetchInterval:i,enabled:c}=a,m=r===void 0?6e4:r;let u;e[0]!==s||e[1]!==t||e[2]!==l?(u=C.toolCall(s,l,JSON.stringify(t??{})),e[0]=s,e[1]=t,e[2]=l,e[3]=u):u=e[3];let n;e[4]!==o||e[5]!==t||e[6]!==l?(n=async()=>await o(l,t??{}),e[4]=o,e[5]=t,e[6]=l,e[7]=n):n=e[7];let f;return e[8]!==c||e[9]!==i||e[10]!==m||e[11]!==u||e[12]!==n?(f={queryKey:u,queryFn:n,enabled:c,staleTime:m,refetchInterval:i},e[8]=c,e[9]=i,e[10]=m,e[11]=u,e[12]=n,e[13]=f):f=e[13],q(f)}export{O as a,I as b,F as u};
1
+ import{c as y,K as C,p as T}from"./index-DsWTyaMI.js";import{u as q}from"./useQuery-BXYZ1U8o.js";import{u as K}from"./input-Bjw47IqN.js";function F(a){const e=y.c(23);let o,l,t,s,r;e[0]!==a?({toolCaller:t,toolName:r,toolInputParams:s,scope:l,...o}=a,e[0]=a,e[1]=o,e[2]=l,e[3]=t,e[4]=s,e[5]=r):(o=e[1],l=e[2],t=e[3],s=e[4],r=e[5]);let i,c,m,u;if(e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==r){const p=JSON.stringify(s);u=T,i=o,c=o.staleTime??6e4,m=C.toolCall(l,r,p),e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=c,e[12]=m,e[13]=u}else i=e[10],c=e[11],m=e[12],u=e[13];let n;e[14]!==t||e[15]!==s||e[16]!==r?(n=async()=>await t(r,s),e[14]=t,e[15]=s,e[16]=r,e[17]=n):n=e[17];let f;return e[18]!==i||e[19]!==c||e[20]!==m||e[21]!==n?(f={...i,staleTime:c,queryKey:m,queryFn:n},e[18]=i,e[19]=c,e[20]=m,e[21]=n,e[22]=f):f=e[22],u(f)}function I(a){const e=y.c(3),{toolCaller:o,toolName:l}=a;let t;return e[0]!==o||e[1]!==l?(t={mutationFn:async s=>await o(l,s),onSuccess:S,onError:N},e[0]=o,e[1]=l,e[2]=t):t=e[2],K(t)}function N(a){console.error("tool call mutation error",a)}function S(a){console.log("tool call mutation success",a)}function O(a){const e=y.c(14),{toolCaller:o,toolName:l,toolInputParams:t,scope:s,staleTime:r,refetchInterval:i,enabled:c}=a,m=r===void 0?6e4:r;let u;e[0]!==s||e[1]!==t||e[2]!==l?(u=C.toolCall(s,l,JSON.stringify(t??{})),e[0]=s,e[1]=t,e[2]=l,e[3]=u):u=e[3];let n;e[4]!==o||e[5]!==t||e[6]!==l?(n=async()=>await o(l,t??{}),e[4]=o,e[5]=t,e[6]=l,e[7]=n):n=e[7];let f;return e[8]!==c||e[9]!==i||e[10]!==m||e[11]!==u||e[12]!==n?(f={queryKey:u,queryFn:n,enabled:c,staleTime:m,refetchInterval:i},e[8]=c,e[9]=i,e[10]=m,e[11]=u,e[12]=n,e[13]=f):f=e[13],q(f)}export{O as a,I as b,F as u};
@@ -1 +1 @@
1
- import{a_ as C,a$ as y,b0 as S,b1 as q,ap as w,B as x,b2 as M,b3 as k,r as p,b4 as B,b5 as H,b6 as L,b7 as P,b8 as m,b9 as E,ba as A,bb as T}from"./index-DHr9tFb0.js";function Q(s,e){const i=new Set(e);return s.filter(t=>!i.has(t))}function z(s,e,i){const t=s.slice(0);return t[e]=i,t}var I=class extends C{#r;#e;#i;#n;#s;#t;#u;#o;#h=[];constructor(s,e,i){super(),this.#r=s,this.#n=i,this.#i=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(s=>{s.subscribe(e=>{this.#f(s,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(s=>{s.destroy()})}setQueries(s,e){this.#i=s,this.#n=e,y.batch(()=>{const i=this.#s,t=this.#l(this.#i);t.forEach(n=>n.observer.setOptions(n.defaultedQueryOptions));const r=t.map(n=>n.observer),u=r.map(n=>n.getCurrentResult()),o=i.length!==r.length,l=r.some((n,b)=>n!==i[b]),f=o||l,d=f?!0:u.some((n,b)=>{const g=this.#e[b];return!g||!S(n,g)});!f&&!d||(f&&(this.#h=t,this.#s=r),this.#e=u,this.hasListeners()&&(f&&(Q(i,r).forEach(n=>{n.destroy()}),Q(r,i).forEach(n=>{n.subscribe(b=>{this.#f(n,b)})})),this.#b()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(s=>s.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(s,e){const i=this.#l(s),t=i.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[t,r=>this.#c(r??t,e),()=>this.#a(t,i)]}#a(s,e){return e.map((i,t)=>{const r=s[t];return i.defaultedQueryOptions.notifyOnChangeProps?r:i.observer.trackResult(r,u=>{e.forEach(o=>{o.observer.trackProp(u)})})})}#c(s,e){return e?((!this.#t||this.#e!==this.#o||e!==this.#u)&&(this.#u=e,this.#o=this.#e,this.#t=q(this.#t,e(s))),this.#t):s}#l(s){const e=new Map;this.#s.forEach(t=>{const r=t.options.queryHash;if(!r)return;const u=e.get(r);u?u.push(t):e.set(r,[t])});const i=[];return s.forEach(t=>{const r=this.#r.defaultQueryOptions(t),o=e.get(r.queryHash)?.shift()??new w(this.#r,r);i.push({defaultedQueryOptions:r,observer:o})}),i}#f(s,e){const i=this.#s.indexOf(s);i!==-1&&(this.#e=z(this.#e,i,e),this.#b())}#b(){if(this.hasListeners()){const s=this.#t,e=this.#a(this.#e,this.#h),i=this.#c(e,this.#n?.combine);s!==i&&y.batch(()=>{this.listeners.forEach(t=>{t(this.#e)})})}}};function _({queries:s,...e},i){const t=x(i),r=M(),u=k(),o=p.useMemo(()=>s.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=r?"isRestoring":"optimistic",a}),[s,t,r]);o.forEach(h=>{B(h);const a=t.getQueryCache().get(h.queryHash);H(h,u,a)}),L(u);const[l]=p.useState(()=>new I(t,o,e)),[f,d,n]=l.getOptimisticResult(o,e.combine),b=!r&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>b?l.subscribe(y.batchCalls(h)):P,[l,b]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),p.useEffect(()=>{l.setQueries(o,e)},[o,e,l]);const R=f.some((h,a)=>m(o[a],h))?f.flatMap((h,a)=>{const c=o[a];if(c){const v=new w(t,c);if(m(c,h))return E(c,v,u);A(h,r)&&E(c,v,u)}return[]}):[];if(R.length>0)throw Promise.all(R);const O=f.find((h,a)=>{const c=o[a];return c&&T({result:h,errorResetBoundary:u,throwOnError:c.throwOnError,query:t.getQueryCache().get(c.queryHash),suspense:c.suspense})});if(O?.error)throw O.error;return d(n())}export{_ as u};
1
+ import{a_ as C,a$ as y,b0 as S,b1 as q,ap as w,B as x,b2 as M,b3 as k,r as p,b4 as B,b5 as H,b6 as L,b7 as P,b8 as m,b9 as E,ba as A,bb as T}from"./index-DsWTyaMI.js";function Q(s,e){const i=new Set(e);return s.filter(t=>!i.has(t))}function z(s,e,i){const t=s.slice(0);return t[e]=i,t}var I=class extends C{#r;#e;#i;#n;#s;#t;#u;#o;#h=[];constructor(s,e,i){super(),this.#r=s,this.#n=i,this.#i=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(s=>{s.subscribe(e=>{this.#f(s,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(s=>{s.destroy()})}setQueries(s,e){this.#i=s,this.#n=e,y.batch(()=>{const i=this.#s,t=this.#l(this.#i);t.forEach(n=>n.observer.setOptions(n.defaultedQueryOptions));const r=t.map(n=>n.observer),u=r.map(n=>n.getCurrentResult()),o=i.length!==r.length,l=r.some((n,b)=>n!==i[b]),f=o||l,d=f?!0:u.some((n,b)=>{const g=this.#e[b];return!g||!S(n,g)});!f&&!d||(f&&(this.#h=t,this.#s=r),this.#e=u,this.hasListeners()&&(f&&(Q(i,r).forEach(n=>{n.destroy()}),Q(r,i).forEach(n=>{n.subscribe(b=>{this.#f(n,b)})})),this.#b()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(s=>s.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(s,e){const i=this.#l(s),t=i.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[t,r=>this.#c(r??t,e),()=>this.#a(t,i)]}#a(s,e){return e.map((i,t)=>{const r=s[t];return i.defaultedQueryOptions.notifyOnChangeProps?r:i.observer.trackResult(r,u=>{e.forEach(o=>{o.observer.trackProp(u)})})})}#c(s,e){return e?((!this.#t||this.#e!==this.#o||e!==this.#u)&&(this.#u=e,this.#o=this.#e,this.#t=q(this.#t,e(s))),this.#t):s}#l(s){const e=new Map;this.#s.forEach(t=>{const r=t.options.queryHash;if(!r)return;const u=e.get(r);u?u.push(t):e.set(r,[t])});const i=[];return s.forEach(t=>{const r=this.#r.defaultQueryOptions(t),o=e.get(r.queryHash)?.shift()??new w(this.#r,r);i.push({defaultedQueryOptions:r,observer:o})}),i}#f(s,e){const i=this.#s.indexOf(s);i!==-1&&(this.#e=z(this.#e,i,e),this.#b())}#b(){if(this.hasListeners()){const s=this.#t,e=this.#a(this.#e,this.#h),i=this.#c(e,this.#n?.combine);s!==i&&y.batch(()=>{this.listeners.forEach(t=>{t(this.#e)})})}}};function _({queries:s,...e},i){const t=x(i),r=M(),u=k(),o=p.useMemo(()=>s.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=r?"isRestoring":"optimistic",a}),[s,t,r]);o.forEach(h=>{B(h);const a=t.getQueryCache().get(h.queryHash);H(h,u,a)}),L(u);const[l]=p.useState(()=>new I(t,o,e)),[f,d,n]=l.getOptimisticResult(o,e.combine),b=!r&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>b?l.subscribe(y.batchCalls(h)):P,[l,b]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),p.useEffect(()=>{l.setQueries(o,e)},[o,e,l]);const R=f.some((h,a)=>m(o[a],h))?f.flatMap((h,a)=>{const c=o[a];if(c){const v=new w(t,c);if(m(c,h))return E(c,v,u);A(h,r)&&E(c,v,u)}return[]}):[];if(R.length>0)throw Promise.all(R);const O=f.find((h,a)=>{const c=o[a];return c&&T({result:h,errorResetBoundary:u,throwOnError:c.throwOnError,query:t.getQueryCache().get(c.queryHash),suspense:c.suspense})});if(O?.error)throw O.error;return d(n())}export{_ as u};
@@ -0,0 +1 @@
1
+ import{a3 as u,ap as s}from"./index-DsWTyaMI.js";function o(e,r){return u(e,s,r)}export{o as u};
@@ -1 +1 @@
1
- import{r as H,ak as A,j as c,af as M,ah as ge,z as h,ae as he,al as X,am as pe,ad as be,an as me,f as ve,c as Y}from"./index-DHr9tFb0.js";import{c as Z}from"./input-C4WvdKkR.js";var ee="Toggle",te=H.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return c.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return c.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return c.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:c.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),f=h.useCallback(l=>s((d=[])=>[...d,l]),[s]),u=h.useCallback(l=>s((d=[])=>d.filter(xe=>xe!==l)),[s]);return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:f,onItemDeactivate:u,children:c.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...f}=t,u=ne(r),l=be(i),d={role:"group",dir:l,...f};return c.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?c.jsx(me,{asChild:!0,...u,orientation:o,dir:l,loop:s,children:c.jsx(M.div,{...d,ref:e})}):c.jsx(M.div,{...d,ref:e})})}),R="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(R,t.__scopeToggleGroup),n=Ne(R,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},f=h.useRef(null);return n.rovingFocus?c.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:f,children:c.jsx(D,{...s,ref:e})}):c.jsx(D,{...s,ref:e})});se.displayName=R;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(R,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return c.jsx(te,{...s,...a,ref:e,onPressedChange:f=>{f?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const ke=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=H.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let f;e[8]!==o||e[9]!==i?(f={variant:i,size:o},e[8]=o,e[9]=i,e[10]=f):f=e[10];let u;e[11]!==r||e[12]!==f?(u=c.jsx(fe.Provider,{value:f,children:r}),e[11]=r,e[12]=f,e[13]=u):u=e[13];let l;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==u||e[18]!==i?(l=c.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:u}),e[14]=a,e[15]=o,e[16]=s,e[17]=u,e[18]=i,e[19]=l):l=e[19],l}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=H.useContext(fe),f=s.variant||i,u=s.size||o;let l;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(l=Z(ke({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=l):l=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==f||e[15]!==u||e[16]!==l?(d=c.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":f,"data-size":u,className:l,...a,children:r}),e[12]=r,e[13]=a,e[14]=f,e[15]=u,e[16]=l,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,C=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Re=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Te=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),je=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:ze,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function ze(){return ue(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Re.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ce.exec(t))?new x(e[1],e[2],e[3],1):(e=Te.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=je.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function He(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?He(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=T(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ue(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,f=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=f<.5?o+a:2-o-a,i*=60):s=f>0&&f<1?0:i,new g(i,s,f,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ue(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(j(t>=240?t-240:t+120,a,n),j(t,a,n),j(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),k(this.s),k(this.l),T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=T(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${k(this.s)*100}%, ${k(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function k(t){return Math.max(0,Math.min(1,t||0))}function j(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ce:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ce(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),f=r(a.b,o.b),u=ce(a.opacity,o.opacity);return function(l){return a.r=i(l),a.g=s(l),a.b=f(l),a.opacity=u(l),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var z=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(z.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=z.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],f=[];for(t=t+"",e=e+"";(n=z.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,f.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?f[0]?Ke(f[0].x):Je(e):(e=f.length,function(u){for(var l=0,d;l<e;++l)s[(d=f[l]).i]=d.x(u);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
1
+ import{r as H,ak as A,j as c,af as M,ah as ge,z as h,ae as he,al as X,am as pe,ad as be,an as me,f as ve,c as Y}from"./index-DsWTyaMI.js";import{c as Z}from"./input-Bjw47IqN.js";var ee="Toggle",te=H.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return c.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return c.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return c.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:c.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),f=h.useCallback(l=>s((d=[])=>[...d,l]),[s]),u=h.useCallback(l=>s((d=[])=>d.filter(xe=>xe!==l)),[s]);return c.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:f,onItemDeactivate:u,children:c.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...f}=t,u=ne(r),l=be(i),d={role:"group",dir:l,...f};return c.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?c.jsx(me,{asChild:!0,...u,orientation:o,dir:l,loop:s,children:c.jsx(M.div,{...d,ref:e})}):c.jsx(M.div,{...d,ref:e})})}),R="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(R,t.__scopeToggleGroup),n=Ne(R,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},f=h.useRef(null);return n.rovingFocus?c.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:f,children:c.jsx(D,{...s,ref:e})}):c.jsx(D,{...s,ref:e})});se.displayName=R;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(R,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return c.jsx(te,{...s,...a,ref:e,onPressedChange:f=>{f?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const ke=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=H.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let f;e[8]!==o||e[9]!==i?(f={variant:i,size:o},e[8]=o,e[9]=i,e[10]=f):f=e[10];let u;e[11]!==r||e[12]!==f?(u=c.jsx(fe.Provider,{value:f,children:r}),e[11]=r,e[12]=f,e[13]=u):u=e[13];let l;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==u||e[18]!==i?(l=c.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:u}),e[14]=a,e[15]=o,e[16]=s,e[17]=u,e[18]=i,e[19]=l):l=e[19],l}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=H.useContext(fe),f=s.variant||i,u=s.size||o;let l;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(l=Z(ke({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=l):l=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==f||e[15]!==u||e[16]!==l?(d=c.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":f,"data-size":u,className:l,...a,children:r}),e[12]=r,e[13]=a,e[14]=f,e[15]=u,e[16]=l,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,C=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Re=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Te=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),je=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:ze,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function ze(){return ue(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Re.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ce.exec(t))?new x(e[1],e[2],e[3],1):(e=Te.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=je.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function He(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?He(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=T(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ue(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,f=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=f<.5?o+a:2-o-a,i*=60):s=f>0&&f<1?0:i,new g(i,s,f,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ue(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(j(t>=240?t-240:t+120,a,n),j(t,a,n),j(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),k(this.s),k(this.l),T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=T(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${k(this.s)*100}%, ${k(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function k(t){return Math.max(0,Math.min(1,t||0))}function j(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ce:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ce(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),f=r(a.b,o.b),u=ce(a.opacity,o.opacity);return function(l){return a.r=i(l),a.g=s(l),a.b=f(l),a.opacity=u(l),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var z=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(z.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=z.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],f=[];for(t=t+"",e=e+"";(n=z.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,f.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?f[0]?Ke(f[0].x):Je(e):(e=f.length,function(u){for(var l=0,d;l<e;++l)s[(d=f[l]).i]=d.x(u);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
@@ -1 +1 @@
1
- import{c as Y,r as V,j as i}from"./index-DHr9tFb0.js";import{c as n}from"./input-C4WvdKkR.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
1
+ import{c as Y,r as V,j as i}from"./index-DsWTyaMI.js";import{c as n}from"./input-Bjw47IqN.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
@@ -1 +1 @@
1
- import{a as L,h as P,r as v,j as e,c as k}from"./index-DHr9tFb0.js";import{d as _}from"./well-known-mcp-D13f-8h2.js";import{C as R}from"./collection-tab-BPPicFWO.js";import{b as z,E as A,u as F}from"./use-connection-gZqQ1FAI.js";import{u as B}from"./project-context-provider-SYQQWwHt.js";import{B as y}from"./input-C4WvdKkR.js";import{C as M}from"./collection-header-BQqQNO9q.js";import{u as O,b as H}from"./use-binding-DxCldqD_.js";import{i as T}from"./Loading01-C0_l8AxO.js";import"./generate-id-Dyweu44Y.js";import"./collection-display-button-CqzsQ6A1.js";import"./dropdown-menu-DTGJCwi0.js";import"./ChevronRight-SzPzGSNO.js";import"./Grid01-R-k411L-.js";import"./view-mode-toggle-DAKbBF5Z.js";import"./collection-search-CIs95Rnw.js";import"./card-DZuxbKf1.js";import"./Copy01-DS49wIzW.js";import"./DotsVertical-eZBspOrA.js";import"./use-list-state-_DXZxdCV.js";import"./use-mobile-CXfyAVoY.js";import"./Trash01-BMJLKtdF.js";import"./collection-table-wrapper-D1OlmFUL.js";import"./empty-state-DVGQ1BWZ.js";import"./Inbox01-bvdCozgs.js";import"./avatar-D4SXwEgs.js";import"./useQuery--jXLy0yb.js";import"./pin-to-sidebar-button-Bau5uIKK.js";import"./use-organization-settings-g1OUF8Uc.js";import"./constants-BSLIcG1u.js";import"./alert-dialog-Dz8Vs8_m.js";import"./Plus-KTlOMNSY.js";import"./layout-9R3rtCy3.js";import"./ArrowLeft-DQOG1GuJ.js";import"./auth-CJNQiaii.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=z(),{org:{slug:m}}=B(),{data:h}=L.useSession(),d=P(),[a,w]=v.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){w(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),d({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{w(!1)}}},j=()=>{d({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(A,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Custom Connection"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),d=F();let a;t[0]!==d||t[1]!==o?(a={connections:d,binding:o},t[0]=d,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=v.useState(null),N=l&&S&&(l.id||E);let f;t[8]!==s?(f=e.jsx(M,{title:s}),t[8]=s,t[9]=f):f=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let p;t[11]!==s?(p=s.toLowerCase(),t[11]=s,t[12]=p):p=t[12];let u;t[13]!==p?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",p,"..."]})]}),t[13]=p,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==N||t[20]!==m?(g=N?e.jsx(R,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=N,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(v.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let b;return t[25]!==f||t[26]!==x?(b=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[f,x]}),t[25]=f,t[26]=x,t[27]=b):b=t[27],b}function yt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{yt as default};
1
+ import{a as L,h as P,r as v,j as e,c as k}from"./index-DsWTyaMI.js";import{d as _}from"./well-known-mcp-D13f-8h2.js";import{C as R}from"./collection-tab-CQ_V1h26.js";import{b as z,E as A,u as F}from"./use-connection-BRzCmTOd.js";import{u as B}from"./project-context-provider-4_jnbmhf.js";import{B as y}from"./input-Bjw47IqN.js";import{C as M}from"./collection-header-DS84Dz-Z.js";import{u as O,b as H}from"./use-binding-CocjKJdo.js";import{i as T}from"./Loading01-BqUL1Os2.js";import"./generate-id-Dyweu44Y.js";import"./collection-display-button-BEkWecO6.js";import"./dropdown-menu-Dl6PURsy.js";import"./ChevronRight-Boh94iyZ.js";import"./Grid01-COCXYn3t.js";import"./view-mode-toggle-DlhHZSZ6.js";import"./collection-search-Dwhflp6J.js";import"./card-DPsjHi5_.js";import"./Copy01-BrkhNqAw.js";import"./DotsVertical-cXTBD68H.js";import"./use-list-state-C9bMHTQK.js";import"./use-mobile-b2I183jd.js";import"./Trash01-C3O36hTP.js";import"./collection-table-wrapper-Tc6aoQU4.js";import"./empty-state-Ctkb5o27.js";import"./Inbox01-CEyXxA8m.js";import"./avatar-MdaY7dDq.js";import"./useQuery-BXYZ1U8o.js";import"./pin-to-sidebar-button-B_8L8Vb0.js";import"./use-organization-settings-D21MRe-D.js";import"./constants-DgMd8oVj.js";import"./alert-dialog-F5nkQKBj.js";import"./Plus-CJASgavw.js";import"./layout-CSrwjVH6.js";import"./ArrowLeft-Bpp_SsGd.js";import"./auth-m66JRmI1.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=z(),{org:{slug:m}}=B(),{data:h}=L.useSession(),d=P(),[a,w]=v.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){w(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),d({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{w(!1)}}},j=()=>{d({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(A,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Custom Connection"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),d=F();let a;t[0]!==d||t[1]!==o?(a={connections:d,binding:o},t[0]=d,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=v.useState(null),N=l&&S&&(l.id||E);let f;t[8]!==s?(f=e.jsx(M,{title:s}),t[8]=s,t[9]=f):f=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let p;t[11]!==s?(p=s.toLowerCase(),t[11]=s,t[12]=p):p=t[12];let u;t[13]!==p?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",p,"..."]})]}),t[13]=p,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==N||t[20]!==m?(g=N?e.jsx(R,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=N,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(v.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let b;return t[25]!==f||t[26]!==x?(b=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[f,x]}),t[25]=f,t[26]=x,t[27]=b):b=t[27],b}function yt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{yt as default};
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <title>MCP Mesh</title>
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
- <script type="module" crossorigin src="/assets/index-DHr9tFb0.js"></script>
6
+ <script type="module" crossorigin src="/assets/index-DsWTyaMI.js"></script>
7
7
  <link rel="stylesheet" crossorigin href="/assets/index-BV_tzcZC.css">
8
8
  </head>
9
9
  <body>