@decocms/mesh 2.31.1 → 2.32.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 (188) hide show
  1. package/dist/client/assets/{AlertCircle-CNlbeaNO.js → AlertCircle-BC5XMJnh.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-H58XLYPH.js → ArrowLeft-YLXxN85l.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-C39Etgym.js → ArrowUp-B5D5I-e4.js} +1 -1
  4. package/dist/client/assets/{Check-qyrf_w7u.js → Check-BJ8aD04h.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-D4EQGXFb.js → ChevronDown-Dwu65bm7.js} +1 -1
  6. package/dist/client/assets/{Code01-B-sXoUAx.js → Code01-D5im63O6.js} +1 -1
  7. package/dist/client/assets/{Copy01-EV4WWtW9.js → Copy01-CzCGcpFB.js} +1 -1
  8. package/dist/client/assets/CpuChip02-DL5MAhty.js +1 -0
  9. package/dist/client/assets/{DotsHorizontal-BLQeuj18.js → DotsHorizontal-B8KoSTcW.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BIgdSuWw.js → DotsVertical-Q4BfP_OZ.js} +1 -1
  11. package/dist/client/assets/{Download01-CfIslxub.js → Download01-DdEO2Y20.js} +1 -1
  12. package/dist/client/assets/{Edit01-YiEPkU0g.js → Edit01-BeUmNzHw.js} +1 -1
  13. package/dist/client/assets/{File06-BOUeu2_s.js → File06-Dbh0s9nF.js} +1 -1
  14. package/dist/client/assets/{FilterLines-C9-FwG4M.js → FilterLines-DOm0e2np.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-CXUecZqc.js → FlipBackward-B0YDj6U2.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-C7TElKX3.js → GitBranch01-7JSGEKWK.js} +1 -1
  17. package/dist/client/assets/{Grid01-DS_Rpsaf.js → Grid01-CxjwpfJx.js} +1 -1
  18. package/dist/client/assets/{Home02-kWTen2lJ.js → Home02-Mi1g3zml.js} +1 -1
  19. package/dist/client/assets/{Image01-C1Gj64FS.js → Image01-k29lIkxT.js} +1 -1
  20. package/dist/client/assets/{Inbox01-BWl9K4GL.js → Inbox01-C3SZugQ0.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-fjnTRxT_.js → InfoCircle-BpN5-782.js} +1 -1
  22. package/dist/client/assets/{Key01-BH9DhJ8d.js → Key01-CfBi5Z2i.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-Cu4-40eG.js → LinkExternal01-D9T5dDpq.js} +1 -1
  24. package/dist/client/assets/{List-CMJ7wwXL.js → List-BH4t2L38.js} +1 -1
  25. package/dist/client/assets/{Loading01-DlgJ1_45.js → Loading01-Dk8ucN4u.js} +1 -1
  26. package/dist/client/assets/{Lock01-Bc4skRDc.js → Lock01-C_cIWOtW.js} +1 -1
  27. package/dist/client/assets/{Play-By6elSLp.js → Play-CQprIR-2.js} +1 -1
  28. package/dist/client/assets/{Plus-DtbgAjWY.js → Plus-DsxxHM8H.js} +1 -1
  29. package/dist/client/assets/{SearchMd--bzHJ7AO.js → SearchMd-COziLDJJ.js} +1 -1
  30. package/dist/client/assets/{Terminal-BVYBaOBz.js → Terminal-onO5xBIt.js} +1 -1
  31. package/dist/client/assets/{Trash01-DjLKhTdL.js → Trash01-Dz97bbYc.js} +1 -1
  32. package/dist/client/assets/{Upload01-Deo1Gmh-.js → Upload01-BX6LCIgm.js} +1 -1
  33. package/dist/client/assets/{X-C24Yv1HS.js → X-IKzqhWHn.js} +1 -1
  34. package/dist/client/assets/{XClose-CnH5yMqw.js → XClose-v1hlIgz0.js} +1 -1
  35. package/dist/client/assets/agent-detail-DJ7sCPlX.js +1 -0
  36. package/dist/client/assets/agents-B2w5ERo_.js +1 -0
  37. package/dist/client/assets/{alert-dialog-D9F5tffK.js → alert-dialog-DrQP8AK1.js} +2 -2
  38. package/dist/client/assets/{auth-catchall-CN5idKvS.js → auth-catchall-CMrAfdfW.js} +1 -1
  39. package/dist/client/assets/{avatar-BZZ8iTNu.js → avatar-BJReLfGX.js} +1 -1
  40. package/dist/client/assets/{badge-Bv6QbUSE.js → badge-DbdCj_uM.js} +1 -1
  41. package/dist/client/assets/{binder-Co4G2PF6.js → binder-D69FJEqF.js} +1 -1
  42. package/dist/client/assets/button-PodD5p0U.js +1 -0
  43. package/dist/client/assets/{card-CRtF9cdr.js → card-D-ovGS63.js} +1 -1
  44. package/dist/client/assets/checkbox-6AvRm83v.js +1 -0
  45. package/dist/client/assets/collection-detail-CQJDYkNb.js +26 -0
  46. package/dist/client/assets/{collection-display-button-CQf7wSjn.js → collection-display-button-Dh09Ilcf.js} +1 -1
  47. package/dist/client/assets/{collection-header-ebtrK-4-.js → collection-header-BmH5wfr6.js} +1 -1
  48. package/dist/client/assets/{collection-page-BhBrRtz8.js → collection-page-DQfIdy6i.js} +1 -1
  49. package/dist/client/assets/{collection-search-BHs67_UI.js → collection-search-4ynn1TPY.js} +1 -1
  50. package/dist/client/assets/collection-tab--D0SMzDr.js +1 -0
  51. package/dist/client/assets/{collection-table-wrapper-3bPS8SS1.js → collection-table-wrapper-DNSd3m2k.js} +1 -1
  52. package/dist/client/assets/{connection-card-CEKO3io8.js → connection-card-DnSsvBT0.js} +1 -1
  53. package/dist/client/assets/connection-detail-DHFifhwE.js +1 -0
  54. package/dist/client/assets/connections-B9O8nDt9.js +1 -0
  55. package/dist/client/assets/constants-B4USxFBv.js +1 -0
  56. package/dist/client/assets/constants-CmWKkXWd.js +1 -0
  57. package/dist/client/assets/create-organization-dialog-CEW5VGHH.js +1 -0
  58. package/dist/client/assets/dialog-CWaQrwji.js +1 -0
  59. package/dist/client/assets/dropdown-menu-D9Rmpcp9.js +1 -0
  60. package/dist/client/assets/dynamic-plugin-layout-CBpne9DX.js +1 -0
  61. package/dist/client/assets/{empty-state-CSTjcp0X.js → empty-state-B-Xm_EaJ.js} +1 -1
  62. package/dist/client/assets/{empty-state-CUODA5WM.js → empty-state-DqNObyCj.js} +1 -1
  63. package/dist/client/assets/env-vars-editor-CfgmDeU5.js +1 -0
  64. package/dist/client/assets/{error-boundary-DP1kX1Iw.js → error-boundary-BjOv2UWq.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-D7M4EXYt.js → extract-connection-data-0XBBnZdV.js} +1 -1
  66. package/dist/client/assets/{file-browser-C9Hg6ohe.js → file-browser-B9wkG-Sl.js} +2 -2
  67. package/dist/client/assets/form-vSEoY8gy.js +1 -0
  68. package/dist/client/assets/{grid-view-DvYWkbyi.js → grid-view-DFrm-jAH.js} +1 -1
  69. package/dist/client/assets/home-bVBdjE9M.js +1 -0
  70. package/dist/client/assets/{index-B9c3bNyk.js → index-964bfDMw.js} +29 -29
  71. package/dist/client/assets/index-B_Tj7K9k.js +1 -0
  72. package/dist/client/assets/index-Cmw-k2HD.js +1 -0
  73. package/dist/client/assets/{index-I-Aus2DH.css → index-D86tzVve.css} +1 -1
  74. package/dist/client/assets/{index-SYlc-1Tl.js → index-DuRBn85W.js} +83 -83
  75. package/dist/client/assets/index-EWMtHb8y.js +25 -0
  76. package/dist/client/assets/index-wKTAGmPb.js +1 -0
  77. package/dist/client/assets/infiniteQueryObserver-KoZoIabU.js +1 -0
  78. package/dist/client/assets/{input-Dh7sDwu6.js → input-Ej7Hdv-8.js} +1 -1
  79. package/dist/client/assets/{layout-CMBAL9_n.js → layout-CXY5gq_4.js} +1 -1
  80. package/dist/client/assets/localstorage-keys-D1mHOPHm.js +1 -0
  81. package/dist/client/assets/{login-CgLLYYgm.js → login--5WB-nLi.js} +1 -1
  82. package/dist/client/assets/mcp-oauth-BD4MGpFX.js +1 -0
  83. package/dist/client/assets/{mcp-server-card-3RQV4Klx.js → mcp-server-card-DS0l3oak.js} +1 -1
  84. package/dist/client/assets/mcp-server-detail-CJwkhfLJ.js +2 -0
  85. package/dist/client/assets/members-BJW4tDMu.js +3 -0
  86. package/dist/client/assets/{monaco-editor-9ao1STYz.js → monaco-editor-3Me4XJ9I.js} +4 -4
  87. package/dist/client/assets/monitoring-CR4-lnND.js +49 -0
  88. package/dist/client/assets/{oauth-callback-DC00uX2L.js → oauth-callback-B8Ags9WE.js} +1 -1
  89. package/dist/client/assets/page-CCwujlJd.js +21 -0
  90. package/dist/client/assets/page-CN8DT11b.js +1 -0
  91. package/dist/client/assets/pin-to-sidebar-button-CYXcrmnE.js +1 -0
  92. package/dist/client/assets/plugin-empty-state-DJU_t0en.js +1 -0
  93. package/dist/client/assets/plugin-header-DXCUdn_T.js +1 -0
  94. package/dist/client/assets/plugins-Bl59udAj.js +1 -0
  95. package/dist/client/assets/popover-DBItUBYK.js +1 -0
  96. package/dist/client/assets/registry-utils-CPkD9bdu.js +1 -0
  97. package/dist/client/assets/resizable-ZQy6ZhoG.js +1 -0
  98. package/dist/client/assets/{resource-tabs-B7x4zlfW.js → resource-tabs-eTZinrmK.js} +1 -1
  99. package/dist/client/assets/select-AaQnf6IX.js +1 -0
  100. package/dist/client/assets/settings-7r0XCBIy.js +1 -0
  101. package/dist/client/assets/shell-layout-Bi9hmLN-.js +3 -0
  102. package/dist/client/assets/{spinner-CO1NH93o.js → spinner-C--oN2eV.js} +1 -1
  103. package/dist/client/assets/{switch-IXdsAtvF.js → switch-uzDLGnXk.js} +1 -1
  104. package/dist/client/assets/{textarea-BIhbkxfH.js → textarea-E7VOwyYz.js} +1 -1
  105. package/dist/client/assets/tool-set-selector-CQhszaVY.js +1 -0
  106. package/dist/client/assets/{tools-list-DvTDsJWw.js → tools-list-BK4C4awn.js} +1 -1
  107. package/dist/client/assets/{tooltip-Bb2oNaYJ.js → tooltip-Bdoc9quu.js} +1 -1
  108. package/dist/client/assets/{typewriter-title-Dm2sjP0K.js → typewriter-title-BlMj2uGN.js} +1 -1
  109. package/dist/client/assets/use-binding-DhM8knFB.js +23 -0
  110. package/dist/client/assets/use-collections-xUu5CPtF.js +1 -0
  111. package/dist/client/assets/use-connection-Bqsa8RaS.js +1 -0
  112. package/dist/client/assets/use-create-virtual-mcp-CdxRkVjT.js +1 -0
  113. package/dist/client/assets/{use-list-state-Ck_kabtn.js → use-list-state-BmjPeRyR.js} +1 -1
  114. package/dist/client/assets/use-members-B5HINX4i.js +1 -0
  115. package/dist/client/assets/{use-mobile-Bb5jBMYm.js → use-mobile-CH4OC_dx.js} +1 -1
  116. package/dist/client/assets/use-organization-settings-BOpggtjG.js +1 -0
  117. package/dist/client/assets/use-virtual-mcp-mbM9JS_c.js +1 -0
  118. package/dist/client/assets/use-virtual-mcp-system-prompt-BlXwuykx.js +1 -0
  119. package/dist/client/assets/useInfiniteQuery-Dmu_NRFV.js +1 -0
  120. package/dist/client/assets/useMutation-BABUvOV4.js +1 -0
  121. package/dist/client/assets/useQuery-B2QbSzDL.js +1 -0
  122. package/dist/client/assets/value-D8ri8g3W.js +1 -0
  123. package/dist/client/assets/{view-mode-toggle-C6P0fGVR.js → view-mode-toggle-C-30gO9H.js} +1 -1
  124. package/dist/client/assets/virtual-mcp-zquQbLgI.js +1 -0
  125. package/dist/client/assets/workflow-Dka00GsI.js +1 -0
  126. package/dist/client/index.html +2 -2
  127. package/dist/server/cli.js +196 -176
  128. package/dist/server/migrate.js +167 -147
  129. package/dist/server/server.js +160 -160
  130. package/package.json +2 -2
  131. package/dist/client/assets/agent-detail-RPUTUaLt.js +0 -1
  132. package/dist/client/assets/agents-DLD7xSIr.js +0 -1
  133. package/dist/client/assets/button-Ta3HWdYR.js +0 -1
  134. package/dist/client/assets/checkbox-PlWQwQ-Z.js +0 -1
  135. package/dist/client/assets/collection-detail-D2KCEX1U.js +0 -26
  136. package/dist/client/assets/collection-tab-B2mnSptX.js +0 -1
  137. package/dist/client/assets/connection-C0f0eQA8.js +0 -2
  138. package/dist/client/assets/connection-detail-CdPOOjUE.js +0 -1
  139. package/dist/client/assets/connections-DiIaCwOD.js +0 -1
  140. package/dist/client/assets/constants-7IT_izqz.js +0 -1
  141. package/dist/client/assets/create-organization-dialog-dWwHUnmz.js +0 -1
  142. package/dist/client/assets/dialog-DU-St4qJ.js +0 -1
  143. package/dist/client/assets/dropdown-menu-BbIA2rWH.js +0 -1
  144. package/dist/client/assets/dynamic-plugin-layout-CvhGXoEg.js +0 -1
  145. package/dist/client/assets/env-vars-editor-D9YuRsdO.js +0 -1
  146. package/dist/client/assets/form-HErbLCwX.js +0 -1
  147. package/dist/client/assets/home-CszARX6v.js +0 -1
  148. package/dist/client/assets/index-D0C0gp7N.js +0 -1
  149. package/dist/client/assets/index-DE0l5h4l.js +0 -25
  150. package/dist/client/assets/index-DMxjLEp2.js +0 -1
  151. package/dist/client/assets/infiniteQueryObserver-DTO2dBsV.js +0 -1
  152. package/dist/client/assets/localstorage-keys-DJR10CLV.js +0 -1
  153. package/dist/client/assets/mcp-oauth-Bb9RwQ7y.js +0 -1
  154. package/dist/client/assets/mcp-server-detail-ERiwQuLO.js +0 -1
  155. package/dist/client/assets/members-COVJZ-4S.js +0 -3
  156. package/dist/client/assets/monitoring-BTGpm-FJ.js +0 -49
  157. package/dist/client/assets/page-2qu28FYa.js +0 -21
  158. package/dist/client/assets/page-CeLSKVJn.js +0 -1
  159. package/dist/client/assets/pin-to-sidebar-button-B85FzaKS.js +0 -1
  160. package/dist/client/assets/plugin-empty-state-CLZp9CCB.js +0 -1
  161. package/dist/client/assets/plugin-header-DlV51u69.js +0 -1
  162. package/dist/client/assets/plugins-BNlg-adG.js +0 -1
  163. package/dist/client/assets/popover-nSqfHOuL.js +0 -1
  164. package/dist/client/assets/project-context-provider-DJGvA4-w.js +0 -1
  165. package/dist/client/assets/registry-utils-BKwhzouz.js +0 -1
  166. package/dist/client/assets/resizable-CXrT3-gZ.js +0 -1
  167. package/dist/client/assets/schema-rISYOzpk.js +0 -1
  168. package/dist/client/assets/select-DEFdCmMs.js +0 -1
  169. package/dist/client/assets/settings-DwBDaBpc.js +0 -1
  170. package/dist/client/assets/shell-layout-BGLgMyjW.js +0 -3
  171. package/dist/client/assets/tool-set-selector-Cu6h1Zi5.js +0 -1
  172. package/dist/client/assets/use-binding-C-jiWM_O.js +0 -23
  173. package/dist/client/assets/use-collections-BnNAdJQg.js +0 -1
  174. package/dist/client/assets/use-connection-Cpo9FQLA.js +0 -1
  175. package/dist/client/assets/use-connection-resources-Bf67v2HN.js +0 -1
  176. package/dist/client/assets/use-create-virtual-mcp-B5oK5D73.js +0 -1
  177. package/dist/client/assets/use-mcp-C4SOdL_A.js +0 -1
  178. package/dist/client/assets/use-members-DKVZHAEo.js +0 -1
  179. package/dist/client/assets/use-organization-settings-BksJ8-FR.js +0 -1
  180. package/dist/client/assets/use-tool-call-CDQ4ked9.js +0 -1
  181. package/dist/client/assets/use-virtual-mcp-CMArCljo.js +0 -1
  182. package/dist/client/assets/use-virtual-mcp-system-prompt-CeE5LXb5.js +0 -1
  183. package/dist/client/assets/useInfiniteQuery-CoW_DO_L.js +0 -1
  184. package/dist/client/assets/useMutation-BYfWAlPb.js +0 -1
  185. package/dist/client/assets/useQuery-CqMcSUvK.js +0 -1
  186. package/dist/client/assets/value-CpF7GK8s.js +0 -1
  187. package/dist/client/assets/well-known-mcp-DOEdYmKO.js +0 -1
  188. package/dist/client/assets/workflow-JTUHDWeK.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.31.1",
3
+ "version": "2.32.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -74,7 +74,7 @@
74
74
  "@rjsf/utils": "^6.1.2",
75
75
  "@rjsf/validator-ajv8": "^6.1.2",
76
76
  "@tailwindcss/vite": "^4.1.17",
77
- "@tanstack/react-query": "^5.90.11",
77
+ "@tanstack/react-query": "5.90.11",
78
78
  "@tanstack/react-router": "^1.139.7",
79
79
  "@tanstack/react-router-devtools": "^1.139.7",
80
80
  "@tiptap/core": "^3.15.3",
@@ -1 +0,0 @@
1
- import{r as S,_ as Ce,y as ae,I as D,z as _,c as P,j as t,f as Be,d as st,b as lt,k as ot,ad as nt,B as it,E as rt,t as Re}from"./index-B9c3bNyk.js";import{I as ze,E as ct}from"./empty-state-CSTjcp0X.js";import{E as Fe}from"./error-boundary-DP1kX1Iw.js";import{C as We}from"./checkbox-PlWQwQ-Z.js";import{c as Y,B as H}from"./button-Ta3HWdYR.js";import{i as at}from"./ArrowLeft-H58XLYPH.js";import{u as He}from"./use-connection-Cpo9FQLA.js";import{C as dt}from"./collection-search-BHs67_UI.js";import{p as mt}from"./schema-rISYOzpk.js";import{I as Ae}from"./input-Dh7sDwu6.js";import{s as ut}from"./Plus-DtbgAjWY.js";import{i as ft}from"./X-C24Yv1HS.js";import{P as ht}from"./pin-to-sidebar-button-B85FzaKS.js";import{T as xt}from"./tool-set-selector-Cu6h1Zi5.js";import{b as pt,a as gt,i as bt}from"./use-virtual-mcp-CMArCljo.js";import{u as jt,a as vt}from"./use-connection-resources-Bf67v2HN.js";import{u as St}from"./use-virtual-mcp-system-prompt-CeE5LXb5.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{B as Ge}from"./badge-Bv6QbUSE.js";import{a as Ct,D as Nt,c as _t,d as yt}from"./dialog-DU-St4qJ.js";import{F as ve,a as wt,b as Ne,d as _e,f as ye,c as kt}from"./form-HErbLCwX.js";import{I as It,R as Mt,a as Tt}from"./index-DMxjLEp2.js";import{R as Pt}from"./resource-tabs-B7x4zlfW.js";import{S as $t,a as Rt,b as zt,c as At,d as De}from"./select-DEFdCmMs.js";import{S as Vt}from"./switch-IXdsAtvF.js";import{T as Et}from"./textarea-BIhbkxfH.js";import{a as J,c as Q,b as K,T as X}from"./tooltip-Bb2oNaYJ.js";import{i as Ze}from"./Check-qyrf_w7u.js";import{i as Dt}from"./Code01-B-sXoUAx.js";import{a as Lt}from"./Copy01-EV4WWtW9.js";import{i as Ot}from"./FlipBackward-CXUecZqc.js";import{i as Se}from"./InfoCircle-fjnTRxT_.js";import{i as $e}from"./Loading01-DlgJ1_45.js";import{a as Ut,V as Bt,b as Ft}from"./layout-CMBAL9_n.js";import"./connection-C0f0eQA8.js";import"./project-context-provider-DJGvA4-w.js";import"./use-collections-BnNAdJQg.js";import"./useMutation-BYfWAlPb.js";import"./SearchMd--bzHJ7AO.js";import"./use-organization-settings-BksJ8-FR.js";import"./localstorage-keys-DJR10CLV.js";import"./useQuery-CqMcSUvK.js";import"./ChevronDown-D4EQGXFb.js";const Ye=({size:l=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Ye.displayName="ArrowsRight";const Je=({size:l=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Je.displayName="Circle";const Qe=({size:l=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));Qe.displayName="Lightbulb02";const Ke=({size:l=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},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"}));Ke.displayName="Save01";const Xe=({size:l=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));Xe.displayName="Share07";const Ve=Ce(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Wt=ae({connection_id:_().describe("Connection ID"),selected_tools:D(_()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:D(_()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:D(_()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Ht=ae({id:_().describe("Unique identifier for the virtual MCP"),title:_().describe("Human-readable name for the virtual MCP"),description:_().nullable().describe("Description of the virtual MCP"),icon:_().nullable().optional().describe("Icon URL for the virtual MCP"),created_at:_().describe("When the virtual MCP was created"),updated_at:_().describe("When the virtual MCP was last updated"),created_by:_().describe("User ID who created the virtual MCP"),updated_by:_().optional().describe("User ID who last updated the virtual MCP"),organization_id:_().describe("Organization ID this virtual MCP belongs to"),tool_selection_mode:Ve.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:Ce(["active","inactive"]).describe("Current status"),connections:D(Wt).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});ae({title:_().min(1).max(255).describe("Name for the virtual MCP"),description:_().nullable().optional().describe("Optional description"),tool_selection_mode:Ve.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:_().nullable().optional().describe("Optional icon URL"),status:Ce(["active","inactive"]).optional().default("active").describe("Initial status"),connections:D(ae({connection_id:_().describe("Connection ID"),selected_tools:D(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:D(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:D(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});ae({title:_().min(1).max(255).optional().describe("New name"),description:_().nullable().optional().describe("New description (null to clear)"),tool_selection_mode:Ve.optional().describe("New tool selection mode"),icon:_().nullable().optional().describe("New icon URL (null to clear)"),status:Ce(["active","inactive"]).optional().describe("New status"),connections:D(ae({connection_id:_().describe("Connection ID"),selected_tools:D(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:D(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:D(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const qt=S.memo(function(e){const s=P.c(20),{connection:o,isSelected:n,hasItemsEnabled:i,activeItemsCount:r,totalItemsCount:c,onSelect:m,onToggle:a}=e,d=n?"bg-accent/50":"hover:bg-muted/50";let f;s[0]!==d?(f=Y("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=f):f=s[1];let u;s[2]!==o.icon||s[3]!==o.title?(u=t.jsx(ze,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=u):u=s[4];let x;s[5]!==o.title?(x=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]=x):x=s[6];let p;s[7]!==m||s[8]!==u||s[9]!==x?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[u,x]}),s[7]=m,s[8]=u,s[9]=x,s[10]=p):p=s[10];let g;s[11]!==r||s[12]!==i||s[13]!==a||s[14]!==c?(g=c>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",c]}),t.jsx(We,{checked:i,onCheckedChange:a,onClick:Zt})]}),s[11]=r,s[12]=i,s[13]=a,s[14]=c,s[15]=g):g=s[15];let v;return s[16]!==f||s[17]!==p||s[18]!==g?(v=t.jsxs("div",{className:f,children:[p,g]}),s[16]=f,s[17]=p,s[18]=g,s[19]=v):v=s[19],v}),Gt=S.memo(function(e){const s=P.c(18),{connectionId:o,item:n,isSelected:i,onToggle:r}=e,c=`item-${o}-${n.id}`,m=i?"text-foreground":"text-muted-foreground";let a;s[0]!==m?(a=Y("text-sm font-medium",m),s[0]=m,s[1]=a):a=s[1];let d;s[2]!==n.name||s[3]!==a?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:a,children:n.name})}),s[2]=n.name,s[3]=a,s[4]=d):d=s[4];let f;s[5]!==n.description?(f=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),s[5]=n.description,s[6]=f):f=s[6];let u;s[7]!==d||s[8]!==f?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,f]}),s[7]=d,s[8]=f,s[9]=u):u=s[9];const x=`item-${o}-${n.id}`;let p;s[10]!==i||s[11]!==r||s[12]!==x?(p=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(We,{id:x,checked:i,onCheckedChange:r,onClick:Yt})}),s[10]=i,s[11]=r,s[12]=x,s[13]=p):p=s[13];let g;return s[14]!==c||s[15]!==u||s[16]!==p?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[u,p]}),s[14]=c,s[15]=u,s[16]=p,s[17]=g):g=s[17],g});function et({itemSet:l,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:n,extraContent:i,excludeVirtualMcpId:r}){const[c,m]=S.useState(""),a=S.useDeferredValue(c),[d,f]=S.useState("all"),[u,x]=S.useState(!1),p=S.useRef(new Set(Object.keys(l))),g=He({searchTerm:a.trim()||void 0}),v=r?g.filter(h=>h.connection_type!=="VIRTUAL"?!0:mt(h.connection_url)!==r):g,b=p.current,y=[...b.values()].map(h=>v.find(N=>N.id===h)).filter(h=>h!==void 0),C=v.filter(h=>!b.has(h.id)),j=[...y,...C],k=h=>{const N=l[h];return N!==void 0&&N.length>0},w=j.filter(h=>{if(d==="all")return!0;const N=k(h.id);return d==="selected"?N:d==="unselected"?!N:!0}),[$,T]=S.useState(j[0]?.id??null),I=$?j.find(h=>h.id===$)??null:null,A=I?s(I):[],B=(h,N)=>l[h]?.includes(N)??!1,R=(h,N)=>{const F=l[h]??[],O=F.includes(N),q={...l};if(O){const G=F.filter(Z=>Z!==N);G.length===0?delete q[h]:q[h]=G}else q[h]=[...F,N];e(q)},V=h=>{const N=j.find(W=>W.id===h);if(!N)return;const F=s(N);if(F.length===0)return;const O=l[h]??[],q=F.map(W=>W.id),G=O.length>0&&q.every(W=>O.includes(W)),Z={...l};G?delete Z[h]:(Z[h]=q,T(h)),e(Z)},L=h=>{T(h),x(!0)},z=()=>{x(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:Y("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(dt,{value:c,onChange:m,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>f("all"),className:Y("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>f("selected"),className:Y("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>f("unselected"),className:Y("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",d==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:c?"No connections found":d==="selected"?"No servers selected":d==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:w.map(h=>{const F=s(h).length,O=l[h.id]?.length??0;return t.jsx(qt,{connection:h,isSelected:$===h.id,hasItemsEnabled:k(h.id),activeItemsCount:O,totalItemsCount:F,onSelect:()=>L(h.id),onToggle:()=>V(h.id)},h.id)})})})]}),t.jsx("div",{className:Y("flex-1 flex-col",u?"flex":"hidden md:flex"),children:I?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(H,{variant:"ghost",size:"sm",onClick:z,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(at,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(ze,{icon:I.icon,name:I.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:I.title}),I.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:I.description})]})]})]}),i,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:A.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:A.map(h=>t.jsx(Gt,{connectionId:I.id,item:h,isSelected:B(I.id,h.id),onToggle:()=>R(I.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function Zt(l){return l.stopPropagation()}function Yt(l){return l.stopPropagation()}function Jt(l){const e=P.c(7),{promptSet:s,onPromptSetChange:o,connectionPrompts:n,excludeVirtualMcpId:i}=l;let r;e[0]!==n?(r=a=>(n.get(a.id)??[]).map(Qt),e[0]=n,e[1]=r):r=e[1];const c=r;let m;return e[2]!==i||e[3]!==c||e[4]!==o||e[5]!==s?(m=t.jsx(et,{itemSet:s,onItemSetChange:o,getItems:c,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available",excludeVirtualMcpId:i}),e[2]=i,e[3]=c,e[4]=o,e[5]=s,e[6]=m):m=e[6],m}function Qt(l){return{id:l.name,name:l.name,description:l.description}}function Kt(l){return l.includes("*")}function Xt(l){const e=P.c(27),{patterns:s,onAddPattern:o,onRemovePattern:n}=l,[i,r]=S.useState("");let c;e[0]!==i||e[1]!==o||e[2]!==s?(c=()=>{const u=i.trim();u&&!s.includes(u)&&(o(u),r(""))},e[0]=i,e[1]=o,e[2]=s,e[3]=c):c=e[3];const m=c;let a;e[4]!==m?(a=u=>{u.key==="Enter"&&(u.preventDefault(),m())},e[4]=m,e[5]=a):a=e[5];const d=a;let f;if(e[6]!==m||e[7]!==d||e[8]!==i||e[9]!==n||e[10]!==s){const u=s.filter(Kt);let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("code",{children:"*"}),e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",x," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=p):p=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=w=>r(w.target.value),e[14]=g):g=e[14];let v;e[15]!==d||e[16]!==i?(v=t.jsx(Ae,{value:i,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=i,e[17]=v):v=e[17];let b;e[18]!==i?(b=i.trim(),e[18]=i,e[19]=b):b=e[19];const y=!b;let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ut,{size:16}),e[20]=C):C=e[20];let j;e[21]!==m||e[22]!==y?(j=t.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:y,children:C}),e[21]=m,e[22]=y,e[23]=j):j=e[23];let k;e[24]!==j||e[25]!==v?(k=t.jsxs("div",{className:"flex gap-2",children:[v,j]}),e[24]=j,e[25]=v,e[26]=k):k=e[26],f=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,k,u.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(w=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:w}),t.jsx("button",{type:"button",onClick:()=>n(w),className:"text-muted-foreground hover:text-foreground",children:t.jsx(ft,{size:12})})]},w))})]}),e[6]=m,e[7]=d,e[8]=i,e[9]=n,e[10]=s,e[11]=f}else f=e[11];return f}function es(l){const e=P.c(24),{resourceSet:s,onResourceSetChange:o,connectionResources:n,excludeVirtualMcpId:i}=l,[r]=S.useState(null);let c;e[0]!==n?(c=j=>(n.get(j.id)??[]).map(ts),e[0]=n,e[1]=c):c=e[1];const m=c;let a;e[2]!==o||e[3]!==s?(a=(j,k)=>{const w=s[j]??[];w.includes(k)||o({...s,[j]:[...w,k]})},e[2]=o,e[3]=s,e[4]=a):a=e[4];const d=a;let f;e[5]!==o||e[6]!==s?(f=(j,k)=>{const $=(s[j]??[]).filter(T=>T!==k);if($.length===0){const T={...s};delete T[j],o(T)}else o({...s,[j]:$})},e[5]=o,e[6]=s,e[7]=f):f=e[7];const u=f;let x;e[8]!==o?(x=j=>{o(j)},e[8]=o,e[9]=x):x=e[9];const p=x;let g;e[10]!==s||e[11]!==r?(g=r?s[r]??[]:[],e[10]=s,e[11]=r,e[12]=g):g=e[12];const v=g;let b;e[13]!==d||e[14]!==u||e[15]!==r||e[16]!==v?(b=r?t.jsx(Xt,{patterns:v,onAddPattern:j=>d(r,j),onRemovePattern:j=>u(r,j)}):null,e[13]=d,e[14]=u,e[15]=r,e[16]=v,e[17]=b):b=e[17];const y=b;let C;return e[18]!==i||e[19]!==y||e[20]!==m||e[21]!==p||e[22]!==s?(C=t.jsx("div",{className:"h-full",children:t.jsx(et,{itemSet:s,onItemSetChange:p,getItems:m,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:y,excludeVirtualMcpId:i})}),e[18]=i,e[19]=y,e[20]=m,e[21]=p,e[22]=s,e[23]=C):C=e[23],C}function ts(l){return{id:l.uri,name:l.name||l.uri,description:l.description||l.uri}}function ss(l){const e=P.c(8);let s,o;e[0]!==l?({className:s,...o}=l,e[0]=l,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=Y("grid gap-3",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==o||e[6]!==n?(i=t.jsx(Mt,{"data-slot":"radio-group",className:n,...o}),e[5]=o,e[6]=n,e[7]=i):i=e[7],i}function Pe(l){const e=P.c(9);let s,o;e[0]!==l?({className:s,...o}=l,e[0]=l,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=Y("border-input text-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 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=n):n=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Tt,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Je,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=i):i=e[5];let r;return e[6]!==o||e[7]!==n?(r=t.jsx(It,{"data-slot":"radio-group-item",className:n,...o,children:i}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r}function ls(l){const s=new TextEncoder().encode(l),o=Array.from(s,n=>String.fromCharCode(n)).join("");return btoa(o)}const os=Ht.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0}).extend({title:_().min(1,"Name is required").max(255)});function Le(l,e){const s={};for(const o of l.connections)if(o.selected_tools===null){const n=e.get(o.connection_id)??[];n.length>0&&(s[o.connection_id]=n)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function Oe(l){const e={};for(const s of l.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 Ue(l){const e={};for(const s of l.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 ns(l,e,s,o){const n=new Set([...Object.keys(l),...Object.keys(e),...Object.keys(s)]);return Array.from(n).map(i=>{const r=l[i]??[],c=o.get(i)??[],m=c.length>0&&c.every(a=>r.includes(a));return{connection_id:i,selected_tools:r.length===0||m?null:r,selected_resources:e[i]??null,selected_prompts:s[i]??null}})}function is(l){const e=P.c(10),{url:s}=l,[o,n]=S.useState(!1);let i;e[0]!==s?(i=async()=>{await navigator.clipboard.writeText(s),n(!0),Re.success("Agent URL copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=i):i=e[1];const r=i;let c;e[2]!==o?(c=o?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx(Lt,{size:20}),e[2]=o,e[3]=c):c=e[3];const m=o?"Copied!":"Copy URL";let a;e[4]!==m?(a=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=a):a=e[5];let d;return e[6]!==r||e[7]!==c||e[8]!==a?(d=t.jsxs(H,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,a]}),e[6]=r,e[7]=c,e[8]=a,e[9]=d):d=e[9],d}function rs(l){const e=P.c(7),{url:s,serverName:o}=l;let n;e[0]!==o||e[1]!==s?(n=()=>{const a=qe(o),f=ls(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),u=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(a)}&config=${encodeURIComponent(f)}`;window.open(u,"_blank"),Re.success("Opening Cursor...")},e[0]=o,e[1]=s,e[2]=n):n=e[2];const i=n;let r,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),c=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=r,e[4]=c):(r=e[3],c=e[4]);let m;return e[5]!==i?(m=t.jsxs(H,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[r,c]}),e[5]=i,e[6]=m):m=e[6],m}function cs(l){const e=P.c(11),{url:s,serverName:o}=l,[n,i]=S.useState(!1);let r;e[0]!==o||e[1]!==s?(r=async()=>{const u=qe(o),p=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${u}" --config '${p.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),i(!0),Re.success("Claude Code command copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=o,e[1]=s,e[2]=r):r=e[2];const c=r;let m;e[3]!==n?(m=n?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=n,e[4]=m):m=e[4];const a=n?"Copied!":"Install on Claude";let d;e[5]!==a?(d=t.jsx("span",{className:"text-xs font-medium",children:a}),e[5]=a,e[6]=d):d=e[6];let f;return e[7]!==c||e[8]!==m||e[9]!==d?(f=t.jsxs(H,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=c,e[8]=m,e[9]=d,e[10]=f):f=e[10],f}function as(l){const e=P.c(40),{open:s,onOpenChange:o,virtualMcp:n}=l,[i,r]=S.useState("code_execution");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=N=>{(N==="passthrough"||N==="smart_tool_selection"||N==="code_execution")&&r(N)},e[0]=c):c=e[0];const m=c;let a;e[1]!==i||e[2]!==n.id?(a=new URL(`/mcp/virtual-mcp/${n.id}`,window.location.origin),a.searchParams.set("mode",i),e[1]=i,e[2]=n.id,e[3]=a):a=e[3];let d;e[4]!==n.id||e[5]!==n.title?(d=n.title||`agent-${n.id.slice(0,8)}`,e[4]=n.id,e[5]=n.title,e[6]=d):d=e[6];const f=d;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ct,{children:t.jsx(Nt,{children:"Share Agent"})}),e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ye,{className:"size-5 text-muted-foreground"})}),e[9]=p):p=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(K,{asChild:!0,children:t.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),e[11]=v):v=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[p,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(J,{children:t.jsxs(Q,{children:[v,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Pe,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=b):b=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Qe,{className:"size-5 text-muted-foreground"})}),e[13]=y):y=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=C):C=e[14];let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(K,{asChild:!0,children:t.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),e[15]=j):j=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[y,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[C,t.jsx(J,{children:t.jsxs(Q,{children:[j,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Pe,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=k):k=e[16];let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Dt,{className:"size-5 text-muted-foreground"})}),e[17]=w):w=e[17];let $;e[18]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=$):$=e[18];let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(K,{asChild:!0,children:t.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),e[19]=T):T=e[19];let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[w,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[$,t.jsx(J,{children:t.jsxs(Q,{children:[T,t.jsx(X,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Pe,{id:"mode-code",value:"code_execution"}),t.jsx(Ge,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=I):I=e[20];let A;e[21]!==i?(A=t.jsxs("div",{className:"flex flex-col gap-3",children:[x,t.jsxs(ss,{value:i,onValueChange:m,className:"flex flex-col gap-4.5",children:[b,k,I]})]}),e[21]=i,e[22]=A):A=e[22];let B;e[23]!==a.href?(B=t.jsx(is,{url:a.href}),e[23]=a.href,e[24]=B):B=e[24];let R,V;e[25]!==f||e[26]!==a.href?(R=t.jsx(rs,{url:a.href,serverName:f}),V=t.jsx(cs,{url:a.href,serverName:f}),e[25]=f,e[26]=a.href,e[27]=R,e[28]=V):(R=e[27],V=e[28]);let L;e[29]!==B||e[30]!==R||e[31]!==V?(L=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[B,R,V]})}),e[29]=B,e[30]=R,e[31]=V,e[32]=L):L=e[32];let z;e[33]!==A||e[34]!==L?(z=t.jsxs(_t,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[u,t.jsxs("div",{className:"flex flex-col gap-6",children:[A,L]})]}),e[33]=A,e[34]=L,e[35]=z):z=e[35];let h;return e[36]!==o||e[37]!==s||e[38]!==z?(h=t.jsx(yt,{open:s,onOpenChange:o,children:z}),e[36]=o,e[37]=s,e[38]=z,e[39]=h):h=e[39],h}function ds(l){const e=P.c(31),{form:s,icon:o,virtualMcpId:n}=l,[i,r]=St(n);let c;e[0]!==s?(c=s.watch("title")||"Agent",e[0]=s,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(bt,{}),e[2]=m):m=e[2];let a;e[3]!==o||e[4]!==c?(a=t.jsx(ze,{icon:o,name:c,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=o,e[4]=c,e[5]=a):a=e[5];let d;e[6]!==s.control?(d=t.jsx(ve,{control:s.control,name:"status",render:hs}),e[6]=s.control,e[7]=d):d=e[7];let f;e[8]!==a||e[9]!==d?(f=t.jsxs("div",{className:"flex items-start justify-between",children:[a,d]}),e[8]=a,e[9]=d,e[10]=f):f=e[10];let u;e[11]!==s.control?(u=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ve,{control:s.control,name:"title",render:fs}),t.jsx(ve,{control:s.control,name:"description",render:us})]}),e[11]=s.control,e[12]=u):u=e[12];let x;e[13]!==f||e[14]!==u?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[f,u]}),e[13]=f,e[14]=u,e[15]=x):x=e[15];let p;e[16]!==s.control?(p=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(ve,{control:s.control,name:"tool_selection_mode",render:ms})}),e[16]=s.control,e[17]=p):p=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=g):g=e[18];let v;e[19]!==r?(v=j=>r(j.target.value),e[19]=r,e[20]=v):v=e[20];let b;e[21]!==i||e[22]!==v?(b=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[g,t.jsx(Et,{value:i,onChange:v,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=i,e[22]=v,e[23]=b):b=e[23];let y;e[24]!==b||e[25]!==x||e[26]!==p?(y=t.jsxs("div",{className:"flex flex-col",children:[x,p,b]}),e[24]=b,e[25]=x,e[26]=p,e[27]=y):y=e[27];let C;return e[28]!==s||e[29]!==y?(C=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(wt,{...s,children:y})}),e[28]=s,e[29]=y,e[30]=C):C=e[30],C}function ms(l){const{field:e}=l;return t.jsxs(Ne,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(kt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(J,{children:t.jsxs(Q,{children:[t.jsx(K,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(Se,{size:14,className:"text-muted-foreground"})})}),t.jsx(X,{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($t,{value:e.value,onValueChange:e.onChange,children:[t.jsx(_e,{children:t.jsx(Rt,{className:"w-[180px]",children:t.jsx(zt,{})})}),t.jsxs(At,{children:[t.jsx(De,{value:"inclusion",children:"Include Selected"}),t.jsx(De,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(ye,{})]})}function us(l){const{field:e}=l;return t.jsxs(Ne,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx(Ae,{...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(ye,{})]})}function fs(l){const{field:e}=l;return t.jsxs(Ne,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx(Ae,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Agent Name"})}),t.jsx(ye,{})]})}function hs(l){const{field:e}=l;return t.jsxs(Ne,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ge,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(_e,{children:t.jsx(Vt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(ye,{})]})}function xs(l){const e=P.c(81),{virtualMcp:s,virtualMcpId:o,requestedTabId:n}=l,r=ot().location.href,c=nt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/agents/$agentId"},e[0]=m):m=e[0];const a=Be(m),d=gt();let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f={},e[1]=f):f=e[1];const u=He(f);let x;e[2]!==u?(x=u.map(gs),e[2]=u,e[3]=x):x=e[3];const p=x,{promptsMap:g}=jt(p),{resourcesMap:v}=vt(p);let b;if(e[4]!==u){b=new Map;for(const M of u)M.tools&&M.tools.length>0&&b.set(M.id,M.tools.map(ps));e[4]=u,e[5]=b}else b=e[5];let y;e[6]!==b||e[7]!==s?(y=()=>Le(s,b),e[6]=b,e[7]=s,e[8]=y):y=e[8];const[C,j]=S.useState(y);let k;e[9]!==s?(k=()=>Oe(s),e[9]=s,e[10]=k):k=e[10];const[w,$]=S.useState(k);let T;e[11]!==s?(T=()=>Ue(s),e[11]=s,e[12]=T):T=e[12];const[I,A]=S.useState(T),[B,R]=S.useState(!1),[V,L]=S.useState(!1);let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=M=>{j(M),R(!0)},e[13]=z):z=e[13];const h=z;let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=M=>{$(M),R(!0)},e[14]=N):N=e[14];const F=N;let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O=M=>{A(M),R(!0)},e[15]=O):O=e[15];const q=O;let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=it(os),e[16]=G):G=e[16];const Z=s.tool_selection_mode??"inclusion";let W;e[17]!==Z||e[18]!==s.description||e[19]!==s.status||e[20]!==s.title?(W={resolver:G,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:Z}},e[17]=Z,e[18]=s.description,e[19]=s.status,e[20]=s.title,e[21]=W):W=e[21];const U=rt(W),we=U.formState.isDirty||B;let me;e[22]!==d.update||e[23]!==b||e[24]!==U||e[25]!==I||e[26]!==w||e[27]!==C||e[28]!==o?(me=async()=>{try{const M=U.getValues(),je=ns(C,w,I,b),tt={title:M.title,description:M.description,status:M.status,tool_selection_mode:M.tool_selection_mode,connections:je};await d.update.mutateAsync({id:o,data:tt}),U.reset(M),R(!1)}catch(M){console.error("Failed to save virtual MCP:",M)}},e[22]=d.update,e[23]=b,e[24]=U,e[25]=I,e[26]=w,e[27]=C,e[28]=o,e[29]=me):me=e[29];const ke=me;let ue;e[30]!==b||e[31]!==U||e[32]!==s?(ue=()=>{U.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion"}),j(Le(s,b)),$(Oe(s)),A(Ue(s)),R(!1)},e[30]=b,e[31]=U,e[32]=s,e[33]=ue):ue=e[33];const Ie=ue;let fe;e[34]===Symbol.for("react.memo_cache_sentinel")?(fe=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[34]=fe):fe=e[34];const Ee=fe,E=Ee.some(M=>M.id===n)?n:"settings";let he;e[35]!==a?(he=M=>{a({search:je=>({...je,tab:M}),replace:!0})},e[35]=a,e[36]=he):he=e[36];const Me=he,de=d.update.isPending;let ee;e[37]!==c.history?(ee=()=>c.history.back(),e[37]=c.history,e[38]=ee):ee=e[38];let te;e[39]!==E||e[40]!==Me?(te=t.jsx(Ut,{children:t.jsx(Pt,{tabs:Ee,activeTab:E,onTabChange:Me})}),e[39]=E,e[40]=Me,e[41]=te):te=e[41];let se;e[42]!==Ie||e[43]!==ke||e[44]!==we||e[45]!==de?(se=we&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsxs(Q,{delayDuration:0,children:[t.jsx(K,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:de,onClick:Ie,"aria-label":"Cancel",children:t.jsx(Ot,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Cancel"})]})}),t.jsx(J,{children:t.jsxs(Q,{delayDuration:0,children:[t.jsx(K,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:de,onClick:ke,"aria-label":"Save",children:de?t.jsx($e,{size:14,className:"animate-spin"}):t.jsx(Ke,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Save"})]})})]}),e[42]=Ie,e[43]=ke,e[44]=we,e[45]=de,e[46]=se):se=e[46];let xe;e[47]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>L(!0),e[47]=xe):xe=e[47];let pe;e[48]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(J,{children:t.jsxs(Q,{delayDuration:0,children:[t.jsx(K,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:xe,"aria-label":"Share",children:t.jsx(Xe,{size:14})})})}),t.jsx(X,{side:"bottom",children:"Share"})]})}),e[48]=pe):pe=e[48];const Te=s.icon??"cpu_chip";let le;e[49]!==Te||e[50]!==r||e[51]!==s.title?(le=t.jsx(ht,{title:s.title,url:r,icon:Te}),e[49]=Te,e[50]=r,e[51]=s.title,e[52]=le):le=e[52];let oe;e[53]!==se||e[54]!==le?(oe=t.jsxs(Bt,{children:[se,pe,le]}),e[53]=se,e[54]=le,e[55]=oe):oe=e[55];let ge;e[56]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),e[56]=ge):ge=e[56];let ne;e[57]!==E||e[58]!==g||e[59]!==v||e[60]!==U||e[61]!==I||e[62]!==w||e[63]!==C||e[64]!==s.icon||e[65]!==o?(ne=E==="settings"?t.jsx(ds,{form:U,icon:s.icon,virtualMcpId:o}):E==="tools"?t.jsx(xt,{toolSet:C,onToolSetChange:h,excludeVirtualMcpId:o}):E==="resources"?t.jsx(es,{resourceSet:w,onResourceSetChange:F,connectionResources:v,excludeVirtualMcpId:o}):E==="prompts"?t.jsx(Jt,{promptSet:I,onPromptSetChange:q,connectionPrompts:g,excludeVirtualMcpId:o}):null,e[57]=E,e[58]=g,e[59]=v,e[60]=U,e[61]=I,e[62]=w,e[63]=C,e[64]=s.icon,e[65]=o,e[66]=ne):ne=e[66];let ie;e[67]!==ne?(ie=t.jsx(S.Suspense,{fallback:ge,children:ne}),e[67]=ne,e[68]=ie):ie=e[68];let re;e[69]!==E||e[70]!==ie?(re=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(Fe,{children:ie},E)})})}),e[69]=E,e[70]=ie,e[71]=re):re=e[71];let ce;e[72]!==V||e[73]!==s?(ce=t.jsx(as,{open:V,onOpenChange:L,virtualMcp:s}),e[72]=V,e[73]=s,e[74]=ce):ce=e[74];let be;return e[75]!==ee||e[76]!==te||e[77]!==oe||e[78]!==re||e[79]!==ce?(be=t.jsxs(Ft,{onBack:ee,children:[te,oe,re,ce]}),e[75]=ee,e[76]=te,e[77]=oe,e[78]=re,e[79]=ce,e[80]=be):be=e[80],be}function ps(l){return l.name}function gs(l){return l.id}function bs(){const l=P.c(10);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/agents/$agentId"},l[0]=e):e=l[0];const s=Be(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},l[1]=o):o=l[1];const n=st(o),{org:i}=n,r=n.agentId??n.virtualMcpId??"";let c;l[2]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},l[2]=c):c=l[2];const a=lt(c).tab||"settings",d=pt(r);if(!d){let u;return l[3]!==s||l[4]!==i?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ct,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>s({to:"/$org/agents",params:{org:i}}),children:"Back to agents"})})}),l[3]=s,l[4]=i,l[5]=u):u=l[5],u}let f;return l[6]!==a||l[7]!==d||l[8]!==r?(f=t.jsx(xs,{virtualMcp:d,virtualMcpId:r,requestedTabId:a}),l[6]=a,l[7]=d,l[8]=r,l[9]=f):f=l[9],f}function js(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Fe,{children:t.jsx(S.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(bs,{})})}),l[0]=e):e=l[0],e}function dl(){const l=P.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(js,{}),l[0]=e):e=l[0],e}export{dl as default};
@@ -1 +0,0 @@
1
- import{c as ee,j as t,r as te,f as oe}from"./index-B9c3bNyk.js";import{C as ne}from"./collection-header-ebtrK-4-.js";import{C as re}from"./collection-page-BhBrRtz8.js";import{C as ie}from"./collection-search-BHs67_UI.js";import{C as ae}from"./collection-table-wrapper-3bPS8SS1.js";import{C as le}from"./connection-card-CEKO3io8.js";import{E as q,I as ce}from"./empty-state-CSTjcp0X.js";import{E as de}from"./error-boundary-DP1kX1Iw.js";import{u as me,a as ue,i as x}from"./use-virtual-mcp-CMArCljo.js";import{u as ge,s as J}from"./use-list-state-Ck_kabtn.js";import{u as pe}from"./use-create-virtual-mcp-B5oK5D73.js";import{u as he}from"./project-context-provider-DJGvA4-w.js";import{c as fe,b as xe,d as je,A as Ce,e as we,g as Ne,a as ye,f as De}from"./alert-dialog-D9F5tffK.js";import{B as se}from"./badge-Bv6QbUSE.js";import{B as G}from"./button-Ta3HWdYR.js";import{b as Q,D as U,a as X,c as V}from"./dropdown-menu-BbIA2rWH.js";import{i as Y}from"./DotsVertical-BIgdSuWw.js";import{i as Se}from"./Loading01-DlgJ1_45.js";import{s as Z}from"./Trash01-DjLKhTdL.js";import"./collection-display-button-CQf7wSjn.js";import"./ArrowUp-C39Etgym.js";import"./Check-qyrf_w7u.js";import"./Grid01-DS_Rpsaf.js";import"./List-CMJ7wwXL.js";import"./tooltip-Bb2oNaYJ.js";import"./view-mode-toggle-C6P0fGVR.js";import"./SearchMd--bzHJ7AO.js";import"./input-Dh7sDwu6.js";import"./card-CRtF9cdr.js";import"./useMutation-BYfWAlPb.js";import"./connection-C0f0eQA8.js";import"./use-collections-BnNAdJQg.js";import"./use-mobile-Bb5jBMYm.js";function be(e,n){switch(n.type){case"delete":return{mode:"deleting",virtualMcp:n.virtualMcp};case"close":return{mode:"idle"}}}function ve(){const e=ee.c(63),{org:n}=he(),i=oe();let j;e[0]!==n.slug?(j={namespace:n.slug,resource:"agents"},e[0]=n.slug,e[1]=j):j=e[1];const s=ge(j),f=me(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createVirtualMCP:O,isCreating:w}=pe(C),B=ue();let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N={mode:"idle"},e[3]=N):N=e[3];const[r,y]=te.useReducer(be,N);let D;e[4]!==B||e[5]!==r.mode||e[6]!==r.virtualMcp?(D=async()=>{if(r.mode!=="deleting")return;const o=r.virtualMcp.id;y({type:"close"});try{await B.delete.mutateAsync(o)}catch{}},e[4]=B,e[5]=r.mode,e[6]=r.virtualMcp,e[7]=D):D=e[7];const R=D;let S,b,v,k,A,_;e[8]===Symbol.for("react.memo_cache_sentinel")?(S={id:"icon",header:"",render:Ke,cellClassName:"w-16 shrink-0",wrap:!0},b={id:"title",header:"Name",render:Ee,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},v={id:"description",header:"Description",render:Pe,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"mode",header:"Mode",accessor:$e,cellClassName:"w-[100px]"},A={id:"connections",header:"Connections",render:Me,cellClassName:"w-24 shrink-0"},_={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=b,e[10]=v,e[11]=k,e[12]=A,e[13]=_):(S=e[8],b=e[9],v=e[10],k=e[11],A=e[12],_=e[13]);let I;e[14]!==i||e[15]!==n.slug?(I=[S,b,v,k,A,_,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:_e,children:[t.jsxs(V,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:n.slug,agentId:o.id}})},children:[t.jsx(J,{size:16}),"Open"]}),t.jsxs(V,{variant:"destructive",onClick:a=>{a.stopPropagation(),y({type:"delete",virtualMcp:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[14]=i,e[15]=n.slug,e[16]=I):I=e[16];const T=I,H=w?"Creating...":"Create Agent";let z;e[17]!==O||e[18]!==w||e[19]!==H?(z=t.jsx(G,{onClick:O,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:H}),e[17]=O,e[18]=w,e[19]=H,e[20]=z):z=e[20];const L=z,F=r.mode==="deleting";let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=o=>!o&&y({type:"close"}),e[21]=M):M=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(fe,{children:"Delete Agent?"}),e[22]=$):$=e[22];const W=r.mode==="deleting"&&r.virtualMcp.title;let l;e[23]!==W?(l=t.jsxs(xe,{children:[$,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[23]=W,e[24]=l):l=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Ce,{children:"Cancel"}),e[25]=P):P=e[25];let c;e[26]!==R?(c=t.jsxs(we,{children:[P,t.jsx(Ne,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[26]=R,e[27]=c):c=e[27];let d;e[28]!==l||e[29]!==c?(d=t.jsxs(ye,{children:[l,c]}),e[28]=l,e[29]=c,e[30]=d):d=e[30];let m;e[31]!==F||e[32]!==d?(m=t.jsx(De,{open:F,onOpenChange:M,children:d}),e[31]=F,e[32]=d,e[33]=m):m=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=E):E=e[34];let u;e[35]!==L||e[36]!==s.handleSort||e[37]!==s.setViewMode||e[38]!==s.sortDirection||e[39]!==s.sortKey||e[40]!==s.viewMode?(u=t.jsx(ne,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:E,ctaButton:L}),e[35]=L,e[36]=s.handleSort,e[37]=s.setViewMode,e[38]=s.sortDirection,e[39]=s.sortKey,e[40]=s.viewMode,e[41]=u):u=e[41];let g;e[42]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[42]=s,e[43]=g):g=e[43];let p;e[44]!==s.search||e[45]!==s.setSearch||e[46]!==g?(p=t.jsx(ie,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:g}),e[44]=s.search,e[45]=s.setSearch,e[46]=g,e[47]=p):p=e[47];let h;e[48]!==T||e[49]!==s.handleSort||e[50]!==s.search||e[51]!==s.sortDirection||e[52]!==s.sortKey||e[53]!==s.viewMode||e[54]!==i||e[55]!==n.slug||e[56]!==f?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(q,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent 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:f.map(o=>t.jsx(le,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(x,{}),onClick:()=>i({to:"/$org/agents/$agentId",params:{org:n.slug,agentId: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(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:ke,children:[t.jsxs(V,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:n.slug,agentId:o.id}})},children:[t.jsx(J,{size:16}),"Open"]}),t.jsxs(V,{variant:"destructive",onClick:a=>{a.stopPropagation(),y({type:"delete",virtualMcp:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ae,{columns:T,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/agents/$agentId",params:{org:n.slug,agentId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(q,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[48]=T,e[49]=s.handleSort,e[50]=s.search,e[51]=s.sortDirection,e[52]=s.sortKey,e[53]=s.viewMode,e[54]=i,e[55]=n.slug,e[56]=f,e[57]=h):h=e[57];let K;return e[58]!==m||e[59]!==u||e[60]!==p||e[61]!==h?(K=t.jsxs(re,{children:[m,u,p,h]}),e[58]=m,e[59]=u,e[60]=p,e[61]=h,e[62]=K):K=e[62],K}function ke(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function ze(e){return t.jsx(se,{variant:e.status==="active"?"default":"outline",children:e.status})}function Me(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function $e(e){return t.jsx(se,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Pe(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ee(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function ft(){const e=ee.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(de,{children:t.jsx(te.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{})})}),e[0]=n):n=e[0],n}export{ft as default};
@@ -1 +0,0 @@
1
- import{ax as g,W as u,c as l,j as v,h as b,i as p}from"./index-B9c3bNyk.js";function x(...a){return g(u(a))}const h=p("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 k(a){const e=l.c(14);let t,r,s,o,i;e[0]!==a?({className:t,variant:i,size:s,asChild:o,...r}=a,e[0]=a,e[1]=t,e[2]=r,e[3]=s,e[4]=o,e[5]=i):(t=e[1],r=e[2],s=e[3],o=e[4],i=e[5]);const c=(o===void 0?!1:o)?b:"button";let n;e[6]!==t||e[7]!==s||e[8]!==i?(n=x(h({variant:i,size:s,className:t})),e[6]=t,e[7]=s,e[8]=i,e[9]=n):n=e[9];let d;return e[10]!==c||e[11]!==r||e[12]!==n?(d=v.jsx(c,{"data-slot":"button",className:n,...r}),e[10]=c,e[11]=r,e[12]=n,e[13]=d):d=e[13],d}export{k as B,h as b,x as c};
@@ -1 +0,0 @@
1
- import{c as d,j as c,ay as n,az as l}from"./index-B9c3bNyk.js";import{i as m}from"./Check-qyrf_w7u.js";import{c as b}from"./button-Ta3HWdYR.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,26 +0,0 @@
1
- import{ae as X,r as C,y as ns,z as Ze,c as N,j as o,k as at,E as ss,i as os,d as ne,b as rs,t as Zt,H as U,F as is,af as ls,a3 as dt,a6 as Q,a5 as Yt,ag as cs,a8 as ut,ah as as,ai as Qt,a1 as en,aj as ds,ak as us,a4 as tn,al as fs,am as ft,an as ms,ao as ps,ap as xs,a2 as hs,aq as gs,ad as nn}from"./index-B9c3bNyk.js";import{U as le,c as Z}from"./connection-C0f0eQA8.js";import{E as sn,I as ze,n as bs}from"./empty-state-CSTjcp0X.js";import{E as on}from"./error-boundary-DP1kX1Iw.js";import{u as mt,a as pt}from"./use-collections-BnNAdJQg.js";import{P as xt}from"./pin-to-sidebar-button-B85FzaKS.js";import{B,c as O}from"./button-Ta3HWdYR.js";import{F as Ye,a as js,b as ht,d as gt}from"./form-HErbLCwX.js";import{I as bt}from"./input-Dh7sDwu6.js";import{T as rt}from"./textarea-BIhbkxfH.js";import{b as se,T as oe,a as re,c as ie}from"./tooltip-Bb2oNaYJ.js";import{i as rn}from"./FlipBackward-CXUecZqc.js";import{a as ln,V as jt,b as ve}from"./layout-CMBAL9_n.js";import{b as vt,u as vs}from"./use-connection-Cpo9FQLA.js";import{i as ws}from"./AlertCircle-CNlbeaNO.js";import{s as ys,M as we}from"./monaco-editor-9ao1STYz.js";import{i as Ss}from"./Code01-B-sXoUAx.js";import{a as Ns}from"./Copy01-EV4WWtW9.js";import{i as _e}from"./Loading01-DlgJ1_45.js";import{i as wt,n as ks}from"./Play-By6elSLp.js";import{s as yt}from"./XClose-CnH5yMqw.js";import{u as Cs,O as Is,M as _s,F as Ts,v as $s}from"./index-DE0l5h4l.js";import{u as St}from"./use-mcp-C4SOdL_A.js";import{E as Nt}from"./empty-state-CUODA5WM.js";import{D as Es,b as Os}from"./use-binding-C-jiWM_O.js";import{u as Rs}from"./use-virtual-mcp-CMArCljo.js";import{b as As,R as Wt,a as Ps}from"./resizable-CXrT3-gZ.js";import{c as Ms,N as Ls,d as zs,e as Ds,f as Ws,m as Oe,P as Hs,g as Vs,R as Fs,h as Us,j as Bs,k as Ht,E as qs,l as Ks,n as Js,o as Gs,T as Xs,p as cn}from"./index-SYlc-1Tl.js";import{d as Zs,b as Ys,a as Qs,c as eo,S as to}from"./select-DEFdCmMs.js";import{S as De}from"./spinner-CO1NH93o.js";import{V as no}from"./view-mode-toggle-C6P0fGVR.js";import{i as so}from"./GitBranch01-C7TElKX3.js";import{a as kt,b as Ct}from"./use-tool-call-CDQ4ked9.js";import"./project-context-provider-DJGvA4-w.js";import{a as oo,D as ro,g as io,f as lo,c as co,d as ao}from"./dialog-DU-St4qJ.js";import"./index-D0C0gp7N.js";import{s as an}from"./Plus-DtbgAjWY.js";import{i as It}from"./Check-qyrf_w7u.js";import{i as uo}from"./DotsHorizontal-BLQeuj18.js";import{b as fo,D as mo,a as po,c as Vt}from"./dropdown-menu-BbIA2rWH.js";import{i as xo}from"./Grid01-DS_Rpsaf.js";import{B as je}from"./badge-Bv6QbUSE.js";import{i as dn}from"./X-C24Yv1HS.js";import"./useMutation-BYfWAlPb.js";import"./use-organization-settings-BksJ8-FR.js";import"./ArrowLeft-H58XLYPH.js";import"./infiniteQueryObserver-DTO2dBsV.js";import"./mcp-oauth-Bb9RwQ7y.js";import"./schema-rISYOzpk.js";import"./env-vars-editor-D9YuRsdO.js";import"./Trash01-DjLKhTdL.js";import"./File06-BOUeu2_s.js";import"./Key01-BH9DhJ8d.js";import"./extract-connection-data-D7M4EXYt.js";import"./constants-7IT_izqz.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BKwhzouz.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-BVYBaOBz.js";import"./index-DMxjLEp2.js";import"./useQuery-CqMcSUvK.js";import"./binder-Co4G2PF6.js";import"./use-virtual-mcp-system-prompt-CeE5LXb5.js";import"./localstorage-keys-DJR10CLV.js";import"./popover-nSqfHOuL.js";import"./Image01-C1Gj64FS.js";import"./SearchMd--bzHJ7AO.js";import"./use-create-virtual-mcp-B5oK5D73.js";import"./ArrowUp-C39Etgym.js";import"./ChevronDown-D4EQGXFb.js";import"./Edit01-YiEPkU0g.js";import"./well-known-mcp-DOEdYmKO.js";const un=X("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const fn=X("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const _t=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Tt=X("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const ho=X("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const go=X("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const mn=X("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const pn=X("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const xn=X("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const hn=X("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const gn=X("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),$t=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));$t.displayName="AlertOctagon";const bn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));bn.displayName="Box";const jn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));jn.displayName="ClockFastForward";const vn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));vn.displayName="Code02";const Re=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Re.displayName="Columns01";const wn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));wn.displayName="CornerDownRight";const yn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));yn.displayName="Database01";const Sn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Sn.displayName="Repeat03";const Et=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-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"}));Et.displayName="Save02";const Nn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Nn.displayName="Tool01";ns({title:Ze().min(1),description:Ze().nullable(),body:Ze()});function Qe(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function bo(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function jo(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(Ye,{control:n.control,name:"title",render:yo}),o.jsx(Ye,{control:n.control,name:"description",render:wo})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(Ye,{control:n.control,name:"body",render:vo})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(js,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function vo(t){const{field:e}=t;return o.jsx(ht,{children:o.jsx(gt,{children:o.jsx(rt,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function wo(t){const{field:e}=t;return o.jsxs(ht,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(gt,{children:o.jsx(bt,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function yo(t){const{field:e}=t;return o.jsxs(ht,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(gt,{children:o.jsx(bt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function So(t){const e=N.c(51),{providerId:n,promptId:s,onBack:i}=t,l=at().location.href,c=n||le;let a;e[0]!==c?(a=Z(c),e[0]=c,e[1]=a):a=e[1];const d=a,u=mt(n,"PROMPT",s,d),f=pt(n,"PROMPT",d),p=f.update.isPending;let m;e[2]!==u?(m=u?{title:u.title,description:u.description??null,body:Qe(u)}:void 0,e[2]=u,e[3]=m):m=e[3];let x;e[4]!==m?(x={values:m},e[4]=m,e[5]=x):x=e[5];const h=ss(x);let g;e[6]!==h||e[7]!==u?(g=()=>{u&&h.reset({title:u.title,description:u.description??null,body:Qe(u)})},e[6]=h,e[7]=u,e[8]=g):g=e[8];const b=g;let j;e[9]!==f.update||e[10]!==h||e[11]!==s?(j=h.handleSubmit(async W=>{const G=await f.update.mutateAsync({id:s,data:{title:W.title,description:W.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:W.body}}]}});h.reset({title:G.title,description:G.description??null,body:Qe(G)})}),e[9]=f.update,e[10]=h,e[11]=s,e[12]=j):j=e[12];const v=j;if(!u){let W;return e[13]===Symbol.for("react.memo_cache_sentinel")?(W=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(sn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=W):W=e[13],W}let S;e[14]!==u.title?(S=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[14]=u.title,e[15]=S):S=e[15];let w;e[16]!==u.description?(w=u.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:u.description})]}):null,e[16]=u.description,e[17]=w):w=e[17];let y;e[18]!==S||e[19]!==w?(y=o.jsx(ln,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,w]})}),e[18]=S,e[19]=w,e[20]=y):y=e[20];let k;e[21]!==u.title||e[22]!==l?(k=o.jsx(xt,{title:u.title,url:l,icon:"description"}),e[21]=u.title,e[22]=l,e[23]=k):k=e[23];const $=!h.formState.isDirty||p;let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=o.jsx(rn,{size:14}),e[24]=_):_=e[24];let R;e[25]!==b||e[26]!==$?(R=o.jsx(se,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(B,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:$,onClick:b,"aria-label":"Cancel",children:_})})}),e[25]=b,e[26]=$,e[27]=R):R=e[27];let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(oe,{side:"bottom",children:"Cancel"}),e[28]=A):A=e[28];let P;e[29]!==R?(P=o.jsx(re,{children:o.jsxs(ie,{delayDuration:0,children:[R,A]})}),e[29]=R,e[30]=P):P=e[30];const M=!h.formState.isDirty||p;let z;e[31]!==v?(z=()=>{v()},e[31]=v,e[32]=z):z=e[32];let H;e[33]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx(Et,{size:14}),e[33]=H):H=e[33];let I;e[34]!==M||e[35]!==z?(I=o.jsx(se,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(B,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:M,onClick:z,"aria-label":"Save",children:H})})}),e[34]=M,e[35]=z,e[36]=I):I=e[36];let E;e[37]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx(oe,{side:"bottom",children:"Save"}),e[37]=E):E=e[37];let T;e[38]!==I?(T=o.jsx(re,{children:o.jsxs(ie,{delayDuration:0,children:[I,E]})}),e[38]=I,e[39]=T):T=e[39];let L;e[40]!==k||e[41]!==P||e[42]!==T?(L=o.jsxs(jt,{children:[k,P,T]}),e[40]=k,e[41]=P,e[42]=T,e[43]=L):L=e[43];let V;e[44]!==h?(V=o.jsx("div",{className:"h-full",children:o.jsx(jo,{form:h})}),e[44]=h,e[45]=V):V=e[45];let K;return e[46]!==i||e[47]!==L||e[48]!==V||e[49]!==y?(K=o.jsxs(ve,{onBack:i,children:[y,L,V]}),e[46]=i,e[47]=L,e[48]=V,e[49]=y,e[50]=K):K=e[50],K}function No(t){const e=N.c(5),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=bo()??le,e[0]=i):i=e[0];const r=i;if(!r||r===le){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(sn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let l;return e[2]!==n||e[3]!==s?(l=o.jsx(on,{children:o.jsx(C.Suspense,{fallback:null,children:o.jsx(So,{providerId:r,promptId:n,onBack:s})})}),e[2]=n,e[3]=s,e[4]=l):l=e[4],l}const ko=os("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Co(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=O(ko({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Io(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function _o(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const To=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function $o(t){const e=N.c(13),{toolName:n,connectionId:s,onBack:i}=t,r=`/mcp/${s}`;let l;e[0]!==r?(l=new URL(r,window.location.origin),e[0]=r,e[1]=l):l=e[1];const c=l;let a;e[2]!==s?(a={connectionId:s},e[2]=s,e[3]=a):a=e[3];const d=Cs(a);if(!d.isAuthenticated){let p;return e[4]!==d.supportsOAuth||e[5]!==i?(p=o.jsx("div",{className:"flex h-full items-center justify-center",children:d.supportsOAuth?o.jsx(Is,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(_s,{hasReadme:!1})}),e[4]=d.supportsOAuth,e[5]=i,e[6]=p):p=e[6],p}const u=`${s}:${n}`;let f;return e[7]!==s||e[8]!==c||e[9]!==i||e[10]!==u||e[11]!==n?(f=o.jsx(Eo,{toolName:n,connectionId:s,mcpProxyUrl:c,onBack:i},u),e[7]=s,e[8]=c,e[9]=i,e[10]=u,e[11]=n,e[12]=f):f=e[12],f}function Eo({toolName:t,connectionId:e,mcpProxyUrl:n,onBack:s}){const r=at().location.href,{replayId:l}=rs({strict:!1}),c=(()=>{if(!l)return null;const I=`replay-${l}`,E=sessionStorage.getItem(I);if(!E)return null;sessionStorage.removeItem(I);try{return JSON.parse(E)}catch{return null}})(),a=(()=>{if(!c)return null;const I={};for(const[E,T]of Object.entries(c))T!==null&&typeof T=="object"?I[E]=JSON.stringify(T,null,2):I[E]=T;return I})(),[d,u]=C.useState(a??{}),[f,p]=C.useState(c?JSON.stringify(c,null,2):"{}"),[m,x]=C.useState(null),[h,g]=C.useState(null),[b,j]=C.useState(!1),[v,S]=C.useState(null),w=vt(e),y=St({url:n.href});C.useEffect(()=>{y.error&&console.error("MCP Error:",y.error)},[y.error]);const k=y.tools?.find(I=>I.name===t),$=k?.inputSchema?.properties,_=$?Object.keys($):[],R=_.length>0,A={};if(R&&k?.inputSchema?.properties)for(const I of _)A[I]=k.inputSchema.required?.includes(I)?"":void 0;const P=I=>Object.prototype.hasOwnProperty.call(d,I),M=async()=>{j(!0),g(null),x(null),S(null);const I=performance.now(),E=Z(e);try{const T=R?{...A,...d}:(()=>{const F=f.trim();if(!F)return{};const D=JSON.parse(F);if(D&&typeof D=="object")return D;throw new Error("Raw JSON input must be an object.")})();R&&k?.inputSchema?.properties&&Object.entries(k.inputSchema.properties).forEach(([F,D])=>{if((D.type==="object"||D.type==="array")&&typeof T[F]=="string")try{T[F]=JSON.parse(T[F])}catch{}});const L=await E(t,T),V=performance.now(),K=Math.round(V-I);x(L);const W=JSON.stringify(L),G=new TextEncoder().encode(W).length;S({duration:`${K}ms`,bytes:`${G} bytes`,tokens:`~${Math.ceil(G/4)} tokens`,cost:"$0.0000"})}catch(T){const L=T instanceof Error?T.message:String(T);g(L||"Unknown error occurred");const V=performance.now();S({duration:`${Math.round(V-I)}ms`})}finally{j(!1)}},z=(I,E)=>{u(T=>({...T,[I]:E}))},H=()=>{x(null),g(null),S(null)};return o.jsxs(ve,{onBack:s,children:[o.jsx(jt,{children:o.jsx(xt,{title:k?.name??To(t),url:r,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ze,{icon:w?.icon||null,name:w?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[y.state==="ready"?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):y.state==="connecting"?o.jsx(_e,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:y.state.replace("_"," ")})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:k?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),k?.inputSchema?.required&&k.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:R&&k?.inputSchema?.properties?Object.entries(k.inputSchema.properties).map(([I,E])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,k.inputSchema?.required?.includes(I)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:E.type})]}),E.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:E.description}),E.type==="object"||E.type==="array"?o.jsx(rt,{className:"font-mono text-xs",value:P(I)?d[I]??"":A[I]??"",onChange:T=>z(I,T.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):o.jsx(bt,{value:P(I)?d[I]??"":A[I]??"",onChange:T=>z(I,T.target.value),placeholder:`Enter ${I}...`})]},I)):k?.inputSchema&&!R?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(rt,{className:"font-mono text-xs min-h-[120px]",value:f,onChange:I=>p(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),v&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ys,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(bn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(yn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]})]}),o.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:o.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[o.jsx(B,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:M,disabled:b,children:b?o.jsxs(o.Fragment,{children:[o.jsx(_e,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(wt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(re,{children:o.jsxs(ie,{children:[o.jsx(se,{asChild:!0,children:o.jsx(B,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:H,disabled:!m&&!h,children:o.jsx(yt,{size:14})})}),o.jsx(oe,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),h&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Co,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ws,{className:"h-4 w-4"}),o.jsx(Io,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(_o,{className:"text-xs text-destructive",children:h})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:m?o.jsxs(o.Fragment,{children:[o.jsx(we,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Zt.success("Copied to clipboard")},children:o.jsx(Ns,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(Ss,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Oo(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=ne(i).connectionId??le;if(!vt(l)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(C.Suspense,{fallback:a,children:o.jsx($o,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const Ft=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const p=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(m=>m(e,p))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Ot=(t=>t?Ft(t):Ft),Ro=t=>t;function it(t,e=Ro){const n=U.useSyncExternalStore(t.subscribe,U.useCallback(()=>e(t.getState()),[t,e]),U.useCallback(()=>e(t.getInitialState()),[t,e]));return U.useDebugValue(n),n}const Ao=t=>{const e=Ot(t),n=s=>it(e,s);return Object.assign(n,e),n},Po=(t=>Ao);function kn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const lt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return lt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return lt(s)(n)}}}},Mo=(t,e)=>(n,s,i)=>{let r={storage:kn(()=>localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},p=i.setState;i.setState=(g,b)=>(p(g,b),f());const m=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>m;let x;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(S=>{var w;return S((w=s())!=null?w:m)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:m))||void 0;return lt(u.getItem.bind(u))(r.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==r.version){if(r.migrate){const w=r.migrate(S.state,S.version);return w instanceof Promise?w.then(y=>[!0,y]):[!0,w]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var w;if(j!==c)return;const[y,k]=S;if(x=r.merge(k,(w=s())!=null?w:m),n(x,!0),y)return f()}).then(()=>{j===c&&(v?.(x,void 0),x=s(),l=!0,d.forEach(S=>S(x)))}).catch(S=>{j===c&&v?.(void 0,S)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),x||m},Cn=Mo,{useSyncExternalStoreWithSelector:Lo}=is,zo=t=>t;function Do(t,e=zo,n){const s=Lo(t.subscribe,t.getState,t.getInitialState,e,n);return U.useDebugValue(s),s}const Ut=t=>Symbol.iterator in t,Bt=t=>"entries"in t,qt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Wo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Ho(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Ut(t)&&Ut(e)?Bt(t)&&Bt(e)?qt(t,e):Wo(t,e):qt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Vo(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
- ${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
3
- `:""} ${d}${f}: ${n(u)};`}).join(`
4
- `)}
5
- }`}return`interface ${e} ${n(t)}`}function et(t,e){const n=t.trim();return e.some(i=>i.name.toLowerCase()===n.toLowerCase())?`${n}_${Math.random().toString(36).substring(2,6)}`:n}function Fo(t,e){const n=t.match(/interface\s+Input\s*\{/);if(!n||n.index===void 0)return`${e}
6
-
7
- ${t.trimStart()}`;const s=n.index,i=s+n[0].length-1;let r=1,l=i+1;for(;l<t.length&&r>0;)t[l]==="{"?r++:t[l]==="}"&&r--,l++;return t.slice(0,s)+e+t.slice(l)}function tt(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...Es,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const In=C.createContext(null),Uo=t=>Ot()(Cn(e=>({...t,actions:{setIsAddingStep:n=>e(s=>({...s,isAddingStep:n})),setCurrentStepTab:n=>e(s=>({...s,currentStepTab:n})),setToolAction:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.map(i=>"toolName"in i.action&&i.action.toolName===n.toolName?{...i,action:n}:i)}})),appendStep:({step:n,type:s})=>e(i=>{const r=n??tt(s,i.workflow.steps.length),l=i.workflow.steps.find(a=>a.name===r.name),c=l?`${r.name} ${parseInt(l.name.split(" ").pop()??Math.random().toString(36).substring(2,15))+1}`:r.name;return{workflow:{...i.workflow,steps:[...i.workflow.steps,{...r,name:c}]}}}),deleteStep:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.filter(i=>i.name!==n)}})),duplicateStep:n=>e(s=>{const i=s.workflow.steps.findIndex(a=>a.name===n);if(i===-1)return s;const r=s.workflow.steps[i];if(!r)return s;const l={...r,name:et(r.name,s.workflow.steps)},c=[...s.workflow.steps];return c.splice(i+1,0,l),{workflow:{...s.workflow,steps:c},currentStepName:l.name}}),setCurrentStepName:n=>e(s=>({...s,currentStepName:n})),updateStep:(n,s)=>e(i=>({...i,workflow:{...i.workflow,steps:i.workflow.steps.map(r=>r.name===n?{...r,...s}:r)}})),setTrackingExecutionId:n=>e(s=>({...s,trackingExecutionId:n})),resetToOriginalWorkflow:()=>e(n=>({...n,workflow:n.localWorkflow})),startAddingStep:n=>e(s=>({...s,isAddingStep:!0,addingStepType:n})),cancelAddingStep:()=>e(n=>({...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[]})),toggleParentStepSelection:n=>e(s=>{const i=s.selectedParentSteps.includes(n);return{...s,selectedParentSteps:i?s.selectedParentSteps.filter(r=>r!==n):[...s.selectedParentSteps,n]}}),confirmAddCodeStep:()=>e(n=>{const{selectedParentSteps:s,addingStepType:i,workflow:r}=n;if(i!=="code"||s.length===0)return n;const l={};for(const f of s)l[f]=`@${f}`;const c={};for(const f of s){const p=r.steps.find(m=>m.name===f);p?.outputSchema&&(c[f]=p.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=tt("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=Vo(a,"Input"),p=d.action,m=Fo(p.code,f);d={...d,action:{...p,code:m}}}const u=et(d.name,r.steps);return{...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...r,steps:[...r.steps,{...d,name:u}]},currentStepName:u}}),addToolStep:()=>e(n=>{let s=tt("tool",Number((Math.random()*1e6).toFixed(0)));const i=et(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),setOriginalWorkflow:n=>e(s=>({...s,localWorkflow:n})),setWorkflow:n=>e(s=>({...s,workflow:n})),startReplacingTool:n=>e(s=>({...s,replacingToolInfo:{toolName:n}})),cancelReplacingTool:()=>e(n=>({...n,replacingToolInfo:null})),setSelectedVirtualMcpId:n=>e(s=>({...s,selectedVirtualMcpId:n}))}}),{name:`workflow-store-${encodeURIComponent(t.workflow.id)}`,storage:kn(()=>localStorage),version:1,partialize:e=>({trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,localWorkflow:e.localWorkflow,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedVirtualMcpId:e.selectedVirtualMcpId})}));function Bo(t){const e=N.c(8),{children:n,initialState:s}=t,i=Rs();let r;e[0]!==s.currentStepTab||e[1]!==s.trackingExecutionId||e[2]!==s.workflow||e[3]!==i?.[0]?.id?(r=()=>Uo({workflow:s.workflow,localWorkflow:s.workflow,selectedVirtualMcpId:i?.[0]?.id,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[0]=s.currentStepTab,e[1]=s.trackingExecutionId,e[2]=s.workflow,e[3]=i?.[0]?.id,e[4]=r):r=e[4];const[l]=C.useState(r);let c;return e[5]!==n||e[6]!==l?(c=o.jsx(In.Provider,{value:l,children:n}),e[5]=n,e[6]=l,e[7]=c):c=e[7],c}function ye(t,e){const n=C.useContext(In);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return Do(n,t,Ho)}function Se(){return ye(qo)}function qo(t){return t.workflow}function J(){return ye(Ko)}function Ko(t){return t.actions}function _n(){const t=$e();return ye(Jo)??t[0]?.name}function Jo(t){return t.currentStepName}function Te(){const t=N.c(5),e=_n(),n=$e();let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==e?(r=l=>l.name===e,t[3]=e,t[4]=r):r=t[4],s=n.find(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];const i=s;return i||n[0]}function $e(){return Se().steps}function Tn(){const t=N.c(8),e=Se(),n=ye(Zo);let s,i;if(t[0]!==n.description||t[1]!==n.steps||t[2]!==n.title||t[3]!==e.description||t[4]!==e.steps||t[5]!==e.title){const r={title:e.title,description:e.description,steps:e.steps.map(Xo)},l={title:n.title,description:n.description,steps:n.steps.map(Go)};s=JSON.stringify(r),i=JSON.stringify(l),t[0]=n.description,t[1]=n.steps,t[2]=n.title,t[3]=e.description,t[4]=e.steps,t[5]=e.title,t[6]=s,t[7]=i}else s=t[6],i=t[7];return s!==i}function Go(t){return{...t,outputSchema:void 0}}function Xo(t){return{...t,outputSchema:void 0}}function Zo(t){return t.localWorkflow}function q(){return ye(Yo)}function Yo(t){return t.trackingExecutionId}function Ne(){return ye(Qo)}function Qo(t){return t.selectedVirtualMcpId}function er(t){const e=N.c(18),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=Ms(),a=n??void 0;let d;e[0]!==s?(d=g=>s(g===""?void 0:g),e[0]=s,e[1]=d):d=e[1];let u;e[2]!==i?(u=O("text-xs",i),e[2]=i,e[3]=u):u=e[3];let f;e[4]!==l?(f=o.jsx(Ys,{placeholder:l}),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==u||e[7]!==f?(p=o.jsx(Qs,{size:"sm",className:u,children:f}),e[6]=u,e[7]=f,e[8]=p):p=e[8];let m;e[9]!==c?(m=c.map(tr),e[9]=c,e[10]=m):m=e[10];let x;e[11]!==m?(x=o.jsx(eo,{children:m}),e[11]=m,e[12]=x):x=e[12];let h;return e[13]!==a||e[14]!==d||e[15]!==p||e[16]!==x?(h=o.jsxs(to,{value:a,onValueChange:d,children:[p,x]}),e[13]=a,e[14]=d,e[15]=p,e[16]=x,e[17]=h):h=e[17],h}function tr(t){return o.jsx(Zs,{value:t.id,children:t.title},t.id)}function ke(){const t=N.c(2),e=vs();let n;t[0]!==e?(n={connections:e,binding:"WORKFLOW"},t[0]=e,t[1]=n):n=t[1];const s=Os(n);if(!s||s.length===0||!s[0])throw new Error("No workflow connection found");return s[0]}const Kt=[100,1e3,2e3];function Ce(t){const e=N.c(15),n=ke();let s;e[0]!==n.id?(s=Z(n.id),e[0]=n.id,e[1]=s):s=e[1];const i=s,r=C.useRef(0);let l;e[2]!==t?(l={id:t},e[2]=t,e[3]=l):l=e[3];const c=!!t;let a;e[4]!==t?(a=t?x=>{const h=x.state?.data?.item?.status;if(h==="running"||h==="enqueued"){const g=Kt[r.current]??1;return r.current=(r.current+1)%Kt.length,g}return r.current=0,!1}:!1,e[4]=t,e[5]=a):a=e[5];let d;e[6]!==n.id||e[7]!==l||e[8]!==c||e[9]!==a||e[10]!==i?(d={toolCaller:i,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolInputParams:l,scope:n.id,staleTime:0,gcTime:0,enabled:c,refetchInterval:a},e[6]=n.id,e[7]=l,e[8]=c,e[9]=a,e[10]=i,e[11]=d):d=e[11];const{data:u,isLoading:f}=kt(d),p=u?.item;let m;return e[12]!==f||e[13]!==p?(m={item:p,isLoading:f},e[12]=f,e[13]=p,e[14]=m):m=e[14],m}function nr(t,e){const n=N.c(14),s=ke();let i;n[0]!==s.id?(i=Z(s.id),n[0]=s.id,n[1]=i):i=n[1];const r=i;let l;n[2]!==t||n[3]!==e?(l={executionId:t,stepId:e},n[2]=t,n[3]=e,n[4]=l):l=n[4];const c=!!t&&!!e;let a;n[5]!==s.id||n[6]!==l||n[7]!==c||n[8]!==r?(a={toolCaller:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolInputParams:l,scope:s.id,enabled:c},n[5]=s.id,n[6]=l,n[7]=c,n[8]=r,n[9]=a):a=n[9];const{data:d,isLoading:u}=kt(a),f=d?.output,p=d?.error;let m;return n[10]!==u||n[11]!==f||n[12]!==p?(m={output:f,error:p,isLoading:u},n[10]=u,n[11]=f,n[12]=p,n[13]=m):m=n[13],m}function sr(){const t=N.c(19),e=ke(),n=Se();let s;t[0]!==e.id?(s=Z(e.id),t[0]=e.id,t[1]=s):s=t[1];const i=s;let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=["workflow"],t[2]=r):r=t[2];let l;t[3]!==n.id?(l={field:r,operator:"eq",value:n.id},t[3]=n.id,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=[{field:["created_at"],direction:"desc"}],t[5]=c):c=t[5];let a;t[6]!==l?(a={where:l,orderBy:c,limit:100},t[6]=l,t[7]=a):a=t[7];const d=`${e.id}-executions-${n.id}`,u=!!n.id;let f;t[8]!==a||t[9]!==d||t[10]!==u||t[11]!==i?(f={toolCaller:i,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolInputParams:a,scope:d,enabled:u,staleTime:5e3},t[8]=a,t[9]=d,t[10]=u,t[11]=i,t[12]=f):f=t[12];const{data:p,isLoading:m,refetch:x}=kt(f),h=p;let g;t[13]!==h?.items?(g=h?.items??[],t[13]=h?.items,t[14]=g):g=t[14];let b;return t[15]!==m||t[16]!==x||t[17]!==g?(b={executions:g,isLoading:m,refetch:x},t[15]=m,t[16]=x,t[17]=g,t[18]=b):b=t[18],b}function $n(t){const e=[];function n(s){if(typeof s=="string"){const i=s.match(/@input(?:\.(\w+(?:\.\w+)*))?/g);if(i)for(const r of i)if(r==="@input")e.push("__entire_input__");else{const l=r.replace("@input.","");e.push(l)}}else Array.isArray(s)?s.forEach(n):typeof s=="object"&&s!==null&&Object.values(s).forEach(n)}return n(t),[...new Set(e)]}function or(t){const e=[];for(const n of t){const s=$n(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function rr(t){for(const e of t)if($n(e.input).includes("__entire_input__"))return!0;return!1}function ir(t){const e=or(t);if(e.length===0)return rr(t)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const n={},s=[];for(const i of e){const r=i.split(".");if(r.length===1)n[i]={type:"string",description:`Input field: ${i}`},s.push(i);else{const l=r[0];l&&!n[l]&&(n[l]={type:"object",description:`Input object: ${l}`,additionalProperties:!0},s.push(l))}}return{type:"object",properties:n,required:s,description:"Workflow execution input"}}function lr(){const t=N.c(2),e=Se();let n;return t[0]!==e.steps?(n=ir(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function cr(){const t=N.c(14),{id:e}=ke(),{setTrackingExecutionId:n}=J();let s;t[0]!==e?(s=Z(e),t[0]=e,t[1]=s):s=t[1];const i=s,r=Se(),l=Ne(),c=lr();let a;t[2]!==i?(a={toolCaller:i,toolName:"COLLECTION_WORKFLOW_EXECUTION_CREATE"},t[2]=i,t[3]=a):a=t[3];const{mutateAsync:d,isPending:u}=Ct(a);let f;t[4]!==l||t[5]!==n||t[6]!==d||t[7]!==r?(f=async h=>{const g=h===void 0?{}:h;if(!l)throw new Error("Please select an Agent before running the workflow");const b=Date.now(),j=await d({input:g,virtual_mcp_id:l,start_at_epoch_ms:b,workflow_collection_id:r.id}),v=j?.item?.id??j?.structuredContent?.item?.id;return n(v),v},t[4]=l,t[5]=n,t[6]=d,t[7]=r,t[8]=f):f=t[8];const p=f,m=c!==null;let x;return t[9]!==p||t[10]!==c||t[11]!==u||t[12]!==m?(x={handleRunWorkflow:p,isPending:u,requiresInput:m,inputSchema:c},t[9]=p,t[10]=c,t[11]=u,t[12]=m,t[13]=x):x=t[13],x}function ar(){const t=N.c(9),{id:e}=ke();let n;t[0]!==e?(n=Z(e),t[0]=e,t[1]=n):n=t[1];const s=n;let i;t[2]!==s?(i={toolCaller:s,toolName:"CANCEL_EXECUTION"},t[2]=s,t[3]=i):i=t[3];const{mutateAsync:r,isPending:l}=Ct(i);let c;t[4]!==r?(c=async u=>await r({executionId:u}),t[4]=r,t[5]=c):c=t[5];const a=c;let d;return t[6]!==a||t[7]!==l?(d={handleCancelWorkflow:a,isCancelling:l},t[6]=a,t[7]=l,t[8]=d):d=t[8],d}function dr(){const t=N.c(9),{id:e}=ke();let n;t[0]!==e?(n=Z(e),t[0]=e,t[1]=n):n=t[1];const s=n;let i;t[2]!==s?(i={toolCaller:s,toolName:"RESUME_EXECUTION"},t[2]=s,t[3]=i):i=t[3];const{mutateAsync:r,isPending:l}=Ct(i);let c;t[4]!==r?(c=async u=>(await r({executionId:u})).success,t[4]=r,t[5]=c):c=t[5];const a=c;let d;return t[6]!==a||t[7]!==l?(d={handleResumeWorkflow:a,isResuming:l},t[6]=a,t[7]=l,t[8]=d):d=t[8],d}function ur(){const t=N.c(3),e=q(),{item:n}=Ce(e);let s;return t[0]!==n||t[1]!==e?(s=e&&n?(()=>{const r={};return n?.input&&(r.input=n.input),r})():void 0,t[0]=n,t[1]=e,t[2]=s):s=t[2],s}function fr(t,e,n,s){if(!e)return[...t].sort(s);const i=n(e);return[...t].sort((r,l)=>{const c=n(r),a=n(l);return c===i?-1:a===i?1:s?s(r,l):0})}const Rt=Po()(Cn(t=>({viewMode:"visual",setViewMode:e=>t({viewMode:e}),showExecutionsList:!1,setShowExecutionsList:e=>t({showExecutionsList:e}),toggleExecutionsList:()=>t(e=>({showExecutionsList:!e.showExecutionsList}))}),{name:"workflow-view-mode"})),En=C.createContext([]);function On(){return C.useContext(En)}function mr({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new Hs;return{editor:t,char:s,pluginKey:i,command:({editor:r,range:l,props:c})=>{var a,d,u;const f=r.view.state.selection.$to.nodeAfter;(a=f?.text)!=null&&a.startsWith(" ")&&(l.to+=1),r.chain().focus().insertContentAt(l,[{type:n,attrs:{...c,mentionSuggestionChar:s}},{type:"text",text:" "}]).run(),(u=(d=r.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:r,range:l})=>{const c=r.doc.resolve(l.from),a=r.schema.nodes[n];return!!c.parent.type.contentMatch.matchType(a)},...e}}function Rn(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>mr({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function Jt(t,e){const n=Rn(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var pr=Ls.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,s;return`${(n=e?.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var s,i;return["span",Oe(this.HTMLAttributes,t.HTMLAttributes),`${(s=n?.char)!=null?s:"@"}${(i=e.attrs.label)!=null?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=Jt(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Oe({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Oe({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Oe({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...Ws({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let s=n.exec(t);for(;s!==null;){const[,i,r,l]=s,c=r??l;e[i==="char"?"mentionSuggestionChar":i]=c,s=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:Jt(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:s}=e,{empty:i,anchor:r}=s;if(!i)return!1;let l=new Ds,c=0;return e.doc.nodesBetween(r-1,r,(a,d)=>{if(a.type.name===this.name)return n=!0,l=a,c=d,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,c,c+l.nodeSize),n})}},addProseMirrorPlugins(){return Rn(this).map(zs)}}),xr=pr,nt,We="HoverCard",[An]=tn(We,[Qt]),He=Qt(),[hr,Ve]=An(We),Pn=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=He(e),d=C.useRef(0),u=C.useRef(0),f=C.useRef(!1),p=C.useRef(!1),[m,x]=ut({prop:s,defaultProp:i??!1,onChange:r,caller:We}),h=C.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>x(!0),l)},[l,x]),g=C.useCallback(()=>{clearTimeout(d.current),!f.current&&!p.current&&(u.current=window.setTimeout(()=>x(!1),c))},[c,x]),b=C.useCallback(()=>x(!1),[x]);return C.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(hr,{scope:e,open:m,onOpenChange:x,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:p,children:o.jsx(as,{...a,children:n})})};Pn.displayName=We;var Mn="HoverCardTrigger",Ln=C.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=Ve(Mn,n),r=He(n);return o.jsx(ls,{asChild:!0,...r,children:o.jsx(dt.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:Q(t.onPointerEnter,Me(i.onOpen)),onPointerLeave:Q(t.onPointerLeave,Me(i.onClose)),onFocus:Q(t.onFocus,i.onOpen),onBlur:Q(t.onBlur,i.onClose),onTouchStart:Q(t.onTouchStart,l=>l.preventDefault())})})});Ln.displayName=Mn;var At="HoverCardPortal",[gr,br]=An(At,{forceMount:void 0}),zn=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=Ve(At,e);return o.jsx(gr,{scope:e,forceMount:n,children:o.jsx(Yt,{present:n||r.open,children:o.jsx(cs,{asChild:!0,container:i,children:s})})})};zn.displayName=At;var Pe="HoverCardContent",Dn=C.forwardRef((t,e)=>{const n=br(Pe,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=Ve(Pe,t.__scopeHoverCard);return o.jsx(Yt,{present:s||r.open,children:o.jsx(jr,{"data-state":r.open?"open":"closed",...i,onPointerEnter:Q(t.onPointerEnter,Me(r.onOpen)),onPointerLeave:Q(t.onPointerLeave,Me(r.onClose)),ref:e})})});Dn.displayName=Pe;var jr=C.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=Ve(Pe,n),d=He(n),u=C.useRef(null),f=en(e,u),[p,m]=C.useState(!1);return C.useEffect(()=>{if(p){const x=document.body;return nt=x.style.userSelect||x.style.webkitUserSelect,x.style.userSelect="none",x.style.webkitUserSelect="none",()=>{x.style.userSelect=nt,x.style.webkitUserSelect=nt}}},[p]),C.useEffect(()=>{if(u.current){const x=()=>{m(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",x),()=>{document.removeEventListener("pointerup",x),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),C.useEffect(()=>{u.current&&yr(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(ds,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:Q(r,x=>{x.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(us,{...d,...c,onPointerDown:Q(c.onPointerDown,x=>{x.currentTarget.contains(x.target)&&m(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),vr="HoverCardArrow",wr=C.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=He(n);return o.jsx(fs,{...i,...s,ref:e})});wr.displayName=vr;function Me(t){return e=>e.pointerType==="touch"?void 0:t()}function yr(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Sr=Pn,Nr=Ln,kr=zn,Cr=Dn;function Ir(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Sr,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function _r(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Nr,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function Tr(t){const e=N.c(12);let n,s,i,r;e[0]!==t?({className:n,align:i,sideOffset:r,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=r):(n=e[1],s=e[2],i=e[3],r=e[4]);const l=i===void 0?"center":i,c=r===void 0?4:r;let a;e[5]!==n?(a=O("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 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==s||e[9]!==c||e[10]!==a?(d=o.jsx(kr,{"data-slot":"hover-card-portal",children:o.jsx(Cr,{"data-slot":"hover-card-content",align:l,sideOffset:c,className:a,...s})}),e[7]=l,e[8]=s,e[9]=c,e[10]=a,e[11]=d):d=e[11],d}const Wn=C.createContext(void 0);function $r(t,e){const n=e.split("."),s=n[0];if(!s)return;let i=t[s];for(let r=1;r<n.length&&i!==void 0;r++){const l=n[r];if(l)if(typeof i=="object"&&i!==null)i=i[l];else return}return i}function Er(t){const e=N.c(20),{node:n}=t,s=C.useContext(Wn),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?$r(s,i):void 0;l=h!==void 0?typeof h=="object"?JSON.stringify(h,null,2):String(h):void 0,e[0]=r,e[1]=i,e[2]=s,e[3]=l}else l=e[3];const c=l;let a;e[4]!==i?(a=o.jsxs("span",{className:"bg-primary/20 text-primary px-1 rounded font-medium cursor-pointer",children:["@",i]}),e[4]=i,e[5]=a):a=e[5];const d=a;if(!r||c===void 0){let h;return e[6]!==d?(h=o.jsx(Ht,{as:"span",children:d}),e[6]=d,e[7]=h):h=e[7],h}let u;e[8]!==d?(u=o.jsx(_r,{asChild:!0,children:d}),e[8]=d,e[9]=u):u=e[9];let f;e[10]!==i?(f=o.jsxs("div",{className:"text-xs font-medium text-muted-foreground",children:["@",i]}),e[10]=i,e[11]=f):f=e[11];let p;e[12]!==c?(p=o.jsx("pre",{className:"text-xs font-mono bg-muted/50 p-2 rounded overflow-auto max-h-[200px] whitespace-pre-wrap break-all",children:c}),e[12]=c,e[13]=p):p=e[13];let m;e[14]!==f||e[15]!==p?(m=o.jsx(Tr,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,p]})}),e[14]=f,e[15]=p,e[16]=m):m=e[16];let x;return e[17]!==u||e[18]!==m?(x=o.jsx(Ht,{as:"span",children:o.jsxs(Ir,{openDelay:200,children:[u,m]})}),e[17]=u,e[18]=m,e[19]=x):x=e[19],x}function Hn(t){const e=[];function n(s){for(const i of s)i.children?.length||e.push(i),i.children&&n(i.children)}return n(t),e}let ee=Vn();function Vn(){return Ot(()=>({items:[],selectedIndex:0,command:null}))}function Gt(t,e){ee.setState({items:t,command:e,selectedIndex:0})}function Or(){const{items:t,selectedIndex:e}=ee.getState();t.length&&ee.setState({selectedIndex:(e-1+t.length)%t.length})}function Rr(){const{items:t,selectedIndex:e}=ee.getState();t.length&&ee.setState({selectedIndex:(e+1)%t.length})}function Fn(){const{items:t,selectedIndex:e,command:n}=ee.getState(),s=t[e];return s?(n?.(s),!0):!1}function Xt(){ee=Vn()}function Ar(){const t=N.c(7),e=it(ee,Mr),n=it(ee,Pr);if(!e.length)return null;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==n?(r=(l,c)=>o.jsx("button",{type:"button",onClick:()=>{ee.setState({selectedIndex:c}),Fn()},className:O("flex items-center w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",c===n?"bg-accent text-accent-foreground":"hover:bg-muted"),children:l.label},l.id),t[3]=n,t[4]=r):r=t[4],s=e.map(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];let i;return t[5]!==s?(i=o.jsx("div",{className:"bg-popover border border-border rounded-lg shadow-lg overflow-hidden min-w-[180px]",children:o.jsx("div",{className:"p-1",children:s})}),t[5]=s,t[6]=i):i=t[6],i}function Pr(t){return t.selectedIndex}function Mr(t){return t.items}function Lr(){let t=null,e=null;return{onStart:n=>{Gt(n.items,n.command),t=new Bs(Ar,{editor:n.editor}),e=document.createElement("div"),e.style.cssText="position:absolute;z-index:9999";const s=n.clientRect?.();s&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`),e.appendChild(t.element),document.body.appendChild(e)},onUpdate:n=>{Gt(n.items,n.command);const s=n.clientRect?.();s&&e&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`)},onKeyDown:({event:n})=>n.key==="Escape"?(e?.remove(),t?.destroy(),Xt(),!0):n.key==="ArrowUp"?(Or(),!0):n.key==="ArrowDown"?(Rr(),!0):n.key==="Enter"?Fn():!1,onExit:()=>{e?.remove(),t?.destroy(),Xt()}}}const st=/@([\w.]+)/g;function zr(t,e){if(!t)return null;const n=Hn(e),s=new Map(n.map(a=>[a.id,a]));if(!st.test(t))return t;st.lastIndex=0;const r=[];let l=0,c;for(;(c=st.exec(t))!==null;){const a=c[1]??"",d=c.index;d>l&&r.push({type:"text",text:t.slice(l,d)});const u=s.get(a);u?r.push({type:"mention",attrs:{id:u.id,label:u.label}}):r.push({type:"text",text:c[0]}),l=d+c[0].length}return l<t.length&&r.push({type:"text",text:t.slice(l)}),{type:"doc",content:[{type:"paragraph",content:r.length>0?r:void 0}]}}function Pt(t){const e=N.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=ur();let d;e[0]!==n||e[1]!==s?(d=zr(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,p=!c;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=Vs.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=m):m=e[3];let x;if(e[4]!==n||e[5]!==f){let _;e[7]!==n?(_=R=>{const{query:A}=R;return Hn(n).filter(M=>M.label.toLowerCase().includes(A.toLowerCase())||M.id.toLowerCase().includes(A.toLowerCase()))},e[7]=n,e[8]=_):_=e[8],x=xr.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Vr,renderHTML:Hr,suggestion:{items:_,render:Lr,command:Wr}}).extend(f?{addNodeView(){return Fs(Er)}}:{}),e[4]=n,e[5]=f,e[6]=x}else x=e[6];let h;e[9]!==x?(h=[m,x],e[9]=x,e[10]=h):h=e[10];const g=r??"";let b;e[11]!==g?(b={attributes:{class:"prose prose-sm max-w-none focus:outline-none w-full min-h-[20px]","data-placeholder":g},handleKeyDown:Dr},e[11]=g,e[12]=b):b=e[12];let j;e[13]!==i?(j=_=>{const{editor:R}=_;return i?.(R.getText().trim())},e[13]=i,e[14]=j):j=e[14];let v;e[15]!==u||e[16]!==p||e[17]!==h||e[18]!==b||e[19]!==j?(v={content:u,editable:p,extensions:h,editorProps:b,onUpdate:j},e[15]=u,e[16]=p,e[17]=h,e[18]=b,e[19]=j,e[20]=v):v=e[20];const S=Us(v);let w;e[21]!==l?(w=O("rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",l),e[21]=l,e[22]=w):w=e[22];let y;e[23]!==S?(y=o.jsx(qs,{editor:S}),e[23]=S,e[24]=y):y=e[24];let k;e[25]!==w||e[26]!==y?(k=o.jsx("div",{className:w,children:y}),e[25]=w,e[26]=y,e[27]=k):k=e[27];const $=k;if(a!==void 0){let _;return e[28]!==$||e[29]!==a?(_=o.jsx(Wn.Provider,{value:a,children:$}),e[28]=$,e[29]=a,e[30]=_):_=e[30],_}return $}function Dr(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function Wr(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function Hr(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Vr(t){const{node:e}=t;return`@${e.attrs.id}`}function Fr(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=On(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Pt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Ur(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=On(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Pt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r,className:"min-h-[80px]"}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Br(t){const e=N.c(8),{value:n,onChange:s,readonly:i,id:r}=t,l=n??"";let c;e[0]!==s?(c=u=>s(u.target.value===""?void 0:Number(u.target.value)),e[0]=s,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),e[2]=a):a=e[2];let d;return e[3]!==r||e[4]!==i||e[5]!==l||e[6]!==c?(d=o.jsx("input",{id:r,type:"number",value:l,onChange:c,disabled:i,className:a}),e[3]=r,e[4]=i,e[5]=l,e[6]=c,e[7]=d):d=e[7],d}function qr(t){const e=N.c(13),{value:n,onChange:s,readonly:i,id:r,label:l}=t,c=n??!1;let a;e[0]!==s?(a=p=>s(p.target.checked),e[0]=s,e[1]=a):a=e[1];let d;e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==a?(d=o.jsx("input",{id:r,type:"checkbox",checked:c,onChange:a,disabled:i,className:"h-4 w-4 rounded border-input"}),e[2]=r,e[3]=i,e[4]=c,e[5]=a,e[6]=d):d=e[6];let u;e[7]!==l?(u=o.jsx("span",{className:"text-sm",children:l}),e[7]=l,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==d||e[11]!==u?(f=o.jsxs("label",{htmlFor:r,className:"flex items-center gap-2 cursor-pointer",children:[d,u]}),e[9]=r,e[10]=d,e[11]=u,e[12]=f):f=e[12],f}function Kr(t){const e=N.c(14),{value:n,onChange:s,readonly:i,id:r,options:l}=t;let c;e[0]!==l.enumOptions?(c=l.enumOptions??[],e[0]=l.enumOptions,e[1]=c):c=e[1];const a=c,d=n??"";let u;e[2]!==s?(u=h=>s(h.target.value),e[2]=s,e[3]=u):u=e[3];let f,p;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),p=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=p):(f=e[4],p=e[5]);let m;e[6]!==a?(m=a.map(Jr),e[6]=a,e[7]=m):m=e[7];let x;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==m?(x=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[p,m]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=m,e[13]=x):x=e[13],x}function Jr(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Gr={TextWidget:Fr,TextareaWidget:Ur,NumberWidget:Br,CheckboxWidget:qr,SelectWidget:Kr};function Xr(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:gn,color:"text-blue-500"};case"number":case"integer":return{Icon:xn,color:"text-blue-500"};case"array":return{Icon:fn,color:"text-purple-500"};case"object":return{Icon:un,color:"text-orange-500"};case"boolean":return{Icon:hn,color:"text-pink-500"};case"null":return{Icon:ft,color:"text-gray-500"};default:return{Icon:mn,color:"text-muted-foreground"}}}function Zr(t){const e=N.c(36),{id:n,label:s,required:i,description:r,children:l,schema:c,hidden:a}=t;if(a){let w;return e[0]!==l?(w=o.jsx("div",{className:"hidden",children:l}),e[0]=l,e[1]=w):w=e[1],w}if(n==="root"){let w;return e[2]!==l?(w=o.jsx("div",{className:"space-y-4",children:l}),e[2]=l,e[3]=w):w=e[3],w}const d=Array.isArray(c.type)?c.type[0]:c.type??"string";let u,f,p,m,x,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:w,color:y}=Xr(d);g="space-y-2",m="flex items-center gap-2",e[15]!==n||e[16]!==s?(x=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=x):x=e[17],e[18]!==i?(h=i&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"}),e[18]=i,e[19]=h):h=e[19],u=w,f=14,p=O(y,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=p,e[11]=m,e[12]=x,e[13]=h,e[14]=g}else u=e[8],f=e[9],p=e[10],m=e[11],x=e[12],h=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==p?(b=o.jsx(u,{size:f,className:p}),e[20]=u,e[21]=f,e[22]=p,e[23]=b):b=e[23];let j;e[24]!==m||e[25]!==x||e[26]!==h||e[27]!==b?(j=o.jsxs("div",{className:m,children:[x,h,b]}),e[24]=m,e[25]=x,e[26]=h,e[27]=b,e[28]=j):j=e[28];let v;e[29]!==r?(v=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=v):v=e[30];let S;return e[31]!==l||e[32]!==g||e[33]!==j||e[34]!==v?(S=o.jsxs("div",{className:g,children:[j,v,l]}),e[31]=l,e[32]=g,e[33]=j,e[34]=v,e[35]=S):S=e[35],S}function Yr(t){const e=N.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(ei),e[0]=n,e[1]=c):c=e[1];let a;return e[2]!==c?(a=o.jsx("div",{className:"space-y-4",children:c}),e[2]=c,e[3]=a):a=e[3],a}let r;e[4]!==n?(r=n.map(Qr),e[4]=n,e[5]=r):r=e[5];let l;return e[6]!==r?(l=o.jsx("div",{className:"pl-4 border-l-2 border-border/50 space-y-4",children:r}),e[6]=r,e[7]=l):l=e[7],l}function Qr(t){return o.jsx("div",{children:t.content},t.name)}function ei(t){return o.jsx("div",{children:t.content},t.name)}function ti(t){const e=N.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(ni),e[0]=n,e[1]=l):l=e[1];let c;e[2]!==l?(c=o.jsx("div",{className:"space-y-2",children:l}),e[2]=l,e[3]=c):c=e[3];let a;e[4]!==s||e[5]!==i||e[6]!==r?(a=s&&o.jsxs(B,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:i,children:["+ Add ",r||"item"]}),e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==c||e[9]!==a?(d=o.jsxs("div",{className:"space-y-2",children:[c,a]}),e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function ni(t){return o.jsx("div",{className:"flex gap-2 items-start",children:o.jsx("div",{className:"flex-1",children:t})},t.key||t.index)}function si(){return null}function oi(){return null}const ri={FieldTemplate:Zr,ObjectFieldTemplate:Yr,ArrayFieldTemplate:ti,UnsupportedFieldTemplate:si,ErrorListTemplate:oi};function ii(t){const e=N.c(6),{inputSchema:n,inputParams:s,mentions:i}=t;if(!n?.properties||!s)return null;let r;e[0]!==i?(r=(a,d,u)=>{const f=typeof d=="object"&&d!==null?JSON.stringify(d,null,2):String(d??""),p=Array.isArray(u.type)?u.type.join(" | "):u.type??"string";return o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:a}),o.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:p})]}),u.description&&o.jsx("div",{className:"text-xs text-muted-foreground",children:u.description}),o.jsx("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-sm",children:o.jsx(Pt,{mentions:i,value:f,readOnly:!0,className:"border-0 bg-transparent p-0"})})]},a)},e[0]=i,e[1]=r):r=e[1];const l=r;let c;return e[2]!==s||e[3]!==n.properties||e[4]!==l?(c=o.jsx("div",{className:"space-y-4",children:Object.entries(n.properties).map(a=>{const[d,u]=a,f=s[d];return l(d,f,u)})}),e[2]=s,e[3]=n.properties,e[4]=l,e[5]=c):c=e[5],c}function Un({inputSchema:t,inputParams:e,setInputParams:n,handleInputChange:s,mentions:i,readOnly:r}){const l=i??[];if(!t)return o.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."});if(r)return o.jsx(ii,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=C.useRef(e??{}),d=u=>{const f=u.formData??{},p=a.current;if(n?.(f),s){for(const[m,x]of Object.entries(f))p[m]!==x&&s(m,x);for(const m of Object.keys(p))m in f||s(m,void 0)}a.current=f};return o.jsx(En.Provider,{value:l,children:o.jsx(Ts,{schema:c,formData:e,onChange:d,validator:$s,widgets:Gr,templates:ri,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function li(t){const e=N.c(33),{open:n,onOpenChange:s,inputSchema:i,onSubmit:r,isPending:l}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const[a,d]=C.useState(c);let u;e[1]!==a||e[2]!==s||e[3]!==r?(u=async()=>{await r(a),s(!1),d({})},e[1]=a,e[2]=s,e[3]=r,e[4]=u):u=e[4];const f=u;let p;e[5]!==s?(p=$=>{$||d({}),s($)},e[5]=s,e[6]=p):p=e[6];const m=p;let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsxs(oo,{children:[o.jsx(ro,{children:"Workflow Input"}),o.jsx(io,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=x):x=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[8]=h):h=e[8];let g;e[9]!==a||e[10]!==i?(g=o.jsx("div",{className:"py-4",children:o.jsx(Un,{inputSchema:i,inputParams:a,setInputParams:d,mentions:h})}),e[9]=a,e[10]=i,e[11]=g):g=e[11];let b;e[12]!==m?(b=()=>m(!1),e[12]=m,e[13]=b):b=e[13];let j;e[14]!==l||e[15]!==b?(j=o.jsx(B,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=j):j=e[16];let v;e[17]!==l?(v=l?o.jsx(De,{size:"xs"}):o.jsx(wt,{size:14}),e[17]=l,e[18]=v):v=e[18];let S;e[19]!==f||e[20]!==l||e[21]!==v?(S=o.jsxs(B,{onClick:f,disabled:l,className:"gap-2",children:[v,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=v,e[22]=S):S=e[22];let w;e[23]!==S||e[24]!==j?(w=o.jsxs(lo,{children:[j,S]}),e[23]=S,e[24]=j,e[25]=w):w=e[25];let y;e[26]!==w||e[27]!==g?(y=o.jsxs(co,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[x,g,w]}),e[26]=w,e[27]=g,e[28]=y):y=e[28];let k;return e[29]!==m||e[30]!==n||e[31]!==y?(k=o.jsx(ao,{open:n,onOpenChange:m,children:y}),e[29]=m,e[30]=n,e[31]=y,e[32]=k):k=e[32],k}function ci(t){const e=N.c(26),{title:n,description:s,onSave:i}=t,l=at().location.href,{viewMode:c,setViewMode:a,showExecutionsList:d,toggleExecutionsList:u}=Rt(),{resetToOriginalWorkflow:f,setSelectedVirtualMcpId:p}=J(),m=Tn(),x=Ne(),h=q();let g;e[0]!==n?(g=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=g):g=e[1];let b;e[2]!==s?(b=s?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s})]}):null,e[2]=s,e[3]=b):b=e[3];let j;e[4]!==g||e[5]!==b?(j=o.jsx(ln,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[g,b]})}),e[4]=g,e[5]=b,e[6]=j):j=e[6];let v;e[7]!==m||e[8]!==i||e[9]!==f||e[10]!==x||e[11]!==p||e[12]!==a||e[13]!==d||e[14]!==n||e[15]!==u||e[16]!==h||e[17]!==l||e[18]!==c?(v=!h&&o.jsxs(o.Fragment,{children:[o.jsx(xt,{title:n,url:l,icon:"workflow"}),o.jsx(C.Suspense,{fallback:o.jsx(De,{size:"xs"}),children:o.jsx(er,{selectedVirtualMcpId:x,onVirtualMcpChange:p,placeholder:"Select Agent"})}),o.jsx(no,{value:c,onValueChange:a,size:"sm",options:[{value:"visual",icon:o.jsx(so,{})},{value:"code",icon:o.jsx(vn,{})}]}),o.jsx(re,{children:o.jsxs(ie,{delayDuration:0,children:[o.jsx(se,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(B,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:f,disabled:!m,"aria-label":"Reset changes",children:o.jsx(rn,{size:14})})})}),o.jsx(oe,{side:"bottom",children:"Reset changes"})]})}),o.jsx(re,{children:o.jsxs(ie,{delayDuration:0,children:[o.jsx(se,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(B,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:i,disabled:!m,"aria-label":"Save workflow",children:o.jsx(Et,{size:14})})})}),o.jsx(oe,{side:"bottom",children:"Save workflow"})]})}),o.jsx(re,{children:o.jsxs(ie,{delayDuration:0,children:[o.jsx(se,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(B,{variant:d?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:u,"aria-label":d?"Hide runs":"Show runs",children:o.jsx(jn,{size:14})})})}),o.jsx(oe,{side:"bottom",children:d?"Hide runs":"Show runs"})]})})]}),e[7]=m,e[8]=i,e[9]=f,e[10]=x,e[11]=p,e[12]=a,e[13]=d,e[14]=n,e[15]=u,e[16]=h,e[17]=l,e[18]=c,e[19]=v):v=e[19];let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(ui,{}),e[20]=S):S=e[20];let w;e[21]!==v?(w=o.jsxs(jt,{children:[v,S]}),e[21]=v,e[22]=w):w=e[22];let y;return e[23]!==j||e[24]!==w?(y=o.jsxs(o.Fragment,{children:[j,w]}),e[23]=j,e[24]=w,e[25]=y):y=e[25],y}function ai(){const t=q(),{item:e}=Ce(t);return e?.completed_at_epoch_ms!=null}function di(){const t=q(),{item:e}=Ce(t);return e?.status==="cancelled"}function ui(){const t=N.c(57),e=Tn(),n=ai(),s=di(),i=q(),r=Ne(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=cr(),u=$e(),[f,p]=C.useState(!1),{handleCancelWorkflow:m,isCancelling:x}=ar(),{handleResumeWorkflow:h,isResuming:g}=dr(),b=i&&!n;let j;t[0]!==u?(j=u.some(fi),t[0]=u,t[1]=j):j=t[1];const v=j,S=!r,w=e||v||S||c||x,y=b||c;let k;t[2]!==v||t[3]!==S||t[4]!==e||t[5]!==s||t[6]!==y?(k=()=>s?"Workflow is currently cancelled":y?"Workflow is currently running":e?"Save your changes before running":S?"Select an Agent first":v?"Add at least one step to the workflow":null,t[2]=v,t[3]=S,t[4]=e,t[5]=s,t[6]=y,t[7]=k):k=t[7];const _=k();let R;t[8]!==m||t[9]!==h||t[10]!==l||t[11]!==d||t[12]!==s||t[13]!==y||t[14]!==a||t[15]!==i?(R=async()=>{if(a&&d){p(!0);return}if(s&&i){await h(i);return}if(y&&i){await m(i);return}await l({})},t[8]=m,t[9]=h,t[10]=l,t[11]=d,t[12]=s,t[13]=y,t[14]=a,t[15]=i,t[16]=R):R=t[16];const A=R;let P;t[17]!==l?(P=async te=>{await l(te)},t[17]=l,t[18]=P):P=t[18];const M=P,z=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",H=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let I;t[19]!==H?(I=O("gap-2 h-7 px-3",H),t[19]=H,t[20]=I):I=t[20];let E;t[21]!==x||t[22]!==s||t[23]!==c||t[24]!==g||t[25]!==b?(E=(!b&&!c&&!x&&!g||s)&&o.jsx(wt,{size:14}),t[21]=x,t[22]=s,t[23]=c,t[24]=g,t[25]=b,t[26]=E):E=t[26];let T;t[27]!==x||t[28]!==s||t[29]!==c||t[30]!==g||t[31]!==b?(T=b&&!c&&!x&&!g&&!s&&o.jsx(Ks,{size:14}),t[27]=x,t[28]=s,t[29]=c,t[30]=g,t[31]=b,t[32]=T):T=t[32];let L;t[33]!==x||t[34]!==c||t[35]!==g?(L=(c||x||g)&&o.jsx(De,{size:"xs"}),t[33]=x,t[34]=c,t[35]=g,t[36]=L):L=t[36];let V;t[37]!==z||t[38]!==A||t[39]!==w||t[40]!==I||t[41]!==E||t[42]!==T||t[43]!==L?(V=o.jsxs(B,{variant:"default",size:"sm",className:I,disabled:w,onClick:A,children:[E,T,L,z]}),t[37]=z,t[38]=A,t[39]=w,t[40]=I,t[41]=E,t[42]=T,t[43]=L,t[44]=V):V=t[44];const K=V;let W;t[45]!==K||t[46]!==_?(W=_?o.jsx(re,{children:o.jsxs(ie,{delayDuration:0,children:[o.jsx(se,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:K})}),o.jsx(oe,{side:"bottom",children:_})]})}):K,t[45]=K,t[46]=_,t[47]=W):W=t[47];const G=W;let F;t[48]!==M||t[49]!==d||t[50]!==c||t[51]!==a||t[52]!==f?(F=a&&d&&o.jsx(li,{open:f,onOpenChange:p,inputSchema:d,onSubmit:M,isPending:c}),t[48]=M,t[49]=d,t[50]=c,t[51]=a,t[52]=f,t[53]=F):F=t[53];let D;return t[54]!==G||t[55]!==F?(D=o.jsxs(o.Fragment,{children:[G,F]}),t[54]=G,t[55]=F,t[56]=D):D=t[56],D}function fi(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function mi(){const t=N.c(17),e=q(),n=$e(),{item:s}=Ce(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.status||t[3]!==n){i={};let r;t[5]!==s.completed_steps?.success?(r=s.completed_steps?.success??[],t[5]=s.completed_steps?.success,t[6]=r):r=t[6];let l;t[7]!==r?(l=new Set(r),t[7]=r,t[8]=l):l=t[8];const c=l;let a;t[9]!==s.completed_steps?.error?(a=s.completed_steps?.error??[],t[9]=s.completed_steps?.error,t[10]=a):a=t[10];let d;t[11]!==a?(d=new Set(a),t[11]=a,t[12]=d):d=t[12];const u=d;let f;t[13]!==u||t[14]!==n||t[15]!==c?(f=-1,n.forEach((p,m)=>{(c.has(p.name)||u.has(p.name))&&(f=m)}),t[13]=u,t[14]=n,t[15]=c,t[16]=f):f=t[16],n.forEach((p,m)=>{let x="pending";u.has(p.name)?x="error":c.has(p.name)?x="success":s.status==="running"&&m===f+1&&(x="running"),i[p.name]={status:x,output:void 0,error:void 0,stepIndex:m}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.status,t[3]=n,t[4]=i}else i=t[4];return i}function pi(t){const e=N.c(119),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=q(),{item:p}=Ce(f),m=p?.completed_at_epoch_ms;let x;e[0]!==p?.completed_steps?.success||e[1]!==n.name?(x=p?.completed_steps?.success?.includes(n.name)??!1,e[0]=p?.completed_steps?.success,e[1]=n.name,e[2]=x):x=e[2];const h=x;let g;e[3]!==p?.completed_steps?.error||e[4]!==n.name?(g=p?.completed_steps?.error?.includes(n.name)??!1,e[3]=p?.completed_steps?.error,e[4]=n.name,e[5]=g):g=e[5];const b=g,j="toolName"in n.action,v=j&&"connectionId"in n.action?n.action.connectionId:null,w=!!(j&&"toolName"in n.action?n.action.toolName:null);let y,k,$,_,R,A,P,M,z,H,I;if(e[6]!==v||e[7]!==r||e[8]!==w||e[9]!==s||e[10]!==h||e[11]!==b||e[12]!==c||e[13]!==i||e[14]!==l||e[15]!==j||e[16]!==d||e[17]!==u||e[18]!==a||e[19]!==n||e[20]!==f){const K=ki(n);y=h?"success":b?"error":r?.status;const W=r!==void 0,G=y==="success"||y==="error";let F=K.length>0?60:12;(y==="success"||y==="error")&&(F=F+32);let D,te,ce;if(e[32]!==i||e[33]!==l||e[34]!==a||e[35]!==y){const Ie=gi(y);let Ee;e[44]!==y?(Ee=bi(y),e[44]=y,e[45]=Ee):Ee=e[45],D=Ee;const Ke=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",Je=y==="running"&&"bg-accent/50",Ge=l&&"opacity-50";e[46]!==Ke||e[47]!==Je||e[48]!==Ge?(M=O("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",Ke,Je,Ge),e[46]=Ke,e[47]=Je,e[48]=Ge,e[49]=M):M=e[49],z=a,H="button",I=0,e[50]!==a?(k=Xe=>{(Xe.key==="Enter"||Xe.key===" ")&&(Xe.preventDefault(),a())},e[50]=a,e[51]=k):k=e[51],ce="w-5 flex flex-col items-center justify-center shrink-0 pt-3",te=O("text-xs font-mono opacity-75 h-8 flex items-center",Ie),e[32]=i,e[33]=l,e[34]=a,e[35]=y,e[36]=D,e[37]=k,e[38]=te,e[39]=ce,e[40]=M,e[41]=z,e[42]=H,e[43]=I}else D=e[36],k=e[37],te=e[38],ce=e[39],M=e[40],z=e[41],H=e[42],I=e[43];const Be=s+1;let ae;e[52]!==te||e[53]!==Be?(ae=o.jsxs("span",{className:te,children:[Be,"."]}),e[52]=te,e[53]=Be,e[54]=ae):ae=e[54],e[55]!==ce||e[56]!==ae?($=o.jsx("div",{className:ce,children:ae}),e[55]=ce,e[56]=ae,e[57]=$):$=e[57];let de;e[58]!==D||e[59]!==s?(de=s>0?o.jsx(ot,{height:12,color:D}):o.jsx("div",{className:"h-3"}),e[58]=D,e[59]=s,e[60]=de):de=e[60];let ue;e[61]!==v||e[62]!==w||e[63]!==j||e[64]!==n.name?(ue=o.jsx(Si,{connectionId:v,isToolStep:j,hasToolSelected:w,stepName:n.name}),e[61]=v,e[62]=w,e[63]=j,e[64]=n.name,e[65]=ue):ue=e[65];let fe;e[66]!==D||e[67]!==G||e[68]!==y?(fe=G&&o.jsxs(o.Fragment,{children:[o.jsx(ot,{height:8,color:D}),o.jsx(ji,{status:y})]}),e[66]=D,e[67]=G,e[68]=y,e[69]=fe):fe=e[69];let me;e[70]!==D||e[71]!==F||e[72]!==c||e[73]!==f?(me=c&&f?null:o.jsx(ot,{height:F,color:D}),e[70]=D,e[71]=F,e[72]=c,e[73]=f,e[74]=me):me=e[74],e[75]!==de||e[76]!==ue||e[77]!==fe||e[78]!==me?(_=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[de,ue,fe,me]}),e[75]=de,e[76]=ue,e[77]=fe,e[78]=me,e[79]=_):_=e[79],R="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3";const qe=w?"font-medium text-foreground":"text-foreground";let pe;e[80]!==qe?(pe=O("text-sm truncate flex-1",qe),e[80]=qe,e[81]=pe):pe=e[81];let xe;e[82]!==n?(xe=Ni(n),e[82]=n,e[83]=xe):xe=e[83];let he;e[84]!==pe||e[85]!==xe?(he=o.jsx("span",{className:pe,children:xe}),e[84]=pe,e[85]=xe,e[86]=he):he=e[86];let ge;e[87]!==W||e[88]!==y?(ge=W&&o.jsx(vi,{status:y}),e[87]=W,e[88]=y,e[89]=ge):ge=e[89];let be;e[90]!==W||e[91]!==d||e[92]!==u?(be=!W&&o.jsxs(fo,{children:[o.jsx(mo,{asChild:!0,children:o.jsx(B,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",onClick:hi,children:o.jsx(uo,{size:14})})}),o.jsxs(po,{align:"end",children:[o.jsxs(Vt,{onClick:Ie=>{Ie.stopPropagation(),u()},children:[o.jsx(go,{size:14}),"Duplicate"]}),o.jsxs(Vt,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:Ie=>{Ie.stopPropagation(),d()},children:[o.jsx(ms,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[90]=W,e[91]=d,e[92]=u,e[93]=be):be=e[93],e[94]!==he||e[95]!==ge||e[96]!==be?(A=o.jsxs("div",{className:"flex items-center h-8",children:[he,ge,be]}),e[94]=he,e[95]=ge,e[96]=be,e[97]=A):A=e[97],P=K.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:K.map(xi)}),e[6]=v,e[7]=r,e[8]=w,e[9]=s,e[10]=h,e[11]=b,e[12]=c,e[13]=i,e[14]=l,e[15]=j,e[16]=d,e[17]=u,e[18]=a,e[19]=n,e[20]=f,e[21]=y,e[22]=k,e[23]=$,e[24]=_,e[25]=R,e[26]=A,e[27]=P,e[28]=M,e[29]=z,e[30]=H,e[31]=I}else y=e[21],k=e[22],$=e[23],_=e[24],R=e[25],A=e[26],P=e[27],M=e[28],z=e[29],H=e[30],I=e[31];let E;e[98]!==m||e[99]!==y?(E=y==="success"&&o.jsx(wi,{completedAtEpochMs:m}),e[98]=m,e[99]=y,e[100]=E):E=e[100];let T;e[101]!==r?.error||e[102]!==y?(T=y==="error"&&o.jsx(yi,{error:r?.error}),e[101]=r?.error,e[102]=y,e[103]=T):T=e[103];let L;e[104]!==E||e[105]!==T||e[106]!==R||e[107]!==A||e[108]!==P?(L=o.jsxs("div",{className:R,children:[A,P,E,T]}),e[104]=E,e[105]=T,e[106]=R,e[107]=A,e[108]=P,e[109]=L):L=e[109];let V;return e[110]!==k||e[111]!==$||e[112]!==_||e[113]!==L||e[114]!==M||e[115]!==z||e[116]!==H||e[117]!==I?(V=o.jsxs("div",{className:M,onClick:z,role:H,tabIndex:I,onKeyDown:k,children:[$,_,L]}),e[110]=k,e[111]=$,e[112]=_,e[113]=L,e[114]=M,e[115]=z,e[116]=H,e[117]=I,e[118]=V):V=e[118],V}function xi(t){return o.jsx("span",{className:"px-1.5 py-1 text-xs text-muted-foreground bg-background border border-border rounded-lg",children:t},t)}function hi(t){return t.stopPropagation()}function gi(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function bi(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function ji(t){const e=N.c(2),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-success flex items-center justify-center",children:o.jsx(It,{size:8,className:"text-success-foreground"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-destructive flex items-center justify-center",children:o.jsx(yt,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function vi(t){const e=N.c(3),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(It,{size:11,className:"text-success"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(yt,{size:11,className:"text-destructive"})}),e[1]=s):s=e[1],s}if(n==="running"){let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(_e,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function wi(t){const e=N.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null?new Date(n):null;s=a?a.toISOString().split("T")[0]:null,i=a?a.toTimeString().split(" ")[0]:null,e[0]=n,e[1]=s,e[2]=i}else s=e[1],i=e[2];const r=i;let l;e[3]!==s||e[4]!==r?(l=s&&r&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ks,{size:16,className:"text-success"}),o.jsx("span",{className:"text-xs text-success",children:s}),o.jsx("span",{className:"text-xs text-success",children:r})]}),e[3]=s,e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==l?(c=o.jsx("div",{className:"inline-flex items-center gap-3 px-1.5 py-1 bg-success-foreground rounded-lg w-fit",children:l}),e[6]=l,e[7]=c):c=e[7],c}function yi(t){const e=N.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx($t,{size:16,className:"text-destructive"}),e[0]=s):s=e[0];const i=n||"Execution failed";let r;return e[1]!==i?(r=o.jsxs("div",{className:"inline-flex items-center gap-1.5 px-1.5 py-1 bg-destructive-foreground rounded-lg w-fit",children:[s,o.jsx("span",{className:"text-xs text-destructive",children:i})]}),e[1]=i,e[2]=r):r=e[2],r}function Si(t){const e=N.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=vt(n??"");if(s&&i&&l?.icon){let a;return e[0]!==l.icon||e[1]!==r?(a=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center overflow-hidden",children:o.jsx(ze,{icon:l.icon,name:r,size:"xs",className:"border-0 rounded-none"})}),e[0]=l.icon,e[1]=r,e[2]=a):a=e[2],a}let c;return e[3]!==s?(c=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center",children:s?o.jsx(Nn,{size:16,className:"text-muted-foreground"}):o.jsx(ho,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function ot(t){const e=N.c(7),{height:n,color:s}=t,i=s===void 0?"bg-border":s;let r;e[0]!==i?(r=O("w-px",i),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;return e[4]!==r||e[5]!==l?(c=o.jsx("div",{className:r,style:l}),e[4]=r,e[5]=l,e[6]=c):c=e[6],c}function Ni(t){return t.name?t.name:"toolName"in t.action&&t.action.toolName?t.action.toolName:"code"in t.action?t.name||"Code Step":"Select tool..."}function ki(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function Ci(t){const e=N.c(32),{className:n}=t,s=$e(),i=_n(),r=mi(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=J(),d=q();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(v=>r[v.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{children:"Loading..."}),e[3]=p):p=e[3];let m;e[4]!==n?(m=O("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=m):m=e[5];let x;if(e[6]!==i||e[7]!==c||e[8]!==a||e[9]!==f||e[10]!==l||e[11]!==r||e[12]!==s){let v;e[14]!==i||e[15]!==c||e[16]!==a||e[17]!==f||e[18]!==l||e[19]!==r||e[20]!==s.length?(v=(S,w)=>{const y=r?.[S.name],k=f!==-1&&w>f&&y?.status==="pending",$=w===s.length-1;return o.jsx(pi,{step:S,index:w,isSelected:S.name===i,executionStatus:y,isSkipped:k,isLastStep:$,onSelect:()=>l(S.name),onDelete:()=>c(S.name),onDuplicate:()=>a(S.name)},S.name)},e[14]=i,e[15]=c,e[16]=a,e[17]=f,e[18]=l,e[19]=r,e[20]=s.length,e[21]=v):v=e[21],x=s.map(v),e[6]=i,e[7]=c,e[8]=a,e[9]=f,e[10]=l,e[11]=r,e[12]=s,e[13]=x}else x=e[13];let h;e[22]!==x?(h=o.jsx("div",{className:"pt-3 -space-y-1",children:x}),e[22]=x,e[23]=h):h=e[23];let g;e[24]!==d?(g=d?null:o.jsx(Ii,{}),e[24]=d,e[25]=g):g=e[25];let b;e[26]!==h||e[27]!==g?(b=o.jsxs("div",{className:"w-full -space-y-1",children:[h,g]}),e[26]=h,e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==m||e[30]!==b?(j=o.jsx(C.Suspense,{fallback:p,children:o.jsx("div",{className:m,children:b})}),e[29]=m,e[30]=b,e[31]=j):j=e[31],j}function Ii(){const t=N.c(8),{addToolStep:e}=J();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("div",{className:"w-5 shrink-0"}),t[0]=n):n=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"w-px h-3 bg-border"}),t[1]=s):s=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(an,{size:14}),t[2]=i):i=t[2];let r;t[3]!==e?(r=o.jsx(B,{variant:"outline",size:"icon",className:"size-8 rounded-lg",onClick:e,children:i}),t[3]=e,t[4]=r):r=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"w-px h-8",style:{backgroundImage:"repeating-linear-gradient(180deg, var(--border), var(--border) 4px, transparent 4px, transparent 8px)",backgroundPosition:"left top",backgroundRepeat:"repeat-y",backgroundSize:"2px 100%"}}),t[5]=l):l=t[5];let c;return t[6]!==r?(c=o.jsxs("div",{className:"flex gap-2 items-start px-4 pb-3",children:[n,o.jsxs("div",{className:"flex flex-col border-1 border-transparent items-center shrink-0",children:[s,r,l]})]}),t[6]=r,t[7]=c):c=t[7],c}function _i(){const t=N.c(5),e=Ne();let n;t[0]!==e?(n=e?new URL(`/mcp/virtual-mcp/${e}`,window.location.origin).href:"",t[0]=e,t[1]=n):n=t[1];const s=n,i=!!e;let r;return t[2]!==s||t[3]!==i?(r={url:s,enabled:i},t[2]=s,t[3]=i,t[4]=r):r=t[4],St(r)}function Ti(t){const e=N.c(7),{className:n}=t;if(!Ne()){let r;e[0]!==n?(r=O("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground p-4 text-center",children:"Select an agent to see available tools"}),e[2]=l):l=e[2];let c;return e[3]!==r?(c=o.jsx("div",{className:r,children:l}),e[3]=r,e[4]=c):c=e[4],c}let i;return e[5]!==n?(i=o.jsx($i,{className:n}),e[5]=n,e[6]=i):i=e[6],i}function $i(t){const e=N.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=_i(),l=Te(),{updateStep:c}=J(),d=l&&"toolName"in l.action&&"toolName"in l.action?l.action.toolName:null;let u;if(e[0]!==d||e[1]!==s){let w;e[3]!==d?(w=y=>y.name===d,e[3]=d,e[4]=w):w=e[4],u=s.find(w),e[0]=d,e[1]=s,e[2]=u}else u=e[2];const p=fr(s,u??null,Oi,Ei);let m;e[5]!==l||e[6]!==c?(m=w=>{l&&c(l.name,{action:{...l.action,toolName:w.name},outputSchema:w.outputSchema??{}})},e[5]=l,e[6]=c,e[7]=m):m=e[7];const x=m;if(i){let w;e[8]!==n?(w=O("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=w):w=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(De,{size:"sm"})}),e[10]=y):y=e[10];let k;return e[11]!==w?(k=o.jsx("div",{className:w,children:y}),e[11]=w,e[12]=k):k=e[12],k}if(r){let w;e[13]!==n?(w=O("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=w):w=e[14];let y;e[15]!==r.message?(y=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-destructive p-4 text-center",children:["Failed to load tools: ",r.message]}),e[15]=r.message,e[16]=y):y=e[16];let k;return e[17]!==w||e[18]!==y?(k=o.jsx("div",{className:w,children:y}),e[17]=w,e[18]=y,e[19]=k):k=e[19],k}let h;e[20]!==n?(h=O("flex flex-col h-full bg-sidebar",n),e[20]=n,e[21]=h):h=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("span",{className:"text-base font-medium text-foreground",children:"Select tool"}),e[22]=g):g=e[22];let b;e[23]!==s.length?(b=o.jsx("div",{className:"flex items-start border-b border-border",children:o.jsxs("div",{className:"flex-1 flex items-center h-12 px-5",children:[g,o.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["(",s.length,")"]})]})}),e[23]=s.length,e[24]=b):b=e[24];let j;if(e[25]!==x||e[26]!==p||e[27]!==d){let w;e[29]!==x||e[30]!==d?(w=y=>o.jsx(Ri,{icon:null,title:y.name,description:y.description,isSelected:y.name===d,onClick:()=>x(y)},y.name),e[29]=x,e[30]=d,e[31]=w):w=e[31],j=p.map(w),e[25]=x,e[26]=p,e[27]=d,e[28]=j}else j=e[28];let v;e[32]!==j?(v=o.jsx("div",{className:"flex-1 overflow-auto",children:j}),e[32]=j,e[33]=v):v=e[33];let S;return e[34]!==h||e[35]!==b||e[36]!==v?(S=o.jsxs("div",{className:h,children:[b,v]}),e[34]=h,e[35]=b,e[36]=v,e[37]=S):S=e[37],S}function Ei(t,e){return t.name.localeCompare(e.name)}function Oi(t){return t.name}function Ri(t){const e=N.c(20),{icon:n,title:s,description:i,isSelected:r,onClick:l}=t,c=r&&"bg-muted/50";let a;e[0]!==c?(a=O("flex items-start gap-2.5 min-h-14 px-5 py-4 cursor-pointer transition-colors","hover:bg-muted/50",c),e[0]=c,e[1]=a):a=e[1];let d;e[2]!==l?(d=h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},e[2]=l,e[3]=d):d=e[3];let u;e[4]!==n||e[5]!==s?(u=o.jsx(ze,{icon:n,name:s,size:"xs",className:"shadow-sm mt-0.5"}),e[4]=n,e[5]=s,e[6]=u):u=e[6];let f;e[7]!==s?(f=o.jsx("span",{className:"text-sm font-medium text-foreground truncate block",children:s}),e[7]=s,e[8]=f):f=e[8];let p;e[9]!==i?(p=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=p):p=e[10];let m;e[11]!==f||e[12]!==p?(m=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,p]}),e[11]=f,e[12]=p,e[13]=m):m=e[13];let x;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==m?(x=o.jsxs("div",{className:a,onClick:l,role:"button",tabIndex:0,onKeyDown:d,children:[u,m]}),e[14]=l,e[15]=a,e[16]=d,e[17]=u,e[18]=m,e[19]=x):x=e[19],x}var Y="Accordion",Ai=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Mt,Pi,Mi]=xs(Y),[Fe]=tn(Y,[Mi,cn]),Lt=cn(),Bn=U.forwardRef((t,e)=>{const{type:n,...s}=t,i=s,r=s;return o.jsx(Mt.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?o.jsx(Wi,{...r,ref:e}):o.jsx(Di,{...i,ref:e})})});Bn.displayName=Y;var[qn,Li]=Fe(Y),[Kn,zi]=Fe(Y,{collapsible:!1}),Di=U.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},collapsible:r=!1,...l}=t,[c,a]=ut({prop:n,defaultProp:s??"",onChange:i,caller:Y});return o.jsx(qn,{scope:t.__scopeAccordion,value:U.useMemo(()=>c?[c]:[],[c]),onItemOpen:a,onItemClose:U.useCallback(()=>r&&a(""),[r,a]),children:o.jsx(Kn,{scope:t.__scopeAccordion,collapsible:r,children:o.jsx(Jn,{...l,ref:e})})})}),Wi=U.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},...r}=t,[l,c]=ut({prop:n,defaultProp:s??[],onChange:i,caller:Y}),a=U.useCallback(u=>c((f=[])=>[...f,u]),[c]),d=U.useCallback(u=>c((f=[])=>f.filter(p=>p!==u)),[c]);return o.jsx(qn,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:d,children:o.jsx(Kn,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(Jn,{...r,ref:e})})})}),[Hi,Ue]=Fe(Y),Jn=U.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:s,dir:i,orientation:r="vertical",...l}=t,c=U.useRef(null),a=en(c,e),d=Pi(n),f=hs(i)==="ltr",p=Q(t.onKeyDown,m=>{if(!Ai.includes(m.key))return;const x=m.target,h=d().filter($=>!$.ref.current?.disabled),g=h.findIndex($=>$.ref.current===x),b=h.length;if(g===-1)return;m.preventDefault();let j=g;const v=0,S=b-1,w=()=>{j=g+1,j>S&&(j=v)},y=()=>{j=g-1,j<v&&(j=S)};switch(m.key){case"Home":j=v;break;case"End":j=S;break;case"ArrowRight":r==="horizontal"&&(f?w():y());break;case"ArrowDown":r==="vertical"&&w();break;case"ArrowLeft":r==="horizontal"&&(f?y():w());break;case"ArrowUp":r==="vertical"&&y();break}const k=j%b;h[k].ref.current?.focus()});return o.jsx(Hi,{scope:n,disabled:s,direction:i,orientation:r,children:o.jsx(Mt.Slot,{scope:n,children:o.jsx(dt.div,{...l,"data-orientation":r,ref:a,onKeyDown:s?void 0:p})})})}),Le="AccordionItem",[Vi,zt]=Fe(Le),Gn=U.forwardRef((t,e)=>{const{__scopeAccordion:n,value:s,...i}=t,r=Ue(Le,n),l=Li(Le,n),c=Lt(n),a=ps(),d=s&&l.value.includes(s)||!1,u=r.disabled||t.disabled;return o.jsx(Vi,{scope:n,open:d,disabled:u,triggerId:a,children:o.jsx(Js,{"data-orientation":r.orientation,"data-state":ts(d),...c,...i,ref:e,disabled:u,open:d,onOpenChange:f=>{f?l.onItemOpen(s):l.onItemClose(s)}})})});Gn.displayName=Le;var Xn="AccordionHeader",Zn=U.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=Ue(Y,n),r=zt(Xn,n);return o.jsx(dt.h3,{"data-orientation":i.orientation,"data-state":ts(r.open),"data-disabled":r.disabled?"":void 0,...s,ref:e})});Zn.displayName=Xn;var ct="AccordionTrigger",Yn=U.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=Ue(Y,n),r=zt(ct,n),l=zi(ct,n),c=Lt(n);return o.jsx(Mt.ItemSlot,{scope:n,children:o.jsx(Xs,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...c,...s,ref:e})})});Yn.displayName=ct;var Qn="AccordionContent",es=U.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=Ue(Y,n),r=zt(Qn,n),l=Lt(n);return o.jsx(Gs,{role:"region","aria-labelledby":r.triggerId,"data-orientation":i.orientation,...l,...s,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});es.displayName=Qn;function ts(t){return t?"open":"closed"}var Fi=Bn,Ui=Gn,Bi=Zn,qi=Yn,Ki=es;function Ji(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Fi,{"data-slot":"accordion",...n}),e[2]=n,e[3]=s):s=e[3],s}function Gi(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("border-b last:border-b-0",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx(Ui,{"data-slot":"accordion-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Xi(t){const e=N.c(11);let n,s,i;e[0]!==t?({className:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==s?(r=O("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-center justify-between gap-4 py-4 text-left text-sm font-medium transition-all outline-none hover:bg-accent/50 focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-90",s),e[4]=s,e[5]=r):r=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(xo,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 transition-transform duration-200"}),e[6]=l):l=e[6];let c;return e[7]!==n||e[8]!==i||e[9]!==r?(c=o.jsx(Bi,{className:"flex",children:o.jsxs(qi,{"data-slot":"accordion-trigger",className:r,...i,children:[n,l]})}),e[7]=n,e[8]=i,e[9]=r,e[10]=c):c=e[10],c}function Zi(t){const e=N.c(12);let n,s,i;e[0]!==t?({className:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==s?(r=O("pt-0 pb-4",s),e[4]=s,e[5]=r):r=e[5];let l;e[6]!==n||e[7]!==r?(l=o.jsx("div",{className:r,children:n}),e[6]=n,e[7]=r,e[8]=l):l=e[8];let c;return e[9]!==i||e[10]!==l?(c=o.jsx(Ki,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...i,children:l}),e[9]=i,e[10]=l,e[11]=c):c=e[11],c}var Yi=(t,e,n,s,i,r,l,c)=>{let a=document.documentElement,d=["light","dark"];function u(m){(Array.isArray(t)?t:[t]).forEach(x=>{let h=x==="class",g=h&&r?i.map(b=>r[b]||b):i;h?(a.classList.remove(...g),a.classList.add(r&&r[m]?r[m]:m)):a.setAttribute(x,m)}),f(m)}function f(m){c&&d.includes(m)&&(a.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)u(s);else try{let m=localStorage.getItem(e)||n,x=l&&m==="system"?p():m;u(x)}catch{}};C.createContext(void 0);C.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:s,enableColorScheme:i,defaultTheme:r,value:l,themes:c,nonce:a,scriptProps:d})=>{let u=JSON.stringify([n,e,r,t,c,l,s,i]).slice(1,-1);return C.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?a:"",dangerouslySetInnerHTML:{__html:`(${Yi.toString()})(${u})`}})});function Qi(t){const{updateStep:e}=J(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=Dt(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function el(t){const e=N.c(25),{className:n}=t,s=Te(),{appendStep:i}=J();if(Qi(s),!s){let p;e[0]!==n?(p=O("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=p):p=e[1];let m;e[2]!==i?(m=()=>{i({type:"tool"})},e[2]=i,e[3]=m):m=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(an,{size:14}),e[4]=x):x=e[4];let h;e[5]!==m?(h=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground gap-2 flex-col",children:["Select or create a step to configure",o.jsx(B,{variant:"ghost",size:"icon",className:"size-7",onClick:m,children:x})]}),e[5]=m,e[6]=h):h=e[6];let g;return e[7]!==p||e[8]!==h?(g=o.jsx("div",{className:p,children:h}),e[7]=p,e[8]=h,e[9]=g):g=e[9],g}let r;e[10]!==n?(r=O("flex flex-col h-full bg-sidebar overflow-scroll",n),e[10]=n,e[11]=r):r=e[11];let l,c,a,d,u;e[12]!==s?(l=o.jsx(tl,{step:s}),c=o.jsx(sl,{step:s}),a=o.jsx(ol,{step:s}),d=o.jsx(cl,{step:s}),u=o.jsx(ul,{step:s}),e[12]=s,e[13]=l,e[14]=c,e[15]=a,e[16]=d,e[17]=u):(l=e[13],c=e[14],a=e[15],d=e[16],u=e[17]);let f;return e[18]!==r||e[19]!==l||e[20]!==c||e[21]!==a||e[22]!==d||e[23]!==u?(f=o.jsxs("div",{className:r,children:[l,c,a,d,u]}),e[18]=r,e[19]=l,e[20]=c,e[21]=a,e[22]=d,e[23]=u,e[24]=f):f=e[24],f}function tl(t){const e=N.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=q(),l=i??"";let c;e[0]!==l?(c=o.jsx(ze,{icon:null,name:l,size:"xs",className:"shadow-sm"}),e[0]=l,e[1]=c):c=e[1];let a;e[2]!==i?(a=o.jsx("span",{className:"text-base font-medium text-foreground truncate flex-1",children:i}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==r?(d=r?null:o.jsx(nl,{}),e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==a||e[8]!==d?(u=o.jsxs("div",{className:"flex items-center gap-2",children:[c,a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;e[10]!==n.description?(f=n.description&&o.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[10]=n.description,e[11]=f):f=e[11];let p;return e[12]!==u||e[13]!==f?(p=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex flex-col gap-2",children:[u,f]}),e[12]=u,e[13]=f,e[14]=p):p=e[14],p}function nl(){const t=N.c(9),e=Te(),{updateStep:n,startReplacingTool:s}=J(),i=q(),l=e&&"toolName"in e.action?e.action.toolName:null;let c;t[0]!==e||t[1]!==s||t[2]!==l||t[3]!==i||t[4]!==n?(c=()=>{if(e){if(i){Zt.error("You cannot replace a tool while a workflow is executing.");return}l&&s(l),n(e.name,{action:{...e.action,toolName:""}})}},t[0]=e,t[1]=s,t[2]=l,t[3]=i,t[4]=n,t[5]=c):c=t[5];const a=c;let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Sn,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(B,{variant:"ghost",size:"icon",className:"size-7",onClick:a,title:"Replace tool",children:d}),t[7]=a,t[8]=u):u=t[8],u}function Dt(t){const e=N.c(13),n=Ne();let s;e[0]!==n?(s=n?new URL(`/mcp/virtual-mcp/${n}`,window.location.origin).href:"",e[0]=n,e[1]=s):s=e[1];const i=s,r=!!n;let l;e[2]!==i||e[3]!==r?(l={url:i,enabled:r},e[2]=i,e[3]=r,e[4]=l):l=e[4];const c=St(l);let a;e[5]!==c.tools||e[6]!==t?(a=c.tools?.find(m=>m.name===t),e[5]=c.tools,e[6]=t,e[7]=a):a=e[7];const d=a,u=c.state==="connecting",f=c.state==="ready";let p;return e[8]!==c.error||e[9]!==u||e[10]!==f||e[11]!==d?(p={tool:d,isLoading:u,isReady:f,error:c.error},e[8]=c.error,e[9]=u,e[10]=f,e[11]=d,e[12]=p):p=e[12],p}function sl(t){const e=N.c(13),{step:n}=t,{updateStep:s}=J(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=q(),{tool:c}=Dt(r??"");if(!c||!c.inputSchema)return null;let a;e[0]!==n.name||e[1]!==s?(a=b=>{s(n.name,{input:b})},e[0]=n.name,e[1]=s,e[2]=a):a=e[2];const d=a,u=l?"output":"input";let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(Xi,{className:"px-5 py-5",children:o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),e[3]=f):f=e[3];const p=c.inputSchema,m=n.input;let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[4]=x):x=e[4];let h;e[5]!==d||e[6]!==n.name||e[7]!==p||e[8]!==m?(h=o.jsxs(Gi,{value:"input",className:"border-b-0",children:[f,o.jsx(Zi,{className:"px-5 pt-2",children:o.jsx(Un,{inputSchema:p,inputParams:m,setInputParams:d,mentions:x},n.name)})]}),e[5]=d,e[6]=n.name,e[7]=p,e[8]=m,e[9]=h):h=e[9];let g;return e[10]!==u||e[11]!==h?(g=o.jsx(Ji,{type:"single",collapsible:!0,defaultValue:u,className:"border-b border-border shrink-0",children:h}),e[10]=u,e[11]=h,e[12]=g):g=e[12],g}function ol(t){const e=N.c(24),{step:n}=t,s=n.outputSchema,[i,r]=C.useState(!1),l=q(),{item:c}=Ce(l),a=!!(c?.completed_steps?.success?.includes(n.name)||c?.completed_steps?.error?.includes(n.name)),{output:d,error:u}=nr(l,a?n.name:void 0);let f;e[0]!==u||e[1]!==d?(f=d||(u?{error:u}:void 0),e[0]=u,e[1]=d,e[2]=f):f=e[2];const p=f,m=s&&typeof s=="object"?s.properties:void 0;let x;e[3]!==m?(x=m?Object.entries(m):[],e[3]=m,e[4]=x):x=e[4];const h=x,g=i?"flex-1 min-h-0 overflow-hidden":"shrink-0";let b;e[5]!==g?(b=O("flex flex-col border-b border-border",g),e[5]=g,e[6]=b):b=e[6];let j;e[7]!==i?(j=()=>r(!i),e[7]=i,e[8]=j):j=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Output"}),e[9]=v):v=e[9];let S;e[10]!==i?(S=o.jsxs("div",{className:"flex items-center justify-between",children:[v,i?o.jsx(Tt,{size:14,className:"text-muted-foreground"}):o.jsx(_t,{size:14,className:"text-muted-foreground"})]}),e[10]=i,e[11]=S):S=e[11];let w;e[12]!==j||e[13]!==S?(w=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:j,children:S}),e[12]=j,e[13]=S,e[14]=w):w=e[14];let y;e[15]!==p||e[16]!==i||e[17]!==h||e[18]!==l?(y=i&&o.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:[l&&p?o.jsx(we,{code:JSON.stringify(p,null,2),language:"json",height:"100%",readOnly:!0}):null,!l&&h.map(rl)]}),e[15]=p,e[16]=i,e[17]=h,e[18]=l,e[19]=y):y=e[19];let k;return e[20]!==b||e[21]!==w||e[22]!==y?(k=o.jsxs("div",{className:b,children:[w,y]}),e[20]=b,e[21]=w,e[22]=y,e[23]=k):k=e[23],k}function rl(t){const[e,n]=t;return o.jsx(ll,{name:e,schema:n},e)}function il(t){switch(t){case"string":return{Icon:gn,color:"text-blue-500"};case"number":case"integer":return{Icon:xn,color:"text-blue-500"};case"array":return{Icon:fn,color:"text-purple-500"};case"object":return{Icon:un,color:"text-orange-500"};case"boolean":return{Icon:hn,color:"text-pink-500"};case"null":return{Icon:ft,color:"text-gray-500"};default:return{Icon:mn,color:"text-muted-foreground"}}}function ll(t){const e=N.c(28),{name:n,schema:s}=t,i=Te(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:S,color:w}=il(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=S,c=14,a=O(w),e[0]=r,e[1]=l,e[2]=c,e[3]=a,e[4]=d,e[5]=u}else l=e[1],c=e[2],a=e[3],d=e[4],u=e[5];let f;e[6]!==l||e[7]!==c||e[8]!==a?(f=o.jsx(l,{size:c,className:a}),e[6]=l,e[7]=c,e[8]=a,e[9]=f):f=e[9];let p;e[10]!==n?(p=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=p):p=e[11];let m;e[12]!==d||e[13]!==f||e[14]!==p?(m=o.jsxs("div",{className:d,children:[f,p]}),e[12]=d,e[13]=f,e[14]=p,e[15]=m):m=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(wn,{size:14,className:"opacity-50"}),e[16]=x):x=e[16];const h=i?.name;let g;e[17]!==h?(g=o.jsxs("span",{className:"text-muted-foreground",children:[h,"."]}),e[17]=h,e[18]=g):g=e[18];let b;e[19]!==n?(b=o.jsx("div",{className:"bg-blue-500/10 text-blue-500 px-1 py-0.5 rounded",children:n}),e[19]=n,e[20]=b):b=e[20];let j;e[21]!==g||e[22]!==b?(j=o.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[x,g,b]}),e[21]=g,e[22]=b,e[23]=j):j=e[23];let v;return e[24]!==j||e[25]!==u||e[26]!==m?(v=o.jsxs("div",{className:u,children:[m,j]}),e[24]=j,e[25]=u,e[26]=m,e[27]=v):v=e[27],v}function cl(t){const e=N.c(29),{step:n}=t,{updateStep:s}=J(),i=q(),[r,l]=C.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=Dt(a??""),u=c&&"transformCode"in n.action?n.action.transformCode??null:null;let f;e[0]!==d?(f=()=>{if(!d?.outputSchema)return`interface Input {
8
- // Tool output schema not available
9
- }`;const $=d.outputSchema,_=$.properties;return _?`interface Input {
10
- ${Object.entries(_).map(A=>{const[P,M]=A,z=Ae(M),H=!$.required?.includes(P);return` ${P}${H?"?":""}: ${z};`}).join(`
11
- `)}
12
- }`:`interface Input {
13
- [key: string]: unknown;
14
- }`},e[0]=d,e[1]=f):f=e[1];const p=f;let m;e[2]!==p||e[3]!==n.action||e[4]!==n.name||e[5]!==s?(m=()=>{if("transformCode"in n.action&&n.action.transformCode){l(dl);return}const _=`${p()}
15
-
16
- interface Output {
17
- // Define your output type here
18
- result: unknown;
19
- }
20
-
21
- export default async function(input: Input): Promise<Output> {
22
- // Transform the tool output
23
- return {
24
- result: input,
25
- };
26
- }`;s(n.name,{action:{...n.action,transformCode:_}}),l(al)},e[2]=p,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=m):m=e[6];const x=m;let h;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(h=($,_)=>{s(n.name,{action:{...n.action,transformCode:$},..._?{outputSchema:_}:{}})},e[7]=n.action,e[8]=n.name,e[9]=s,e[10]=h):h=e[10];const g=h;if("code"in n.action&&n.action.code)return null;const b=r?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[11]!==b?(j=O("flex flex-col flex-1 min-h-0 overflow-hidden border-b border-border",b),e[11]=b,e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=v):v=e[13];let S;e[14]!==r?(S=o.jsxs("div",{className:"flex items-center justify-between",children:[v,r?o.jsx(Tt,{size:14,className:"text-muted-foreground"}):o.jsx(_t,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=S):S=e[15];let w;e[16]!==S||e[17]!==x?(w=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:x,children:S}),e[16]=S,e[17]=x,e[18]=w):w=e[18];let y;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(y=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(we,{code:u,language:"typescript",readOnly:i!==void 0,onSave:g,height:"100%"},`transform-code-${n.name}-${i}`)}),e[19]=g,e[20]=r,e[21]=n.name,e[22]=i,e[23]=u,e[24]=y):y=e[24];let k;return e[25]!==j||e[26]!==w||e[27]!==y?(k=o.jsxs("div",{className:j,children:[w,y]}),e[25]=j,e[26]=w,e[27]=y,e[28]=k):k=e[28],k}function al(t){return!t}function dl(t){return!t}function ul(t){const e=N.c(24),{step:n}=t,[s,i]=C.useState(!1),{updateStep:r}=J(),l="code"in n.action&&n.action.code?n.action.code:null,c=q();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,v)=>{r(n.name,{action:{...n.action,code:j},...v?{outputSchema:v}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=a):a=e[3];const d=a;if(!l)return null;const u=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let f;e[4]!==u?(f=O("flex flex-col border-b border-border",u),e[4]=u,e[5]=f):f=e[5];let p;e[6]!==s?(p=()=>i(!s),e[6]=s,e[7]=p):p=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[8]=m):m=e[8];let x;e[9]!==s?(x=o.jsxs("div",{className:"flex items-center justify-between",children:[m,s?o.jsx(Tt,{size:14,className:"text-muted-foreground"}):o.jsx(_t,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=x):x=e[10];let h;e[11]!==p||e[12]!==x?(h=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:x}),e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==l||e[15]!==d||e[16]!==s||e[17]!==n.name||e[18]!==c?(g=s&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(we,{onSave:(j,v)=>d(j,v),code:l,language:"typescript",height:"100%",readOnly:c!==void 0},`step-code-${n.name}-${c}`)}),e[14]=l,e[15]=d,e[16]=s,e[17]=n.name,e[18]=c,e[19]=g):g=e[19];let b;return e[20]!==f||e[21]!==h||e[22]!==g?(b=o.jsxs("div",{className:f,children:[h,g]}),e[20]=f,e[21]=h,e[22]=g,e[23]=b):b=e[23],b}function Ae(t){if(Array.isArray(t.type))return t.type.map(n=>Ae({...t,type:n})).join(" | ");switch(t.type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return t.items?`${Ae(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Ae(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function fl(t){switch(t){case"success":return o.jsxs(je,{variant:"success",className:"gap-1",children:[o.jsx(It,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(je,{variant:"destructive",className:"gap-1",children:[o.jsx($t,{size:11}),"Error"]});case"running":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),"Running"]});case"enqueued":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),"On hold"]});case"cancelled":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(dn,{size:11}),"Cancelled"]});default:return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),t]})}}function ml(t){return`Run #${t.slice(-4).toUpperCase()}`}function pl(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=sr(),{setShowExecutionsList:r}=Rt(),{setTrackingExecutionId:l}=J(),c=q();let a;e[0]!==l?(a=v=>{l(v)},e[0]=l,e[1]=a):a=e[1];const d=a;let u;e[2]!==r?(u=()=>{r(!1)},e[2]=r,e[3]=u):u=e[3];const f=u;let p;e[4]!==n?(p=O("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=p):p=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=m):m=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(dn,{size:11}),e[7]=x):x=e[7];let h;e[8]!==f?(h=o.jsxs("div",{className:"flex items-center h-12 px-5 border-b border-border shrink-0",children:[m,o.jsx(B,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:x})]}),e[8]=f,e[9]=h):h=e[9];let g;e[10]!==s||e[11]!==d||e[12]!==i||e[13]!==c?(g=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((v,S)=>o.jsx(xl,{execution:v,isSelected:v.id===c,isFirst:S===0,onSelect:()=>d(v.id)},v.id)),e[10]=s,e[11]=d,e[12]=i,e[13]=c,e[14]=g):g=e[14];let b;e[15]!==g?(b=o.jsx("div",{className:"flex-1 overflow-auto",children:g}),e[15]=g,e[16]=b):b=e[16];let j;return e[17]!==p||e[18]!==h||e[19]!==b?(j=o.jsxs("div",{className:p,children:[h,b]}),e[17]=p,e[18]=h,e[19]=b,e[20]=j):j=e[20],j}function xl(t){const e=N.c(17),{execution:n,isSelected:s,isFirst:i,onSelect:r}=t,l=s&&"bg-accent/50",c=i&&s&&"bg-accent/50",a=!s&&"hover:bg-accent/30";let d;e[0]!==l||e[1]!==c||e[2]!==a?(d=O("flex flex-col justify-center h-[60px] px-4 border-b border-border cursor-pointer transition-colors",l,c,a),e[0]=l,e[1]=c,e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n.status?(u=fl(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=ml(n.id),e[6]=n.id,e[7]=f):f=e[7];let p;e[8]!==f?(p=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=p):p=e[9];let m;e[10]!==u||e[11]!==p?(m=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,p]}),e[10]=u,e[11]=p,e[12]=m):m=e[12];let x;return e[13]!==r||e[14]!==d||e[15]!==m?(x=o.jsx("div",{className:d,onClick:r,children:m}),e[13]=r,e[14]=d,e[15]=m,e[16]=x):x=e[16],x}function hl(t){const e=N.c(9),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=ne(s),r=i??le;let l;e[1]!==r?(l=Z(r),e[1]=r,e[2]=l):l=e[2];const c=l,a=mt(r,"WORKFLOW",n,c),d=pt(r,"WORKFLOW",c);let u;e[3]!==d||e[4]!==n?(u=async m=>{await d.update.mutateAsync({id:n,data:m})},e[3]=d,e[4]=n,e[5]=u):u=e[5];const f=u;let p;return e[6]!==a||e[7]!==f?(p={item:a,update:f},e[6]=a,e[7]=f,e[8]=p):p=e[8],p}function gl(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=J();let r,l,c,a;if(e[0]!==n.description||e[1]!==n.id||e[2]!==n.steps||e[3]!==n.title){const f={title:n.title,description:n.description,steps:n.steps};r=we,l=`workflow-${n.id}`,c="100%",a=JSON.stringify(f,null,2),e[0]=n.description,e[1]=n.id,e[2]=n.steps,e[3]=n.title,e[4]=r,e[5]=l,e[6]=c,e[7]=a}else r=e[4],l=e[5],c=e[6],a=e[7];let d;e[8]!==s||e[9]!==i||e[10]!==n?(d=f=>{const p=JSON.parse(f);i({...n,...p}),s(p)},e[8]=s,e[9]=i,e[10]=n,e[11]=d):d=e[11];let u;return e[12]!==r||e[13]!==l||e[14]!==c||e[15]!==a||e[16]!==d?(u=o.jsx(r,{height:c,code:a,language:"json",onSave:d},l),e[12]=r,e[13]=l,e[14]=c,e[15]=a,e[16]=d,e[17]=u):u=e[17],u}function bl(){const t=N.c(12),{setTrackingExecutionId:e}=J(),n=q();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(gs,{className:"w-4 h-4 text-muted-foreground"})}),t[0]=s):s=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[1]=i):i=t[1];let r;t[2]!==n?(r=o.jsxs("div",{className:"flex items-center h-full",children:[s,o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[i,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]})]}),t[2]=n,t[3]=r):r=t[3];let l;t[4]!==e?(l=()=>e(void 0),t[4]=e,t[5]=l):l=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(ft,{className:"w-4 h-4 text-muted-foreground"}),t[6]=c):c=t[6];let a;t[7]!==l?(a=o.jsx(B,{variant:"ghost",size:"xs",onClick:l,children:c}),t[7]=l,t[8]=a):a=t[8];let d;return t[9]!==r||t[10]!==a?(d=o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between border-b border-border",children:[r,a]}),t[9]=r,t[10]=a,t[11]=d):d=t[11],d}function jl(t){const e=N.c(17),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=ne(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l,update:c}=hl(r);let a;e[3]!==l?(a=JSON.stringify(l),e[3]=l,e[4]=a):a=e[4];const d=a;if(!l){let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Nt,{icon:o.jsx(pn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow not found",description:"This workflow may have been deleted or you may not have access to it."})}),e[5]=m):m=e[5];let x;return e[6]!==n?(x=o.jsx(ve,{onBack:n,children:m}),e[6]=n,e[7]=x):x=e[7],x}let u;e[8]!==l?(u={workflow:l,trackingExecutionId:void 0,currentStepTab:"input"},e[8]=l,e[9]=u):u=e[9];let f;e[10]!==n||e[11]!==c?(f=o.jsx(vl,{onBack:n,onUpdate:c}),e[10]=n,e[11]=c,e[12]=f):f=e[12];let p;return e[13]!==d||e[14]!==u||e[15]!==f?(p=o.jsx(Bo,{initialState:u,children:f},d),e[13]=d,e[14]=u,e[15]=f,e[16]=p):p=e[16],p}function vl(t){const e=N.c(24),{onBack:n,onUpdate:s}=t,i=Se(),r=q(),{setOriginalWorkflow:l}=J(),{viewMode:c,showExecutionsList:a}=Rt(),d=Te();let u;e[0]!==s||e[1]!==l||e[2]!==i?(u=async()=>{await s(i),l(i)},e[0]=s,e[1]=l,e[2]=i,e[3]=u):u=e[3];const f=u,p=d&&"toolName"in d.action,m=p?d.action.toolName:null,x=p&&!m&&!r,h=!x&&(d||r||!a);let g;e[4]!==f||e[5]!==i.description||e[6]!==i.title?(g=o.jsx(ci,{title:i.title,description:i.description,onSave:f}),e[4]=f,e[5]=i.description,e[6]=i.title,e[7]=g):g=e[7];let b;e[8]!==r?(b=r&&o.jsx(bl,{}),e[8]=r,e[9]=b):b=e[9];let j;e[10]!==s||e[11]!==a||e[12]!==h||e[13]!==x||e[14]!==c||e[15]!==i?(j=o.jsx("div",{className:"flex-1 overflow-hidden",children:c==="code"?o.jsx(gl,{workflow:i,onUpdate:s}):o.jsxs(As,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(Wt,{defaultSize:50,minSize:30,children:o.jsx(Ci,{})}),o.jsx(Ps,{}),o.jsxs(Wt,{defaultSize:50,minSize:25,children:[x&&o.jsx(Ti,{className:"border-l border-border"}),a&&o.jsx(pl,{}),h&&o.jsx(el,{className:"border-l border-border"})]})]})}),e[10]=s,e[11]=a,e[12]=h,e[13]=x,e[14]=c,e[15]=i,e[16]=j):j=e[16];let v;e[17]!==g||e[18]!==b||e[19]!==j?(v=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[g,b,j]}),e[17]=g,e[18]=b,e[19]=j,e[20]=v):v=e[20];let S;return e[21]!==n||e[22]!==v?(S=o.jsx(ve,{onBack:n,children:v}),e[21]=n,e[22]=v,e[23]=S):S=e[23],S}function wl(t){const e=N.c(5),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=ne(s),r=i??le;let l;e[1]!==r?(l=Z(r),e[1]=r,e[2]=l):l=e[2];const a=mt(r,"WORKFLOW_EXECUTION",n,l);let d;return e[3]!==a?(d={item:a},e[3]=a,e[4]=d):d=e[4],d}function yl(t){const e=N.c(13),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=ne(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l}=wl(r);if(!l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Nt,{icon:o.jsx(pn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow execution not found",description:"This workflow execution may have been deleted or you may not have access to it."})}),e[3]=u):u=e[3];let f;return e[4]!==n?(f=o.jsx(ve,{onBack:n,children:u}),e[4]=n,e[5]=f):f=e[5],f}let c;e[6]!==l?(c=JSON.stringify(l,null,2),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==c?(a=o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(we,{height:"100%",code:c,language:"json",readOnly:!0})}),e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(ve,{onBack:n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}const Sl={workflow:jl,workflow_execution:yl,prompt:No};function Nl(){const t=N.c(6),e=nn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=ne(n),i=decodeURIComponent(s.itemId);let r;t[1]!==e.history?(r=()=>{e.history.back()},t[1]=e.history,t[2]=r):r=t[2];const l=r,c=kl;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(Oo,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function kl(t){return Promise.resolve()}function Cl(){const t=N.c(18),e=nn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=ne(n),i=s.connectionId,r=decodeURIComponent(s.collectionName),l=decodeURIComponent(s.itemId);let c;t[1]!==e.history?(c=()=>{e.history.back()},t[1]=e.history,t[2]=c):c=t[2];const a=c,d=i??le;let u;t[3]!==d?(u=Z(d),t[3]=d,t[4]=u):u=t[4];const p=pt(d,r,u);let m;t[5]!==p||t[6]!==l?(m=async S=>{l&&await p.update.mutateAsync({id:l,data:S})},t[5]=p,t[6]=l,t[7]=m):m=t[7];const x=m;let h;t[8]!==r?(h=r?.toLowerCase(),t[8]=r,t[9]=h):h=t[9];const g=h,b=g&&Sl[g];if(b){let S;return t[10]!==b||t[11]!==a||t[12]!==x||t[13]!==l?(S=o.jsx(b,{itemId:l,onBack:a,onUpdate:x}),t[10]=b,t[11]=a,t[12]=x,t[13]=l,t[14]=S):S=t[14],S}let j;t[15]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(bs,{size:36,className:"text-muted-foreground"}),t[15]=j):j=t[15];let v;return t[16]!==a?(v=o.jsx(Nt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[16]=a,t[17]=v):v=t[17],v}function Il(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=ne(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Nl,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(Cl,{}),t[2]=r):r=t[2],r}function qc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(on,{children:o.jsx(C.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Il,{})})}),t[0]=e):e=t[0],e}export{qc as default};
@@ -1 +0,0 @@
1
- import{c as ne,j as t,K as nt,f as lt,k as rt,a as at,r as ct,t as dt}from"./index-B9c3bNyk.js";import{g as Me}from"./generate-id-Dyweu44Y.js";import{c as Re}from"./connection-C0f0eQA8.js";import{C as Ve}from"./collection-display-button-CQf7wSjn.js";import{C as mt}from"./collection-search-BHs67_UI.js";import{C as ft}from"./card-CRtF9cdr.js";import{I as qe,E as ut}from"./empty-state-CSTjcp0X.js";import{b as Ge,D as We,a as He,c as F}from"./dropdown-menu-BbIA2rWH.js";import{B as ke,c as ze}from"./button-Ta3HWdYR.js";import{a as Je}from"./Copy01-EV4WWtW9.js";import{i as Qe}from"./DotsVertical-BIgdSuWw.js";import{i as Ye}from"./Edit01-YiEPkU0g.js";import{s as Xe,u as pt}from"./use-list-state-Ck_kabtn.js";import{s as Ze}from"./Trash01-DjLKhTdL.js";import{C as ht}from"./collection-table-wrapper-3bPS8SS1.js";import{E as Ue}from"./empty-state-CUODA5WM.js";import{n as Be}from"./Inbox01-BWl9K4GL.js";import{A as Oe}from"./avatar-BZZ8iTNu.js";import{u as xt}from"./useQuery-CqMcSUvK.js";import{P as gt}from"./pin-to-sidebar-button-B85FzaKS.js";import{b as jt}from"./use-connection-Cpo9FQLA.js";import{a as Ct,b as vt}from"./use-collections-BnNAdJQg.js";import{B as bt}from"./constants-7IT_izqz.js";import{A as yt,g as Nt,c as wt,b as St,d as _t,e as Dt,a as At,f as Tt}from"./alert-dialog-D9F5tffK.js";import{s as It}from"./Plus-DtbgAjWY.js";import{V as Pt}from"./layout-CMBAL9_n.js";function $t(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of d)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Et(n){const e=ne.c(25),{item:s,schema:d,actions:o}=n;let l;e[0]!==s||e[1]!==d?(l=$t(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]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(qe,{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 j;e[8]!==s.title?(j=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=j):j=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]!==j||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[j,m]}),e[12]=j,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 C;e[18]!==o||e[19]!==i||e[20]!==s?(C=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ft,onMouseDown:kt,children:t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ot,children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:zt,children:[o.open&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.open?.(s)},children:[t.jsx(Xe,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.edit?.(s)},children:[t.jsx(Ye,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:r=>{r.stopPropagation(),o.delete?.(s)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=C):C=e[21];let S;return e[22]!==y||e[23]!==C?(S=t.jsxs(ft,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,C]}),e[22]=y,e[23]=C,e[24]=S):S=e[24],S}function zt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Re(),e[0]=s):s=e[0];const d=s;let o;e[1]!==n?(o=nt.user(n),e[1]=n,e[2]=o):o=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]!==o||e[6]!==l||e[7]!==a?(c={queryKey:o,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=o,e[6]=l,e[7]=a,e[8]=c):c=e[8],xt(c)}function Mt(n){const e=ne.c(39),{id:s,size:d,showEmail:o,className:l}=n,a=d===void 0?"xs":d,c=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Kt(s);if(i){let r;e[0]!==l?(r=ze("flex items-center gap-2",l),e[0]=l,e[1]=r):r=e[1];let g;e[2]!==a?(g=t.jsx(Oe.Skeleton,{shape:"circle",size:a}),e[2]=a,e[3]=g):g=e[3];let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=v):v=e[4];let p;e[5]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=c,e[6]=p):p=e[6];let _;e[7]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[v,p]}),e[7]=p,e[8]=_):_=e[8];let b;return e[9]!==r||e[10]!==g||e[11]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[9]=r,e[10]=g,e[11]=_,e[12]=b):b=e[12],b}if(u||!f){let r;e[13]!==l?(r=ze("flex items-center gap-2",l),e[13]=l,e[14]=r):r=e[14];let g;e[15]!==a?(g=t.jsx(Oe,{shape:"circle",size:a,fallback:"?",muted:!0}),e[15]=a,e[16]=g):g=e[16];let v;e[17]===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[17]=v):v=e[17];let p;return e[18]!==r||e[19]!==g?(p=t.jsxs("div",{className:r,children:[g,v]}),e[18]=r,e[19]=g,e[20]=p):p=e[20],p}let j;e[21]!==l?(j=ze("flex items-center gap-2",l),e[21]=l,e[22]=j):j=e[22];const h=f.image??void 0;let m;e[23]!==a||e[24]!==h||e[25]!==f.name?(m=t.jsx(Oe,{shape:"circle",size:a,url:h,fallback:f.name}),e[23]=a,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==c||e[30]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=c,e[30]=f.email,e[31]=y):y=e[31];let C;e[32]!==x||e[33]!==y?(C=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=C):C=e[34];let S;return e[35]!==j||e[36]!==m||e[37]!==C?(S=t.jsxs("div",{className:j,children:[m,C]}),e[35]=j,e[36]=m,e[37]=C,e[38]=S):S=e[38],S}const Ut=["icon","avatar","logo"],Le=["created_at","created_by","id"];function Bt(n){return Object.keys(n).find(e=>Ut.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 Lt(n){const e=ne.c(32),{data:s,schema:d,viewMode:o,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:i,actions:u,onItemClick:j,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:C,sortableFields:S}=n,r=l===void 0?Wt:l,g=f===void 0?"asc":f,v=i===void 0?Gt:i;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=j===void 0?qt:j,P=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,$=C===void 0?!1:C,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Vt).filter(k=>!D||D.includes(k.id)).map(Rt):et(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const K=z;let I;e[6]!==P||e[7]!==$||e[8]!==v||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==K||e[13]!==o?(I=!$&&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:P}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Ve,{viewMode:o,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:v,sortOptions:K})})]})}),e[6]=P,e[7]=$,e[8]=v,e[9]=r,e[10]=g,e[11]=c,e[12]=K,e[13]=o,e[14]=I):I=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]!==o?(A=o==="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(k=>t.jsx("div",{onClick:()=>b?.(k),className:"cursor-pointer h-full",children:t.jsx(Et,{item:k,schema:d,readOnly:E,actions:_})},k.id))})}):t.jsx(ht,{columns:Qt(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]=o,e[28]=A):A=e[28];let O;return e[29]!==I||e[30]!==A?(O=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[I,A]}),e[29]=I,e[30]=A,e[31]=O):O=e[31],O}function Rt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Vt(n){return n.sortable!==!1}function qt(){}function Gt(){}function Wt(){}function Ht(n){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(We,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(He,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Xe,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ye,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Je,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Ze,{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 Jt(n,e){const s=n.properties||{},d=Object.keys(s).filter(i=>{const u=s[i];return u&&tt(u)}),o=Bt(s),l=[],a=new Set;o&&d.includes(o)&&(l.push(o),a.add(o));const c=["title","description","updated_at","updated_by"];for(const i of c)d.includes(i)&&!a.has(i)&&(l.push(i),a.add(i));const f=d.filter(i=>!a.has(i)&&!Le.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),a.add(i);for(const i of Le)d.includes(i)&&!a.has(i)&&(l.push(i),a.add(i));return l.map(i=>{const u=s[i],j=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(qe,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:j,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Mt,{id:String(m),size:"xs"}):"—"},sortable:j,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:j,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:j,cellClassName:"max-w-[200px]"}})}function Qt(n,e,s,d){const o=n||Jt(e,s);return o.some(c=>c.id==="actions")?o:Object.keys(d).length>0?[...o,Ht(d)]:o}function ws(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:o}=n,l=o.name,a=o.schema??bt,c=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=lt(),h=rt().location.href,{data:m}=at.useSession(),x=m?.user?.id||"unknown",y=jt(s);let C;e[0]!==s?(C=Re(s),e[0]=s,e[1]=C):C=e[1];const S=C,r=Ct(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:P,setViewMode:T,sortKey:E,sortDirection:N,handleSort:$}=pt(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=vt(s,l,S,D),K=!c&&!f&&!i;let I;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?(I=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]=I):I=e[13];const A=I;let O;e[14]!==r.create||e[15]!==x?(O=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Me("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]=O):O=e[16];const k=O,[M,xe]=ct.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 U;e[18]!==A||e[19]!==f?(U=f&&{edit:A},e[18]=A,e[19]=f,e[20]=U):U=e[20];let B;e[21]!==k||e[22]!==c?(B=c&&{duplicate:k},e[21]=k,e[22]=c,e[23]=B):B=e[23];let L;e[24]!==i?(L=i&&{delete:st},e[24]=i,e[25]=L):L=e[25];let re;e[26]!==L||e[27]!==U||e[28]!==B?(re={...U,...B,...L},e[26]=L,e[27]=U,e[28]=B,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==M?(ae=async()=>{M&&(await r.delete.mutateAsync(M.id),xe(null))},e[30]=r.delete,e[31]=M,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){dt.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Me("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 Ce=ce;let de;e[41]!==a?(de=et(a),e[41]=a,e[42]=de):de=e[42];const ve=de,Fe=(z?.length??0)>0,it=c&&Fe,ot=c&&!Fe&&!p;let me;e[43]!==r.create||e[44]!==Ce||e[45]!==c?(me=c?t.jsxs(ke,{onClick:Ce,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(It,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=Ce,e[45]=c,e[46]=me):me=e[46];const Ke=me,be=E;let R;e[47]!==$||e[48]!==T||e[49]!==N||e[50]!==ve||e[51]!==be||e[52]!==P?(R=t.jsx(Ve,{viewMode:P,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:$,sortOptions:ve}),e[47]=$,e[48]=T,e[49]=N,e[50]=ve,e[51]=be,e[52]=P,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(gt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=it&&Ke;let q;e[58]!==R||e[59]!==V||e[60]!==we?(q=t.jsxs(Pt,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${l}...`;let G;e[62]!==b?(G=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=G):G=e[63];let W;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==G?(W=t.jsx(mt,{value:p,onChange:b,placeholder:Se,onKeyDown:G}),e[64]=p,e[65]=b,e[66]=Se,e[67]=G,e[68]=W):W=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=ot?Ke:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(ut,{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]!==$||e[78]!==K||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]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Lt,{hideToolbar:!0,data:H,schema:a,viewMode:P,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:$,actions:ge,onItemClick:J,readOnly:K,emptyState:Q})}),e[77]=$,e[78]=K,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]=P,e[90]=Y):Y=e[90];let X;e[91]!==W||e[92]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[91]=W,e[92]=Y,e[93]=X):X=e[93];const Ie=!!M;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(wt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Pe=M?.title;let Z;e[96]!==Pe?(Z=t.jsxs(St,{children:[ue,t.jsxs(_t,{children:['Are you sure you want to delete "',Pe,'"? This action cannot be undone.']})]}),e[96]=Pe,e[97]=Z):Z=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(yt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const $e=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==$e?(te=t.jsx(Nt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$e}),e[100]=r.delete.isPending,e[101]=je,e[102]=$e,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(Dt,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let ie;e[107]!==Z||e[108]!==se?(ie=t.jsxs(At,{children:[Z,se]}),e[107]=Z,e[108]=se,e[109]=ie):ie=e[109];let oe;e[110]!==Ie||e[111]!==ie?(oe=t.jsx(Tt,{open:Ie,onOpenChange:fe,children:ie}),e[110]=Ie,e[111]=ie,e[112]=oe):oe=e[112];let pe;return e[113]!==q||e[114]!==X||e[115]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[113]=q,e[114]=X,e[115]=oe,e[116]=pe):pe=e[116],pe}export{ws as C};
@@ -1,2 +0,0 @@
1
- import{r as b,y as r,_ as d,I as a,z as e,J as n,aD as s,aH as m}from"./index-B9c3bNyk.js";b.createContext(void 0);const h="UNKNOWN_CONNECTION_ID",_=async o=>{const i=(await o.text()).split(`
2
- `).find(t=>t.startsWith("data: "));if(!i)throw new Error("No data received from the server");return JSON.parse(i.replace("data: ",""))};function w(o){if(o===h)return(async()=>{});const l=o?`/mcp/${o}`:"/mcp";return async(i,u)=>{const t=await fetch(l,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:i,arguments:u}}),headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},credentials:"include"});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const c=(t.headers.get("Content-Type")??"").startsWith("application/json")?await t.json():await _(t);if(c.result?.isError)throw new Error(c.result.content?.[0]?.text||"Tool call failed");return c.result?.structuredContent||c.result}}const f=r({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:a(e()),grantType:d(["authorization_code","client_credentials"])}),g=r({name:e(),description:e().optional(),inputSchema:n(e(),s()),outputSchema:n(e(),s()).optional()}),T=r({headers:n(e(),e()).optional()}),y=r({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:a(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:n(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),p=r({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),connection_type:d(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:m([y,T]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:f.nullable().describe("OAuth configuration"),configuration_state:n(e(),s()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:a(e()).nullable().optional().describe("Configuration scopes"),metadata:n(e(),s()).nullable().describe("Additional metadata (includes repository info)"),tools:a(g).nullable().describe("Discovered tools from MCP"),bindings:a(e()).nullable().describe("Detected bindings"),status:d(["active","inactive","error"]).describe("Current status")});p.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});p.partial();export{h as U,w as c};