@decocms/mesh 1.9.0 → 1.11.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 (153) hide show
  1. package/dist/client/assets/{AlertCircle-BrGqb-qb.js → AlertCircle-DIUuKH85.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-B6h573ak.js → ArrowLeft-CkUzXRaI.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-BuogCeI0.js → ChevronDown-BvW0ckZD.js} +1 -1
  4. package/dist/client/assets/ChevronRight-CZtzKGIu.js +1 -0
  5. package/dist/client/assets/{Copy01-_s71W2Ph.js → Copy01-CuJ0g2xO.js} +1 -1
  6. package/dist/client/assets/DotsHorizontal-DYEmF2Ja.js +1 -0
  7. package/dist/client/assets/{DotsVertical-BQk5hPxb.js → DotsVertical-BeEwh9bI.js} +1 -1
  8. package/dist/client/assets/{File06-CpSSTggW.js → File06-CRLpAcG8.js} +1 -1
  9. package/dist/client/assets/FilterLines-Dunahtdb.js +1 -0
  10. package/dist/client/assets/{FlipBackward-C0O2fx27.js → FlipBackward-BNVbTeUf.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-DjmPf135.js → GitBranch01-C6HWIzG8.js} +1 -1
  12. package/dist/client/assets/{Grid01-CmB5R6oU.js → Grid01-abxNmH9m.js} +1 -1
  13. package/dist/client/assets/{Inbox01-Ct-8Lwpv.js → Inbox01-BgT9AcaM.js} +1 -1
  14. package/dist/client/assets/{InfoCircle-D6JXYJn_.js → InfoCircle-BsiOwq0l.js} +1 -1
  15. package/dist/client/assets/{Key01-ZVAVplBN.js → Key01-B5WpAxl2.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-DfHTXuZ9.js → LinkExternal01-CZ9G6wJu.js} +1 -1
  17. package/dist/client/assets/{Loading01-0wYmSKV6.js → Loading01-moxMTYJZ.js} +1 -1
  18. package/dist/client/assets/{Lock01-D5nrmOSx.js → Lock01-DK8m996z.js} +1 -1
  19. package/dist/client/assets/Play-ZrtDSXtF.js +1 -0
  20. package/dist/client/assets/{Plus-DofiSAMU.js → Plus-CmJGP3Pi.js} +1 -1
  21. package/dist/client/assets/{Terminal-CStBCUAd.js → Terminal-D78hWJeY.js} +1 -1
  22. package/dist/client/assets/{Trash01-DnTS63e5.js → Trash01-D5RX1AvX.js} +1 -1
  23. package/dist/client/assets/{X-DeVUfdHG.js → X-DYwfZFnc.js} +1 -1
  24. package/dist/client/assets/XClose-Blj-z_Lg.js +1 -0
  25. package/dist/client/assets/{alert-dialog-BU8uTWb8.js → alert-dialog-2_Xl_cUo.js} +3 -3
  26. package/dist/client/assets/auth-CPKE7Qi_.js +1 -0
  27. package/dist/client/assets/{auth-catchall-2WBu6I6H.js → auth-catchall-asPM_Gpt.js} +1 -1
  28. package/dist/client/assets/{avatar-KDpJ2jsd.js → avatar-NJ2X4Ohl.js} +1 -1
  29. package/dist/client/assets/{badge-CStgouQf.js → badge-CSFb4yoL.js} +1 -1
  30. package/dist/client/assets/button-B6d9pLjw.js +1 -0
  31. package/dist/client/assets/{card-BnWpolEI.js → card-D98cnfOH.js} +1 -1
  32. package/dist/client/assets/checkbox-B3KsIzSA.js +1 -0
  33. package/dist/client/assets/{collection-detail-DnxFiEu9.js → collection-detail-7jpdrsjG.js} +41 -41
  34. package/dist/client/assets/collection-display-button-B_3aOLS4.js +1 -0
  35. package/dist/client/assets/{collection-header-DBUE7n6H.js → collection-header-Dofk8u1h.js} +1 -1
  36. package/dist/client/assets/{collection-page-BHk1uJKe.js → collection-page-B1QnvJAf.js} +1 -1
  37. package/dist/client/assets/collection-search-DT3IVSbs.js +1 -0
  38. package/dist/client/assets/collection-tab-2aj2IyYN.js +1 -0
  39. package/dist/client/assets/{collection-table-wrapper-BRI7T6RJ.js → collection-table-wrapper-DzYv1LYJ.js} +1 -1
  40. package/dist/client/assets/{connection-card-DMv3uM_n.js → connection-card-DoZG4KYv.js} +1 -1
  41. package/dist/client/assets/connection-detail-CG5F7eYm.js +1 -0
  42. package/dist/client/assets/connections-DBqko-au.js +1 -0
  43. package/dist/client/assets/constants-CRMW04Tq.js +1 -0
  44. package/dist/client/assets/{create-organization-dialog-DbNHSUuq.js → create-organization-dialog-chOw1gL3.js} +1 -1
  45. package/dist/client/assets/{dialog-CJsBFVDy.js → dialog-CaCpZWVz.js} +1 -1
  46. package/dist/client/assets/dropdown-menu-DKq7y9Ab.js +1 -0
  47. package/dist/client/assets/{empty-state-Bg-FRZa4.js → empty-state-xLD9BV9Z.js} +1 -1
  48. package/dist/client/assets/env-vars-editor-BIyKC4Rz.js +1 -0
  49. package/dist/client/assets/{error-boundary-CsEoagci.js → error-boundary-ZHp5NunN.js} +1 -1
  50. package/dist/client/assets/extract-connection-data-DaYEiIhd.js +1 -0
  51. package/dist/client/assets/{form-BjarY-Jq.js → form-C_Mz-Re1.js} +1 -1
  52. package/dist/client/assets/{formatDistanceToNow-fhdySMxO.js → formatDistanceToNow-CxfQwfjE.js} +1 -1
  53. package/dist/client/assets/gateway-detail-BH34ou9a.js +1 -0
  54. package/dist/client/assets/gateway-selector-DgKTRIKP.js +1 -0
  55. package/dist/client/assets/gateways-D_z8EWpe.js +1 -0
  56. package/dist/client/assets/github-icon-BrF3LMLL.js +1 -0
  57. package/dist/client/assets/{home-BXCs6vTQ.js → home-DwiZZ6Lk.js} +1 -1
  58. package/dist/client/assets/index-BjKus4OW.css +1 -0
  59. package/dist/client/assets/{index-CRGUNI2v.js → index-CjDpnJWb.js} +5 -5
  60. package/dist/client/assets/index-CytkXEgd.js +155 -0
  61. package/dist/client/assets/index-DFBaadWa.js +1 -0
  62. package/dist/client/assets/{input-BxywPo2X.js → input-hiMZ1V63.js} +1 -1
  63. package/dist/client/assets/{layout-Dfp1nH3g.js → layout-DEsRSKAp.js} +1 -1
  64. package/dist/client/assets/{lazy-highlighter-DYlTa9LA.js → lazy-highlighter-CgR5ZMfY.js} +1 -1
  65. package/dist/client/assets/{localstorage-keys-Bj9V9Nbd.js → localstorage-keys-CpCKetOn.js} +1 -1
  66. package/dist/client/assets/{login-BfaeBzql.js → login-9yN2SgKi.js} +1 -1
  67. package/dist/client/assets/{mcp-oauth-Vd_yzV5S.js → mcp-oauth-D_E4Op0m.js} +1 -1
  68. package/dist/client/assets/mcp-server-detail-DPNY9vgF.js +1 -0
  69. package/dist/client/assets/members-VwgW_g24.js +3 -0
  70. package/dist/client/assets/{monaco-editor-mQfzbJMr.js → monaco-editor-DAqCldiN.js} +4 -4
  71. package/dist/client/assets/monitoring-BdaWFgQZ.js +49 -0
  72. package/dist/client/assets/{oauth-callback-Cwog6Jzh.js → oauth-callback-C_lwUhYa.js} +1 -1
  73. package/dist/client/assets/page-BH17Xeeo.js +35 -0
  74. package/dist/client/assets/page-CRqZQKSl.js +1 -0
  75. package/dist/client/assets/pin-to-sidebar-button-Dmct01St.js +1 -0
  76. package/dist/client/assets/popover-Clubonj7.js +1 -0
  77. package/dist/client/assets/project-context-provider-DtvnTwVB.js +1 -0
  78. package/dist/client/assets/resizable-BPaAYZlg.js +1 -0
  79. package/dist/client/assets/{resource-tabs-s0IiCCzU.js → resource-tabs-D70FgHGt.js} +1 -1
  80. package/dist/client/assets/select-DSYJVHKu.js +1 -0
  81. package/dist/client/assets/settings-D8ofqvqO.js +1 -0
  82. package/dist/client/assets/shell-layout-GW5ptB5d.js +19 -0
  83. package/dist/client/assets/{spinner-D7ZAVJCR.js → spinner-wRRUlECI.js} +1 -1
  84. package/dist/client/assets/switch-DBKcBjJ4.js +1 -0
  85. package/dist/client/assets/{textarea-DNeEC-Sl.js → textarea-YnyjDZNX.js} +1 -1
  86. package/dist/client/assets/{thread-history-popover-CykPOF9f.js → thread-history-popover-MOKjUScw.js} +37 -37
  87. package/dist/client/assets/tools-list-CurlBMu7.js +1 -0
  88. package/dist/client/assets/{use-binding-C5e_Y70M.js → use-binding-DQAwqqzW.js} +8 -8
  89. package/dist/client/assets/use-connection-CD_z3y8h.js +2 -0
  90. package/dist/client/assets/{use-connection-resources-CjjFKWSM.js → use-connection-resources-vGIbHphJ.js} +1 -1
  91. package/dist/client/assets/use-gateway-DTR5dTeA.js +1 -0
  92. package/dist/client/assets/{use-list-state-B13SO1z3.js → use-list-state-Da9AxEO9.js} +1 -1
  93. package/dist/client/assets/{use-mcp-CPBDJGOj.js → use-mcp-BX-QiIqs.js} +1 -1
  94. package/dist/client/assets/use-members-CCurAGbi.js +1 -0
  95. package/dist/client/assets/{use-mobile-VYFif8jU.js → use-mobile-h7BkfBcD.js} +1 -1
  96. package/dist/client/assets/{use-organization-settings-i4aS_Egu.js → use-organization-settings-B9z0BdMT.js} +1 -1
  97. package/dist/client/assets/{use-tool-call-BdbJ3oy8.js → use-tool-call-NuFBLRMj.js} +1 -1
  98. package/dist/client/assets/useQuery-DUm3_rZs.js +1 -0
  99. package/dist/client/assets/value-BH4rnske.js +1 -0
  100. package/dist/client/assets/{view-mode-toggle-BXo-WMnB.js → view-mode-toggle-DZJhL4Oe.js} +1 -1
  101. package/dist/client/assets/{well-known-mcp-VNRT0JrW.js → well-known-mcp-D13f-8h2.js} +1 -1
  102. package/dist/client/assets/workflow-Btak9-NU.js +1 -0
  103. package/dist/client/index.html +2 -2
  104. package/dist/server/cli.js +2 -2
  105. package/dist/server/server.js +2 -2
  106. package/package.json +2 -3
  107. package/dist/client/assets/Clock-LzAlJ-1R.js +0 -1
  108. package/dist/client/assets/Code01-Wll8WS4F.js +0 -1
  109. package/dist/client/assets/CpuChip02-BwTl0fBj.js +0 -1
  110. package/dist/client/assets/Play-BedrzKsi.js +0 -1
  111. package/dist/client/assets/SearchMd-D70t5LVP.js +0 -1
  112. package/dist/client/assets/XClose-5A0s2w1d.js +0 -1
  113. package/dist/client/assets/auth-DpA5_jth.js +0 -1
  114. package/dist/client/assets/button-IijH0wdI.js +0 -1
  115. package/dist/client/assets/checkbox-BYeNlYdH.js +0 -1
  116. package/dist/client/assets/collection-display-button-2ZQ5sQTW.js +0 -1
  117. package/dist/client/assets/collection-search-CM9rltH6.js +0 -1
  118. package/dist/client/assets/collection-tab-ClOnLgHC.js +0 -1
  119. package/dist/client/assets/connection-detail-Cs5NpuH7.js +0 -1
  120. package/dist/client/assets/connections-DSbytdP0.js +0 -1
  121. package/dist/client/assets/constants-TKUQnnwA.js +0 -1
  122. package/dist/client/assets/dropdown-menu-BvLCKekW.js +0 -1
  123. package/dist/client/assets/env-vars-editor-Z7SwcUr8.js +0 -1
  124. package/dist/client/assets/extract-connection-data-BgA1QcA6.js +0 -1
  125. package/dist/client/assets/gateway-detail-DeFxNps5.js +0 -1
  126. package/dist/client/assets/gateways-CXlSFkKr.js +0 -1
  127. package/dist/client/assets/index-9pHY4m3c.css +0 -1
  128. package/dist/client/assets/index-BGEzzv-W.js +0 -1
  129. package/dist/client/assets/index-BLgTJ8o3.js +0 -155
  130. package/dist/client/assets/index-B_OB0BCO.js +0 -1
  131. package/dist/client/assets/members-fIe1QSNh.js +0 -3
  132. package/dist/client/assets/monitoring-I1RqzeAN.js +0 -4
  133. package/dist/client/assets/page-BVptnX4j.js +0 -21
  134. package/dist/client/assets/pin-to-sidebar-button-C8t5xznu.js +0 -1
  135. package/dist/client/assets/popover-CwHNob2q.js +0 -1
  136. package/dist/client/assets/registry-utils-ulDDT0d8.js +0 -1
  137. package/dist/client/assets/resizable-DybyPt6-.js +0 -1
  138. package/dist/client/assets/responsive-select-INSf3elv.js +0 -1
  139. package/dist/client/assets/select-C0rvNlZx.js +0 -1
  140. package/dist/client/assets/settings-3Or8ShnF.js +0 -1
  141. package/dist/client/assets/shell-layout-4x0MHQQc.js +0 -19
  142. package/dist/client/assets/store-Bl_0XUq8.js +0 -1
  143. package/dist/client/assets/store-app-detail--3qLKygc.js +0 -1
  144. package/dist/client/assets/switch-D37mVt_9.js +0 -1
  145. package/dist/client/assets/tools-list-CFmwpEf4.js +0 -1
  146. package/dist/client/assets/tooltip-CSuczTFq.js +0 -1
  147. package/dist/client/assets/types-CJK7iTsI.js +0 -46
  148. package/dist/client/assets/use-connection-CsPrFY0x.js +0 -2
  149. package/dist/client/assets/use-gateway-Bz_y7oh7.js +0 -1
  150. package/dist/client/assets/use-members-b3tDRslY.js +0 -1
  151. package/dist/client/assets/useQuery-DXchCtgN.js +0 -1
  152. package/dist/client/assets/useSuspenseInfiniteQuery-BLpBJxLd.js +0 -1
  153. package/dist/client/assets/workflow-wGJTSVc-.js +0 -1
@@ -1 +0,0 @@
1
- import{aJ as h,w as e,a$ as u,bE as y,a_ as ve,v as i,b0 as r,aI as S,_ as U,W as s,bz as Le,X as _,Y as m,bM as Ie,aY as dt,bN as g,bF as mt,b1 as Ae,bO as ht,bP as _t,bQ as ft,bs as St}from"./index-BLgTJ8o3.js";const gt={custom:"custom"},me="2025-11-25",Bn=[me,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Rt="io.modelcontextprotocol/related-task",F="2.0",C=dt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Oe=h([e(),u().int()]),Me=e();y({ttl:h([u(),ve()]).optional(),pollInterval:u().optional()});const wt=i({ttl:u().optional()}),yt=i({taskId:e()}),he=y({progressToken:Oe.optional(),[Rt]:yt.optional()}),T=i({_meta:he.optional()}),M=T.extend({task:wt.optional()}),Jn=t=>M.safeParse(t).success,x=i({method:e(),params:T.loose().optional()}),b=i({_meta:he.optional()}),q=i({method:e(),params:b.loose().optional()}),k=y({_meta:he.optional()}),Z=h([e(),u().int()]),Ne=i({jsonrpc:r(F),id:Z,...x.shape}).strict(),Gn=t=>Ne.safeParse(t).success,je=i({jsonrpc:r(F),...q.shape}).strict(),Fn=t=>je.safeParse(t).success,_e=i({jsonrpc:r(F),id:Z,result:k}).strict(),Zn=t=>_e.safeParse(t).success;var W;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(W||(W={}));const fe=i({jsonrpc:r(F),id:Z.optional(),error:i({code:u().int(),message:e(),data:S().optional()})}).strict(),Yn=t=>fe.safeParse(t).success,Kn=h([Ne,je,_e,fe]);h([_e,fe]);const ze=k.strict(),Ct=b.extend({requestId:Z.optional(),reason:e().optional()}),$e=q.extend({method:r("notifications/cancelled"),params:Ct}),xt=i({src:e(),mimeType:e().optional(),sizes:s(e()).optional(),theme:U(["light","dark"]).optional()}),N=i({icons:s(xt).optional()}),L=i({name:e(),title:e().optional()}),He=L.extend({...L.shape,...N.shape,version:e(),websiteUrl:e().optional(),description:e().optional()}),kt=Le(i({applyDefaults:m().optional()}),_(e(),S())),Pt=Ie(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Le(i({form:kt.optional(),url:C.optional()}),_(e(),S()).optional())),Tt=y({list:C.optional(),cancel:C.optional(),requests:y({sampling:y({createMessage:C.optional()}).optional(),elicitation:y({create:C.optional()}).optional()}).optional()}),Ut=y({list:C.optional(),cancel:C.optional(),requests:y({tools:y({call:C.optional()}).optional()}).optional()}),bt=i({experimental:_(e(),C).optional(),sampling:i({context:C.optional(),tools:C.optional()}).optional(),elicitation:Pt.optional(),roots:i({listChanged:m().optional()}).optional(),tasks:Tt.optional()}),qt=T.extend({protocolVersion:e(),capabilities:bt,clientInfo:He}),Et=x.extend({method:r("initialize"),params:qt}),vt=i({experimental:_(e(),C).optional(),logging:C.optional(),completions:C.optional(),prompts:i({listChanged:m().optional()}).optional(),resources:i({subscribe:m().optional(),listChanged:m().optional()}).optional(),tools:i({listChanged:m().optional()}).optional(),tasks:Ut.optional()}),Lt=k.extend({protocolVersion:e(),capabilities:vt,serverInfo:He,instructions:e().optional()}),We=q.extend({method:r("notifications/initialized"),params:b.optional()}),Qn=t=>We.safeParse(t).success,Ve=x.extend({method:r("ping"),params:T.optional()}),It=i({progress:u(),total:g(u()),message:g(e())}),At=i({...b.shape,...It.shape,progressToken:Oe}),De=q.extend({method:r("notifications/progress"),params:At}),Ot=T.extend({cursor:Me.optional()}),j=x.extend({params:Ot.optional()}),z=k.extend({nextCursor:Me.optional()}),Mt=U(["working","input_required","completed","failed","cancelled"]),$=i({taskId:e(),status:Mt,ttl:h([u(),ve()]),createdAt:e(),lastUpdatedAt:e(),pollInterval:g(u()),statusMessage:g(e())}),Be=k.extend({task:$}),Nt=b.merge($),Je=q.extend({method:r("notifications/tasks/status"),params:Nt}),Ge=x.extend({method:r("tasks/get"),params:T.extend({taskId:e()})}),Fe=k.merge($),Ze=x.extend({method:r("tasks/result"),params:T.extend({taskId:e()})});k.loose();const Ye=j.extend({method:r("tasks/list")}),Ke=z.extend({tasks:s($)}),Qe=x.extend({method:r("tasks/cancel"),params:T.extend({taskId:e()})}),Xn=k.merge($),Xe=i({uri:e(),mimeType:g(e()),_meta:_(e(),S()).optional()}),et=Xe.extend({text:e()}),Se=e().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),tt=Xe.extend({blob:Se}),H=U(["user","assistant"]),A=i({audience:s(H).optional(),priority:u().min(0).max(1).optional(),lastModified:mt({offset:!0}).optional()}),ot=i({...L.shape,...N.shape,uri:e(),description:g(e()),mimeType:g(e()),annotations:A.optional(),_meta:g(y({}))}),jt=i({...L.shape,...N.shape,uriTemplate:e(),description:g(e()),mimeType:g(e()),annotations:A.optional(),_meta:g(y({}))}),zt=j.extend({method:r("resources/list")}),$t=z.extend({resources:s(ot)}),Ht=j.extend({method:r("resources/templates/list")}),Wt=z.extend({resourceTemplates:s(jt)}),ge=T.extend({uri:e()}),Vt=ge,Dt=x.extend({method:r("resources/read"),params:Vt}),Bt=k.extend({contents:s(h([et,tt]))}),Jt=q.extend({method:r("notifications/resources/list_changed"),params:b.optional()}),Gt=ge,Ft=x.extend({method:r("resources/subscribe"),params:Gt}),Zt=ge,Yt=x.extend({method:r("resources/unsubscribe"),params:Zt}),Kt=b.extend({uri:e()}),Qt=q.extend({method:r("notifications/resources/updated"),params:Kt}),Xt=i({name:e(),description:g(e()),required:g(m())}),eo=i({...L.shape,...N.shape,description:g(e()),arguments:g(s(Xt)),_meta:g(y({}))}),to=j.extend({method:r("prompts/list")}),oo=z.extend({prompts:s(eo)}),no=T.extend({name:e(),arguments:_(e(),e()).optional()}),ao=x.extend({method:r("prompts/get"),params:no}),Re=i({type:r("text"),text:e(),annotations:A.optional(),_meta:_(e(),S()).optional()}),we=i({type:r("image"),data:Se,mimeType:e(),annotations:A.optional(),_meta:_(e(),S()).optional()}),ye=i({type:r("audio"),data:Se,mimeType:e(),annotations:A.optional(),_meta:_(e(),S()).optional()}),so=i({type:r("tool_use"),name:e(),id:e(),input:_(e(),S()),_meta:_(e(),S()).optional()}),io=i({type:r("resource"),resource:h([et,tt]),annotations:A.optional(),_meta:_(e(),S()).optional()}),ro=ot.extend({type:r("resource_link")}),Ce=h([Re,we,ye,ro,io]),co=i({role:H,content:Ce}),lo=k.extend({description:e().optional(),messages:s(co)}),po=q.extend({method:r("notifications/prompts/list_changed"),params:b.optional()}),uo=i({title:e().optional(),readOnlyHint:m().optional(),destructiveHint:m().optional(),idempotentHint:m().optional(),openWorldHint:m().optional()}),mo=i({taskSupport:U(["required","optional","forbidden"]).optional()}),nt=i({...L.shape,...N.shape,description:e().optional(),inputSchema:i({type:r("object"),properties:_(e(),C).optional(),required:s(e()).optional()}).catchall(S()),outputSchema:i({type:r("object"),properties:_(e(),C).optional(),required:s(e()).optional()}).catchall(S()).optional(),annotations:uo.optional(),execution:mo.optional(),_meta:_(e(),S()).optional()}),ho=j.extend({method:r("tools/list")}),_o=z.extend({tools:s(nt)}),at=k.extend({content:s(Ce).default([]),structuredContent:_(e(),S()).optional(),isError:m().optional()});at.or(k.extend({toolResult:S()}));const fo=M.extend({name:e(),arguments:_(e(),S()).optional()}),So=x.extend({method:r("tools/call"),params:fo}),go=q.extend({method:r("notifications/tools/list_changed"),params:b.optional()}),ea=i({autoRefresh:m().default(!0),debounceMs:u().int().nonnegative().default(300)}),st=U(["debug","info","notice","warning","error","critical","alert","emergency"]),Ro=T.extend({level:st}),wo=x.extend({method:r("logging/setLevel"),params:Ro}),yo=b.extend({level:st,logger:e().optional(),data:S()}),Co=q.extend({method:r("notifications/message"),params:yo}),xo=i({name:e().optional()}),ko=i({hints:s(xo).optional(),costPriority:u().min(0).max(1).optional(),speedPriority:u().min(0).max(1).optional(),intelligencePriority:u().min(0).max(1).optional()}),Po=i({mode:U(["auto","required","none"]).optional()}),To=i({type:r("tool_result"),toolUseId:e().describe("The unique identifier for the corresponding tool call."),content:s(Ce).default([]),structuredContent:i({}).loose().optional(),isError:m().optional(),_meta:_(e(),S()).optional()}),Uo=Ae("type",[Re,we,ye]),V=Ae("type",[Re,we,ye,so,To]),bo=i({role:H,content:h([V,s(V)]),_meta:_(e(),S()).optional()}),qo=M.extend({messages:s(bo),modelPreferences:ko.optional(),systemPrompt:e().optional(),includeContext:U(["none","thisServer","allServers"]).optional(),temperature:u().optional(),maxTokens:u().int(),stopSequences:s(e()).optional(),metadata:C.optional(),tools:s(nt).optional(),toolChoice:Po.optional()}),Eo=x.extend({method:r("sampling/createMessage"),params:qo}),vo=k.extend({model:e(),stopReason:g(U(["endTurn","stopSequence","maxTokens"]).or(e())),role:H,content:Uo}),Lo=k.extend({model:e(),stopReason:g(U(["endTurn","stopSequence","maxTokens","toolUse"]).or(e())),role:H,content:h([V,s(V)])}),Io=i({type:r("boolean"),title:e().optional(),description:e().optional(),default:m().optional()}),Ao=i({type:r("string"),title:e().optional(),description:e().optional(),minLength:u().optional(),maxLength:u().optional(),format:U(["email","uri","date","date-time"]).optional(),default:e().optional()}),Oo=i({type:U(["number","integer"]),title:e().optional(),description:e().optional(),minimum:u().optional(),maximum:u().optional(),default:u().optional()}),Mo=i({type:r("string"),title:e().optional(),description:e().optional(),enum:s(e()),default:e().optional()}),No=i({type:r("string"),title:e().optional(),description:e().optional(),oneOf:s(i({const:e(),title:e()})),default:e().optional()}),jo=i({type:r("string"),title:e().optional(),description:e().optional(),enum:s(e()),enumNames:s(e()).optional(),default:e().optional()}),zo=h([Mo,No]),$o=i({type:r("array"),title:e().optional(),description:e().optional(),minItems:u().optional(),maxItems:u().optional(),items:i({type:r("string"),enum:s(e())}),default:s(e()).optional()}),Ho=i({type:r("array"),title:e().optional(),description:e().optional(),minItems:u().optional(),maxItems:u().optional(),items:i({anyOf:s(i({const:e(),title:e()}))}),default:s(e()).optional()}),Wo=h([$o,Ho]),Vo=h([jo,zo,Wo]),Do=h([Vo,Io,Ao,Oo]),Bo=M.extend({mode:r("form").optional(),message:e(),requestedSchema:i({type:r("object"),properties:_(e(),Do),required:s(e()).optional()})}),Jo=M.extend({mode:r("url"),message:e(),elicitationId:e(),url:e().url()}),Go=h([Bo,Jo]),Fo=x.extend({method:r("elicitation/create"),params:Go}),Zo=b.extend({elicitationId:e()}),Yo=q.extend({method:r("notifications/elicitation/complete"),params:Zo}),Ko=k.extend({action:U(["accept","decline","cancel"]),content:Ie(t=>t===null?void 0:t,_(e(),h([e(),u(),m(),s(e())])).optional())}),Qo=i({type:r("ref/resource"),uri:e()}),Xo=i({type:r("ref/prompt"),name:e()}),en=T.extend({ref:h([Xo,Qo]),argument:i({name:e(),value:e()}),context:i({arguments:_(e(),e()).optional()}).optional()}),tn=x.extend({method:r("completion/complete"),params:en}),on=k.extend({completion:y({values:s(e()).max(100),total:g(u().int()),hasMore:g(m())})}),nn=i({uri:e().startsWith("file://"),name:e().optional(),_meta:_(e(),S()).optional()}),an=x.extend({method:r("roots/list"),params:T.optional()}),sn=k.extend({roots:s(nn)}),rn=q.extend({method:r("notifications/roots/list_changed"),params:b.optional()});h([Ve,Et,tn,wo,ao,to,zt,Ht,Dt,Ft,Yt,So,ho,Ge,Ze,Ye,Qe]);h([$e,De,We,rn,Je]);h([ze,vo,Lo,Ko,sn,Fe,Ke,Be]);h([Ve,Eo,Fo,an,Ge,Ze,Ye,Qe]);h([$e,De,Co,Qt,Jt,go,po,Je,Yo]);h([ze,Lt,on,lo,oo,$t,Wt,Bt,at,_o,Fe,Ke,Be]);class xe extends Error{constructor(o,n,a){super(`MCP error ${o}: ${n}`),this.code=o,this.data=a,this.name="McpError"}static fromError(o,n,a){if(o===W.UrlElicitationRequired&&a){const c=a;if(c.elicitations)return new cn(c.elicitations,n)}return new xe(o,n,a)}}class cn extends xe{constructor(o,n=`URL elicitation${o.length>1?"s":""} required`){super(W.UrlElicitationRequired,n,{elicitations:o})}get elicitations(){return this.data?.elicitations??[]}}let ke;ke=globalThis.crypto;async function ln(t){return(await ke).getRandomValues(new Uint8Array(t))}async function pn(t){const o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%o.length;let a="";for(;a.length<t;){const c=await ln(t-a.length);for(const p of c)p<n&&(a+=o[p%o.length])}return a}async function un(t){return await pn(t)}async function dn(t){const o=await(await ke).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(o))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function mn(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;const o=await un(t),n=await dn(o);return{code_verifier:o,code_challenge:n}}const w=ht().superRefine((t,o)=>{if(!URL.canParse(t))return o.addIssue({code:gt.custom,message:"URL must be parseable",fatal:!0}),_t}).refine(t=>{const o=new URL(t);return o.protocol!=="javascript:"&&o.protocol!=="data:"&&o.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),hn=y({resource:e().url(),authorization_servers:s(w).optional(),jwks_uri:e().url().optional(),scopes_supported:s(e()).optional(),bearer_methods_supported:s(e()).optional(),resource_signing_alg_values_supported:s(e()).optional(),resource_name:e().optional(),resource_documentation:e().optional(),resource_policy_uri:e().url().optional(),resource_tos_uri:e().url().optional(),tls_client_certificate_bound_access_tokens:m().optional(),authorization_details_types_supported:s(e()).optional(),dpop_signing_alg_values_supported:s(e()).optional(),dpop_bound_access_tokens_required:m().optional()}),it=y({issuer:e(),authorization_endpoint:w,token_endpoint:w,registration_endpoint:w.optional(),scopes_supported:s(e()).optional(),response_types_supported:s(e()),response_modes_supported:s(e()).optional(),grant_types_supported:s(e()).optional(),token_endpoint_auth_methods_supported:s(e()).optional(),token_endpoint_auth_signing_alg_values_supported:s(e()).optional(),service_documentation:w.optional(),revocation_endpoint:w.optional(),revocation_endpoint_auth_methods_supported:s(e()).optional(),revocation_endpoint_auth_signing_alg_values_supported:s(e()).optional(),introspection_endpoint:e().optional(),introspection_endpoint_auth_methods_supported:s(e()).optional(),introspection_endpoint_auth_signing_alg_values_supported:s(e()).optional(),code_challenge_methods_supported:s(e()).optional(),client_id_metadata_document_supported:m().optional()}),_n=y({issuer:e(),authorization_endpoint:w,token_endpoint:w,userinfo_endpoint:w.optional(),jwks_uri:w,registration_endpoint:w.optional(),scopes_supported:s(e()).optional(),response_types_supported:s(e()),response_modes_supported:s(e()).optional(),grant_types_supported:s(e()).optional(),acr_values_supported:s(e()).optional(),subject_types_supported:s(e()),id_token_signing_alg_values_supported:s(e()),id_token_encryption_alg_values_supported:s(e()).optional(),id_token_encryption_enc_values_supported:s(e()).optional(),userinfo_signing_alg_values_supported:s(e()).optional(),userinfo_encryption_alg_values_supported:s(e()).optional(),userinfo_encryption_enc_values_supported:s(e()).optional(),request_object_signing_alg_values_supported:s(e()).optional(),request_object_encryption_alg_values_supported:s(e()).optional(),request_object_encryption_enc_values_supported:s(e()).optional(),token_endpoint_auth_methods_supported:s(e()).optional(),token_endpoint_auth_signing_alg_values_supported:s(e()).optional(),display_values_supported:s(e()).optional(),claim_types_supported:s(e()).optional(),claims_supported:s(e()).optional(),service_documentation:e().optional(),claims_locales_supported:s(e()).optional(),ui_locales_supported:s(e()).optional(),claims_parameter_supported:m().optional(),request_parameter_supported:m().optional(),request_uri_parameter_supported:m().optional(),require_request_uri_registration:m().optional(),op_policy_uri:w.optional(),op_tos_uri:w.optional(),client_id_metadata_document_supported:m().optional()}),fn=i({..._n.shape,...it.pick({code_challenge_methods_supported:!0}).shape}),Sn=i({access_token:e(),id_token:e().optional(),token_type:e(),expires_in:ft().optional(),scope:e().optional(),refresh_token:e().optional()}).strip(),gn=i({error:e(),error_description:e().optional(),error_uri:e().optional()}),qe=w.optional().or(r("").transform(()=>{})),Rn=i({redirect_uris:s(w),token_endpoint_auth_method:e().optional(),grant_types:s(e()).optional(),response_types:s(e()).optional(),client_name:e().optional(),client_uri:w.optional(),logo_uri:qe,scope:e().optional(),contacts:s(e()).optional(),tos_uri:qe,policy_uri:e().optional(),jwks_uri:w.optional(),jwks:St().optional(),software_id:e().optional(),software_version:e().optional(),software_statement:e().optional()}).strip(),wn=i({client_id:e(),client_secret:e().optional(),client_id_issued_at:u().optional(),client_secret_expires_at:u().optional()}).strip(),yn=Rn.merge(wn);i({error:e(),error_description:e().optional()}).strip();i({token:e(),token_type_hint:e().optional()}).strip();function Cn(t){const o=typeof t=="string"?new URL(t):new URL(t.href);return o.hash="",o}function xn({requestedResource:t,configuredResource:o}){const n=typeof t=="string"?new URL(t):new URL(t.href),a=typeof o=="string"?new URL(o):new URL(o.href);if(n.origin!==a.origin||n.pathname.length<a.pathname.length)return!1;const c=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",p=a.pathname.endsWith("/")?a.pathname:a.pathname+"/";return c.startsWith(p)}class R extends Error{constructor(o,n){super(o),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const o={error:this.errorCode,error_description:this.message};return this.errorUri&&(o.error_uri=this.errorUri),o}get errorCode(){return this.constructor.errorCode}}class te extends R{}te.errorCode="invalid_request";class D extends R{}D.errorCode="invalid_client";class B extends R{}B.errorCode="invalid_grant";class J extends R{}J.errorCode="unauthorized_client";class oe extends R{}oe.errorCode="unsupported_grant_type";class ne extends R{}ne.errorCode="invalid_scope";class ae extends R{}ae.errorCode="access_denied";class I extends R{}I.errorCode="server_error";class se extends R{}se.errorCode="temporarily_unavailable";class ie extends R{}ie.errorCode="unsupported_response_type";class re extends R{}re.errorCode="unsupported_token_type";class ce extends R{}ce.errorCode="invalid_token";class le extends R{}le.errorCode="method_not_allowed";class pe extends R{}pe.errorCode="too_many_requests";class G extends R{}G.errorCode="invalid_client_metadata";class ue extends R{}ue.errorCode="insufficient_scope";class de extends R{}de.errorCode="invalid_target";const kn={[te.errorCode]:te,[D.errorCode]:D,[B.errorCode]:B,[J.errorCode]:J,[oe.errorCode]:oe,[ne.errorCode]:ne,[ae.errorCode]:ae,[I.errorCode]:I,[se.errorCode]:se,[ie.errorCode]:ie,[re.errorCode]:re,[ce.errorCode]:ce,[le.errorCode]:le,[pe.errorCode]:pe,[G.errorCode]:G,[ue.errorCode]:ue,[de.errorCode]:de};class ta extends Error{constructor(o){super(o??"Unauthorized")}}function Pn(t){return["client_secret_basic","client_secret_post","none"].includes(t)}const K="code",Q="S256";function Tn(t,o){const n=t.client_secret!==void 0;return o.length===0?n?"client_secret_post":"none":"token_endpoint_auth_method"in t&&t.token_endpoint_auth_method&&Pn(t.token_endpoint_auth_method)&&o.includes(t.token_endpoint_auth_method)?t.token_endpoint_auth_method:n&&o.includes("client_secret_basic")?"client_secret_basic":n&&o.includes("client_secret_post")?"client_secret_post":o.includes("none")?"none":n?"client_secret_post":"none"}function Un(t,o,n,a){const{client_id:c,client_secret:p}=o;switch(t){case"client_secret_basic":bn(c,p,n);return;case"client_secret_post":qn(c,p,a);return;case"none":En(c,a);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function bn(t,o,n){if(!o)throw new Error("client_secret_basic authentication requires a client_secret");const a=btoa(`${t}:${o}`);n.set("Authorization",`Basic ${a}`)}function qn(t,o,n){n.set("client_id",t),o&&n.set("client_secret",o)}function En(t,o){o.set("client_id",t)}async function rt(t){const o=t instanceof Response?t.status:void 0,n=t instanceof Response?await t.text():t;try{const a=gn.parse(JSON.parse(n)),{error:c,error_description:p,error_uri:d}=a,l=kn[c]||I;return new l(p||"",d)}catch(a){const c=`${o?`HTTP ${o}: `:""}Invalid OAuth error response: ${a}. Raw body: ${n}`;return new I(c)}}async function oa(t,o){try{return await X(t,o)}catch(n){if(n instanceof D||n instanceof J)return await t.invalidateCredentials?.("all"),await X(t,o);if(n instanceof B)return await t.invalidateCredentials?.("tokens"),await X(t,o);throw n}}async function X(t,{serverUrl:o,authorizationCode:n,scope:a,resourceMetadataUrl:c,fetchFn:p}){let d,l;try{d=await In(o,{resourceMetadataUrl:c},p),d.authorization_servers&&d.authorization_servers.length>0&&(l=d.authorization_servers[0])}catch{}l||(l=new URL("/",o));const f=await Ln(o,t,d),P=await jn(l,{fetchFn:p});let E=await Promise.resolve(t.clientInformation());if(!E){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const v=P?.client_id_metadata_document_supported===!0,O=t.clientMetadataUrl;if(O&&!vn(O))throw new G(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${O}`);if(v&&O)E={client_id:O},await t.saveClientInformation?.(E);else{if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const be=await Wn(l,{metadata:P,clientMetadata:t.clientMetadata,fetchFn:p});await t.saveClientInformation(be),E=be}}const Y=!t.redirectUrl;if(n!==void 0||Y){const v=await Hn(t,l,{metadata:P,resource:f,authorizationCode:n,fetchFn:p});return await t.saveTokens(v),"AUTHORIZED"}const Ue=await t.tokens();if(Ue?.refresh_token)try{const v=await $n(l,{metadata:P,clientInformation:E,refreshToken:Ue.refresh_token,resource:f,addClientAuthentication:t.addClientAuthentication,fetchFn:p});return await t.saveTokens(v),"AUTHORIZED"}catch(v){if(!(!(v instanceof R)||v instanceof I))throw v}const lt=t.state?await t.state():void 0,{authorizationUrl:pt,codeVerifier:ut}=await zn(l,{metadata:P,clientInformation:E,state:lt,redirectUrl:t.redirectUrl,scope:a||d?.scopes_supported?.join(" ")||t.clientMetadata.scope,resource:f});return await t.saveCodeVerifier(ut),await t.redirectToAuthorization(pt),"REDIRECT"}function vn(t){if(!t)return!1;try{const o=new URL(t);return o.protocol==="https:"&&o.pathname!=="/"}catch{return!1}}async function Ln(t,o,n){const a=Cn(t);if(o.validateResourceURL)return await o.validateResourceURL(a,n?.resource);if(n){if(!xn({requestedResource:a,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${a} (or origin)`);return new URL(n.resource)}}function na(t){const o=t.headers.get("WWW-Authenticate");if(!o)return{};const[n,a]=o.split(" ");if(n.toLowerCase()!=="bearer"||!a)return{};const c=ee(t,"resource_metadata")||void 0;let p;if(c)try{p=new URL(c)}catch{}const d=ee(t,"scope")||void 0,l=ee(t,"error")||void 0;return{resourceMetadataUrl:p,scope:d,error:l}}function ee(t,o){const n=t.headers.get("WWW-Authenticate");if(!n)return null;const a=new RegExp(`${o}=(?:"([^"]+)"|([^\\s,]+))`),c=n.match(a);return c?c[1]||c[2]:null}async function In(t,o,n=fetch){const a=await Mn(t,"oauth-protected-resource",n,{protocolVersion:o?.protocolVersion,metadataUrl:o?.resourceMetadataUrl});if(!a||a.status===404)throw await a?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!a.ok)throw await a.body?.cancel(),new Error(`HTTP ${a.status} trying to load well-known OAuth protected resource metadata.`);return hn.parse(await a.json())}async function Pe(t,o,n=fetch){try{return await n(t,{headers:o})}catch(a){if(a instanceof TypeError)return o?Pe(t,void 0,n):void 0;throw a}}function An(t,o="",n={}){return o.endsWith("/")&&(o=o.slice(0,-1)),n.prependPathname?`${o}/.well-known/${t}`:`/.well-known/${t}${o}`}async function Ee(t,o,n=fetch){return await Pe(t,{"MCP-Protocol-Version":o},n)}function On(t,o){return!t||t.status>=400&&t.status<500&&o!=="/"}async function Mn(t,o,n,a){const c=new URL(t),p=a?.protocolVersion??me;let d;if(a?.metadataUrl)d=new URL(a.metadataUrl);else{const f=An(o,c.pathname);d=new URL(f,a?.metadataServerUrl??c),d.search=c.search}let l=await Ee(d,p,n);if(!a?.metadataUrl&&On(l,c.pathname)){const f=new URL(`/.well-known/${o}`,c);l=await Ee(f,p,n)}return l}function Nn(t){const o=typeof t=="string"?new URL(t):t,n=o.pathname!=="/",a=[];if(!n)return a.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),a.push({url:new URL("/.well-known/openid-configuration",o.origin),type:"oidc"}),a;let c=o.pathname;return c.endsWith("/")&&(c=c.slice(0,-1)),a.push({url:new URL(`/.well-known/oauth-authorization-server${c}`,o.origin),type:"oauth"}),a.push({url:new URL(`/.well-known/openid-configuration${c}`,o.origin),type:"oidc"}),a.push({url:new URL(`${c}/.well-known/openid-configuration`,o.origin),type:"oidc"}),a}async function jn(t,{fetchFn:o=fetch,protocolVersion:n=me}={}){const a={"MCP-Protocol-Version":n,Accept:"application/json"},c=Nn(t);for(const{url:p,type:d}of c){const l=await Pe(p,a,o);if(l){if(!l.ok){if(await l.body?.cancel(),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${d==="oauth"?"OAuth":"OpenID provider"} metadata from ${p}`)}return d==="oauth"?it.parse(await l.json()):fn.parse(await l.json())}}}async function zn(t,{metadata:o,clientInformation:n,redirectUrl:a,scope:c,state:p,resource:d}){let l;if(o){if(l=new URL(o.authorization_endpoint),!o.response_types_supported.includes(K))throw new Error(`Incompatible auth server: does not support response type ${K}`);if(o.code_challenge_methods_supported&&!o.code_challenge_methods_supported.includes(Q))throw new Error(`Incompatible auth server: does not support code challenge method ${Q}`)}else l=new URL("/authorize",t);const f=await mn(),P=f.code_verifier,E=f.code_challenge;return l.searchParams.set("response_type",K),l.searchParams.set("client_id",n.client_id),l.searchParams.set("code_challenge",E),l.searchParams.set("code_challenge_method",Q),l.searchParams.set("redirect_uri",String(a)),p&&l.searchParams.set("state",p),c&&l.searchParams.set("scope",c),c?.includes("offline_access")&&l.searchParams.append("prompt","consent"),d&&l.searchParams.set("resource",d.href),{authorizationUrl:l,codeVerifier:P}}function ct(t,o,n){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:o,redirect_uri:String(n)})}async function Te(t,{metadata:o,tokenRequestParams:n,clientInformation:a,addClientAuthentication:c,resource:p,fetchFn:d}){const l=o?.token_endpoint?new URL(o.token_endpoint):new URL("/token",t),f=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(p&&n.set("resource",p.href),c)await c(f,n,l,o);else if(a){const E=o?.token_endpoint_auth_methods_supported??[],Y=Tn(a,E);Un(Y,a,f,n)}const P=await(d??fetch)(l,{method:"POST",headers:f,body:n});if(!P.ok)throw await rt(P);return Sn.parse(await P.json())}async function aa(t,{metadata:o,clientInformation:n,authorizationCode:a,codeVerifier:c,redirectUri:p,resource:d,addClientAuthentication:l,fetchFn:f}){const P=ct(a,c,p);return Te(t,{metadata:o,tokenRequestParams:P,clientInformation:n,addClientAuthentication:l,resource:d,fetchFn:f})}async function $n(t,{metadata:o,clientInformation:n,refreshToken:a,resource:c,addClientAuthentication:p,fetchFn:d}){const l=new URLSearchParams({grant_type:"refresh_token",refresh_token:a}),f=await Te(t,{metadata:o,tokenRequestParams:l,clientInformation:n,addClientAuthentication:p,resource:c,fetchFn:d});return{refresh_token:a,...f}}async function Hn(t,o,{metadata:n,resource:a,authorizationCode:c,fetchFn:p}={}){const d=t.clientMetadata.scope;let l;if(t.prepareTokenRequest&&(l=await t.prepareTokenRequest(d)),!l){if(!c)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const P=await t.codeVerifier();l=ct(c,P,t.redirectUrl)}const f=await t.clientInformation();return Te(o,{metadata:n,tokenRequestParams:l,clientInformation:f??void 0,addClientAuthentication:t.addClientAuthentication,resource:a,fetchFn:p})}async function Wn(t,{metadata:o,clientMetadata:n,fetchFn:a}){let c;if(o){if(!o.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");c=new URL(o.registration_endpoint)}else c=new URL("/register",t);const p=await(a??fetch)(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!p.ok)throw await rt(p);return yn.parse(await p.json())}export{Fo as A,Ko as B,$e as C,Eo as D,W as E,vo as F,Ge as G,oa as H,Lt as I,na as J,Kn as K,Ye as L,xe as M,Qn as N,In as O,De as P,jn as Q,Rt as R,Bn as S,Je as T,ta as U,aa as V,Ve as a,Ze as b,Qe as c,Yn as d,Gn as e,Fn as f,Jn as g,Be as h,Zn as i,Fe as j,Ke as k,Xn as l,at as m,go as n,po as o,Jt as p,me as q,ze as r,on as s,lo as t,oo as u,$t as v,Wt as w,Bt as x,_o as y,ea as z};
@@ -1 +0,0 @@
1
- import{ba as v,bc as g,bJ as l,bK as p,bb as b,e as f,r as u,bj as m,bL as x,aC as y,V as k,c as O,i as C,j as M,k as E}from"./index-BLgTJ8o3.js";var j=class extends v{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),g(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#o(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??p();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#o(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,r=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(i){Promise.reject(i)}}}this.listeners.forEach(t=>{t(this.#i)})})}};function R(e,t){const r=f(t),[s]=u.useState(()=>new j(r,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const i=u.useSyncExternalStore(u.useCallback(o=>s.subscribe(b.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),n=u.useCallback((o,d)=>{s.mutate(o,d).catch(m)},[s]);if(i.error&&x(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}function S(...e){return y(k(e))}const w=C("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-7 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=O.c(14);let r,s,i,n,o;t[0]!==e?({className:r,variant:o,size:i,asChild:n,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=i,t[4]=n,t[5]=o):(r=t[1],s=t[2],i=t[3],n=t[4],o=t[5]);const c=(n===void 0?!1:n)?E:"button";let a;t[6]!==r||t[7]!==i||t[8]!==o?(a=S(w({variant:o,size:i,className:r})),t[6]=r,t[7]=i,t[8]=o,t[9]=a):a=t[9];let h;return t[10]!==c||t[11]!==s||t[12]!==a?(h=M.jsx(c,{"data-slot":"button",className:a,...s}),t[10]=c,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}export{z as B,w as b,S as c,R as u};
@@ -1 +0,0 @@
1
- import{c as d,j as c,aD as n,aE as l}from"./index-BLgTJ8o3.js";import{i as m}from"./tooltip-CSuczTFq.js";import{c as b}from"./button-IijH0wdI.js";function f(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=b("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(n,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{f as C};
@@ -1 +0,0 @@
1
- import{r as n,c as N,j as s}from"./index-BLgTJ8o3.js";import{c as C,B as y}from"./button-IijH0wdI.js";import{c as M,D as z,b as E,a as D}from"./dropdown-menu-BvLCKekW.js";import{i as S,c as T}from"./Grid01-CmB5R6oU.js";import{i as L,a as V,c as B,b as _,T as W}from"./tooltip-CSuczTFq.js";import{V as $}from"./view-mode-toggle-BXo-WMnB.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function K(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsxs(B,{children:[s.jsx(_,{asChild:!0,children:s.jsx(z,{asChild:!0,children:s.jsx(y,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(W,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(T,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx($,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(f=>{const j=v===f.id;return s.jsx(M,{onClick:()=>l(f.id),className:C("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(L,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(E,{children:[h,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{K as C,w as n};
@@ -1 +0,0 @@
1
- import{c as x,j as a}from"./index-BLgTJ8o3.js";import{i as u}from"./SearchMd-D70t5LVP.js";import{I as b}from"./input-BxywPo2X.js";import{c as g}from"./button-IijH0wdI.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
@@ -1 +0,0 @@
1
- import{r as ke,c as ne,j as t,K as nt,f as lt,g as rt,a as at,t as ct}from"./index-BLgTJ8o3.js";import{g as Ke}from"./generate-id-Dyweu44Y.js";import{I as Ve,c as We,b as dt,d as mt,e as ft}from"./use-connection-CsPrFY0x.js";import{C as qe}from"./collection-display-button-2ZQ5sQTW.js";import{C as ut}from"./collection-search-CM9rltH6.js";import{C as pt}from"./card-BnWpolEI.js";import{b as Ge,D as He,a as Je,c as L}from"./dropdown-menu-BvLCKekW.js";import{B as Oe}from"./button-IijH0wdI.js";import{a as Qe}from"./Copy01-_s71W2Ph.js";import{i as Ye}from"./DotsVertical-BQk5hPxb.js";import{s as Ze,u as ht}from"./use-list-state-B13SO1z3.js";import{s as Xe}from"./Trash01-DnTS63e5.js";import{C as xt}from"./collection-table-wrapper-BRI7T6RJ.js";import{E as Ue}from"./empty-state-Bg-FRZa4.js";import{n as Be}from"./Inbox01-Ct-8Lwpv.js";import{A as ze}from"./avatar-KDpJ2jsd.js";import{u as gt}from"./useQuery-DXchCtgN.js";import{E as jt}from"./SearchMd-D70t5LVP.js";import{P as vt}from"./pin-to-sidebar-button-C8t5xznu.js";import{B as Ct}from"./constants-TKUQnnwA.js";import{A as bt,g as yt,c as Nt,b as wt,d as St,e as _t,a as Dt,f as At}from"./alert-dialog-BU8uTWb8.js";import{s as Tt}from"./Plus-DofiSAMU.js";import{V as $t}from"./layout-Dfp1nH3g.js";const Le=({size:n=24,color:e="currentColor",...s})=>ke.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},ke.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Le.displayName="Edit01";function It(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of d)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Pt(n){const e=ne.c(25),{item:s,schema:d,actions:i}=n;let l;e[0]!==s||e[1]!==d?(l=It(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==i?(f=i&&Object.keys(i).length>0,e[3]=i,e[4]=f):f=e[4];const o=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(Ve,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let C;e[8]!==s.title?(C=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=C):C=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==C||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[C,m]}),e[12]=C,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let j;e[18]!==i||e[19]!==o||e[20]!==s?(j=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ot,onMouseDown:kt,children:t.jsxs(Ge,{children:[t.jsx(He,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:Et,children:[i.open&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),i.edit&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.edit?.(s)},children:[t.jsx(Le,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(L,{variant:"destructive",onClick:r=>{r.stopPropagation(),i.delete?.(s)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=j):j=e[21];let S;return e[22]!==y||e[23]!==j?(S=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,j]}),e[22]=y,e[23]=j,e[24]=S):S=e[24],S}function Et(n){return n.stopPropagation()}function zt(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function Lt(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=We(),e[0]=s):s=e[0];const d=s;let i;e[1]!==n?(i=nt.user(n),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==i||e[6]!==l||e[7]!==a?(c={queryKey:i,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=i,e[6]=l,e[7]=a,e[8]=c):c=e[8],gt(c)}function Mt(n){const e=ne.c(33),{id:s,size:d,showEmail:i,className:l}=n,a=d===void 0?"xs":d,c=i===void 0?!1:i,{data:f,isLoading:o,isError:u}=Lt(s);if(o){const r=`flex items-center gap-2 ${l||""}`;let g;e[0]!==a?(g=t.jsx(ze.Skeleton,{shape:"circle",size:a}),e[0]=a,e[1]=g):g=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=v):v=e[2];let p;e[3]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=c,e[4]=p):p=e[4];let _;e[5]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[v,p]}),e[5]=p,e[6]=_):_=e[6];let b;return e[7]!==r||e[8]!==g||e[9]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[7]=r,e[8]=g,e[9]=_,e[10]=b):b=e[10],b}if(u||!f){const r=`flex items-center gap-2 ${l||""}`;let g;e[11]!==a?(g=t.jsx(ze,{shape:"circle",size:a,fallback:"?",muted:!0}),e[11]=a,e[12]=g):g=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=v):v=e[13];let p;return e[14]!==r||e[15]!==g?(p=t.jsxs("div",{className:r,children:[g,v]}),e[14]=r,e[15]=g,e[16]=p):p=e[16],p}const C=`flex items-center gap-2 ${l||""}`,h=f.image??void 0;let m;e[17]!==a||e[18]!==h||e[19]!==f.name?(m=t.jsx(ze,{shape:"circle",size:a,url:h,fallback:f.name}),e[17]=a,e[18]=h,e[19]=f.name,e[20]=m):m=e[20];let x;e[21]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[21]=f.name,e[22]=x):x=e[22];let y;e[23]!==c||e[24]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[23]=c,e[24]=f.email,e[25]=y):y=e[25];let j;e[26]!==x||e[27]!==y?(j=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[26]=x,e[27]=y,e[28]=j):j=e[28];let S;return e[29]!==C||e[30]!==m||e[31]!==j?(S=t.jsxs("div",{className:C,children:[m,j]}),e[29]=C,e[30]=m,e[31]=j,e[32]=S):S=e[32],S}const Ft=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Kt(n){return Object.keys(n).find(e=>Ft.includes(e.toLowerCase()))}function et(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Ut(n){const e=ne.c(32),{data:s,schema:d,viewMode:i,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:o,actions:u,onItemClick:C,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:j,sortableFields:S}=n,r=l===void 0?qt:l,g=f===void 0?"asc":f,v=o===void 0?Wt:o;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=C===void 0?Vt:C,I=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,P=j===void 0?!1:j,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Rt).filter(O=>!D||D.includes(O.id)).map(Bt):et(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const M=z;let $;e[6]!==I||e[7]!==P||e[8]!==v||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==M||e[13]!==i?($=!P&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:i,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:v,sortOptions:M})})]})}),e[6]=I,e[7]=P,e[8]=v,e[9]=r,e[10]=g,e[11]=c,e[12]=M,e[13]=i,e[14]=$):$=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==v||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==i?(A=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>b?.(O),className:"cursor-pointer h-full",children:t.jsx(Pt,{item:O,schema:d,readOnly:E,actions:_})},O.id))})}):t.jsx(xt,{columns:Jt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:v,onRowClick:b,emptyState:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=v,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=i,e[28]=A):A=e[28];let k;return e[29]!==$||e[30]!==A?(k=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,A]}),e[29]=$,e[30]=A,e[31]=k):k=e[31],k}function Bt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Rt(n){return n.sortable!==!1}function Vt(){}function Wt(){}function qt(){}function Gt(n){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(He,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Le,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(L,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function tt(n){const e=n.type;return Array.isArray(e)?e.every(s=>tt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ht(n,e){const s=n.properties||{},d=Object.keys(s).filter(o=>{const u=s[o];return u&&tt(u)}),i=Kt(s),l=[],a=new Set;i&&d.includes(i)&&(l.push(i),a.add(i));const c=["title","description","updated_at","updated_by"];for(const o of c)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));const f=d.filter(o=>!a.has(o)&&!Re.includes(o)).sort((o,u)=>o.localeCompare(u));for(const o of f)l.push(o),a.add(o);for(const o of Re)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));return l.map(o=>{const u=s[o],C=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:h=>{const m=h[o];return t.jsx(Ve,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:C,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx(Mt,{id:String(m),size:"xs"}):"—"},sortable:C,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:C,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:C,cellClassName:"max-w-[200px]"}})}function Jt(n,e,s,d){const i=n||Ht(e,s);return i.some(c=>c.id==="actions")?i:Object.keys(d).length>0?[...i,Gt(d)]:i}function Cs(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:i}=n,l=i.name,a=i.schema??Ct,c=i.hasCreateTool,f=i.hasUpdateTool,o=i.hasDeleteTool,u=lt(),h=rt().location.href,{data:m}=at.useSession(),x=m?.user?.id||"unknown",y=dt(s);let j;e[0]!==s?(j=We(s),e[0]=s,e[1]=j):j=e[1];const S=j,r=mt(s,l,S),g=`${s}-${l}`;let v;e[2]!==d||e[3]!==g?(v={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=v):v=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:I,setViewMode:T,sortKey:E,sortDirection:N,handleSort:P}=ht(v);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=ft(s,l,S,D),M=!c&&!f&&!o;let $;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?($=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=$):$=e[13];const A=$;let k;e[14]!==r.create||e[15]!==x?(k=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Ke("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=k):k=e[16];const O=k,[F,xe]=ke.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const st=le;let K;e[18]!==A||e[19]!==f?(K=f&&{edit:A},e[18]=A,e[19]=f,e[20]=K):K=e[20];let U;e[21]!==O||e[22]!==c?(U=c&&{duplicate:O},e[21]=O,e[22]=c,e[23]=U):U=e[23];let B;e[24]!==o?(B=o&&{delete:st},e[24]=o,e[25]=B):B=e[25];let re;e[26]!==B||e[27]!==K||e[28]!==U?(re={...K,...U,...B},e[26]=B,e[27]=K,e[28]=U,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==F?(ae=async()=>{F&&(await r.delete.mutateAsync(F.id),xe(null))},e[30]=r.delete,e[31]=F,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){ct.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ke("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const ve=ce;let de;e[41]!==a?(de=et(a),e[41]=a,e[42]=de):de=e[42];const Ce=de,Me=(z?.length??0)>0,ot=c&&Me,it=c&&!Me&&!p;let me;e[43]!==r.create||e[44]!==ve||e[45]!==c?(me=c?t.jsxs(Oe,{onClick:ve,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=ve,e[45]=c,e[46]=me):me=e[46];const Fe=me,be=E;let R;e[47]!==P||e[48]!==T||e[49]!==N||e[50]!==Ce||e[51]!==be||e[52]!==I?(R=t.jsx(qe,{viewMode:I,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:P,sortOptions:Ce}),e[47]=P,e[48]=T,e[49]=N,e[50]=Ce,e[51]=be,e[52]=I,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(vt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=ot&&Fe;let W;e[58]!==R||e[59]!==V||e[60]!==we?(W=t.jsxs($t,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=W):W=e[61];const Se=`Search ${l}...`;let q;e[62]!==b?(q=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=q):q=e[63];let G;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==q?(G=t.jsx(ut,{value:p,onChange:b,placeholder:Se,onKeyDown:q}),e[64]=p,e[65]=b,e[66]=Se,e[67]=q,e[68]=G):G=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=it?Fe:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(jt,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==P||e[78]!==M||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==I?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Ut,{hideToolbar:!0,data:H,schema:a,viewMode:I,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:P,actions:ge,onItemClick:J,readOnly:M,emptyState:Q})}),e[77]=P,e[78]=M,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=I,e[90]=Y):Y=e[90];let Z;e[91]!==G||e[92]!==Y?(Z=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,Y]}),e[91]=G,e[92]=Y,e[93]=Z):Z=e[93];const $e=!!F;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ie=F?.title;let X;e[96]!==Ie?(X=t.jsxs(wt,{children:[ue,t.jsxs(St,{children:['Are you sure you want to delete "',Ie,'"? This action cannot be undone.']})]}),e[96]=Ie,e[97]=X):X=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(bt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(te=t.jsx(yt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(_t,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==X||e[108]!==se?(oe=t.jsxs(Dt,{children:[X,se]}),e[107]=X,e[108]=se,e[109]=oe):oe=e[109];let ie;e[110]!==$e||e[111]!==oe?(ie=t.jsx(At,{open:$e,onOpenChange:fe,children:oe}),e[110]=$e,e[111]=oe,e[112]=ie):ie=e[112];let pe;return e[113]!==W||e[114]!==Z||e[115]!==ie?(pe=t.jsxs(t.Fragment,{children:[W,Z,ie]}),e[113]=W,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}export{Cs as C};
@@ -1 +0,0 @@
1
- import{c as q,j as o,f as W,g as J,r as z,d as ce,b as le,af as ae}from"./index-BLgTJ8o3.js";import{E as F}from"./SearchMd-D70t5LVP.js";import{E as Q}from"./error-boundary-CsEoagci.js";import{b as G,I as X,a as me}from"./use-connection-CsPrFY0x.js";import{b as de}from"./use-binding-C5e_Y70M.js";import{u as ue,S as pe}from"./index-CRGUNI2v.js";import{u as fe,a as he}from"./use-connection-resources-CjjFKWSM.js";import{B as xe}from"./button-IijH0wdI.js";import{i as Y}from"./Loading01-0wYmSKV6.js";import{R as ge}from"./resource-tabs-s0IiCCzU.js";import{V as Z,a as be,b as je}from"./layout-Dfp1nH3g.js";import{C as ye}from"./collection-tab-ClOnLgHC.js";import{C as ee}from"./collection-display-button-2ZQ5sQTW.js";import{C as te}from"./collection-search-CM9rltH6.js";import{C as oe}from"./collection-table-wrapper-BRI7T6RJ.js";import{P as se}from"./pin-to-sidebar-button-C8t5xznu.js";import{C as ne}from"./card-BnWpolEI.js";import{R as Se,T as Ce}from"./tools-list-CFmwpEf4.js";import"./tooltip-CSuczTFq.js";import"./auth-DpA5_jth.js";import"./mcp-oauth-Vd_yzV5S.js";import"./env-vars-editor-Z7SwcUr8.js";import"./input-BxywPo2X.js";import"./Plus-DofiSAMU.js";import"./Trash01-DnTS63e5.js";import"./use-tool-call-BdbJ3oy8.js";import"./useQuery-DXchCtgN.js";import"./File06-CpSSTggW.js";import"./Key01-ZVAVplBN.js";import"./form-BjarY-Jq.js";import"./select-C0rvNlZx.js";import"./ChevronDown-BuogCeI0.js";import"./Terminal-CStBCUAd.js";import"./use-gateway-Bz_y7oh7.js";import"./CpuChip02-BwTl0fBj.js";import"./formatDistanceToNow-fhdySMxO.js";import"./constants-TKUQnnwA.js";import"./registry-utils-ulDDT0d8.js";import"./extract-connection-data-BgA1QcA6.js";import"./generate-id-Dyweu44Y.js";import"./index-BGEzzv-W.js";import"./index-B_OB0BCO.js";import"./badge-CStgouQf.js";import"./ArrowLeft-B6h573ak.js";import"./dropdown-menu-BvLCKekW.js";import"./Copy01-_s71W2Ph.js";import"./DotsVertical-BQk5hPxb.js";import"./use-list-state-B13SO1z3.js";import"./use-mobile-VYFif8jU.js";import"./empty-state-Bg-FRZa4.js";import"./Inbox01-Ct-8Lwpv.js";import"./avatar-KDpJ2jsd.js";import"./alert-dialog-BU8uTWb8.js";import"./Grid01-CmB5R6oU.js";import"./view-mode-toggle-BXo-WMnB.js";import"./use-organization-settings-i4aS_Egu.js";function ve(t){const e=q.c(42),{prompts:r,connectionId:n,org:s,connectionTitle:l,connectionIcon:f,onPromptClick:j,showToolbar:g,emptyMessage:N}=t,V=g===void 0?!0:g,L=N===void 0?"This connection doesn't have any prompts yet.":N,u=W(),y=J().location.href,[p,i]=z.useState(""),[w,a]=z.useState("table"),[h,_]=z.useState("name"),[d,k]=z.useState("asc");let b;e[0]!==d||e[1]!==h?(b=x=>{h===x?(k(Ie),d==="desc"&&_(void 0)):(_(x),k("asc"))},e[0]=d,e[1]=h,e[2]=b):b=e[2];const T=b;let P;e[3]!==n||e[4]!==u||e[5]!==j||e[6]!==s?(P=x=>{j?j(x):n&&s&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:n,collectionName:"prompts",itemId:encodeURIComponent(x.name)}})},e[3]=n,e[4]=u,e[5]=j,e[6]=s,e[7]=P):P=e[7];const A=P;let B;if(e[8]!==r||e[9]!==p||e[10]!==d||e[11]!==h){const x=!r||r.length===0?[]:p.trim()?(()=>{const S=p.toLowerCase();return r.filter(U=>U.name.toLowerCase().includes(S)||U.description&&U.description.toLowerCase().includes(S))})():r;B=!h||!d?x:[...x].sort((S,U)=>{const re=S[h]||"",ie=U[h]||"",H=String(re).localeCompare(String(ie));return d==="asc"?H:-H}),e[8]=r,e[9]=p,e[10]=d,e[11]=h,e[12]=B}else B=e[12];const m=B;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:$e,sortable:!0},{id:"description",header:"Description",render:Te,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const E=O;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=E.filter(we).map(Ne),e[14]=M):M=e[14];const D=M;let $;e[15]!==f||e[16]!==l||e[17]!==T||e[18]!==V||e[19]!==d||e[20]!==h||e[21]!==y||e[22]!==w?($=V&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:w,onViewModeChange:a,sortKey:h,sortDirection:d,onSort:T,sortOptions:D}),o.jsx(se,{title:l?`${l}: Prompts`:"Prompts",url:y,icon:f??"description"})]}),e[15]=f,e[16]=l,e[17]=T,e[18]=V,e[19]=d,e[20]=h,e[21]=y,e[22]=w,e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=x=>{x.key==="Escape"&&(i(""),x.target.blur())},e[24]=I):I=e[24];let R;e[25]!==p?(R=o.jsx(te,{value:p,onChange:i,placeholder:"Search prompts...",onKeyDown:I}),e[25]=p,e[26]=R):R=e[26];let c;e[27]!==L||e[28]!==A||e[29]!==T||e[30]!==p||e[31]!==d||e[32]!==h||e[33]!==m||e[34]!==w?(c=w==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:m.length===0?o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":L}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:m.map(x=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>A(x),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(X,{icon:null,name:x.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x.description||"No description"})]})]})},x.name))})}):o.jsx(oe,{columns:E,data:m,isLoading:!1,sortKey:h,sortDirection:d,onSort:T,onRowClick:x=>A(x),emptyState:o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":L})}),e[27]=L,e[28]=A,e[29]=T,e[30]=p,e[31]=d,e[32]=h,e[33]=m,e[34]=w,e[35]=c):c=e[35];let C;e[36]!==R||e[37]!==c?(C=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[R,c]}),e[36]=R,e[37]=c,e[38]=C):C=e[38];let v;return e[39]!==C||e[40]!==$?(v=o.jsxs(o.Fragment,{children:[$,C]}),e[39]=C,e[40]=$,e[41]=v):v=e[41],v}function Ne(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function we(t){return t.sortable}function Te(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function $e(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Ie(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Re(t){const e=q.c(6),{prompts:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ve,{prompts:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function _e(t){const e=q.c(2),{repository:r}=t;let n;return e[0]!==r?(n=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Se,{repository:r})}),e[0]=r,e[1]=n):n=e[1],n}function ke(t){const e=q.c(39),{resources:r,connectionTitle:n,connectionIcon:s,onResourceClick:l,showToolbar:f,emptyMessage:j}=t,g=f===void 0?!0:f,N=j===void 0?"This connection doesn't have any resources yet.":j,L=J().location.href,[u,K]=z.useState(""),[y,p]=z.useState("table"),[i,w]=z.useState("name"),[a,h]=z.useState("asc");let _;e[0]!==a||e[1]!==i?(_=c=>{i===c?(h(De),a==="desc"&&w(void 0)):(w(c),h("asc"))},e[0]=a,e[1]=i,e[2]=_):_=e[2];const d=_;let k;e[3]!==l?(k=c=>{l&&l(c)},e[3]=l,e[4]=k):k=e[4];const b=k;let T;if(e[5]!==r||e[6]!==u||e[7]!==a||e[8]!==i){const c=!r||r.length===0?[]:u.trim()?(()=>{const C=u.toLowerCase();return r.filter(v=>v.uri.toLowerCase().includes(C)||v.name&&v.name.toLowerCase().includes(C)||v.description&&v.description.toLowerCase().includes(C))})():r;T=!i||!a?c:[...c].sort((C,v)=>{const x=C[i]||"",S=v[i]||"",U=String(x).localeCompare(String(S));return a==="asc"?U:-U}),e[5]=r,e[6]=u,e[7]=a,e[8]=i,e[9]=T}else T=e[9];const P=T;let A;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=[{id:"name",header:"Name",render:Ae,sortable:!0},{id:"uri",header:"URI",render:Me,sortable:!0},{id:"description",header:"Description",render:Ee,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Le,sortable:!0}],e[10]=A):A=e[10];const B=A;let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=B.filter(Ve).map(Pe),e[11]=m):m=e[11];const O=m;let E;e[12]!==s||e[13]!==n||e[14]!==d||e[15]!==g||e[16]!==a||e[17]!==i||e[18]!==L||e[19]!==y?(E=g&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:y,onViewModeChange:p,sortKey:i,sortDirection:a,onSort:d,sortOptions:O}),o.jsx(se,{title:n?`${n}: Resources`:"Resources",url:L,icon:s??"folder"})]}),e[12]=s,e[13]=n,e[14]=d,e[15]=g,e[16]=a,e[17]=i,e[18]=L,e[19]=y,e[20]=E):E=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=c=>{c.key==="Escape"&&(K(""),c.target.blur())},e[21]=M):M=e[21];let D;e[22]!==u?(D=o.jsx(te,{value:u,onChange:K,placeholder:"Search resources...",onKeyDown:M}),e[22]=u,e[23]=D):D=e[23];let $;e[24]!==N||e[25]!==b||e[26]!==d||e[27]!==u||e[28]!==a||e[29]!==i||e[30]!==P||e[31]!==y?($=y==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:P.length===0?o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:P.map(c=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>b(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(X,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(oe,{columns:B,data:P,isLoading:!1,sortKey:i,sortDirection:a,onSort:d,onRowClick:c=>b(c),emptyState:o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N})}),e[24]=N,e[25]=b,e[26]=d,e[27]=u,e[28]=a,e[29]=i,e[30]=P,e[31]=y,e[32]=$):$=e[32];let I;e[33]!==D||e[34]!==$?(I=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,$]}),e[33]=D,e[34]=$,e[35]=I):I=e[35];let R;return e[36]!==I||e[37]!==E?(R=o.jsxs(o.Fragment,{children:[E,I]}),e[36]=I,e[37]=E,e[38]=R):R=e[38],R}function Pe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ve(t){return t.sortable}function Le(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function Ee(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Me(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Ae(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function De(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Be(t){const e=q.c(6),{resources:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ke,{resources:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Ue(t){const e=q.c(4),{tools:r,connectionId:n,org:s}=t;let l;return e[0]!==n||e[1]!==s||e[2]!==r?(l=o.jsx(Ce,{tools:r,connectionId:n,org:s}),e[0]=n,e[1]=s,e[2]=r,e[3]=l):l=e[3],l}function Ke(t){const e=q.c(61),{connection:r,connectionId:n,org:s,requestedTabId:l,collections:f,onUpdate:j,isUpdating:g,prompts:N,resources:V}=t,L=ae();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/mcps/$connectionId"},e[0]=u):u=e[0];const K=W(u);let y;e[1]!==n?(y={connectionId:n},e[1]=n,e[2]=y):y=e[2];const p=ue(y),i=p.isAuthenticated,w=r?.metadata?.repository,a=!!w?.url,h=r?.tools?.length??0,_=N.length,d=V.length;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let b;e[4]!==i||e[5]!==h?(b=i&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=i,e[5]=h,e[6]=b):b=e[6];let T;e[7]!==i||e[8]!==_?(T=i&&_>0?[{id:"prompts",label:"Prompts",count:_}]:[],e[7]=i,e[8]=_,e[9]=T):T=e[9];let P;e[10]!==i||e[11]!==d?(P=i&&d>0?[{id:"resources",label:"Resources",count:d}]:[],e[10]=i,e[11]=d,e[12]=P):P=e[12];let A;if(e[13]!==f||e[14]!==a||e[15]!==i||e[16]!==b||e[17]!==T||e[18]!==P){let S;e[20]!==a?(S=a?[{id:"readme",label:"README"}]:[],e[20]=a,e[21]=S):S=e[21],A=[k,...b,...T,...P,...i?(f||[]).map(Oe):[],...S],e[13]=f,e[14]=a,e[15]=i,e[16]=b,e[17]=T,e[18]=P,e[19]=A}else A=e[19];const B=A,m=B.some(S=>S.id===l)?l:"settings";let O;e[22]!==K?(O=S=>{K({search:U=>({...U,tab:S}),replace:!0})},e[22]=K,e[23]=O):O=e[23];const E=O;let M;e[24]!==f?(M=f||[],e[24]=f,e[25]=M):M=e[25];let D;if(e[26]!==m||e[27]!==M){let S;e[29]!==m?(S=U=>U.name===m,e[29]=m,e[30]=S):S=e[30],D=M.find(S),e[26]=m,e[27]=M,e[28]=D}else D=e[28];const $=D;let I;e[31]!==L.history?(I=()=>L.history.back(),e[31]=L.history,e[32]=I):I=e[32];let R;e[33]!==m||e[34]!==E||e[35]!==B?(R=o.jsx(be,{children:o.jsx(ge,{tabs:B,activeTab:m,onTabChange:E})}),e[33]=m,e[34]=E,e[35]=B,e[36]=R):R=e[36];let c;e[37]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=c):c=e[37];let C;e[38]!==$||e[39]!==m||e[40]!==p.isServerError||e[41]!==p.supportsOAuth||e[42]!==r||e[43]!==n||e[44]!==E||e[45]!==a||e[46]!==i||e[47]!==g||e[48]!==j||e[49]!==s||e[50]!==N||e[51]!==w||e[52]!==V?(C=o.jsx(z.Suspense,{fallback:c,children:m==="tools"?o.jsx(Ue,{tools:r.tools??void 0,connectionId:n,org:s}):m==="prompts"?o.jsx(Re,{prompts:N,connectionId:n,org:s}):m==="resources"?o.jsx(Be,{resources:V,connectionId:n,org:s}):m==="settings"?o.jsx(pe,{connection:r,onUpdate:j,isUpdating:g,isMCPAuthenticated:i,supportsOAuth:p.supportsOAuth,isServerError:p.isServerError,onViewReadme:a?()=>E("readme"):void 0}):m==="readme"&&a?o.jsx(_e,{repository:w}):$&&i?o.jsx(ye,{connectionId:n,org:s,activeCollection:$},m):o.jsx(F,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=m,e[40]=p.isServerError,e[41]=p.supportsOAuth,e[42]=r,e[43]=n,e[44]=E,e[45]=a,e[46]=i,e[47]=g,e[48]=j,e[49]=s,e[50]=N,e[51]=w,e[52]=V,e[53]=C):C=e[53];let v;e[54]!==m||e[55]!==C?(v=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Q,{children:C},m)})}),e[54]=m,e[55]=C,e[56]=v):v=e[56];let x;return e[57]!==I||e[58]!==R||e[59]!==v?(x=o.jsxs(je,{onBack:I,children:[R,v]}),e[57]=I,e[58]=R,e[59]=v,e[60]=x):x=e[60],x}function Oe(t){return{id:t.name,label:t.displayName}}function ze(){const t=q.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const r=W(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId"},t[1]=n):n=t[1];const{connectionId:s,org:l}=ce(n);let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const g=le(f).tab||"settings",N=G(s),V=me(),L=de(N??void 0);let u;t[3]!==s?(u=[s],t[3]=s,t[4]=u):u=t[4];const{promptsMap:K}=fe(u);let y;t[5]!==s?(y=[s],t[5]=s,t[6]=y):y=t[6];const{resourcesMap:p}=he(y);let i;t[7]!==s||t[8]!==K?(i=K.get(s)??[],t[7]=s,t[8]=K,t[9]=i):i=t[9];const w=i;let a;t[10]!==s||t[11]!==p?(a=p.get(s)??[],t[10]=s,t[11]=p,t[12]=a):a=t[12];const h=a;let _;t[13]!==V.update||t[14]!==s?(_=async b=>{await V.update.mutateAsync({id:s,data:b})},t[13]=V.update,t[14]=s,t[15]=_):_=t[15];const d=_;if(!N){let b;return t[16]!==r||t[17]!==l?(b=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(F,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(xe,{variant:"outline",onClick:()=>r({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=r,t[17]=l,t[18]=b):b=t[18],b}let k;return t[19]!==V.update.isPending||t[20]!==L||t[21]!==N||t[22]!==s||t[23]!==d||t[24]!==l||t[25]!==w||t[26]!==g||t[27]!==h?(k=o.jsx(Ke,{org:l,connection:N,connectionId:s,requestedTabId:g,collections:L,onUpdate:d,isUpdating:V.update.isPending,prompts:w,resources:h}),t[19]=V.update.isPending,t[20]=L,t[21]=N,t[22]=s,t[23]=d,t[24]=l,t[25]=w,t[26]=g,t[27]=h,t[28]=k):k=t[28],k}function qe(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Q,{children:o.jsx(z.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(ze,{})})}),t[0]=e):e=t[0],e}function Gt(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(qe,{}),t[0]=e):e=t[0],e}export{Gt as default};
@@ -1 +0,0 @@
1
- import{c as J,j as e,r as $,f as Q,b as Y,a as Z,u as ee,y as ne,x as te,v as X,W as se,w as x,_ as oe}from"./index-BLgTJ8o3.js";import{C as ie}from"./collection-header-DBUE7n6H.js";import{C as re}from"./collection-page-BHk1uJKe.js";import{C as ae}from"./collection-search-CM9rltH6.js";import{C as ce}from"./collection-table-wrapper-BRI7T6RJ.js";import{C as le}from"./connection-card-DMv3uM_n.js";import{E as T}from"./SearchMd-D70t5LVP.js";import{E as de}from"./error-boundary-CsEoagci.js";import{a as me,u as pe,n as I,I as ue}from"./use-connection-CsPrFY0x.js";import{u as xe,s as M}from"./use-list-state-B13SO1z3.js";import{u as he}from"./tooltip-CSuczTFq.js";import{f as ge,a as je,b as fe,c as _e,d as Ce,e as ve,A as ye,g as we}from"./alert-dialog-BU8uTWb8.js";import{B as ke}from"./badge-CStgouQf.js";import{B as g}from"./button-IijH0wdI.js";import{d as Ne,c as Se,D as De,a as be,b as Te,f as Ie}from"./dialog-CJsBFVDy.js";import{b as z,D as V,a as R,c as S}from"./dropdown-menu-BvLCKekW.js";import{a as Pe,F as l,b as d,c as m,d as p,f as u}from"./form-BjarY-Jq.js";import{i as B}from"./DotsVertical-BQk5hPxb.js";import{i as $e,r as Ee,s as P,E as Oe,e as W}from"./env-vars-editor-Z7SwcUr8.js";import{i as Ae}from"./Loading01-0wYmSKV6.js";import{i as Fe}from"./Terminal-CStBCUAd.js";import{s as H}from"./Trash01-DnTS63e5.js";import{I as f}from"./input-BxywPo2X.js";import{S as Me,a as ze,b as Ve,c as Re,d as k}from"./select-C0rvNlZx.js";import{T as Be}from"./textarea-DNeEC-Sl.js";import{g as He}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-2ZQ5sQTW.js";import"./Grid01-CmB5R6oU.js";import"./view-mode-toggle-BXo-WMnB.js";import"./card-BnWpolEI.js";import"./use-mobile-VYFif8jU.js";import"./X-DeVUfdHG.js";import"./Plus-DofiSAMU.js";import"./ChevronDown-BuogCeI0.js";const Xe=X({key:x(),value:x()}),We=X({title:x().min(1,"Name is required"),description:x().nullable().optional(),ui_type:oe(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:x().optional(),connection_token:x().nullable().optional(),npx_package:x().optional(),stdio_command:x().optional(),stdio_args:x().optional(),stdio_cwd:x().optional(),env_vars:se(Xe).optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Le(t,o){const j={command:"npx",args:["-y",t]},_=W(o);return Object.keys(_).length>0&&(j.envVars=_),j}function Ue(t,o,j,_){const C={command:t};o.trim()&&(C.args=o.trim().split(/\s+/)),j?.trim()&&(C.cwd=j.trim());const r=W(_);return Object.keys(r).length>0&&(C.envVars=r),C}function Ke(t){return t.command==="npx"}function qe(t){return t.args?.find(o=>!o.startsWith("-"))??""}function Ge(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Je(t,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Qe(){const{org:t}=he(),o=Q(),j=Y({strict:!1}),{data:_}=Z.useSession(),{stdioEnabled:C}=ee(),r=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(r),[h,v]=$.useReducer(Je,{mode:"idle"}),E=j.action==="create",L=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},O=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{}})},i=ne({resolver:te(We),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),y=i.watch("ui_type"),a=h.mode==="editing"?h.connection:null;$.useEffect(()=>{if(a){const n=$e(a.connection_headers)?a.connection_headers:null;if(n&&a.connection_type==="STDIO"){const s=Ee(n.envVars);if(Ke(n)){const c=qe(n);i.reset({title:a.title,description:a.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Ge(n);i.reset({title:a.title,description:a.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else i.reset({title:a.title,description:a.description,ui_type:a.connection_type,connection_url:a.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else i.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[a,i]);const U=async()=>{if(h.mode!=="deleting")return;const n=h.connection.id;v({type:"close"});try{await D.delete.mutateAsync(n)}catch{}},K=async n=>{let s,c=null,N=null,w=null;if(n.ui_type==="NPX"?(s="STDIO",c="",w=Le(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(s="STDIO",c="",w=Ue(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(s=n.ui_type,c=n.connection_url||"",N=n.connection_token||null),a){await D.update.mutateAsync({id:a.id,data:{title:n.title,description:n.description||null,connection_type:s,connection_url:c,...N&&{connection_token:N},...w&&{connection_headers:w}}}),v({type:"close"}),i.reset();return}const F=He("conn");await D.create.mutateAsync({id:F,title:n.title,description:n.description||null,connection_type:s,connection_url:c,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:_?.user?.id||"system",organization_id:t.id,icon:null,app_name:null,app_id:null,connection_headers:w,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),O(),i.reset(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:F}})},A=n=>{n||(E?O():v({type:"close"}),i.reset())},q=[{id:"icon",header:"",render:n=>e.jsx(ue,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(I,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:n=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:n.title,children:n.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:n=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:n.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:n=>e.jsx("span",{className:"text-sm font-medium",children:n.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:n=>{const s=n.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:n=>e.jsx(ke,{variant:n.status==="active"?"success":"outline",children:n.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:n=>e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(S,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(M,{size:16}),"Inspect"]}),e.jsxs(S,{variant:"destructive",onClick:s=>{s.stopPropagation(),v({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(g,{onClick:L,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(re,{children:[e.jsx(Ne,{open:E||h.mode==="editing",onOpenChange:A,children:e.jsxs(Se,{className:"sm:max-w-[525px]",children:[e.jsxs(De,{children:[e.jsx(be,{children:a?"Edit Connection":"Create Connection"}),e.jsx(Te,{children:a?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Pe,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(K),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(l,{control:i.control,name:"title",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Name *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"My Connection",...n})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"description",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Description"}),e.jsx(p,{children:e.jsx(Be,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"ui_type",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Type *"}),e.jsxs(Me,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(ze,{children:e.jsx(Ve,{})})}),e.jsxs(Re,{children:[e.jsx(k,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(k,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(k,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4"}),"Websocket"]})}),C&&e.jsxs(e.Fragment,{children:[e.jsx(k,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(k,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(u,{})]})}),y==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(l,{control:i.control,name:"npx_package",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"NPM Package *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(u,{})]})})}),y==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(l,{control:i.control,name:"stdio_command",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Command *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"node, bun, python...",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"stdio_args",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Arguments"}),e.jsx(p,{children:e.jsx(f,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),e.jsx(u,{})]})})]}),e.jsx(l,{control:i.control,name:"stdio_cwd",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Working Directory"}),e.jsx(p,{children:e.jsx(f,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(u,{})]})})]}),(y==="NPX"||y==="STDIO")&&e.jsx(l,{control:i.control,name:"env_vars",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Environment Variables"}),e.jsx(p,{children:e.jsx(Oe,{value:n.value??[],onChange:n.onChange})}),e.jsx(u,{})]})}),y!=="NPX"&&y!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{control:i.control,name:"connection_url",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"URL *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"https://example.com/mcp",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"connection_token",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Token (optional)"}),e.jsx(p,{children:e.jsx(f,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Ie,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>A(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:i.formState.isSubmitting?"Saving...":a?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ge,{open:h.mode==="deleting",onOpenChange:n=>!n&&v({type:"close"}),children:e.jsxs(je,{children:[e.jsxs(fe,{children:[e.jsx(_e,{children:"Delete Connection?"}),e.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:h.mode==="deleting"&&h.connection.title}),"."]})]}),e.jsxs(ve,{children:[e.jsx(ye,{children:"Cancel"}),e.jsx(we,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{title:"Connections",viewMode:r.viewMode,onViewModeChange:r.setViewMode,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:G}),e.jsx(ae,{value:r.search,onChange:r.setSearch,placeholder:"Search for a Connection...",onKeyDown:n=>{n.key==="Escape"&&(r.setSearch(""),n.target.blur())}}),r.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:b.length===0?e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(r.search,"No Connections found"),description:r.search?`No Connections match "${r.search}"`:"Create a connection to get started.",actions:!r.search&&e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:b.map(n=>e.jsx(le,{connection:n,fallbackIcon:e.jsx(I,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),headerActions:e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(S,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(M,{size:16}),"Inspect"]}),e.jsxs(S,{variant:"destructive",onClick:s=>{s.stopPropagation(),v({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]})},n.id))})}):e.jsx(ce,{columns:q,data:b,isLoading:!1,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,onRowClick:n=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),emptyState:r.search?e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${r.search}"`}):e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})})})]})}function En(){const t=J.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(de,{children:e.jsx($.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Qe,{})})}),t[0]=o):o=t[0],o}export{En as default};
@@ -1 +0,0 @@
1
- import{B as o}from"./use-binding-C5e_Y70M.js";import{aM as a}from"./index-BLgTJ8o3.js";const e="mcp.mesh",m="mcp.mesh/publisher-provided",c=a(o,{target:"draft-07"});export{c as B,m as M,e as a};
@@ -1 +0,0 @@
1
- import{c,j as i,aN as p,aO as f,aP as m,aQ as g,aR as x,aS as v,aT as b,aU as w,aV as h}from"./index-BLgTJ8o3.js";import{d as j}from"./tooltip-CSuczTFq.js";import{c as u}from"./button-IijH0wdI.js";function D(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=a):a=e[3],a}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function $(s){const e=c.c(10);let t,a,o;e[0]!==s?({className:t,sideOffset:o,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o):(t=e[1],a=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...a})}),e[6]=a,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,a,o,n;e[0]!==s?({className:t,inset:a,variant:n,...o}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o,e[4]=n):(t=e[1],a=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==a||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:d,...o}),e[7]=a,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==a||e[6]!==o?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=n):n=e[7],n}function T(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=a):a=e[3],a}function C(s){const e=c.c(13);let t,a,o,n;e[0]!==s?({className:a,inset:o,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o,e[4]=n):(t=e[1],a=e[2],o=e[3],n=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",a),e[5]=a,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==a||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=n):n=e[7],n}export{M as D,$ as a,D as b,y as c,_ as d,T as e,C as f,R as g};
@@ -1 +0,0 @@
1
- import{r as N,v as y,_ as D,W as k,w as t,X as m,aI as T,aJ as O,c as R,j as c}from"./index-BLgTJ8o3.js";import{B as z}from"./button-IijH0wdI.js";import{I as W}from"./input-BxywPo2X.js";import{s as H}from"./Plus-DofiSAMU.js";import{s as L}from"./Trash01-DnTS63e5.js";const U=({size:o=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},N.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));U.displayName="Globe02";const B=y({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:k(t()),grantType:D(["authorization_code","client_credentials"])}),M=y({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),K=y({headers:m(t(),t()).optional()}),$=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),V=y({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:O([$,K]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:k(M).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});V.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});V.partial();function Y(o){return o!=null&&"command"in o}function q(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function Z(o){const e=R.c(34),{value:n,onChange:r,keyPlaceholder:j,valuePlaceholder:l,className:I}=o,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let w;e[0]!==r||e[1]!==n?(w=()=>{r([...n,{key:"",value:""}])},e[0]=r,e[1]=n,e[2]=w):w=e[2];const A=w;let x;e[3]!==r||e[4]!==n?(x=s=>{r(n.filter((d,i)=>i!==s))},e[3]=r,e[4]=n,e[5]=x):x=e[5];const b=x;let S;e[6]!==r||e[7]!==n?(S=(s,d)=>{const i=[...n],a=i[s];a&&(i[s]={key:d,value:a.value},r(i))},e[6]=r,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==r||e[10]!==n?(C=(s,d)=>{const i=[...n],a=i[s];a&&(i[s]={key:a.key,value:d},r(i))},e[9]=r,e[10]=n,e[11]=C):C=e[11];const v=C;let u;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==f||e[16]!==n||e[17]!==_){let s;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==f||e[23]!==_?(s=(d,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(W,{placeholder:f,value:d.key,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(W,{type:q(d.key)?"password":"text",placeholder:_,value:d.value,onChange:a=>v(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(i),children:c.jsx(L,{size:16})})]},i),e[19]=g,e[20]=b,e[21]=v,e[22]=f,e[23]=_,e[24]=s):s=e[24],u=n.map(s),e[12]=g,e[13]=b,e[14]=v,e[15]=f,e[16]=n,e[17]=_,e[18]=u}else u=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(H,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(z,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==u||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[u,p]}),e[28]=u,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function ee(o){const e={};for(const{key:n,value:r}of o)n.trim()&&(e[n.trim()]=r);return e}function te(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{Z as E,ee as e,Y as i,te as r,U as s};
@@ -1 +0,0 @@
1
- import{a as p,M as u}from"./constants-TKUQnnwA.js";import{b,g as C}from"./registry-utils-ulDDT0d8.js";import{g as E}from"./generate-id-Dyweu44Y.js";function M(e,s,i){const t=e.server,n=e._meta?.[p]??t?._meta?.[p],r=e._meta?.[u]??t?._meta?.[u],a=r?.metadata,c=t?.remotes?.[0],d=b(c?.type)||"HTTP",l=new Date().toISOString(),f=r?.friendlyName||e.title||t?.title||t?.name||"Unnamed App",_=t?.description||null,m=t?.icons?.[0]?.src||C(t?.repository)||null,o=a?.oauth_config,g=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,y=a?.configuration_state,h=a?.configuration_scopes,v=t?.repository?{url:t.repository.url,source:t.repository.source,subfolder:t.repository.subfolder}:null;return{id:E("conn"),title:f,description:_,icon:m,app_name:n?.appName||t?.name||null,app_id:n?.id||e.id||null,connection_type:d,connection_url:c?.url||"",connection_token:null,connection_headers:null,oauth_config:g,configuration_state:y??null,configuration_scopes:h??null,metadata:{...a,source:"store",registry_item_id:e.id,verified:n?.verified??!1,scopeName:n?.scopeName??null,toolsCount:r?.tools?.length??0,publishedAt:n?.publishedAt??null,repository:v},created_at:l,updated_at:l,created_by:i,organization_id:s,tools:null,bindings:null,status:"inactive"}}function T(e,s){if(!s?.startsWith("@"))return;const[i,t]=s.replace("@","").split("/");if(!(!i||!t))return e.find(n=>{const r=n._meta?.["mcp.mesh"],a=n.server.name;return r?.scopeName===i&&r?.appName===t||a===`${i}/${t}`})}export{M as e,T as f};
@@ -1 +0,0 @@
1
- import{r as $,c as Z,j as t,f as Ye,d as pt,b as gt,v as jt,_ as qe,w as et,g as bt,af as vt,x as yt,y as St,a as Ct,t as Je}from"./index-BLgTJ8o3.js";import{E as wt}from"./SearchMd-D70t5LVP.js";import{E as Ke}from"./error-boundary-CsEoagci.js";import{I as Fe,u as Qe}from"./use-connection-CsPrFY0x.js";import{T as Nt,S as _t}from"./switch-D37mVt_9.js";import{C as st}from"./checkbox-BYeNlYdH.js";import{c as xe,B as te}from"./button-IijH0wdI.js";import{i as It}from"./ArrowLeft-B6h573ak.js";import{C as Tt}from"./collection-search-CM9rltH6.js";import{I as Ze}from"./input-BxywPo2X.js";import{s as nt}from"./Plus-DofiSAMU.js";import{i as kt}from"./X-DeVUfdHG.js";import{b as $t,a as Pt}from"./use-gateway-Bz_y7oh7.js";import{u as zt,a as Mt}from"./use-connection-resources-CjjFKWSM.js";import{u as Et}from"./use-binding-C5e_Y70M.js";import{a as Rt,e as ot,T as At,C as Y,b as Ft,c as Dt,d as Vt,u as Bt,N as Ot,G as Gt,U as Lt,M as Ut}from"./thread-history-popover-CykPOF9f.js";import{u as lt,a as pe,c as ge,b as je,T as be,i as tt}from"./tooltip-CSuczTFq.js";import{a as Ht}from"./Copy01-_s71W2Ph.js";import{i as Xe}from"./CpuChip02-BwTl0fBj.js";import{i as Wt}from"./FlipBackward-C0O2fx27.js";import{i as it}from"./InfoCircle-D6JXYJn_.js";import{i as Le}from"./Loading01-0wYmSKV6.js";import{F as Re,a as qt,b as De,d as Ve,f as Be,c as rt}from"./form-BjarY-Jq.js";import{S as at,a as ct,b as dt,c as mt,d as Ae}from"./select-C0rvNlZx.js";import{R as Jt}from"./resource-tabs-s0IiCCzU.js";import{s as Yt}from"./slugify-CEUa2lfQ.js";import{P as Kt}from"./pin-to-sidebar-button-C8t5xznu.js";import{a as Qt,V as Zt,b as Xt}from"./layout-Dfp1nH3g.js";import{u as es,L as ut}from"./localstorage-keys-Bj9V9Nbd.js";import{f as ts}from"./formatDistanceToNow-fhdySMxO.js";import"./auth-DpA5_jth.js";import"./AlertCircle-BrGqb-qb.js";import"./Grid01-CmB5R6oU.js";import"./responsive-select-INSf3elv.js";import"./use-mobile-VYFif8jU.js";import"./textarea-DNeEC-Sl.js";import"./Terminal-CStBCUAd.js";import"./monaco-editor-mQfzbJMr.js";import"./spinner-D7ZAVJCR.js";import"./alert-dialog-BU8uTWb8.js";import"./File06-CpSSTggW.js";import"./well-known-mcp-VNRT0JrW.js";import"./generate-id-Dyweu44Y.js";import"./popover-CwHNob2q.js";import"./Clock-LzAlJ-1R.js";import"./Trash01-DnTS63e5.js";import"./ChevronDown-BuogCeI0.js";import"./badge-CStgouQf.js";import"./use-organization-settings-i4aS_Egu.js";import"./useQuery-DXchCtgN.js";const ft=({size:n=24,color:e="currentColor",...s})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},$.createElement("path",{d:"M12 20h9M3 20h1.675c.489 0 .733 0 .964-.055.204-.05.399-.13.578-.24.201-.123.374-.296.72-.642L19.5 6.5a2.121 2.121 0 0 0-3-3L3.937 16.063c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.578c-.055.23-.055.475-.055.965V20Z"}));ft.displayName="Edit03";const ht=({size:n=24,color:e="currentColor",...s})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},$.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));ht.displayName="Save01";const ss=$.memo(function(e){const s=Z.c(20),{connection:o,isSelected:f,hasItemsEnabled:r,activeItemsCount:m,totalItemsCount:g,onSelect:c,onToggle:l}=e,d=f?"bg-accent/50":"hover:bg-muted/50";let h;s[0]!==d?(h=xe("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=h):h=s[1];let p;s[2]!==o.icon||s[3]!==o.title?(p=t.jsx(Fe,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=p):p=s[4];let b;s[5]!==o.title?(b=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=b):b=s[6];let u;s[7]!==c||s[8]!==p||s[9]!==b?(u=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[p,b]}),s[7]=c,s[8]=p,s[9]=b,s[10]=u):u=s[10];let x;s[11]!==m||s[12]!==r||s[13]!==l||s[14]!==g?(x=g>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[m,"/",g]}),t.jsx(st,{checked:r,onCheckedChange:l,onClick:os})]}),s[11]=m,s[12]=r,s[13]=l,s[14]=g,s[15]=x):x=s[15];let v;return s[16]!==h||s[17]!==u||s[18]!==x?(v=t.jsxs("div",{className:h,children:[u,x]}),s[16]=h,s[17]=u,s[18]=x,s[19]=v):v=s[19],v}),ns=$.memo(function(e){const s=Z.c(18),{connectionId:o,item:f,isSelected:r,onToggle:m}=e,g=`item-${o}-${f.id}`,c=r?"text-foreground":"text-muted-foreground";let l;s[0]!==c?(l=xe("text-sm font-medium",c),s[0]=c,s[1]=l):l=s[1];let d;s[2]!==f.name||s[3]!==l?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:l,children:f.name})}),s[2]=f.name,s[3]=l,s[4]=d):d=s[4];let h;s[5]!==f.description?(h=f.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:f.description}),s[5]=f.description,s[6]=h):h=s[6];let p;s[7]!==d||s[8]!==h?(p=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,h]}),s[7]=d,s[8]=h,s[9]=p):p=s[9];const b=`item-${o}-${f.id}`;let u;s[10]!==r||s[11]!==m||s[12]!==b?(u=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(st,{id:b,checked:r,onCheckedChange:m,onClick:ls})}),s[10]=r,s[11]=m,s[12]=b,s[13]=u):u=s[13];let x;return s[14]!==g||s[15]!==p||s[16]!==u?(x=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:g,children:[p,u]}),s[14]=g,s[15]=p,s[16]=u,s[17]=x):x=s[17],x});function xt({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:f,extraContent:r}){const[m,g]=$.useState(""),c=$.useDeferredValue(m),[l,d]=$.useState("all"),[h,p]=$.useState(!1),b=$.useRef(new Set(Object.keys(n))),u=Qe({searchTerm:c.trim()||void 0}),x=b.current,v=[...x.values()].map(i=>u.find(w=>w.id===i)).filter(i=>i!==void 0),N=u.filter(i=>!x.has(i.id)),I=[...v,...N],j=i=>{const w=n[i];return w!==void 0&&w.length>0},y=I.filter(i=>{if(l==="all")return!0;const w=j(i.id);return l==="selected"?w:l==="unselected"?!w:!0}),[S,a]=$.useState(I[0]?.id??null),C=S?I.find(i=>i.id===S)??null:null,_=C?s(C):[],E=(i,w)=>n[i]?.includes(w)??!1,R=(i,w)=>{const A=n[i]??[],F=A.includes(w),P={...n};if(F){const B=A.filter(M=>M!==w);B.length===0?delete P[i]:P[i]=B}else P[i]=[...A,w];e(P)},q=i=>{const w=I.find(k=>k.id===i);if(!w)return;const A=s(w);if(A.length===0)return;const F=n[i]??[],P=A.map(k=>k.id),B=F.length>0&&P.every(k=>F.includes(k)),M={...n};B?delete M[i]:(M[i]=P,a(i)),e(M)},U=i=>{a(i),p(!0)},T=()=>{p(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:xe("w-full md:w-80 border-r border-border flex flex-col",h&&"hidden md:flex"),children:[t.jsx(Tt,{value:m,onChange:g,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:xe("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",l==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:y.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:m?"No connections found":l==="selected"?"No servers selected":l==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:y.map(i=>{const A=s(i).length,F=n[i.id]?.length??0;return t.jsx(ss,{connection:i,isSelected:S===i.id,hasItemsEnabled:j(i.id),activeItemsCount:F,totalItemsCount:A,onSelect:()=>U(i.id),onToggle:()=>q(i.id)},i.id)})})})]}),t.jsx("div",{className:xe("flex-1 flex-col",h?"flex":"hidden md:flex"),children:C?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(te,{variant:"ghost",size:"sm",onClick:T,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(It,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Fe,{icon:C.icon,name:C.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),r,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:_.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:f||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:_.map(i=>t.jsx(ns,{connectionId:C.id,item:i,isSelected:E(C.id,i.id),onToggle:()=>R(C.id,i.id)},i.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function os(n){return n.stopPropagation()}function ls(n){return n.stopPropagation()}function is(n){const e=Z.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:f}=n;let r;e[0]!==f?(r=c=>(f.get(c.id)??[]).map(rs),e[0]=f,e[1]=r):r=e[1];const m=r;let g;return e[2]!==m||e[3]!==o||e[4]!==s?(g=t.jsx(xt,{itemSet:s,onItemSetChange:o,getItems:m,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=m,e[3]=o,e[4]=s,e[5]=g):g=e[5],g}function rs(n){return{id:n.name,name:n.name,description:n.description}}function as(n){return n.includes("*")}function cs(n){const e=Z.c(27),{patterns:s,onAddPattern:o,onRemovePattern:f}=n,[r,m]=$.useState("");let g;e[0]!==r||e[1]!==o||e[2]!==s?(g=()=>{const p=r.trim();p&&!s.includes(p)&&(o(p),m(""))},e[0]=r,e[1]=o,e[2]=s,e[3]=g):g=e[3];const c=g;let l;e[4]!==c?(l=p=>{p.key==="Enter"&&(p.preventDefault(),c())},e[4]=c,e[5]=l):l=e[5];const d=l;let h;if(e[6]!==c||e[7]!==d||e[8]!==r||e[9]!==f||e[10]!==s){const p=s.filter(as);let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("code",{children:"*"}),e[12]=b):b=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",b," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=u):u=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=a=>m(a.target.value),e[14]=x):x=e[14];let v;e[15]!==d||e[16]!==r?(v=t.jsx(Ze,{value:r,onChange:x,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=r,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.trim(),e[18]=r,e[19]=N):N=e[19];const I=!N;let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(nt,{size:16}),e[20]=j):j=e[20];let y;e[21]!==c||e[22]!==I?(y=t.jsx(te,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:I,children:j}),e[21]=c,e[22]=I,e[23]=y):y=e[23];let S;e[24]!==y||e[25]!==v?(S=t.jsxs("div",{className:"flex gap-2",children:[v,y]}),e[24]=y,e[25]=v,e[26]=S):S=e[26],h=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[u,S,p.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(a=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:a}),t.jsx("button",{type:"button",onClick:()=>f(a),className:"text-muted-foreground hover:text-foreground",children:t.jsx(kt,{size:12})})]},a))})]}),e[6]=c,e[7]=d,e[8]=r,e[9]=f,e[10]=s,e[11]=h}else h=e[11];return h}function ds(n){const e=Z.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:f}=n,[r]=$.useState(null);let m;e[0]!==f?(m=j=>(f.get(j.id)??[]).map(ms),e[0]=f,e[1]=m):m=e[1];const g=m;let c;e[2]!==o||e[3]!==s?(c=(j,y)=>{const S=s[j]??[];S.includes(y)||o({...s,[j]:[...S,y]})},e[2]=o,e[3]=s,e[4]=c):c=e[4];const l=c;let d;e[5]!==o||e[6]!==s?(d=(j,y)=>{const a=(s[j]??[]).filter(C=>C!==y);if(a.length===0){const C={...s};delete C[j],o(C)}else o({...s,[j]:a})},e[5]=o,e[6]=s,e[7]=d):d=e[7];const h=d;let p;e[8]!==o?(p=j=>{o(j)},e[8]=o,e[9]=p):p=e[9];const b=p;let u;e[10]!==s||e[11]!==r?(u=r?s[r]??[]:[],e[10]=s,e[11]=r,e[12]=u):u=e[12];const x=u;let v;e[13]!==l||e[14]!==h||e[15]!==r||e[16]!==x?(v=r?t.jsx(cs,{patterns:x,onAddPattern:j=>l(r,j),onRemovePattern:j=>h(r,j)}):null,e[13]=l,e[14]=h,e[15]=r,e[16]=x,e[17]=v):v=e[17];const N=v;let I;return e[18]!==N||e[19]!==g||e[20]!==b||e[21]!==s?(I=t.jsx("div",{className:"h-full",children:t.jsx(xt,{itemSet:s,onItemSetChange:b,getItems:g,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:N})}),e[18]=N,e[19]=g,e[20]=b,e[21]=s,e[22]=I):I=e[22],I}function ms(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}const us="You are a helpful assistant. Please try answering the user's questions using your available tools.";function fs(n){const s=new TextEncoder().encode(n),o=Array.from(s,f=>String.fromCharCode(f)).join("");return btoa(o)}function hs(n){const e=Z.c(52),{serverName:s,gatewayUrl:o}=n,[f,r]=$.useState(!1),[m,g]=$.useState(null),c=Yt(s);let l,d,h,p;if(e[0]!==o||e[1]!==c){const L={type:"http",url:o},se={[c]:L};l=JSON.stringify(se,null,2);const J=K=>JSON.stringify({...L,headers:{"x-mesh-client":K}},null,2),ae=fs(J("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(ae)}`;const ne=J("Claude Code");h=c;let ce;e[6]===Symbol.for("react.memo_cache_sentinel")?(ce=/'/g,e[6]=ce):ce=e[6],p=ne.replace(ce,"'\\''"),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=h,e[5]=p}else l=e[2],d=e[3],h=e[4],p=e[5];const b=`claude mcp add "${h}" --config '${p}'`;let u;e[7]!==l?(u=async()=>{await navigator.clipboard.writeText(l),r(!0),Je.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[7]=l,e[8]=u):u=e[8];const x=u;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=async(L,se)=>{await navigator.clipboard.writeText(L),g(se),Je.success(`${se} command copied`),setTimeout(()=>g(null),2e3)},e[9]=v):v=e[9];const N=v,I=xs;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=j):j=e[10];let y;e[11]!==f?(y=f?t.jsx(tt,{size:14}):t.jsx(Ht,{size:14}),e[11]=f,e[12]=y):y=e[12];let S;e[13]!==x||e[14]!==y?(S=t.jsx(je,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:x,children:y})}),e[13]=x,e[14]=y,e[15]=S):S=e[15];let a;e[16]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(be,{children:"Copy configuration"}),e[16]=a):a=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(pe,{children:t.jsxs(ge,{children:[S,a]})})}),e[17]=S,e[18]=C):C=e[18];let _;e[19]!==l||e[20]!==x?(_=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:x,children:l}),e[19]=l,e[20]=x,e[21]=_):_=e[21];let E;e[22]!==_||e[23]!==C?(E=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[C,_]}),e[22]=_,e[23]=C,e[24]=E):E=e[24];let R;e[25]!==d?(R=()=>I(d),e[25]=d,e[26]=R):R=e[26];let q,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),U=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=U):(q=e[27],U=e[28]);let T;e[29]!==R?(T=t.jsx(je,{asChild:!0,children:t.jsxs(te,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:R,children:[q,U]})}),e[29]=R,e[30]=T):T=e[30];let i;e[31]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(be,{children:"Add to Cursor"}),e[31]=i):i=e[31];let w;e[32]!==T?(w=t.jsx(pe,{children:t.jsxs(ge,{children:[T,i]})}),e[32]=T,e[33]=w):w=e[33];let A;e[34]!==b?(A=()=>N(b,"Claude"),e[34]=b,e[35]=A):A=e[35];let F,P;e[36]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),P=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=F,e[37]=P):(F=e[36],P=e[37]);let B;e[38]!==m?(B=m==="Claude"&&t.jsx(tt,{size:14,className:"ml-2 text-green-500"}),e[38]=m,e[39]=B):B=e[39];let M;e[40]!==A||e[41]!==B?(M=t.jsx(je,{asChild:!0,children:t.jsxs(te,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:A,children:[F,P,B]})}),e[40]=A,e[41]=B,e[42]=M):M=e[42];let k;e[43]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(be,{children:"Add to Claude Code"}),e[43]=k):k=e[43];let X;e[44]!==M?(X=t.jsx(pe,{children:t.jsxs(ge,{children:[M,k]})}),e[44]=M,e[45]=X):X=e[45];let H;e[46]!==w||e[47]!==X?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[w,X]}),e[46]=w,e[47]=X,e[48]=H):H=e[48];let G;return e[49]!==E||e[50]!==H?(G=t.jsxs("div",{className:"flex flex-col gap-4",children:[j,E,H]}),e[49]=E,e[50]=H,e[51]=G):G=e[51],G}function xs(n){window.open(n,"_blank")}const ps=jt({title:et().min(1,"Name is required").max(255),description:et().nullable(),status:qe(["active","inactive"]),tool_selection_mode:qe(["inclusion","exclusion"]),tool_selection_strategy:qe(["passthrough","smart_tool_selection","code_execution"])});function gs(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const f=e.get(o.connection_id)??[];f.length>0&&(s[o.connection_id]=f)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function js(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function bs(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function vs(n,e,s,o){const f=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(f).map(r=>{const m=n[r]??[],g=o.get(r)??[],c=g.length>0&&g.every(l=>m.includes(l));return{connection_id:r,selected_tools:m.length===0||c?null:m,selected_resources:e[r]??null,selected_prompts:s[r]??null}})}function ys(n){const e=Z.c(110),{gateway:s,activeThreadId:o,setActiveThreadId:f}=n,{data:r}=Ct.useSession(),m=r?.user,g=Ft();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const l=Qe(c);let d;e[1]!==l?(d={connections:l,binding:"LLMS"},e[1]=l,e[2]=d):d=e[2];const[h]=Et(d),p=!!h,{locator:b,org:u}=lt(),x=Ye();let v;e[3]!==b?(v=ut.chatSelectedModel(b),e[3]=b,e[4]=v):v=e[4];const[N,I]=Dt(v,g,Ss),j=ot();let y;e[5]!==s||e[6]!==j?(y=D=>{const O={id:D.id,title:D.title,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),hidden:!1,gatewayId:s.id};j.insert.mutate(O)},e[5]=s,e[6]=j,e[7]=y):y=e[7];let S;e[8]!==o||e[9]!==y?(S={threadId:o,systemPrompt:us,onCreateThread:y},e[8]=o,e[9]=y,e[10]=S):S=e[10];const a=Vt(S),{inputValue:C,setInputValue:_,branchContext:E,clearBranch:R}=Bt(),{isEmpty:q}=a,U=!!N;let T;e[11]!==o||e[12]!==a||e[13]!==R||e[14]!==s||e[15]!==U||e[16]!==N||e[17]!==_||e[18]!==m?.image||e[19]!==m?.name?(T=async D=>{if(!U||!N){Je.error("No model configured");return}_(""),R();const O={created_at:new Date().toISOString(),thread_id:o,model:{id:N.id,connectionId:N.connectionId,provider:N.provider??void 0,limits:N.limits??void 0},gateway:{id:s.id},user:{avatar:m?.image??void 0,name:m?.name??"you"}};await a.sendMessage(D,O)},e[11]=o,e[12]=a,e[13]=R,e[14]=s,e[15]=U,e[16]=N,e[17]=_,e[18]=m?.image,e[19]=m?.name,e[20]=T):T=e[20];const i=T;let w;e[21]!==I?(w=D=>{I(D)},e[21]=I,e[22]=w):w=e[22];const A=w;let F;e[23]!==E||e[24]!==R||e[25]!==f||e[26]!==_?(F=()=>{E&&(f(E.originalThreadId),R(),_(""))},e[23]=E,e[24]=R,e[25]=f,e[26]=_,e[27]=F):F=e[27];const P=F;if(!p){const D=m?.id??"";let O;e[28]!==x||e[29]!==u.slug?(O=()=>x({to:"/$org/mcps",params:{org:u.slug},search:{action:"create"}}),e[28]=x,e[29]=u.slug,e[30]=O):O=e[30];let he;e[31]!==l||e[32]!==u.id||e[33]!==u.slug||e[34]!==O||e[35]!==D?(he=t.jsx(Y.Main,{className:"h-full relative overflow-hidden",children:t.jsx(Y.EmptyState,{children:t.jsx(Ot,{description:"Connect to a model provider to unlock AI-powered features in this Hub.",orgSlug:u.slug,orgId:u.id,userId:D,allConnections:l,onInstallMcpServer:O})})}),e[31]=l,e[32]=u.id,e[33]=u.slug,e[34]=O,e[35]=D,e[36]=he):he=e[36];let ie;e[37]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Y.Footer,{}),e[37]=ie):ie=e[37];let re;return e[38]!==he?(re=t.jsxs(Y,{children:[he,ie]}),e[38]=he,e[39]=re):re=e[39],re}const B=s.title||"Gateway";let M;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Xe,{size:32}),e[40]=M):M=e[40];let k;e[41]!==s.icon||e[42]!==B?(k=t.jsx(Fe,{icon:s.icon,name:B,size:"lg",fallbackIcon:M,className:"size-[60px]! rounded-[18px]!"}),e[41]=s.icon,e[42]=B,e[43]=k):k=e[43];const X=s.title||"Hub Chat";let H;e[44]!==X?(H=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:X}),e[44]=X,e[45]=H):H=e[45];let G;e[46]!==s.description?(G=s.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[46]=s.description,e[47]=G):G=e[47];let L;e[48]!==k||e[49]!==H||e[50]!==G?(L=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[k,H,G]}),e[48]=k,e[49]=H,e[50]=G,e[51]=L):L=e[51];let se;e[52]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(Le,{size:20,className:"animate-spin text-muted-foreground"})}),e[52]=se):se=e[52];let J;e[53]!==i?(J=D=>{i(D.description??D.name)},e[53]=i,e[54]=J):J=e[54];let ae;e[55]!==s.id||e[56]!==J?(ae=t.jsx(Ke,{fallback:null,children:t.jsx($.Suspense,{fallback:se,children:t.jsx(Gt,{gatewayId:s.id,onSelect:J})})}),e[55]=s.id,e[56]=J,e[57]=ae):ae=e[57];let ne;e[58]!==L||e[59]!==ae?(ne=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[L,ae]}),e[58]=L,e[59]=ae,e[60]=ne):ne=e[60];const ce=ne;let K;e[61]!==a.messages||e[62]!==a.status||e[63]!==ce||e[64]!==q?(K=t.jsx(Y.Main,{className:"h-full relative overflow-hidden",children:q?t.jsx(Y.EmptyState,{children:ce}):t.jsx(Y.Messages,{messages:a.messages,status:a.status,minHeightOffset:240})}),e[61]=a.messages,e[62]=a.status,e[63]=ce,e[64]=q,e[65]=K):K=e[65];let de;e[66]!==a.error||e[67]!==i?(de=()=>{a.error&&i(`I encountered this error: ${a.error.message}. Can you help me fix it?`)},e[66]=a.error,e[67]=i,e[68]=de):de=e[68];let me;e[69]!==a.clearError||e[70]!==a.error||e[71]!==de?(me=t.jsx(Y.ErrorBanner,{error:a.error,onFixInChat:de,onDismiss:a.clearError}),e[69]=a.clearError,e[70]=a.error,e[71]=de,e[72]=me):me=e[72];let oe;e[73]!==i?(oe=()=>{i("Please continue.")},e[73]=i,e[74]=oe):oe=e[74];let W;e[75]!==a.clearFinishReason||e[76]!==a.finishReason||e[77]!==oe?(W=t.jsx(Y.FinishReasonWarning,{finishReason:a.finishReason,onContinue:oe,onDismiss:a.clearFinishReason}),e[75]=a.clearFinishReason,e[76]=a.finishReason,e[77]=oe,e[78]=W):W=e[78];let Se;e[79]!==E||e[80]!==R||e[81]!==P||e[82]!==_?(Se=t.jsx(Y.BranchPreview,{branchContext:E,clearBranchContext:R,onGoToOriginalMessage:P,setInputValue:_}),e[79]=E,e[80]=R,e[81]=P,e[82]=_,e[83]=Se):Se=e[83];let ue;e[84]!==i||e[85]!==C?(ue=async()=>{C.trim()&&await i(C.trim())},e[84]=i,e[85]=C,e[86]=ue):ue=e[86];const ve=!U,Ce=a.status==="submitted"||a.status==="streaming",ye=N?"Ask anything or @ for context":"Select a model to start chatting",we=N??void 0;let V;e[87]!==A||e[88]!==we?(V=t.jsx(Ut,{selectedModel:we,onModelChange:A,placeholder:"Model",variant:"borderless"}),e[87]=A,e[88]=we,e[89]=V):V=e[89];let le;e[90]!==a.messages?(le=t.jsx(Lt,{messages:a.messages}),e[90]=a.messages,e[91]=le):le=e[91];let fe;e[92]!==a.stop||e[93]!==C||e[94]!==_||e[95]!==ue||e[96]!==ve||e[97]!==Ce||e[98]!==ye||e[99]!==V||e[100]!==le?(fe=t.jsxs(Y.Input,{value:C,onChange:_,onSubmit:ue,onStop:a.stop,disabled:ve,isStreaming:Ce,placeholder:ye,children:[V,le]}),e[92]=a.stop,e[93]=C,e[94]=_,e[95]=ue,e[96]=ve,e[97]=Ce,e[98]=ye,e[99]=V,e[100]=le,e[101]=fe):fe=e[101];let ee;e[102]!==me||e[103]!==W||e[104]!==Se||e[105]!==fe?(ee=t.jsx(Y.Footer,{children:t.jsxs("div",{className:"max-w-2xl mx-auto w-full min-w-0 flex flex-col gap-2",children:[me,W,Se,fe]})}),e[102]=me,e[103]=W,e[104]=Se,e[105]=fe,e[106]=ee):ee=e[106];let Q;return e[107]!==K||e[108]!==ee?(Q=t.jsxs(Y,{children:[K,ee]}),e[107]=K,e[108]=ee,e[109]=Q):Q=e[109],Q}function Ss(n,e){return n.id===e.id&&n.connectionId===e.connectionId}function Cs(n){const e=Z.c(2);let s;return e[0]!==n?(s=t.jsx(Y.Provider,{children:t.jsx(ys,{...n})}),e[0]=n,e[1]=s):s=e[1],s}function ws(n){const e=Z.c(41),{form:s,gateway:o,icon:f}=n;let r;e[0]!==s?(r=s.watch("title")||"Hub",e[0]=s,e[1]=r):r=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Xe,{}),e[2]=m):m=e[2];let g;e[3]!==f||e[4]!==r?(g=t.jsx(Fe,{icon:f,name:r,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=f,e[4]=r,e[5]=g):g=e[5];let c;e[6]!==s.control?(c=t.jsx(Re,{control:s.control,name:"status",render:ks}),e[6]=s.control,e[7]=c):c=e[7];let l;e[8]!==g||e[9]!==c?(l=t.jsxs("div",{className:"flex items-start justify-between",children:[g,c]}),e[8]=g,e[9]=c,e[10]=l):l=e[10];let d;e[11]!==s.control?(d=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(Re,{control:s.control,name:"title",render:Ts}),t.jsx(Re,{control:s.control,name:"description",render:Is})]}),e[11]=s.control,e[12]=d):d=e[12];let h;e[13]!==l||e[14]!==d?(h=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,d]}),e[13]=l,e[14]=d,e[15]=h):h=e[15];let p;e[16]!==s.control?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(Re,{control:s.control,name:"tool_selection_mode",render:_s}),t.jsx(Re,{control:s.control,name:"tool_selection_strategy",render:Ns})]}),e[16]=s.control,e[17]=p):p=e[17];let b;e[18]!==h||e[19]!==p?(b=t.jsxs("div",{className:"flex flex-col",children:[h,p]}),e[18]=h,e[19]=p,e[20]=b):b=e[20];let u;e[21]!==s||e[22]!==b?(u=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(qt,{...s,children:b})}),e[21]=s,e[22]=b,e[23]=u):u=e[23];let x;e[24]!==o.id||e[25]!==o.title?(x=o.title||`hub-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=x):x=e[26];const v=`${window.location.origin}/mcp/gateway/${o.id}`;let N;e[27]!==x||e[28]!==v?(N=t.jsx("div",{className:"p-5",children:t.jsx(hs,{serverName:x,gatewayUrl:v})}),e[27]=x,e[28]=v,e[29]=N):N=e[29];let I;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=I):I=e[30];let j;e[31]!==o.updated_at?(j=o.updated_at?ts(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=j):j=e[32];let y;e[33]!==j?(y=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[I,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[33]=j,e[34]=y):y=e[34];let S;e[35]!==N||e[36]!==y?(S=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[N,y]}),e[35]=N,e[36]=y,e[37]=S):S=e[37];let a;return e[38]!==u||e[39]!==S?(a=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[u,S]}),e[38]=u,e[39]=S,e[40]=a):a=e[40],a}function Ns(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(rt,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Hub strategy help",children:t.jsx(it,{size:14,className:"text-muted-foreground"})})}),t.jsx(be,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(at,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ve,{children:t.jsx(ct,{className:"w-[180px]",children:t.jsx(dt,{})})}),t.jsxs(mt,{children:[t.jsx(Ae,{value:"passthrough",children:"Passthrough"}),t.jsx(Ae,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(Ae,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Be,{})]})}function _s(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(rt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(it,{size:14,className:"text-muted-foreground"})})}),t.jsx(be,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(at,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ve,{children:t.jsx(ct,{className:"w-[180px]",children:t.jsx(dt,{})})}),t.jsxs(mt,{children:[t.jsx(Ae,{value:"inclusion",children:"Include Selected"}),t.jsx(Ae,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Be,{})]})}function Is(n){const{field:e}=n;return t.jsxs(De,{className:"w-full space-y-0",children:[t.jsx(Ve,{children:t.jsx(Ze,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Be,{})]})}function Ts(n){const{field:e}=n;return t.jsxs(De,{className:"w-full space-y-0",children:[t.jsx(Ve,{children:t.jsx(Ze,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Hub Name"})}),t.jsx(Be,{})]})}function ks(n){const{field:e}=n;return t.jsxs(De,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Ve,{children:t.jsx(_t,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Be,{})]})}function $s(n){const e=Z.c(104),{gateway:s,gatewayId:o,requestedTabId:f}=n,m=bt().location.href,g=vt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/gateways/$gatewayId"},e[0]=c):c=e[0];const l=Ye(c),d=Pt(),{locator:h}=lt(),[p,b]=$.useState("chat");let u;e[1]!==o||e[2]!==h?(u=ut.gatewayChatActiveThread(h,o),e[1]=o,e[2]=h,e[3]=u):u=e[3];const[x,v]=es(u,Ms);let N;e[4]!==o?(N={gatewayId:o},e[4]=o,e[5]=N):N=e[5];const{threads:I,refetch:j}=Rt(N),y=ot();let S;e[6]!==y.update?(S=async z=>{await y.update.mutateAsync({id:z,updates:{hidden:!0}})},e[6]=y.update,e[7]=S):S=e[7];const a=S;let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C={},e[8]=C):C=e[8];const _=Qe(C);let E;e[9]!==_?(E=_.map(zs),e[9]=_,e[10]=E):E=e[10];const R=E,{promptsMap:q}=zt(R),{resourcesMap:U}=Mt(R);let T;if(e[11]!==_){T=new Map;for(const z of _)z.tools&&z.tools.length>0&&T.set(z.id,z.tools.map(Ps));e[11]=_,e[12]=T}else T=e[12];let i;e[13]!==T||e[14]!==s?(i=()=>gs(s,T),e[13]=T,e[14]=s,e[15]=i):i=e[15];const[w,A]=$.useState(i);let F;e[16]!==s?(F=()=>js(s),e[16]=s,e[17]=F):F=e[17];const[P,B]=$.useState(F);let M;e[18]!==s?(M=()=>bs(s),e[18]=s,e[19]=M):M=e[19];const[k,X]=$.useState(M),[H,G]=$.useState(!1);let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=z=>{A(z),G(!0)},e[20]=L):L=e[20];const se=L;let J;e[21]===Symbol.for("react.memo_cache_sentinel")?(J=z=>{B(z),G(!0)},e[21]=J):J=e[21];const ae=J;let ne;e[22]===Symbol.for("react.memo_cache_sentinel")?(ne=z=>{X(z),G(!0)},e[22]=ne):ne=e[22];const ce=ne;let K;e[23]===Symbol.for("react.memo_cache_sentinel")?(K=yt(ps),e[23]=K):K=e[23];const de=s.tool_selection_mode??"inclusion",me=s.tool_selection_strategy??"passthrough";let oe;e[24]!==s.description||e[25]!==s.status||e[26]!==s.title||e[27]!==de||e[28]!==me?(oe={resolver:K,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:de,tool_selection_strategy:me}},e[24]=s.description,e[25]=s.status,e[26]=s.title,e[27]=de,e[28]=me,e[29]=oe):oe=e[29];const W=St(oe),ue=W.formState.isDirty||H;let ve;e[30]!==d.update||e[31]!==T||e[32]!==W||e[33]!==o||e[34]!==k||e[35]!==P||e[36]!==w?(ve=async()=>{const z=W.getValues(),We=vs(w,P,k,T);await d.update.mutateAsync({id:o,data:{title:z.title,description:z.description,status:z.status,tool_selection_mode:z.tool_selection_mode,tool_selection_strategy:z.tool_selection_strategy,connections:We}}),W.reset(z),G(!1),b("chat")},e[30]=d.update,e[31]=T,e[32]=W,e[33]=o,e[34]=k,e[35]=P,e[36]=w,e[37]=ve):ve=e[37];const Ce=ve;let ye;e[38]===Symbol.for("react.memo_cache_sentinel")?(ye=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[38]=ye):ye=e[38];const we=ye,V=we.some(z=>z.id===f)?f:"settings";let le;e[39]!==l?(le=z=>{l({search:We=>({...We,tab:z}),replace:!0})},e[39]=l,e[40]=le):le=e[40];const fe=le,ee=d.update.isPending,Q=p==="edit";let D;e[41]!==g.history?(D=()=>g.history.back(),e[41]=g.history,e[42]=D):D=e[42];let O;e[43]!==V||e[44]!==s.description||e[45]!==s.icon||e[46]!==s.title||e[47]!==fe||e[48]!==Q?(O=t.jsx(Qt,{children:Q?t.jsx(Jt,{tabs:we,activeTab:V,onTabChange:fe}):t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Fe,{icon:s.icon,name:s.title||"Hub",size:"xs",fallbackIcon:t.jsx(Xe,{size:12})}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.title}),s.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s.description})]}):null]})]})}),e[43]=V,e[44]=s.description,e[45]=s.icon,e[46]=s.title,e[47]=fe,e[48]=Q,e[49]=O):O=e[49];const he=s.icon??"cpu_chip";let ie;e[50]!==s.title||e[51]!==he||e[52]!==m?(ie=t.jsx(Kt,{title:s.title,url:m,icon:he}),e[50]=s.title,e[51]=he,e[52]=m,e[53]=ie):ie=e[53];let re;e[54]!==x||e[55]!==a||e[56]!==Ce||e[57]!==ue||e[58]!==Q||e[59]!==ee||e[60]!==j||e[61]!==v||e[62]!==I?(re=Q?t.jsxs(t.Fragment,{children:[t.jsx(pe,{children:t.jsxs(ge,{delayDuration:0,children:[t.jsx(je,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(te,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ee,onClick:()=>b("chat"),"aria-label":"Cancel",children:t.jsx(Wt,{size:14})})})}),t.jsx(be,{side:"bottom",children:"Cancel"})]})}),ue&&t.jsx(pe,{children:t.jsxs(ge,{delayDuration:0,children:[t.jsx(je,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(te,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ee,onClick:Ce,"aria-label":"Save",children:ee?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(ht,{size:14})})})}),t.jsx(be,{side:"bottom",children:"Save"})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",onClick:()=>v(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(nt,{size:16})})}),t.jsx(be,{children:"New thread"})]})}),t.jsx(At,{threads:I,activeThreadId:x,onSelectThread:v,onRemoveThread:a,onOpen:()=>j(),variant:"outline"}),t.jsx(pe,{children:t.jsxs(ge,{children:[t.jsx(je,{asChild:!0,children:t.jsx(te,{type:"button",onClick:()=>b("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(ft,{size:16})})}),t.jsx(be,{children:"Edit Settings"})]})})]}),e[54]=x,e[55]=a,e[56]=Ce,e[57]=ue,e[58]=Q,e[59]=ee,e[60]=j,e[61]=v,e[62]=I,e[63]=re):re=e[63];let Ne;e[64]!==ie||e[65]!==re?(Ne=t.jsxs(Zt,{children:[ie,re]}),e[64]=ie,e[65]=re,e[66]=Ne):Ne=e[66];const Ue=Q?"opacity-0 pointer-events-none hidden":"opacity-100";let _e;e[67]!==Ue?(_e=xe("h-full transition-opacity duration-200 ease-out",Ue),e[67]=Ue,e[68]=_e):_e=e[68];let Ie;e[69]!==x||e[70]!==s||e[71]!==v?(Ie=t.jsx(Cs,{gateway:s,activeThreadId:x,setActiveThreadId:v}),e[69]=x,e[70]=s,e[71]=v,e[72]=Ie):Ie=e[72];let Te;e[73]!==_e||e[74]!==Ie?(Te=t.jsx("div",{className:_e,children:Ie}),e[73]=_e,e[74]=Ie,e[75]=Te):Te=e[75];const He=Q?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none hidden";let ke;e[76]!==He?(ke=xe("h-full overflow-auto transition-opacity duration-200 ease-out",He),e[76]=He,e[77]=ke):ke=e[77];let Oe;e[78]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),e[78]=Oe):Oe=e[78];let $e;e[79]!==V||e[80]!==q||e[81]!==U||e[82]!==W||e[83]!==s||e[84]!==k||e[85]!==P||e[86]!==w?($e=V==="settings"?t.jsx(ws,{form:W,gateway:s,icon:s.icon}):V==="tools"?t.jsx(Nt,{toolSet:w,onToolSetChange:se}):V==="resources"?t.jsx(ds,{resourceSet:P,onResourceSetChange:ae,connectionResources:U}):V==="prompts"?t.jsx(is,{promptSet:k,onPromptSetChange:ce,connectionPrompts:q}):null,e[79]=V,e[80]=q,e[81]=U,e[82]=W,e[83]=s,e[84]=k,e[85]=P,e[86]=w,e[87]=$e):$e=e[87];let Pe;e[88]!==$e?(Pe=t.jsx($.Suspense,{fallback:Oe,children:$e}),e[88]=$e,e[89]=Pe):Pe=e[89];let ze;e[90]!==V||e[91]!==Pe?(ze=t.jsx(Ke,{children:Pe},V),e[90]=V,e[91]=Pe,e[92]=ze):ze=e[92];let Me;e[93]!==ke||e[94]!==ze?(Me=t.jsx("div",{className:ke,children:ze}),e[93]=ke,e[94]=ze,e[95]=Me):Me=e[95];let Ee;e[96]!==Te||e[97]!==Me?(Ee=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[Te,Me]})}),e[96]=Te,e[97]=Me,e[98]=Ee):Ee=e[98];let Ge;return e[99]!==D||e[100]!==O||e[101]!==Ne||e[102]!==Ee?(Ge=t.jsxs(Xt,{onBack:D,children:[O,Ne,Ee]}),e[99]=D,e[100]=O,e[101]=Ne,e[102]=Ee,e[103]=Ge):Ge=e[103],Ge}function Ps(n){return n.name}function zs(n){return n.id}function Ms(n){return n||crypto.randomUUID()}function Es(){const n=Z.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=Ye(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:f,org:r}=pt(o);let m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/gateways/$gatewayId"},n[2]=m):m=n[2];const c=gt(m).tab||"settings",l=$t(f);if(!l){let h;return n[3]!==s||n[4]!==r?(h=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(wt,{title:"Hub not found",description:"This Hub may have been deleted or you may not have access.",actions:t.jsx(te,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),n[3]=s,n[4]=r,n[5]=h):h=n[5],h}let d;return n[6]!==l||n[7]!==f||n[8]!==c?(d=t.jsx($s,{gateway:l,gatewayId:f,requestedTabId:c}),n[6]=l,n[7]=f,n[8]=c,n[9]=d):d=n[9],d}function Rs(){const n=Z.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Es,{})})}),n[0]=e):e=n[0],e}function Mn(){const n=Z.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Rs,{}),n[0]=e):e=n[0],e}export{Mn as default};
@@ -1 +0,0 @@
1
- import{c as te,j as t,r as se,f as re,t as ie}from"./index-BLgTJ8o3.js";import{C as ne}from"./collection-header-DBUE7n6H.js";import{C as ae}from"./collection-page-BHk1uJKe.js";import{C as le}from"./collection-search-CM9rltH6.js";import{C as ce}from"./collection-table-wrapper-BRI7T6RJ.js";import{C as de}from"./connection-card-DMv3uM_n.js";import{E as q}from"./SearchMd-D70t5LVP.js";import{E as me}from"./error-boundary-CsEoagci.js";import{u as ue,I as he}from"./use-connection-CsPrFY0x.js";import{a as ge,u as pe}from"./use-gateway-Bz_y7oh7.js";import{u as fe,s as Q}from"./use-list-state-B13SO1z3.js";import{u as xe}from"./tooltip-CSuczTFq.js";import{c as je,b as ye,d as we,A as Ce,e as be,g as Ne,a as De,f as Se}from"./alert-dialog-BU8uTWb8.js";import{B as oe}from"./badge-CStgouQf.js";import{B as J}from"./button-IijH0wdI.js";import{b as U,D as X,a as Y,c as B}from"./dropdown-menu-BvLCKekW.js";import{i as j}from"./CpuChip02-BwTl0fBj.js";import{i as Z}from"./DotsVertical-BQk5hPxb.js";import{i as ve}from"./Loading01-0wYmSKV6.js";import{s as ee}from"./Trash01-DnTS63e5.js";import"./collection-display-button-2ZQ5sQTW.js";import"./Grid01-CmB5R6oU.js";import"./view-mode-toggle-BXo-WMnB.js";import"./input-BxywPo2X.js";import"./card-BnWpolEI.js";import"./use-mobile-VYFif8jU.js";function ke(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:r}=xe(),i=re();let y;e[0]!==r.slug?(y={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=y):y=e[1];const s=fe(y),n=ge(),x=pe(s);let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={},e[2]=w):w=e[2];const G=ue(w);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[a,b]=se.useReducer(ke,C);let N;e[4]!==n.create||e[5]!==G.length||e[6]!==i||e[7]!==r.slug?(N=async()=>{if(G.length===0){ie.error("Create at least one Connection first");return}const o=await n.create.mutateAsync({title:"New Hub",description:"Hubs let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},e[4]=n.create,e[5]=G.length,e[6]=i,e[7]=r.slug,e[8]=N):N=e[8];const R=N;let D;e[9]!==n.delete||e[10]!==a.gateway||e[11]!==a.mode?(D=async()=>{if(a.mode!=="deleting")return;const o=a.gateway.id;b({type:"close"});try{await n.delete.mutateAsync(o)}catch{}},e[9]=n.delete,e[10]=a.gateway,e[11]=a.mode,e[12]=D):D=e[12];const T=D;let S,v,k,_,I,$;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:He,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ke,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},I={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},$={id:"connections",header:"Connections",render:Pe,cellClassName:"w-24 shrink-0"},S={id:"status",header:"Status",render:Ae,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=S,e[14]=v,e[15]=k,e[16]=_,e[17]=I,e[18]=$):(S=e[13],v=e[14],k=e[15],_=e[16],I=e[17],$=e[18]);let M;e[19]!==i||e[20]!==r.slug?(M=[v,k,_,I,$,S,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ze,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),b({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=i,e[20]=r.slug,e[21]=M):M=e[21];const O=M,V=n.create.isPending?"Creating...":"Create Hub";let z;e[22]!==n.create.isPending||e[23]!==R||e[24]!==V?(z=t.jsx(J,{onClick:R,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:n.create.isPending,children:V}),e[22]=n.create.isPending,e[23]=R,e[24]=V,e[25]=z):z=e[25];const L=z,F=a.mode==="deleting";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=o=>!o&&b({type:"close"}),e[26]=A):A=e[26];let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(je,{children:"Delete Hub?"}),e[27]=P):P=e[27];const W=a.mode==="deleting"&&a.gateway.title;let c;e[28]!==W?(c=t.jsxs(ye,{children:[P,t.jsxs(we,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==T?(d=t.jsxs(be,{children:[E,t.jsx(Ne,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=T,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(De,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(Se,{open:F,onOpenChange:A,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let K;e[39]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=K):K=e[39];let h;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(h=t.jsx(ne,{title:"Hubs",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:K,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=h):h=e[46];let g;e[47]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=g):g=e[48];let p;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==g?(p=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a hub...",onKeyDown:g}),e[49]=s.search,e[50]=s.setSearch,e[51]=g,e[52]=p):p=e[52];let f;e[53]!==O||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==i||e[61]!==r.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:s.search?"No hubs found":"No hubs yet",description:s.search?`No hubs match "${s.search}"`:"Create a hub to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(j,{}),onClick:()=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Ie,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),b({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:O,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No hubs found",description:`No hubs match "${s.search}"`}):t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No hubs yet",description:"Create a hub to aggregate tools from multiple Connections."})}),e[53]=O,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=i,e[61]=r.slug,e[62]=f):f=e[62];let H;return e[63]!==u||e[64]!==h||e[65]!==p||e[66]!==f?(H=t.jsxs(ae,{children:[u,h,p,f]}),e[63]=u,e[64]=h,e[65]=p,e[66]=f,e[67]=H):H=e[67],H}function Ie(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function Me(e){return e.stopPropagation()}function ze(e){return e.stopPropagation()}function Ae(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Pe(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ke(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function He(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(he,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(j,{size:16})})}function mt(){const e=te.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=r):r=e[0],r}export{mt as default};