@decocms/mesh 2.59.7 → 2.61.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 (179) hide show
  1. package/dist/client/assets/{AlertCircle-BFXBDrUr.js → AlertCircle-DZft-TG2.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-BDaeP-ZF.js → ArrowUp-D5u5S04m.js} +1 -1
  3. package/dist/client/assets/{Calendar-Do1_EcNl.js → Calendar-D09MNLuS.js} +1 -1
  4. package/dist/client/assets/{Check-C7bGyGOC.js → Check-DCDAnqOU.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DY2hRH3P.js → ChevronDown-DutrckZC.js} +1 -1
  6. package/dist/client/assets/ChevronRight-DspCPj_w.js +1 -0
  7. package/dist/client/assets/{Code01-Bti_O9RL.js → Code01-DedonTWa.js} +1 -1
  8. package/dist/client/assets/{Copy01-Cql6iNiT.js → Copy01-BWDgSjt6.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-Bn70vF_C.js → DotsHorizontal-HzP-MqOT.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-55vBqpF9.js → DotsVertical-DiYKrTRi.js} +1 -1
  11. package/dist/client/assets/{Download01-CY_txTIU.js → Download01-b-4mb5pm.js} +1 -1
  12. package/dist/client/assets/{Edit01-BcXXA0Bn.js → Edit01-D7FAjBpe.js} +1 -1
  13. package/dist/client/assets/{File02-CZ_CP680.js → File02-DE5qRuoV.js} +1 -1
  14. package/dist/client/assets/{File06-OiAbO58I.js → File06-Dyp_EEPp.js} +1 -1
  15. package/dist/client/assets/{FilterLines-8ygYuAAi.js → FilterLines-DYs8Amde.js} +1 -1
  16. package/dist/client/assets/Grid01-hfoOS4OQ.js +1 -0
  17. package/dist/client/assets/{Home02-BeNorB_C.js → Home02-BftR1elJ.js} +1 -1
  18. package/dist/client/assets/{Image01-DvLyxsOA.js → Image01-BBnTxqKs.js} +1 -1
  19. package/dist/client/assets/{Inbox01-BPkfViyI.js → Inbox01-Br0-Fo7T.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-BJ2AMXf3.js → InfoCircle-4Gg1mCvl.js} +1 -1
  21. package/dist/client/assets/{Key01-D8HCSb8P.js → Key01-ImEEyxuW.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-BrLuchvz.js → LinkExternal01-f9rwgdRB.js} +1 -1
  23. package/dist/client/assets/{List-bC7xiZ2s.js → List-Byzk8GIH.js} +1 -1
  24. package/dist/client/assets/{Loading01-BiNUjLDw.js → Loading01-267RBTet.js} +1 -1
  25. package/dist/client/assets/{Lock01-Bg5yU8Wj.js → Lock01-h-Hl5Kq5.js} +1 -1
  26. package/dist/client/assets/{Pin01-iTXtWrRE.js → Pin01-DBrrq4D2.js} +1 -1
  27. package/dist/client/assets/{Play-C3Hph8xY.js → Play-DAIuzg5S.js} +1 -1
  28. package/dist/client/assets/{Plus-BuZ2XoBN.js → Plus-zV6WU4JB.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BeBVRrdw.js → SearchMd-7_DsxZht.js} +1 -1
  30. package/dist/client/assets/{Share07-DldJlk64.js → Share07-Cnrwf8Jg.js} +1 -1
  31. package/dist/client/assets/{Terminal-EcSYzT5u.js → Terminal-DyHs8Rf6.js} +1 -1
  32. package/dist/client/assets/{Tool01-CH0MYN-2.js → Tool01-BI-I3hYP.js} +1 -1
  33. package/dist/client/assets/{Trash01-DSwoFZY0.js → Trash01-DlcrlG40.js} +1 -1
  34. package/dist/client/assets/{Upload01-CpcqtTNa.js → Upload01-CEsNtyVM.js} +1 -1
  35. package/dist/client/assets/{Users03-B6orUjW9.js → Users03-b0Q6Esat.js} +1 -1
  36. package/dist/client/assets/{X-DLZk4kqC.js → X-BDbowDxs.js} +1 -1
  37. package/dist/client/assets/{XClose-C2SJXRFh.js → XClose-BU7t8GBR.js} +1 -1
  38. package/dist/client/assets/agent-detail-CMBzFEVK.js +1 -0
  39. package/dist/client/assets/agents-dsz6OFgr.js +1 -0
  40. package/dist/client/assets/{alert-dialog-Dllib4My.js → alert-dialog-DvH3np1K.js} +2 -2
  41. package/dist/client/assets/{auth-catchall-BOn2OyMJ.js → auth-catchall-RZI2QIfW.js} +1 -1
  42. package/dist/client/assets/{avatar-BfuaGHdb.js → avatar-DLsqU89S.js} +1 -1
  43. package/dist/client/assets/badge-D0aebo3b.js +1 -0
  44. package/dist/client/assets/{binder-CC8WnynZ.js → binder-DhS3ZsVD.js} +1 -1
  45. package/dist/client/assets/breadcrumb-DYzoaO6c.js +1 -0
  46. package/dist/client/assets/button-ClfTbYRX.js +1 -0
  47. package/dist/client/assets/{card-DFhzHX-B.js → card-D919Ye14.js} +1 -1
  48. package/dist/client/assets/{checkbox-JnNCVINs.js → checkbox-dmut6tGA.js} +1 -1
  49. package/dist/client/assets/{circle-alert-C96B7toE.js → circle-alert-O76dHf-6.js} +1 -1
  50. package/dist/client/assets/{collapsible-CDAezpyL.js → collapsible-CZO59QRP.js} +1 -1
  51. package/dist/client/assets/collection-detail-DfuPZ-Eh.js +26 -0
  52. package/dist/client/assets/{collection-search-rOPXHeEr.js → collection-search-imk5y1tl.js} +1 -1
  53. package/dist/client/assets/collection-tab-CqQprMKz.js +1 -0
  54. package/dist/client/assets/collection-table-wrapper-C7PJGoEH.js +1 -0
  55. package/dist/client/assets/connect-pBMimCL2.js +1 -0
  56. package/dist/client/assets/{connection-card-BLTFMSZS.js → connection-card-D2X3Om4T.js} +1 -1
  57. package/dist/client/assets/connection-detail-By8rfkHM.js +1 -0
  58. package/dist/client/assets/connections-Da_gf-d4.js +1 -0
  59. package/dist/client/assets/{constants-Mpett05j.js → constants-BZCTYQ-m.js} +1 -1
  60. package/dist/client/assets/constants-ClcoOK3l.js +1 -0
  61. package/dist/client/assets/{create-organization-dialog-WqiCWTM4.js → create-organization-dialog-Cwl_Gkel.js} +1 -1
  62. package/dist/client/assets/dialog-Btg4sCez.js +1 -0
  63. package/dist/client/assets/dropdown-menu-DN1Ltf10.js +1 -0
  64. package/dist/client/assets/dynamic-plugin-layout-DSctkXDf.js +1 -0
  65. package/dist/client/assets/empty-state-DYXlKoSr.js +1 -0
  66. package/dist/client/assets/{empty-state-7hq4AubF.js → empty-state-uG-DnAQb.js} +1 -1
  67. package/dist/client/assets/{env-vars-editor--TqeS791.js → env-vars-editor-ChPRpV0a.js} +1 -1
  68. package/dist/client/assets/{error-boundary-B6RXO2oI.js → error-boundary-BNlY9vIT.js} +1 -1
  69. package/dist/client/assets/{extract-connection-data-Cl2cHkSz.js → extract-connection-data-Bjn7AN9v.js} +1 -1
  70. package/dist/client/assets/file-browser-FSoZTHG-.js +2 -0
  71. package/dist/client/assets/form-CYYoaqIb.js +1 -0
  72. package/dist/client/assets/grid-view-DRczCiEv.js +1 -0
  73. package/dist/client/assets/home-DuoTXUw3.js +1 -0
  74. package/dist/client/assets/{index-6m1DUVC_.js → index-B8-fuOjQ.js} +1 -1
  75. package/dist/client/assets/{index-CXUcNyKS.js → index-B8Y83hFI.js} +1 -1
  76. package/dist/client/assets/{index-BDvGMi--.js → index-Bb-7JPLn.js} +1 -1
  77. package/dist/client/assets/{index-Ez2DTosS.js → index-Bk3VGbpH.js} +1 -1
  78. package/dist/client/assets/index-By5YaRHP.js +1 -0
  79. package/dist/client/assets/index-C4iufez8.css +1 -0
  80. package/dist/client/assets/{index-CymrbMj5.js → index-DQEC9k6R.js} +61 -61
  81. package/dist/client/assets/{index-DZqSbjFw.js → index-bZDjEZjy.js} +2 -2
  82. package/dist/client/assets/{infiniteQueryObserver-DmKtj9SR.js → infiniteQueryObserver-R-jPe69x.js} +1 -1
  83. package/dist/client/assets/{input-u1hHzCA4.js → input-Db3X6HvF.js} +1 -1
  84. package/dist/client/assets/layout-oEMg2tAu.js +1 -0
  85. package/dist/client/assets/{localstorage-keys-DpM3uKv7.js → localstorage-keys-Bdti-2mC.js} +1 -1
  86. package/dist/client/assets/{login-DoMEd-lv.js → login-CGsneu9K.js} +1 -1
  87. package/dist/client/assets/{mcp-oauth-C7tn4XA4.js → mcp-oauth-BmPwjDVD.js} +1 -1
  88. package/dist/client/assets/mcp-server-card-BcwB38uI.js +1 -0
  89. package/dist/client/assets/mcp-server-detail-ScZZDM2u.js +2 -0
  90. package/dist/client/assets/members-DrIeM1RI.js +3 -0
  91. package/dist/client/assets/{monaco-editor-CZ0mtshA.js → monaco-editor-B37z8w3N.js} +1 -1
  92. package/dist/client/assets/monitoring-IotTEObQ.js +49 -0
  93. package/dist/client/assets/{oauth-callback-BskSq0jW.js → oauth-callback-CtpbBZ0j.js} +1 -1
  94. package/dist/client/assets/page-BFuI9gLJ.js +1 -0
  95. package/dist/client/assets/page-Bm0zH9kR.js +1 -0
  96. package/dist/client/assets/pin-to-sidebar-button-Dz_XGqkX.js +1 -0
  97. package/dist/client/assets/{plugin-empty-state-rg6DAYSw.js → plugin-empty-state-ByGsbM_q.js} +1 -1
  98. package/dist/client/assets/{plugin-header-Cnc4tGD7.js → plugin-header-C_aZs0N6.js} +1 -1
  99. package/dist/client/assets/plugins-C4o2Tg3p.js +1 -0
  100. package/dist/client/assets/popover-CjjV7g4X.js +1 -0
  101. package/dist/client/assets/{registry-utils-BFBDFgyu.js → registry-utils-pqvn-SQ9.js} +1 -1
  102. package/dist/client/assets/{resizable-akHzriSj.js → resizable-Ds3XfyD1.js} +1 -1
  103. package/dist/client/assets/{resource-tabs-1el8gNET.js → resource-tabs-Ckk3ov-s.js} +1 -1
  104. package/dist/client/assets/select-DdPku9Z8.js +1 -0
  105. package/dist/client/assets/settings-RIVj-SMS.js +1 -0
  106. package/dist/client/assets/shell-layout-D5XFL0IE.js +12 -0
  107. package/dist/client/assets/{spinner-Bwqz03rl.js → spinner-Ch036S5x.js} +1 -1
  108. package/dist/client/assets/{store-invite-DJTXOg3a.js → store-invite-88nPipDW.js} +1 -1
  109. package/dist/client/assets/{switch-DNIxf6Z3.js → switch-D4uenvWn.js} +1 -1
  110. package/dist/client/assets/table-fsTaEaaU.js +1 -0
  111. package/dist/client/assets/{textarea-CLIBzUIu.js → textarea-CJUn3-Wq.js} +1 -1
  112. package/dist/client/assets/tools-list-D62d9csj.js +1 -0
  113. package/dist/client/assets/typewriter-title-BY44IAZn.js +16 -0
  114. package/dist/client/assets/{use-binding-B1LqCJr8.js → use-binding-a8EbFjQ8.js} +1 -1
  115. package/dist/client/assets/use-collections-C8m0cpJK.js +1 -0
  116. package/dist/client/assets/{use-connection-BzhGWFyL.js → use-connection-BsXZoJuC.js} +1 -1
  117. package/dist/client/assets/{use-create-virtual-mcp-D-7Y6G3j.js → use-create-virtual-mcp-C-dJH0KT.js} +1 -1
  118. package/dist/client/assets/use-deco-chat-open-DaZlP6gy.js +1 -0
  119. package/dist/client/assets/{use-list-state-BfmIALu7.js → use-list-state-BR0DnP45.js} +1 -1
  120. package/dist/client/assets/{use-mcp-prompts-C2Az2O1z.js → use-mcp-prompts-CauCdNEE.js} +1 -1
  121. package/dist/client/assets/{use-members-KzHxearI.js → use-members-C9xyUK_j.js} +1 -1
  122. package/dist/client/assets/{use-mobile-VtwOaDa5.js → use-mobile-BJaPqgO-.js} +1 -1
  123. package/dist/client/assets/{use-organization-settings-DMGaX8N0.js → use-organization-settings-C7v8TF4x.js} +1 -1
  124. package/dist/client/assets/{use-virtual-mcp-D3UgDP8i.js → use-virtual-mcp-Mo0Ax2sa.js} +1 -1
  125. package/dist/client/assets/useInfiniteQuery-DAahyMrR.js +1 -0
  126. package/dist/client/assets/{useMutation-BReaxe_W.js → useMutation-BUU-3CfS.js} +1 -1
  127. package/dist/client/assets/useQuery-CziyW3rA.js +1 -0
  128. package/dist/client/assets/useSuspenseInfiniteQuery-D9t8xGlB.js +1 -0
  129. package/dist/client/assets/{view-mode-toggle-DR9UFNqr.js → view-mode-toggle-BuBlE9kN.js} +1 -1
  130. package/dist/client/assets/workflow-BHUnmDkZ.js +1 -0
  131. package/dist/client/index.html +2 -2
  132. package/package.json +1 -1
  133. package/dist/client/assets/ArrowLeft-CDtoEGeL.js +0 -1
  134. package/dist/client/assets/Grid01-Bdrpv4xX.js +0 -1
  135. package/dist/client/assets/agent-detail-1edzdNo4.js +0 -1
  136. package/dist/client/assets/agents-CA-rSchF.js +0 -1
  137. package/dist/client/assets/badge-DF_3zhMz.js +0 -1
  138. package/dist/client/assets/button-0ydgHweE.js +0 -1
  139. package/dist/client/assets/collection-detail-ClXHe-PG.js +0 -26
  140. package/dist/client/assets/collection-display-button-C0Qj_mDn.js +0 -1
  141. package/dist/client/assets/collection-header-CHcRbSVg.js +0 -1
  142. package/dist/client/assets/collection-page-pQhPuVgo.js +0 -1
  143. package/dist/client/assets/collection-tab-e3o0S9Wa.js +0 -1
  144. package/dist/client/assets/collection-table-wrapper-C4t2ZZhF.js +0 -1
  145. package/dist/client/assets/connect-DP_OT-gv.js +0 -1
  146. package/dist/client/assets/connection-detail-C5TmRjj1.js +0 -1
  147. package/dist/client/assets/connections-I2Vy-typ.js +0 -1
  148. package/dist/client/assets/constants-OFVhPv4G.js +0 -1
  149. package/dist/client/assets/dialog-6FUpHXs_.js +0 -1
  150. package/dist/client/assets/dropdown-menu-CvHFB3Gz.js +0 -1
  151. package/dist/client/assets/dynamic-plugin-layout-Mnd5muQb.js +0 -1
  152. package/dist/client/assets/empty-state-BJnVPwS4.js +0 -1
  153. package/dist/client/assets/file-browser-EXbuz5vW.js +0 -2
  154. package/dist/client/assets/form-Bu0daHLu.js +0 -1
  155. package/dist/client/assets/grid-view-C6S8iSjv.js +0 -1
  156. package/dist/client/assets/home-2CTqvtNy.js +0 -1
  157. package/dist/client/assets/index-CqeIU8-o.css +0 -1
  158. package/dist/client/assets/layout-DspSCzsh.js +0 -1
  159. package/dist/client/assets/mcp-server-card-HpdQ81Kj.js +0 -1
  160. package/dist/client/assets/mcp-server-detail-DhHV0S77.js +0 -2
  161. package/dist/client/assets/members-NoyLiC53.js +0 -3
  162. package/dist/client/assets/monitoring-rg9mX2h3.js +0 -49
  163. package/dist/client/assets/page-BpnXhWf3.js +0 -1
  164. package/dist/client/assets/page-KXdqzJaF.js +0 -1
  165. package/dist/client/assets/pin-to-sidebar-button-Bsv2_7kr.js +0 -1
  166. package/dist/client/assets/plugins-CW7mTNa6.js +0 -1
  167. package/dist/client/assets/popover-DEmRxXmY.js +0 -1
  168. package/dist/client/assets/select-BKwPUbTK.js +0 -1
  169. package/dist/client/assets/settings-ZWpf163v.js +0 -1
  170. package/dist/client/assets/shell-layout-D0SSCuI2.js +0 -3
  171. package/dist/client/assets/tools-list-DopNeyHc.js +0 -1
  172. package/dist/client/assets/tooltip-9zLX7HP0.js +0 -1
  173. package/dist/client/assets/typewriter-title-BJariIWR.js +0 -16
  174. package/dist/client/assets/use-collections-DtjYeVzj.js +0 -1
  175. package/dist/client/assets/use-deco-chat-open-CrQFHW7J.js +0 -1
  176. package/dist/client/assets/useInfiniteQuery-CaX6JmUq.js +0 -1
  177. package/dist/client/assets/useQuery-KlPPWaKy.js +0 -1
  178. package/dist/client/assets/useSuspenseInfiniteQuery-jy6MmqiZ.js +0 -1
  179. package/dist/client/assets/workflow-B1lnmdqO.js +0 -1
@@ -0,0 +1 @@
1
+ import{u as v,g as $,l as _,r as N,j as e,c as L}from"./index-bZDjEZjy.js";import{e as R}from"./constants-BZCTYQ-m.js";import{C as z}from"./collection-tab-CqQprMKz.js";import{a as A,b as F}from"./use-connection-BsXZoJuC.js";import{B as k}from"./button-ClfTbYRX.js";import{E as H}from"./empty-state-DYXlKoSr.js";import{P as y}from"./index-By5YaRHP.js";import{B as M,a as O,b as T,c as V}from"./breadcrumb-DYzoaO6c.js";import{a as q,b as D}from"./use-binding-a8EbFjQ8.js";import{i as G}from"./Loading01-267RBTet.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-C7PJGoEH.js";import"./dropdown-menu-DN1Ltf10.js";import"./ChevronRight-DspCPj_w.js";import"./ArrowUp-D5u5S04m.js";import"./Check-DCDAnqOU.js";import"./Grid01-hfoOS4OQ.js";import"./List-Byzk8GIH.js";import"./view-mode-toggle-BuBlE9kN.js";import"./table-fsTaEaaU.js";import"./collection-search-imk5y1tl.js";import"./SearchMd-7_DsxZht.js";import"./input-Db3X6HvF.js";import"./card-D919Ye14.js";import"./Copy01-BWDgSjt6.js";import"./DotsVertical-DiYKrTRi.js";import"./Edit01-D7FAjBpe.js";import"./use-list-state-BR0DnP45.js";import"./use-mobile-BJaPqgO-.js";import"./Trash01-DlcrlG40.js";import"./empty-state-uG-DnAQb.js";import"./Inbox01-Br0-Fo7T.js";import"./avatar-DLsqU89S.js";import"./useQuery-CziyW3rA.js";import"./pin-to-sidebar-button-Dz_XGqkX.js";import"./Pin01-DBrrq4D2.js";import"./use-organization-settings-C7v8TF4x.js";import"./useMutation-BUU-3CfS.js";import"./use-collections-C8m0cpJK.js";import"./constants-ClcoOK3l.js";import"./alert-dialog-DvH3np1K.js";import"./Plus-zV6WU4JB.js";import"./layout-oEMg2tAu.js";import"./binder-DhS3ZsVD.js";function J({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const l=A(),{org:{slug:m}}=v(),{data:C}=$.useSession(),d=_(),[a,w]=N.useState(!1),r=async()=>{if(!(!o||!C?.user?.id)){w(!0);try{const c=await l.create.mutateAsync(o);s?.(c.id),d({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{w(!1)}}},j=()=>{d({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(H,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(k,{variant:"outline",onClick:r,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(k,{variant:"outline",onClick:j,children:"Custom Connection"})]})})}function Q(i){const t=L.c(28),{bindingName:o,collectionName:n,title:s,emptyState:l,wellKnownMcp:m}=i,{org:C}=v(),d=F();let a;t[0]!==d||t[1]!==o?(a={connections:d,binding:o},t[0]=d,t[1]=o,t[2]=a):a=t[2];const r=q(a)[0],j=D(r);let c;if(t[3]!==n||t[4]!==j){let h;t[6]!==n?(h=W=>W.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=h):h=t[7],c=j.find(h),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const b=c,[P,E]=N.useState(null),B=r&&b&&(r.id||P);let p;t[8]!==s?(p=e.jsx(y.Header,{children:e.jsx(y.Header.Left,{children:e.jsx(M,{children:e.jsx(O,{children:e.jsx(T,{children:e.jsx(V,{children:s})})})})})}),t[8]=s,t[9]=p):p=t[9];let S;t[10]===Symbol.for("react.memo_cache_sentinel")?(S=e.jsx(G,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=S):S=t[10];let u;t[11]!==s?(u=s.toLowerCase(),t[11]=s,t[12]=u):u=t[12];let f;t[13]!==u?(f=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[S,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",u,"..."]})]}),t[13]=u,t[14]=f):f=t[14];let g;t[15]!==b||t[16]!==r||t[17]!==l||t[18]!==C||t[19]!==B||t[20]!==m?(g=B?e.jsx(z,{connectionId:r.id,org:C.slug,activeCollection:b}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(J,{title:l.title,description:l.description,wellKnownMcp:m,imageSrc:l.imageSrc,onConnected:h=>{E(h)}})}),t[15]=b,t[16]=r,t[17]=l,t[18]=C,t[19]=B,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==f||t[23]!==g?(x=e.jsx(y.Content,{children:e.jsx(N.Suspense,{fallback:f,children:g})}),t[22]=f,t[23]=g,t[24]=x):x=t[24];let I;return t[25]!==p||t[26]!==x?(I=e.jsxs(y,{children:[p,x]}),t[25]=p,t[26]=x,t[27]=I):I=t[27],I}function Ht(){const i=L.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(Q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:R()}),i[0]=t):t=i[0],t}export{Ht as default};
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <title>MCP Mesh</title>
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
- <script type="module" crossorigin src="/assets/index-DZqSbjFw.js"></script>
7
- <link rel="stylesheet" crossorigin href="/assets/index-CqeIU8-o.css">
6
+ <script type="module" crossorigin src="/assets/index-bZDjEZjy.js"></script>
7
+ <link rel="stylesheet" crossorigin href="/assets/index-C4iufez8.css">
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.59.7",
3
+ "version": "2.61.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",
@@ -1 +0,0 @@
1
- import{r}from"./index-DZqSbjFw.js";const i=({size:e=24,color:t="currentColor",...o})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},r.createElement("path",{d:"M19 12H5m0 0 7 7m-7-7 7-7"}));i.displayName="ArrowLeft";export{i};
@@ -1 +0,0 @@
1
- import{r as t}from"./index-DZqSbjFw.js";const o=({size:e=24,color:a="currentColor",...r})=>t.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:a,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},t.createElement("path",{d:"m9 18 6-6-6-6"}));o.displayName="ChevronRight";const c=({size:e=24,color:a="currentColor",...r})=>t.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:a,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},t.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));c.displayName="Grid01";export{c,o as i};
@@ -1 +0,0 @@
1
- import{r as N,j as t,I as ft,x as he,z as je,R as pt,D as xt,v as ht,w as gt,aw as bt,B as We,E as vt,c as T,u as Oe,V as jt,s as Nt,ao as De,l as yt,a as Ct,b6 as _t,bn as Tt,k as kt,h as St,as as wt}from"./index-DZqSbjFw.js";import{u as Et,C as It,a as At}from"./collapsible-CDAezpyL.js";import{I as ue,E as Ot}from"./empty-state-BJnVPwS4.js";import{E as xe,i as Dt}from"./error-boundary-B6RXO2oI.js";import{P as $t}from"./pin-to-sidebar-button-Bsv2_7kr.js";import{u as Rt}from"./use-deco-chat-open-CrQFHW7J.js";import{B as $e}from"./badge-DF_3zhMz.js";import{c as Z,B as Y}from"./button-0ydgHweE.js";import{I as Be}from"./input-u1hHzCA4.js";import{S as zt}from"./switch-DNIxf6Z3.js";import{T as Lt}from"./textarea-CLIBzUIu.js";import{T as ee,b as Ne,c as te,a as se}from"./tooltip-9zLX7HP0.js";import{b as Pt,u as Ue}from"./use-connection-BzhGWFyL.js";import{u as Mt,a as Vt}from"./use-virtual-mcp-D3UgDP8i.js";import{i as Ke}from"./Grid01-Bdrpv4xX.js";import{n as Ft}from"./select-BKwPUbTK.js";import{i as Re}from"./File02-CZ_CP680.js";import{a as ze,i as Bt}from"./Tool01-CH0MYN-2.js";import{i as Le}from"./Loading01-BiNUjLDw.js";import{i as Gt}from"./Play-C3Hph8xY.js";import{s as Ge}from"./Plus-BuZ2XoBN.js";import{i as Ht}from"./Share07-DldJlk64.js";import{b as Wt,V as Ut}from"./layout-DspSCzsh.js";import{C as Kt}from"./collection-search-rOPXHeEr.js";import{C as Pe}from"./checkbox-JnNCVINs.js";import{e as qt,a as qe,D as Ye,b as Yt,c as Zt}from"./dialog-6FUpHXs_.js";import{f as Jt}from"./use-collections-DtjYeVzj.js";import{u as Me}from"./constants-Mpett05j.js";import{c as Qt,u as Xt}from"./use-mcp-prompts-C2Az2O1z.js";import{s as Ze}from"./slugify-CEUa2lfQ.js";import{I as es,R as ts,a as ss}from"./index-CXUcNyKS.js";import{i as Je}from"./Check-C7bGyGOC.js";import{i as ls}from"./Code01-Bti_O9RL.js";import{a as os}from"./Copy01-Cql6iNiT.js";import{i as ye}from"./InfoCircle-BJ2AMXf3.js";import"./use-binding-B1LqCJr8.js";import"./binder-CC8WnynZ.js";import"./useSuspenseInfiniteQuery-jy6MmqiZ.js";import"./infiniteQueryObserver-DmKtj9SR.js";import"./localstorage-keys-DpM3uKv7.js";import"./useQuery-KlPPWaKy.js";import"./useMutation-BReaxe_W.js";import"./popover-DEmRxXmY.js";import"./ChevronDown-DY2hRH3P.js";import"./File06-OiAbO58I.js";import"./Image01-DvLyxsOA.js";import"./SearchMd-BeBVRrdw.js";import"./Pin01-iTXtWrRE.js";import"./use-organization-settings-DMGaX8N0.js";import"./ArrowLeft-CDtoEGeL.js";import"./X-DLZk4kqC.js";const Qe=({size:l=24,color:e="currentColor",...s})=>N.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},N.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Qe.displayName="ArrowsRight";const Xe=({size:l=24,color:e="currentColor",...s})=>N.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},N.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"}));Xe.displayName="Circle";const et=({size:l=24,color:e="currentColor",...s})=>N.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},N.createElement("path",{d:"M9 2v3m6-3v3M9 19v3m6-3v3m4-13h3m-3 5h3M2 9h3m-3 5h3m4.8 5h4.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C19 16.72 19 15.88 19 14.2V9.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C16.72 5 15.88 5 14.2 5H9.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C5 7.28 5 8.12 5 9.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C7.28 19 8.12 19 9.8 19Z"}));et.displayName="CpuChip02";const ge=({size:l=24,color:e="currentColor",...s})=>N.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},N.createElement("path",{d:"m9.75 20.75 1.473.818c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l1.473-.818m-9-2.5-1.427-.793c-.3-.166-.45-.25-.558-.368a1 1 0 0 1-.215-.364C3 16.573 3 16.401 3 16.06V14.5m0-5V7.942c0-.343 0-.514.05-.667a1 1 0 0 1 .215-.364c.109-.119.258-.202.558-.368L5.25 5.75m4.5-2.5 1.473-.818c.284-.158.425-.237.576-.267a1 1 0 0 1 .402 0c.15.03.292.11.576.267l1.473.818m4.5 2.5 1.427.793c.3.166.45.25.558.368a1 1 0 0 1 .215.364c.05.153.05.324.05.667V9.5m0 5v1.559c0 .342 0 .514-.05.666a.999.999 0 0 1-.215.364c-.109.119-.258.202-.558.368l-1.427.793m-9-7.5L12 12m0 0 2.25-1.25M12 12v2.5M3 7l2.25 1.25m13.5 0L21 7m-9 12.5V22"}));ge.displayName="CubeOutline";const tt=({size:l=24,color:e="currentColor",...s})=>N.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},N.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"}));tt.displayName="Lightbulb02";const st=({size:l=24,color:e="currentColor",...s})=>N.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},N.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));st.displayName="Save01";var be="Tabs",[ns]=vt(be,[We]),lt=We(),[is,Ve]=ns(be),ot=N.forwardRef((l,e)=>{const{__scopeTabs:s,value:n,onValueChange:o,defaultValue:i,orientation:c="horizontal",dir:r,activationMode:a="automatic",...m}=l,u=ht(r),[d,f]=gt({prop:n,onChange:o,defaultProp:i??"",caller:be});return t.jsx(is,{scope:s,baseId:bt(),value:d,onValueChange:f,orientation:c,dir:u,activationMode:a,children:t.jsx(he.div,{dir:u,"data-orientation":c,...m,ref:e})})});ot.displayName=be;var nt="TabsList",it=N.forwardRef((l,e)=>{const{__scopeTabs:s,loop:n=!0,...o}=l,i=Ve(nt,s),c=lt(s);return t.jsx(pt,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:n,children:t.jsx(he.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:e})})});it.displayName=nt;var rt="TabsTrigger",at=N.forwardRef((l,e)=>{const{__scopeTabs:s,value:n,disabled:o=!1,...i}=l,c=Ve(rt,s),r=lt(s),a=mt(c.baseId,n),m=ut(c.baseId,n),u=n===c.value;return t.jsx(ft,{asChild:!0,...r,focusable:!o,active:u,children:t.jsx(he.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:a,...i,ref:e,onMouseDown:je(l.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?c.onValueChange(n):d.preventDefault()}),onKeyDown:je(l.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&c.onValueChange(n)}),onFocus:je(l.onFocus,()=>{const d=c.activationMode!=="manual";!u&&!o&&d&&c.onValueChange(n)})})})});at.displayName=rt;var ct="TabsContent",dt=N.forwardRef((l,e)=>{const{__scopeTabs:s,value:n,forceMount:o,children:i,...c}=l,r=Ve(ct,s),a=mt(r.baseId,n),m=ut(r.baseId,n),u=n===r.value,d=N.useRef(u);return N.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),t.jsx(xt,{present:o||u,children:({present:f})=>t.jsx(he.div,{"data-state":u?"active":"inactive","data-orientation":r.orientation,role:"tabpanel","aria-labelledby":a,hidden:!f,id:m,tabIndex:0,...c,ref:e,style:{...l.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});dt.displayName=ct;function mt(l,e){return`${l}-trigger-${e}`}function ut(l,e){return`${l}-content-${e}`}var rs=ot,as=it,cs=at,ds=dt;function ms(l){const e=T.c(10);let s,n,o;e[0]!==l?({className:s,variant:o,...n}=l,e[0]=l,e[1]=s,e[2]=n,e[3]=o):(s=e[1],n=e[2],o=e[3]);const i=o===void 0?"pill":o;let c;e[4]!==s?(c=Z("flex flex-col gap-2",s),e[4]=s,e[5]=c):c=e[5];let r;return e[6]!==n||e[7]!==c||e[8]!==i?(r=t.jsx(rs,{"data-slot":"tabs","data-variant":i,className:c,...n}),e[6]=n,e[7]=c,e[8]=i,e[9]=r):r=e[9],r}function us(l){const e=T.c(11);let s,n,o;e[0]!==l?({className:s,variant:o,...n}=l,e[0]=l,e[1]=s,e[2]=n,e[3]=o):(s=e[1],n=e[2],o=e[3]);const i=o||"pill",c=i==="underline"?"flex h-[52px] items-center border-b border-border":i==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let r;e[4]!==s||e[5]!==c?(r=Z(c,s),e[4]=s,e[5]=c,e[6]=r):r=e[6];let a;return e[7]!==i||e[8]!==n||e[9]!==r?(a=t.jsx(as,{"data-slot":"tabs-list","data-variant":i,className:r,...n}),e[7]=i,e[8]=n,e[9]=r,e[10]=a):a=e[10],a}function Ce(l){const e=T.c(11);let s,n,o;e[0]!==l?({className:s,variant:o,...n}=l,e[0]=l,e[1]=s,e[2]=n,e[3]=o):(s=e[1],n=e[2],o=e[3]);const i=o||"pill",c=i==="underline"?"cursor-pointer flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-foreground disabled:pointer-events-none disabled:opacity-50":i==="canvas"?"cursor-pointer flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let r;e[4]!==s||e[5]!==c?(r=Z(c,s),e[4]=s,e[5]=c,e[6]=r):r=e[6];let a;return e[7]!==i||e[8]!==n||e[9]!==r?(a=t.jsx(cs,{"data-slot":"tabs-trigger","data-variant":i,className:r,...n}),e[7]=i,e[8]=n,e[9]=r,e[10]=a):a=e[10],a}function _e(l){const e=T.c(8);let s,n;e[0]!==l?({className:s,...n}=l,e[0]=l,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let o;e[3]!==s?(o=Z("flex-1 outline-none h-full",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==n||e[6]!==o?(i=t.jsx(ds,{"data-slot":"tabs-content",className:o,...n}),e[5]=n,e[6]=o,e[7]=i):i=e[7],i}function Te(l){return l===null?"all":l?.length??0}function fs(l,e){const s=l[e];if(!s)return"";const n=[];return s.tools===null?n.push("all tools"):s.tools&&s.tools.length>0&&n.push(`${s.tools.length} tools`),s.resources===null?n.push("all resources"):s.resources&&s.resources.length>0&&n.push(`${s.resources.length} resources`),s.prompts===null?n.push("all prompts"):s.prompts&&s.prompts.length>0&&n.push(`${s.prompts.length} prompts`),n.join(", ")}function ps(l,e){const s=l[e];return s?!((s.tools===void 0||s.tools!==null&&s.tools.length===0)&&(s.resources===void 0||s.resources!==null&&s.resources.length===0)&&(s.prompts===void 0||s.prompts!==null&&s.prompts.length===0)):!1}const xs={tools:null,resources:null,prompts:null};function ke(){const l=T.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Le,{className:"animate-spin text-muted-foreground",size:24})}),l[0]=e):e=l[0],e}function Se(l){return({error:e})=>e?.message?.includes("Method not found")||e?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Dt,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:e?.message?e.message.length>200?`${e.message.slice(0,200)}...`:e.message:"An unexpected error occurred"})]})]})}function hs(l){const e=T.c(18),{item:s,isSelected:n,onToggle:o,disabled:i}=l,c=i?"cursor-not-allowed opacity-50":"cursor-pointer",r=n?"bg-accent/25":"hover:bg-muted/50";let a;e[0]!==c||e[1]!==r?(a=Z("flex items-start gap-3 p-4 rounded-lg transition-colors",c,r),e[0]=c,e[1]=r,e[2]=a):a=e[2];let m;e[3]!==s.name?(m=t.jsx("p",{className:"text-sm font-medium leading-none",children:s.name}),e[3]=s.name,e[4]=m):m=e[4];let u;e[5]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[5]=s.description,e[6]=u):u=e[6];let d;e[7]!==m||e[8]!==u?(d=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[7]=m,e[8]=u,e[9]=d):d=e[9];let f;e[10]!==i||e[11]!==n||e[12]!==o?(f=t.jsx(Pe,{checked:n,onCheckedChange:o,disabled:i,className:"mt-0.5"}),e[10]=i,e[11]=n,e[12]=o,e[13]=f):f=e[13];let g;return e[14]!==a||e[15]!==d||e[16]!==f?(g=t.jsxs("label",{className:a,children:[d,f]}),e[14]=a,e[15]=d,e[16]=f,e[17]=g):g=e[17],g}function Fe(l){const e=T.c(32),{items:s,selections:n,onToggle:o,onToggleAll:i,emptyMessage:c,disabled:r}=l;let a,m,u,d,f;if(e[0]!==r||e[1]!==c||e[2]!==s||e[3]!==o||e[4]!==i||e[5]!==n){f=Symbol.for("react.early_return_sentinel");e:{const x=s.map(gs);if(s.length===0){let y;e[11]!==c?(y=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:c})}),e[11]=c,e[12]=y):y=e[12],f=y;break e}u="flex flex-col h-full";const j=r?"cursor-not-allowed opacity-50":"cursor-pointer";let v;e[13]!==j?(v=Z("flex items-start gap-3 p-4",j),e[13]=j,e[14]=v):v=e[14];let p;e[15]!==s.length?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("span",{className:"text-sm font-medium",children:["Select All (",s.length,")"]})}),e[15]=s.length,e[16]=p):p=e[16];const C=n===null;let _;e[17]!==r||e[18]!==i||e[19]!==C?(_=t.jsx(Pe,{checked:C,onCheckedChange:i,disabled:r,className:"mt-0.5"}),e[17]=r,e[18]=i,e[19]=C,e[20]=_):_=e[20],e[21]!==_||e[22]!==v||e[23]!==p?(d=t.jsx("div",{className:"px-4 border-b border-border shrink-0",children:t.jsxs("label",{className:v,children:[p,_]})}),e[21]=_,e[22]=v,e[23]=p,e[24]=d):d=e[24],a="flex-1 overflow-auto px-4 py-3 space-y-1",m=s.map(y=>t.jsx(hs,{item:y,isSelected:n===null||n?.includes(y.id),onToggle:()=>o(y.id,x),disabled:r},y.id))}e[0]=r,e[1]=c,e[2]=s,e[3]=o,e[4]=i,e[5]=n,e[6]=a,e[7]=m,e[8]=u,e[9]=d,e[10]=f}else a=e[6],m=e[7],u=e[8],d=e[9],f=e[10];if(f!==Symbol.for("react.early_return_sentinel"))return f;let g;e[25]!==a||e[26]!==m?(g=t.jsx("div",{className:a,children:m}),e[25]=a,e[26]=m,e[27]=g):g=e[27];let h;return e[28]!==u||e[29]!==d||e[30]!==g?(h=t.jsxs("div",{className:u,children:[d,g]}),e[28]=u,e[29]=d,e[30]=g,e[31]=h):h=e[31],h}function gs(l){return l.id}function bs(l){const e=T.c(13),{connectionId:s,selections:n,onToggle:o,onToggleAll:i,disabled:c}=l,{org:r}=Oe();let a;e[0]!==s||e[1]!==r.id?(a={connectionId:s,orgId:r.id},e[0]=s,e[1]=r.id,e[2]=a):a=e[2];const m=Me(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=Jt(u);let f;e[5]!==d.tools?(f=d.tools.map(vs),e[5]=d.tools,e[6]=f):f=e[6];const g=f;let h;return e[7]!==c||e[8]!==g||e[9]!==o||e[10]!==i||e[11]!==n?(h=t.jsx(Fe,{items:g,selections:n,onToggle:o,onToggleAll:i,emptyMessage:"No tools available",disabled:c}),e[7]=c,e[8]=g,e[9]=o,e[10]=i,e[11]=n,e[12]=h):h=e[12],h}function vs(l){return{id:l.name,name:l.name,description:l.description}}function js(l){const e=T.c(13),{connectionId:s,selections:n,onToggle:o,onToggleAll:i,disabled:c}=l,{org:r}=Oe();let a;e[0]!==s||e[1]!==r.id?(a={connectionId:s,orgId:r.id},e[0]=s,e[1]=r.id,e[2]=a):a=e[2];const m=Me(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=Qt(u);let f;e[5]!==d.resources?(f=d.resources.map(Ns),e[5]=d.resources,e[6]=f):f=e[6];const g=f;let h;return e[7]!==c||e[8]!==g||e[9]!==o||e[10]!==i||e[11]!==n?(h=t.jsx(Fe,{items:g,selections:n,onToggle:o,onToggleAll:i,emptyMessage:"No resources available",disabled:c}),e[7]=c,e[8]=g,e[9]=o,e[10]=i,e[11]=n,e[12]=h):h=e[12],h}function Ns(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ys(l){const e=T.c(13),{connectionId:s,selections:n,onToggle:o,onToggleAll:i,disabled:c}=l,{org:r}=Oe();let a;e[0]!==s||e[1]!==r.id?(a={connectionId:s,orgId:r.id},e[0]=s,e[1]=r.id,e[2]=a):a=e[2];const m=Me(a);let u;e[3]!==m?(u={client:m},e[3]=m,e[4]=u):u=e[4];const{data:d}=Xt(u);let f;e[5]!==d.prompts?(f=d.prompts.map(Cs),e[5]=d.prompts,e[6]=f):f=e[6];const g=f;let h;return e[7]!==c||e[8]!==g||e[9]!==o||e[10]!==i||e[11]!==n?(h=t.jsx(Fe,{items:g,selections:n,onToggle:o,onToggleAll:i,emptyMessage:"No prompts available",disabled:c}),e[7]=c,e[8]=g,e[9]=o,e[10]=i,e[11]=n,e[12]=h):h=e[12],h}function Cs(l){return{id:l.name,name:l.name,description:l.description}}function _s(l){const e=T.c(24),{connection:s,isSelected:n,hasSelections:o,summary:i,onClick:c,onToggleAll:r,disabled:a}=l,m=a?"cursor-not-allowed opacity-50":"cursor-pointer",u=n?"bg-accent":"hover:bg-muted/50";let d;e[0]!==m||e[1]!==u?(d=Z("flex items-center gap-2 p-2 h-12 rounded-lg transition-colors",m,u),e[0]=m,e[1]=u,e[2]=d):d=e[2];const f=a?void 0:c;let g;e[3]!==s.icon||e[4]!==s.title?(g=t.jsx(ue,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[3]=s.icon,e[4]=s.title,e[5]=g):g=e[5];let h;e[6]!==s.title?(h=t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=h):h=e[7];let x;e[8]!==o||e[9]!==i?(x=o&&i&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[8]=o,e[9]=i,e[10]=x):x=e[10];let j;e[11]!==h||e[12]!==x?(j=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[h,x]}),e[11]=h,e[12]=x,e[13]=j):j=e[13];let v;e[14]!==a||e[15]!==o||e[16]!==r?(v=t.jsx(Pe,{checked:o,onCheckedChange:r,onClick:Ts,disabled:a,className:"shrink-0"}),e[14]=a,e[15]=o,e[16]=r,e[17]=v):v=e[17];let p;return e[18]!==d||e[19]!==f||e[20]!==g||e[21]!==j||e[22]!==v?(p=t.jsxs("div",{className:d,onClick:f,children:[g,j,v]}),e[18]=d,e[19]=f,e[20]=g,e[21]=j,e[22]=v,e[23]=p):p=e[23],p}function Ts(l){return l.stopPropagation()}function ks(l){const e=T.c(22),{allConnections:s,searchTerm:n,selectedId:o,hasSelections:i,getSelectionSummary:c,onConnectionClick:r,onToggleAll:a,disabled:m}=l;let u;e[0]!==s||e[1]!==n?(u=n?s.filter(h=>h.title.toLowerCase().includes(n.toLowerCase())||h.description?.toLowerCase().includes(n.toLowerCase())):s,e[0]=s,e[1]=n,e[2]=u):u=e[2];const d=u;if(d.length===0){const h=n?"No connections found":"No connections available";let x;return e[3]!==h?(x=t.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground p-4",children:h}),e[3]=h,e[4]=x):x=e[4],x}let f;if(e[5]!==m||e[6]!==d||e[7]!==c||e[8]!==i||e[9]!==r||e[10]!==a||e[11]!==o){let h;e[13]!==m||e[14]!==c||e[15]!==i||e[16]!==r||e[17]!==a||e[18]!==o?(h=x=>t.jsx(_s,{connection:x,isSelected:o===x.id,hasSelections:i(x.id),summary:c(x.id),onClick:()=>r(x.id),onToggleAll:()=>a(x.id),disabled:m},x.id),e[13]=m,e[14]=c,e[15]=i,e[16]=r,e[17]=a,e[18]=o,e[19]=h):h=e[19],f=d.map(h),e[5]=m,e[6]=d,e[7]=c,e[8]=i,e[9]=r,e[10]=a,e[11]=o,e[12]=f}else f=e[12];let g;return e[20]!==f?(g=t.jsx("div",{className:"flex flex-col gap-0.5",children:f}),e[20]=f,e[21]=g):g=e[21],g}function Ss(l){const e=T.c(75),{currentConnection:s,activeTab:n,selectedId:o,formData:i,toggleTool:c,toggleResource:r,togglePrompt:a,toggleAllTools:m,toggleAllResources:u,toggleAllPrompts:d,onTabChange:f}=l;let g;e[0]!==s.icon||e[1]!==s.title?(g=t.jsx(ue,{icon:s.icon,name:s.title,size:"md",className:"shrink-0"}),e[0]=s.icon,e[1]=s.title,e[2]=g):g=e[2];let h;e[3]!==s.title?(h=t.jsx("h2",{className:"text-lg font-semibold truncate",children:s.title}),e[3]=s.title,e[4]=h):h=e[4];let x;e[5]!==s.description?(x=s.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:s.description}),e[5]=s.description,e[6]=x):x=e[6];let j;e[7]!==h||e[8]!==x?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[h,x]}),e[7]=h,e[8]=x,e[9]=j):j=e[9];let v;e[10]!==g||e[11]!==j?(v=t.jsx("div",{className:"p-6 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[g,j]})}),e[10]=g,e[11]=j,e[12]=v):v=e[12];let p;e[13]!==f?(p=F=>f(F),e[13]=f,e[14]=p):p=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(Ce,{value:"tools",variant:"underline",className:"gap-2",children:[t.jsx(ze,{size:16}),"Tools"]}),e[15]=C):C=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(Ce,{value:"resources",variant:"underline",className:"gap-2",children:[t.jsx(ge,{size:16}),"Resources"]}),e[16]=_):_=e[16];let y;e[17]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs(us,{variant:"underline",className:"shrink-0 px-6",children:[C,_,t.jsxs(Ce,{value:"prompts",variant:"underline",className:"gap-2",children:[t.jsx(Re,{size:16}),"Prompts"]})]}),e[17]=y):y=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=Se("Tools not supported by this server"),e[18]=P):P=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(ke,{}),e[19]=S):S=e[19];let O;e[20]!==i||e[21]!==o?(O=i[o]?i[o].tools:[],e[20]=i,e[21]=o,e[22]=O):O=e[22];let k;e[23]!==o||e[24]!==c?(k=(F,Q)=>c(o,F,Q),e[23]=o,e[24]=c,e[25]=k):k=e[25];let w;e[26]!==o||e[27]!==m?(w=()=>m(o),e[26]=o,e[27]=m,e[28]=w):w=e[28];let I;e[29]!==o||e[30]!==O||e[31]!==k||e[32]!==w?(I=t.jsx(_e,{value:"tools",className:"flex-1 overflow-hidden mt-0",children:t.jsx(xe,{fallback:P,children:t.jsx(N.Suspense,{fallback:S,children:t.jsx(bs,{connectionId:o,selections:O,onToggle:k,onToggleAll:w})})})}),e[29]=o,e[30]=O,e[31]=k,e[32]=w,e[33]=I):I=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=Se("Resources not supported by this server"),e[34]=D):D=e[34];let z;e[35]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(ke,{}),e[35]=z):z=e[35];let E;e[36]!==i||e[37]!==o?(E=i[o]?i[o].resources:[],e[36]=i,e[37]=o,e[38]=E):E=e[38];let A;e[39]!==o||e[40]!==r?(A=(F,Q)=>r(o,F,Q),e[39]=o,e[40]=r,e[41]=A):A=e[41];let $;e[42]!==o||e[43]!==u?($=()=>u(o),e[42]=o,e[43]=u,e[44]=$):$=e[44];let L;e[45]!==o||e[46]!==E||e[47]!==A||e[48]!==$?(L=t.jsx(_e,{value:"resources",className:"flex-1 overflow-hidden mt-0",children:t.jsx(xe,{fallback:D,children:t.jsx(N.Suspense,{fallback:z,children:t.jsx(js,{connectionId:o,selections:E,onToggle:A,onToggleAll:$})})})}),e[45]=o,e[46]=E,e[47]=A,e[48]=$,e[49]=L):L=e[49];let q;e[50]===Symbol.for("react.memo_cache_sentinel")?(q=Se("Prompts not supported by this server"),e[50]=q):q=e[50];let J;e[51]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(ke,{}),e[51]=J):J=e[51];let B;e[52]!==i||e[53]!==o?(B=i[o]?i[o].prompts:[],e[52]=i,e[53]=o,e[54]=B):B=e[54];let U;e[55]!==o||e[56]!==a?(U=(F,Q)=>a(o,F,Q),e[55]=o,e[56]=a,e[57]=U):U=e[57];let G;e[58]!==o||e[59]!==d?(G=()=>d(o),e[58]=o,e[59]=d,e[60]=G):G=e[60];let K;e[61]!==o||e[62]!==B||e[63]!==U||e[64]!==G?(K=t.jsx(_e,{value:"prompts",className:"flex-1 overflow-hidden mt-0",children:t.jsx(xe,{fallback:q,children:t.jsx(N.Suspense,{fallback:J,children:t.jsx(ys,{connectionId:o,selections:B,onToggle:U,onToggleAll:G})})})}),e[61]=o,e[62]=B,e[63]=U,e[64]=G,e[65]=K):K=e[65];let H;e[66]!==n||e[67]!==I||e[68]!==L||e[69]!==K||e[70]!==p?(H=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:t.jsxs(ms,{value:n,onValueChange:p,variant:"underline",className:"flex-1 flex flex-col overflow-hidden",children:[y,I,L,K]})}),e[66]=n,e[67]=I,e[68]=L,e[69]=K,e[70]=p,e[71]=H):H=e[71];let W;return e[72]!==H||e[73]!==v?(W=t.jsxs(t.Fragment,{children:[v,H]}),e[72]=H,e[73]=v,e[74]=W):W=e[74],W}function ws(l){const e={};for(const s of l)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function we(l){return Object.entries(l).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function Es(l,e){switch(e.type){case"SET_SEARCH_TERM":return{...l,searchTerm:e.payload};case"SET_SELECTED":return{...l,selectedId:e.payload};case"SET_ACTIVE_TAB":return{...l,activeTab:e.payload};case"RESET":return{searchTerm:"",selectedId:e.payload.selectedId??e.payload.firstConnectionId??null,activeTab:"tools"};case"SELECT_CONNECTION":return{...l,selectedId:e.payload,activeTab:"tools"};default:return l}}const He=(l,e)=>l.find(s=>s.id===e)??l[0];function Is(l){const e=T.c(79),{open:s,onOpenChange:n,selectedId:o,form:i,connections:c}=l;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},e[0]=r):r=e[0];const a=Pt(r);let m;e[1]!==a||e[2]!==o?(m=He(a,o)?.id??null,e[1]=a,e[2]=o,e[3]=m):m=e[3];let u;e[4]!==m?(u={activeTab:"tools",searchTerm:"",selectedId:m},e[4]=m,e[5]=u):u=e[5];const[d,f]=N.useReducer(Es,u);let g;e[6]!==c?(g=c??[],e[6]=c,e[7]=g):g=e[7];let h;e[8]!==g?(h=ws(g),e[8]=g,e[9]=h):h=e[9];const x=h;let j;e[10]!==a||e[11]!==d.selectedId?(j=He(a,d.selectedId),e[10]=a,e[11]=d.selectedId,e[12]=j):j=e[12];const v=j;let p;e[13]!==x?(p=b=>ps(x,b),e[13]=x,e[14]=p):p=e[14];const C=p;let _;e[15]!==x?(_=b=>fs(x,b),e[15]=x,e[16]=_):_=e[16];const y=_;let P;e[17]!==i||e[18]!==x?(P=(b,R,M,X)=>{const de=x[b]?.[R];let V;de===null?V=X.filter(ve=>ve!==M):de?.includes(M)?V=de.filter(ve=>ve!==M):(V=[...de??[],M],V.length===X.length&&(V=null));const me={...x};me[b]?me[b]={...me[b]}:me[b]={tools:null,resources:null,prompts:null},me[b][R]=V,i.setValue("connections",we(me),{shouldDirty:!0,shouldTouch:!0})},e[17]=i,e[18]=x,e[19]=P):P=e[19];const S=P;let O;e[20]!==i||e[21]!==x?(O=(b,R)=>{const de=x[b]?.[R]===null?[]:null,V={...x};V[b]?V[b]={...V[b]}:V[b]={tools:null,resources:null,prompts:null},V[b][R]=de,i.setValue("connections",we(V),{shouldDirty:!0,shouldTouch:!0})},e[20]=i,e[21]=x,e[22]=O):O=e[22];const k=O;let w;e[23]!==S?(w=(b,R,M)=>S(b,"tools",R,M),e[23]=S,e[24]=w):w=e[24];const I=w;let D;e[25]!==S?(D=(b,R,M)=>S(b,"resources",R,M),e[25]=S,e[26]=D):D=e[26];const z=D;let E;e[27]!==S?(E=(b,R,M)=>S(b,"prompts",R,M),e[27]=S,e[28]=E):E=e[28];const A=E;let $;e[29]!==k?($=b=>k(b,"tools"),e[29]=k,e[30]=$):$=e[30];const L=$;let q;e[31]!==k?(q=b=>k(b,"resources"),e[31]=k,e[32]=q):q=e[32];const J=q;let B;e[33]!==k?(B=b=>k(b,"prompts"),e[33]=k,e[34]=B):B=e[34];const U=B;let G;e[35]!==i||e[36]!==x?(G=b=>{const R=x[b],M=R&&R.tools===null&&R.resources===null&&R.prompts===null,X={...x};M?delete X[b]:X[b]=xs,i.setValue("connections",we(X),{shouldDirty:!0,shouldTouch:!0})},e[35]=i,e[36]=x,e[37]=G):G=e[37];const K=G;let H;e[38]!==a||e[39]!==n||e[40]!==o?(H=b=>{b&&f({type:"RESET",payload:{selectedId:o,firstConnectionId:a[0]?.id??null}}),n(b)},e[38]=a,e[39]=n,e[40]=o,e[41]=H):H=e[41];const W=H;let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=b=>{f({type:"SELECT_CONNECTION",payload:b})},e[42]=F):F=e[42];const Q=F;let fe;e[43]===Symbol.for("react.memo_cache_sentinel")?(fe=b=>f({type:"SET_SEARCH_TERM",payload:b}),e[43]=fe):fe=e[43];let le;e[44]!==d.searchTerm?(le=t.jsx(Kt,{value:d.searchTerm,onChange:fe,placeholder:"Search connections..."}),e[44]=d.searchTerm,e[45]=le):le=e[45];let oe;e[46]!==a||e[47]!==d.searchTerm||e[48]!==d.selectedId||e[49]!==y||e[50]!==C||e[51]!==K?(oe=t.jsx("div",{className:"flex-1 overflow-auto p-2",children:t.jsx(ks,{allConnections:a,searchTerm:d.searchTerm,selectedId:d.selectedId,hasSelections:C,getSelectionSummary:y,onConnectionClick:Q,onToggleAll:K})}),e[46]=a,e[47]=d.searchTerm,e[48]=d.selectedId,e[49]=y,e[50]=C,e[51]=K,e[52]=oe):oe=e[52];let ne;e[53]!==le||e[54]!==oe?(ne=t.jsxs("div",{className:"w-full sm:w-72 sm:border-r border-b sm:border-b-0 border-border flex flex-col bg-background sm:h-full max-h-[40vh] sm:max-h-full",children:[le,oe]}),e[53]=le,e[54]=oe,e[55]=ne):ne=e[55];let ie;e[56]!==v||e[57]!==d.activeTab||e[58]!==d.selectedId||e[59]!==x||e[60]!==U||e[61]!==J||e[62]!==L||e[63]!==A||e[64]!==z||e[65]!==I?(ie=t.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:v&&d.selectedId?t.jsx(Ss,{currentConnection:v,activeTab:d.activeTab,selectedId:d.selectedId,formData:x,toggleTool:I,toggleResource:z,togglePrompt:A,toggleAllTools:L,toggleAllResources:J,toggleAllPrompts:U,onTabChange:b=>f({type:"SET_ACTIVE_TAB",payload:b})},d.selectedId):t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Select a connection to view its tools, resources, and prompts"})}),e[56]=v,e[57]=d.activeTab,e[58]=d.selectedId,e[59]=x,e[60]=U,e[61]=J,e[62]=L,e[63]=A,e[64]=z,e[65]=I,e[66]=ie):ie=e[66];let re;e[67]!==ne||e[68]!==ie?(re=t.jsxs("div",{className:"flex-1 flex overflow-hidden min-h-0 flex-col sm:flex-row",children:[ne,ie]}),e[67]=ne,e[68]=ie,e[69]=re):re=e[69];let ae;e[70]!==W?(ae=t.jsx(qt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(Y,{variant:"outline",onClick:()=>W(!1),children:"Done"})}),e[70]=W,e[71]=ae):ae=e[71];let ce;e[72]!==re||e[73]!==ae?(ce=t.jsxs(qe,{className:"sm:max-w-5xl h-[80vh] max-h-[80vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[re,ae]}),e[72]=re,e[73]=ae,e[74]=ce):ce=e[74];let pe;return e[75]!==W||e[76]!==s||e[77]!==ce?(pe=t.jsx(Ye,{open:s,onOpenChange:W,children:ce}),e[75]=W,e[76]=s,e[77]=ce,e[78]=pe):pe=e[78],pe}const As=jt.pick({title:!0,description:!0,status:!0,metadata:!0,connections:!0}).extend({title:Nt().min(1,"Name is required").max(255)});function Os(l){const e=T.c(8);let s,n;e[0]!==l?({className:s,...n}=l,e[0]=l,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let o;e[3]!==s?(o=Z("grid gap-3",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==n||e[6]!==o?(i=t.jsx(ts,{"data-slot":"radio-group",className:o,...n}),e[5]=n,e[6]=o,e[7]=i):i=e[7],i}function Ee(l){const e=T.c(9);let s,n;e[0]!==l?({className:s,...n}=l,e[0]=l,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let o;e[3]!==s?(o=Z("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]=o):o=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ss,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Xe,{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 c;return e[6]!==n||e[7]!==o?(c=t.jsx(es,{"data-slot":"radio-group-item",className:o,...n,children:i}),e[6]=n,e[7]=o,e[8]=c):c=e[8],c}function Ds(l){const s=new TextEncoder().encode(l),n=Array.from(s,o=>String.fromCharCode(o)).join("");return btoa(n)}function $s(l){const e=T.c(10),{url:s}=l,[n,o]=N.useState(!1);let i;e[0]!==s?(i=async()=>{await navigator.clipboard.writeText(s),o(!0),De.success("Agent URL copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[0]=s,e[1]=i):i=e[1];const c=i;let r;e[2]!==n?(r=n?t.jsx(Je,{size:20,className:"text-green-600"}):t.jsx(os,{size:20}),e[2]=n,e[3]=r):r=e[3];const a=n?"Copied!":"Copy URL";let m;e[4]!==a?(m=t.jsx("span",{className:"text-xs font-medium",children:a}),e[4]=a,e[5]=m):m=e[5];let u;return e[6]!==c||e[7]!==r||e[8]!==m?(u=t.jsxs(Y,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[r,m]}),e[6]=c,e[7]=r,e[8]=m,e[9]=u):u=e[9],u}function Rs(l){const e=T.c(7),{url:s,serverName:n}=l;let o;e[0]!==n||e[1]!==s?(o=()=>{const m=Ze(n),d=Ds(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(d)}`;window.open(f,"_blank"),De.success("Opening Cursor...")},e[0]=n,e[1]=s,e[2]=o):o=e[2];const i=o;let c,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=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%)"}}),r=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=c,e[4]=r):(c=e[3],r=e[4]);let a;return e[5]!==i?(a=t.jsxs(Y,{type:"button",variant:"outline",onClick:i,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,r]}),e[5]=i,e[6]=a):a=e[6],a}function zs(l){const e=T.c(11),{url:s,serverName:n}=l,[o,i]=N.useState(!1);let c;e[0]!==n||e[1]!==s?(c=async()=>{const f=Ze(n),h=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),x=`claude mcp add-json "${f}" '${h.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(x),i(!0),De.success("Claude Code command copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=n,e[1]=s,e[2]=c):c=e[2];const r=c;let a;e[3]!==o?(a=o?t.jsx(Je,{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]=o,e[4]=a):a=e[4];const m=o?"Copied!":"Install on Claude";let u;e[5]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let d;return e[7]!==r||e[8]!==a||e[9]!==u?(d=t.jsxs(Y,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,u]}),e[7]=r,e[8]=a,e[9]=u,e[10]=d):d=e[10],d}function Ls(l){const e=T.c(40),{open:s,onOpenChange:n,virtualMcp:o}=l,[i,c]=N.useState("code_execution");let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=L=>{(L==="passthrough"||L==="smart_tool_selection"||L==="code_execution")&&c(L)},e[0]=r):r=e[0];const a=r;let m;e[1]!==i||e[2]!==o.id?(m=new URL(`/mcp/virtual-mcp/${o.id}`,window.location.origin),m.searchParams.set("mode",i),e[1]=i,e[2]=o.id,e[3]=m):m=e[3];let u;e[4]!==o.id||e[5]!==o.title?(u=o.title||`agent-${o.id?.slice(0,8)??"default"}`,e[4]=o.id,e[5]=o.title,e[6]=u):u=e[6];const d=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Yt,{children:t.jsx(Zt,{children:"Share Agent"})}),e[7]=f):f=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Qe,{className:"size-5 text-muted-foreground"})}),e[9]=h):h=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=x):x=e[10];let j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(ee,{asChild:!0,children:t.jsx(ye,{className:"size-3.5 text-muted-foreground"})}),e[11]=j):j=e[11];let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=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:[h,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x,t.jsx(Ne,{children:t.jsxs(te,{children:[j,t.jsx(se,{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(Ee,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=v):v=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(tt,{className:"size-5 text-muted-foreground"})}),e[13]=p):p=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 _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ee,{asChild:!0,children:t.jsx(ye,{className:"size-3.5 text-muted-foreground"})}),e[15]=_):_=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=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:[p,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(Ne,{children:t.jsxs(te,{children:[_,t.jsx(se,{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(Ee,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=y):y=e[16];let P;e[17]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(ls,{className:"size-5 text-muted-foreground"})}),e[17]=P):P=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=S):S=e[18];let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ee,{asChild:!0,children:t.jsx(ye,{className:"size-3.5 text-muted-foreground"})}),e[19]=O):O=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=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:[P,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[S,t.jsx(Ne,{children:t.jsxs(te,{children:[O,t.jsx(se,{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(Ee,{id:"mode-code",value:"code_execution"}),t.jsx($e,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=k):k=e[20];let w;e[21]!==i?(w=t.jsxs("div",{className:"flex flex-col gap-3",children:[g,t.jsxs(Os,{value:i,onValueChange:a,className:"flex flex-col gap-4.5",children:[v,y,k]})]}),e[21]=i,e[22]=w):w=e[22];let I;e[23]!==m.href?(I=t.jsx($s,{url:m.href}),e[23]=m.href,e[24]=I):I=e[24];let D,z;e[25]!==d||e[26]!==m.href?(D=t.jsx(Rs,{url:m.href,serverName:d}),z=t.jsx(zs,{url:m.href,serverName:d}),e[25]=d,e[26]=m.href,e[27]=D,e[28]=z):(D=e[27],z=e[28]);let E;e[29]!==I||e[30]!==D||e[31]!==z?(E=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[I,D,z]})}),e[29]=I,e[30]=D,e[31]=z,e[32]=E):E=e[32];let A;e[33]!==w||e[34]!==E?(A=t.jsxs(qe,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[w,E]})]}),e[33]=w,e[34]=E,e[35]=A):A=e[35];let $;return e[36]!==n||e[37]!==s||e[38]!==A?($=t.jsx(Ye,{open:s,onOpenChange:n,children:A}),e[36]=n,e[37]=s,e[38]=A,e[39]=$):$=e[39],$}function Ps(l,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...l,shareDialogOpen:e.payload};case"SET_CONNECTION_DIALOG_OPEN":return{...l,connectionDialogOpen:e.payload};case"SET_EDITING_CONNECTION_ID":return{...l,editingConnectionId:e.payload};case"SET_SKILLS_OPEN":return{...l,skillsOpen:e.payload};default:return l}}function Ie(l){const e=T.c(3),{connection_id:s}=l,n=Ue(s);if(!n)return null;let o;return e[0]!==n.icon||e[1]!==n.title?(o=t.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:t.jsx(ue,{icon:n.icon,name:n.title,size:"xs"})}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2],o}Ie.Fallback=function(){return t.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})})};function Ae(l){const e=T.c(27),{connection_id:s,selected_tools:n,selected_resources:o,selected_prompts:i,onClick:c}=l,r=Ue(s);if(!r)return null;let a;e[0]!==n?(a=Te(n),e[0]=n,e[1]=a):a=e[1];const m=a;let u;e[2]!==o?(u=Te(o),e[2]=o,e[3]=u):u=e[3];const d=u;let f;e[4]!==i?(f=Te(i),e[4]=i,e[5]=f):f=e[5];const g=f;let h;e[6]!==r.icon||e[7]!==r.title?(h=t.jsx(ue,{icon:r.icon,name:r.title,size:"xs"}),e[6]=r.icon,e[7]=r.title,e[8]=h):h=e[8];let x;e[9]!==r.title?(x=t.jsx("p",{className:"flex-1 text-sm font-normal text-foreground truncate",children:r.title}),e[9]=r.title,e[10]=x):x=e[10];let j;e[11]!==m?(j=m!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:m==="all"?"all":m}),t.jsx(ze,{size:12})]}),e[11]=m,e[12]=j):j=e[12];let v;e[13]!==d?(v=d!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:d==="all"?"all":d}),t.jsx(ge,{size:12})]}),e[13]=d,e[14]=v):v=e[14];let p;e[15]!==g?(p=g!==0&&t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("span",{children:g==="all"?"all":g}),t.jsx(Re,{size:12})]}),e[15]=g,e[16]=p):p=e[16];let C;e[17]!==j||e[18]!==v||e[19]!==p?(C=t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[j,v,p]}),e[17]=j,e[18]=v,e[19]=p,e[20]=C):C=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"}),e[21]=_):_=e[21];let y;return e[22]!==c||e[23]!==h||e[24]!==x||e[25]!==C?(y=t.jsxs("div",{onClick:c,className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",children:[h,x,C,_]}),e[22]=c,e[23]=h,e[24]=x,e[25]=C,e[26]=y):y=e[26],y}Ae.Fallback=function(){return t.jsxs("div",{className:"w-full h-12 flex items-center gap-2 px-3 rounded-lg border border-border",children:[t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"flex-1 h-4 rounded bg-muted animate-pulse"}),t.jsxs($e,{variant:"secondary",className:"bg-muted h-5 gap-2 px-1.5 py-1 flex items-center",children:[t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(ze,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(ge,{size:12})]}),t.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[t.jsx("div",{className:"w-3 h-3 rounded bg-muted-foreground/20 animate-pulse"}),t.jsx(Re,{size:12})]})]}),t.jsx(Ke,{size:16,className:"text-muted-foreground shrink-0"})]})};function Ms({virtualMcp:l}){const s=_t().location.href,n=Tt(),o=Vt(),i=kt({resolver:St(As),defaultValues:l}),c=i.watch("connections"),[r,a]=N.useReducer(Ps,{shareDialogOpen:!1,connectionDialogOpen:!1,editingConnectionId:null,skillsOpen:!1}),[,m]=Rt(),{setVirtualMcpId:u}=Et();N.useEffect(()=>{m(!0),u(l.id)},[l.id]);const d=()=>{u(l.id),m(!0)},f=i.formState.isDirty,g=async()=>{const p=i.getValues(),C=await o.update.mutateAsync({id:l.id,data:p});i.reset(C)},h=()=>{i.reset(l)},x=()=>{a({type:"SET_EDITING_CONNECTION_ID",payload:null}),a({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},j=p=>{a({type:"SET_EDITING_CONNECTION_ID",payload:p}),a({type:"SET_CONNECTION_DIALOG_OPEN",payload:!0})},v=o.update.isPending;return t.jsxs(Wt,{onBack:()=>n.history.back(),children:[t.jsxs(Ut,{children:[t.jsxs(te,{delayDuration:0,children:[t.jsx(ee,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(Y,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:!f||v,onClick:h,"aria-label":"Cancel",children:t.jsx(Bt,{size:14})})})}),t.jsx(se,{side:"bottom",children:"Cancel"})]}),t.jsxs(te,{delayDuration:0,children:[t.jsx(ee,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(Y,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:!f||v,onClick:g,"aria-label":"Save",children:v?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(st,{size:14})})})}),t.jsx(se,{side:"bottom",children:"Save"})]}),t.jsxs(te,{delayDuration:0,children:[t.jsx(ee,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 border border-input",onClick:d,"aria-label":"Test Agent",children:[t.jsx(Gt,{size:14}),"Test Agent"]})})}),t.jsx(se,{side:"bottom",children:"Test this agent in chat"})]}),t.jsxs(te,{delayDuration:0,children:[t.jsx(ee,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(Y,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:()=>a({type:"SET_SHARE_DIALOG_OPEN",payload:!0}),"aria-label":"Share",children:t.jsx(Ht,{size:14})})})}),t.jsx(se,{side:"bottom",children:"Share"})]}),t.jsx($t,{title:l.title,url:s,icon:l.icon??"cpu_chip"})]}),t.jsx("div",{className:"flex h-full w-full bg-background overflow-auto",children:t.jsxs("div",{className:"flex flex-col w-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 p-6 shrink-0",children:[t.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[t.jsx(ue,{icon:l.icon,name:i.watch("title")||"Agent",size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(et,{})}),t.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[t.jsx(Be,{...i.register("title"),className:"h-auto py-0.5 text-lg! font-medium leading-7 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Agent Name"}),t.jsx(Be,{...i.register("description"),className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-1 -mx-1 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})]})]}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(zt,{checked:i.watch("status")==="active",onCheckedChange:p=>i.setValue("status",p?"active":"inactive",{shouldDirty:!0})})})]}),t.jsxs(It,{open:r.skillsOpen,onOpenChange:p=>a({type:"SET_SKILLS_OPEN",payload:p}),className:"border-t border-border shrink-0 max-h-[400px] overflow-hidden flex flex-col",children:[c.length===0?t.jsxs("button",{type:"button",onClick:x,className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"h-7 px-2 inline-flex items-center justify-center gap-1 rounded-md text-sm text-muted-foreground",children:[t.jsx(Ge,{size:14}),"Add"]})]}):t.jsx(At,{asChild:!0,children:t.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-6 py-4 hover:bg-muted/50 transition-colors cursor-pointer",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Skills"}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"flex items-center -space-x-2 ease-(--ease-out-expo)",style:{width:r.skillsOpen?0:"auto",marginRight:r.skillsOpen?0:4,opacity:r.skillsOpen?0:1,pointerEvents:r.skillsOpen?"none":"auto",transitionProperty:"all",transitionDuration:r.skillsOpen?"0ms":"200ms"},children:c.slice(0,4).map(p=>t.jsx(N.Suspense,{fallback:t.jsx(Ie.Fallback,{}),children:t.jsx(Ie,{connection_id:p.connection_id})},p.connection_id))}),t.jsxs("div",{role:"button",tabIndex:0,className:"h-7 inline-flex items-center justify-center rounded-md text-sm text-muted-foreground overflow-hidden transition-all duration-200 ease-(--ease-out-expo) hover:bg-accent hover:text-accent-foreground",style:{width:r.skillsOpen?"auto":28,paddingLeft:r.skillsOpen?8:0,paddingRight:r.skillsOpen?8:0,gap:r.skillsOpen?4:0},onPointerDown:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),p.preventDefault(),x()},onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),p.preventDefault(),x())},children:[t.jsx(Ge,{size:14,className:"shrink-0"}),t.jsx("span",{className:"overflow-hidden whitespace-nowrap transition-all duration-200 ease-(--ease-out-expo)",style:{width:r.skillsOpen?"auto":0,opacity:r.skillsOpen?1:0},children:"Add"})]}),t.jsx("div",{className:"h-7 inline-flex items-center justify-center overflow-hidden transition-all duration-200 ease-(--ease-out-expo)",style:{width:r.skillsOpen?28:0,opacity:r.skillsOpen?1:0},children:t.jsx(Ft,{size:16,className:"shrink-0"})})]})]})}),t.jsx("div",{className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-(--ease-out-expo)",style:{gridTemplateRows:r.skillsOpen?"1fr":"0fr"},children:t.jsx("div",{className:"min-h-0 overflow-hidden",children:t.jsx("div",{className:"overflow-y-auto max-h-[300px] mask-[linear-gradient(to_bottom,black_calc(100%-40px),transparent_100%)]",children:t.jsx("div",{className:"flex flex-col gap-2 px-6 pb-4 pt-2",children:c.map(p=>t.jsx(N.Suspense,{fallback:t.jsx(Ae.Fallback,{}),children:t.jsx(Ae,{connection_id:p.connection_id,selected_tools:p.selected_tools,selected_resources:p.selected_resources,selected_prompts:p.selected_prompts,onClick:()=>j(p.connection_id)})},p.connection_id))})})})})]}),t.jsxs("div",{className:"flex flex-col flex-1 p-6 border-t border-border overflow-auto",children:[t.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Instructions"}),t.jsx(wt,{name:"metadata.instructions",control:i.control,render:({field:p})=>t.jsx(Lt,{...p,value:p.value??"",placeholder:"Write instructions here...",className:"min-h-[200px] resize-none text-sm placeholder:text-muted-foreground/50 leading-relaxed border-0 rounded-none shadow-none px-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus:border-0 bg-transparent"})})]})]})}),t.jsx(Is,{open:r.connectionDialogOpen,onOpenChange:p=>a({type:"SET_CONNECTION_DIALOG_OPEN",payload:p}),selectedId:r.editingConnectionId,form:i,connections:c}),t.jsx(Ls,{open:r.shareDialogOpen,onOpenChange:p=>a({type:"SET_SHARE_DIALOG_OPEN",payload:p}),virtualMcp:l})]})}function Vs(){const l=T.c(6),e=yt();let s;l[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/agents/$agentId"},l[0]=s):s=l[0];const n=Ct(s),{org:o,agentId:i}=n,c=Mt(i);if(!c){let a;return l[1]!==e||l[2]!==o?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ot,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(Y,{variant:"outline",onClick:()=>e({to:"/$org/agents",params:{org:o}}),children:"Back to agents"})})}),l[1]=e,l[2]=o,l[3]=a):a=l[3],a}let r;return l[4]!==c?(r=t.jsx(Ms,{virtualMcp:c}),l[4]=c,l[5]=r):r=l[5],r}function Pl(){const l=T.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(xe,{children:t.jsx(N.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Vs,{})})}),l[0]=e):e=l[0],e}export{Pl as default};
@@ -1 +0,0 @@
1
- import{c as Z,j as t,r as ee,u as te,l as se}from"./index-DZqSbjFw.js";import{C as oe}from"./collection-header-CHcRbSVg.js";import{C as re}from"./collection-page-pQhPuVgo.js";import{C as ne}from"./collection-search-rOPXHeEr.js";import{C as ie}from"./collection-table-wrapper-C4t2ZZhF.js";import{C as ae}from"./connection-card-BLTFMSZS.js";import{E as W,I as le}from"./empty-state-BJnVPwS4.js";import{E as ce}from"./error-boundary-B6RXO2oI.js";import{u as de,s as G}from"./use-list-state-BfmIALu7.js";import{u as me}from"./use-create-virtual-mcp-D-7Y6G3j.js";import{i as ge}from"./constants-Mpett05j.js";import{b as ue,a as pe}from"./use-virtual-mcp-D3UgDP8i.js";import{c as he,b as fe,d as xe,A as je,e as Ce,g as we,a as ye,f as Ne}from"./alert-dialog-Dllib4My.js";import{B as De}from"./badge-DF_3zhMz.js";import{B as q}from"./button-0ydgHweE.js";import{D as J,a as Q,b as U,c as E}from"./dropdown-menu-CvHFB3Gz.js";import{i as X}from"./DotsVertical-55vBqpF9.js";import{i as Se}from"./Loading01-BiNUjLDw.js";import{s as Y}from"./Trash01-DSwoFZY0.js";import{t as x}from"./Users03-B6orUjW9.js";import"./collection-display-button-C0Qj_mDn.js";import"./ArrowUp-BDaeP-ZF.js";import"./Check-C7bGyGOC.js";import"./Grid01-Bdrpv4xX.js";import"./List-bC7xiZ2s.js";import"./tooltip-9zLX7HP0.js";import"./view-mode-toggle-DR9UFNqr.js";import"./SearchMd-BeBVRrdw.js";import"./input-u1hHzCA4.js";import"./card-DFhzHX-B.js";import"./use-mobile-VtwOaDa5.js";import"./use-collections-DtjYeVzj.js";import"./useMutation-BReaxe_W.js";import"./useQuery-KlPPWaKy.js";function be(e,r){switch(r.type){case"delete":return{mode:"deleting",virtualMcp:r.virtualMcp};case"close":return{mode:"idle"}}}function ve(){const e=Z.c(62),{org:r}=te(),i=se();let j;e[0]!==r.slug?(j={namespace:r.slug,resource:"agents"},e[0]=r.slug,e[1]=j):j=e[1];const s=de(j),f=ue(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createVirtualMCP:V,isCreating:w}=me(C),O=pe();let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={mode:"idle"},e[3]=y):y=e[3];const[n,N]=ee.useReducer(be,y);let D;e[4]!==O||e[5]!==n.mode||e[6]!==n.virtualMcp?(D=async()=>{if(n.mode!=="deleting")return;const o=n.virtualMcp.id;if(N({type:"close"}),!(!o||ge(o)))try{await O.delete.mutateAsync(o)}catch{}},e[4]=O,e[5]=n.mode,e[6]=n.virtualMcp,e[7]=D):D=e[7];const B=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:$e,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},v={id:"description",header:"Description",render:_e,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"connections",header:"Connections",render:Pe,cellClassName:"w-24 shrink-0"},A={id:"status",header:"Status",render:Ie,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=b,e[10]=v,e[11]=k,e[12]=A):(S=e[8],b=e[9],v=e[10],k=e[11],A=e[12]);let z;e[13]!==i||e[14]!==r.slug?(z=[S,b,v,k,A,{id:"actions",header:"",render:o=>t.jsxs(J,{children:[t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Me,children:t.jsx(X,{size:20})})}),t.jsxs(U,{align:"end",onClick:ze,children:[t.jsxs(E,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}})},children:[t.jsx(G,{size:16}),"Open"]}),t.jsxs(E,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",virtualMcp:o})},children:[t.jsx(Y,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[13]=i,e[14]=r.slug,e[15]=z):z=e[15];const R=z,T=w?"Creating...":"Create Agent";let M;e[16]!==V||e[17]!==w||e[18]!==T?(M=t.jsx(q,{onClick:V,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:T}),e[16]=V,e[17]=w,e[18]=T,e[19]=M):M=e[19];const H=M,L=n.mode==="deleting";let I;e[20]===Symbol.for("react.memo_cache_sentinel")?(I=o=>!o&&N({type:"close"}),e[20]=I):I=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(he,{children:"Delete Agent?"}),e[21]=P):P=e[21];const F=n.mode==="deleting"&&n.virtualMcp.title;let l;e[22]!==F?(l=t.jsxs(fe,{children:[P,t.jsxs(xe,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:F}),"."]})]}),e[22]=F,e[23]=l):l=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(je,{children:"Cancel"}),e[24]=_):_=e[24];let c;e[25]!==B?(c=t.jsxs(Ce,{children:[_,t.jsx(we,{onClick:B,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[25]=B,e[26]=c):c=e[26];let d;e[27]!==l||e[28]!==c?(d=t.jsxs(ye,{children:[l,c]}),e[27]=l,e[28]=c,e[29]=d):d=e[29];let m;e[30]!==L||e[31]!==d?(m=t.jsx(Ne,{open:L,onOpenChange:I,children:d}),e[30]=L,e[31]=d,e[32]=m):m=e[32];let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[33]=$):$=e[33];let g;e[34]!==H||e[35]!==s.handleSort||e[36]!==s.setViewMode||e[37]!==s.sortDirection||e[38]!==s.sortKey||e[39]!==s.viewMode?(g=t.jsx(oe,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:$,ctaButton:H}),e[34]=H,e[35]=s.handleSort,e[36]=s.setViewMode,e[37]=s.sortDirection,e[38]=s.sortKey,e[39]=s.viewMode,e[40]=g):g=e[40];let u;e[41]!==s?(u=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[41]=s,e[42]=u):u=e[42];let p;e[43]!==s.search||e[44]!==s.setSearch||e[45]!==u?(p=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:u}),e[43]=s.search,e[44]=s.setSearch,e[45]=u,e[46]=p):p=e[46];let h;e[47]!==R||e[48]!==s.handleSort||e[49]!==s.search||e[50]!==s.sortDirection||e[51]!==s.sortKey||e[52]!==s.viewMode||e[53]!==i||e[54]!==r.slug||e[55]!==f?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(W,{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(ae,{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:r.slug,agentId:o.id}}),footer:t.jsx("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":""]})}),headerActions:t.jsxs(J,{children:[t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(X,{size:20})})}),t.jsxs(U,{align:"end",onClick:ke,children:[t.jsxs(E,{onClick:a=>{a.stopPropagation(),i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}})},children:[t.jsx(G,{size:16}),"Open"]}),t.jsxs(E,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",virtualMcp:o})},children:[t.jsx(Y,{size:16}),"Delete"]})]})]})},o.id??"default"))})}):t.jsx(ie,{columns:R,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/agents/$agentId",params:{org:r.slug,agentId:o.id}}),emptyState:s.search?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(W,{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[47]=R,e[48]=s.handleSort,e[49]=s.search,e[50]=s.sortDirection,e[51]=s.sortKey,e[52]=s.viewMode,e[53]=i,e[54]=r.slug,e[55]=f,e[56]=h):h=e[56];let K;return e[57]!==m||e[58]!==g||e[59]!==p||e[60]!==h?(K=t.jsxs(re,{children:[m,g,p,h]}),e[57]=m,e[58]=g,e[59]=p,e[60]=h,e[61]=K):K=e[61],K}function ke(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function ze(e){return e.stopPropagation()}function Me(e){return e.stopPropagation()}function Ie(e){return t.jsx(De,{variant:e.status==="active"?"default":"outline",children:e.status})}function Pe(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function _e(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function $e(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(le,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function ft(){const e=Z.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{children:t.jsx(ee.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]=r):r=e[0],r}export{ft as default};
@@ -1 +0,0 @@
1
- import{c as d,j as u,$ as l,t as v}from"./index-DZqSbjFw.js";import{c as g}from"./button-0ydgHweE.js";const f=v("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?l:"span";let i;e[5]!==r||e[6]!==t?(i=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=u.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{m as B};
@@ -1 +0,0 @@
1
- import{aR as g,aS as u,c as l,j as v,$ as b,t as p}from"./index-DZqSbjFw.js";function x(...a){return g(u(a))}const f=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(f({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,f as b,x as c};
@@ -1,26 +0,0 @@
1
- import{bE as Q,r as C,o as As,s as mt,c as N,j as o,b6 as It,u as Y,k as Ms,t as Ps,a as oe,f as Ls,ao as gn,bu as F,bF as zs,ax as Ds,x as _t,z as ne,D as bn,ay as Ws,w as Tt,av as Hs,az as jn,y as vn,aF as Fs,aG as Vs,E as yn,aH as Bs,bG as $t,bH as Us,aw as qs,b2 as Ks,v as Js,bI as Gs,bn as Sn}from"./index-DZqSbjFw.js";import{E as wn,I as Ye,n as Xs}from"./empty-state-BJnVPwS4.js";import{E as Nn}from"./error-boundary-B6RXO2oI.js";import{a as Et,u as Ot,g as Rt,e as At,d as Mt}from"./use-collections-DtjYeVzj.js";import{u as ee,i as Zs}from"./constants-Mpett05j.js";import{P as Pt}from"./pin-to-sidebar-button-Bsv2_7kr.js";import{B as V,c as O}from"./button-0ydgHweE.js";import{F as pt,a as Qs,b as Lt,d as zt}from"./form-Bu0daHLu.js";import{I as Dt}from"./input-u1hHzCA4.js";import{T as yt}from"./textarea-CLIBzUIu.js";import{T as le,a as ce,b as ae,c as de}from"./tooltip-9zLX7HP0.js";import{i as kn,a as Ys}from"./Tool01-CH0MYN-2.js";import{a as Cn,V as Wt,b as Ee}from"./layout-DspSCzsh.js";import{S as In,a as _n,b as Tn,c as $n,d as St}from"./select-BKwPUbTK.js";import{i as eo}from"./AlertCircle-BFXBDrUr.js";import{s as to,M as Oe}from"./monaco-editor-CZ0mtshA.js";import{i as no}from"./Code01-Bti_O9RL.js";import{a as so}from"./Copy01-Cql6iNiT.js";import{i as ze}from"./Loading01-BiNUjLDw.js";import{i as Ht}from"./Play-C3Hph8xY.js";import{s as Ft}from"./XClose-C2SJXRFh.js";import{u as oo,O as ro,M as io,F as lo,v as co}from"./index-BDvGMi--.js";import{u as Vt,b as ao}from"./use-connection-BzhGWFyL.js";import{E as Bt}from"./empty-state-7hq4AubF.js";import{D as uo,a as fo}from"./use-binding-B1LqCJr8.js";import{b as En}from"./use-virtual-mcp-D3UgDP8i.js";import{b as mo,a as rn,R as po}from"./resizable-akHzriSj.js";import{S as De}from"./spinner-Bwqz03rl.js";import{V as xo}from"./view-mode-toggle-DR9UFNqr.js";import{N as ho,S as go,a as bo,c as jo,m as Ke,P as vo,i as yo,R as So,b as wo,d as No,e as ln,E as ko,f as Co}from"./index-CymrbMj5.js";import{b as Io,c as _o,d as To,e as $o,a as Eo,D as Oo}from"./dialog-6FUpHXs_.js";import"./index-6m1DUVC_.js";import{s as On}from"./Plus-BuZ2XoBN.js";import{n as Ro}from"./Calendar-Do1_EcNl.js";import{i as Ut}from"./Check-C7bGyGOC.js";import{i as Ao}from"./DotsHorizontal-Bn70vF_C.js";import{D as Mo,a as Po,b as Lo,c as cn}from"./dropdown-menu-CvHFB3Gz.js";import{T as zo,R as Do,b as Wo,c as Rn}from"./collapsible-CDAezpyL.js";import{i as Ho}from"./Grid01-Bdrpv4xX.js";import{B as $e}from"./badge-DF_3zhMz.js";import{i as An}from"./X-DLZk4kqC.js";import"./useMutation-BReaxe_W.js";import"./useQuery-KlPPWaKy.js";import"./Pin01-iTXtWrRE.js";import"./use-organization-settings-DMGaX8N0.js";import"./ArrowLeft-CDtoEGeL.js";import"./ChevronDown-DY2hRH3P.js";import"./mcp-oauth-C7tn4XA4.js";import"./env-vars-editor--TqeS791.js";import"./Trash01-DSwoFZY0.js";import"./File06-OiAbO58I.js";import"./Key01-D8HCSb8P.js";import"./extract-connection-data-Cl2cHkSz.js";import"./constants-OFVhPv4G.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BFBDFgyu.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-EcSYzT5u.js";import"./Users03-B6orUjW9.js";import"./circle-alert-C96B7toE.js";import"./index-CXUcNyKS.js";import"./binder-CC8WnynZ.js";import"./popover-DEmRxXmY.js";import"./use-mcp-prompts-C2Az2O1z.js";import"./ArrowUp-BDaeP-ZF.js";import"./Edit01-BcXXA0Bn.js";import"./localstorage-keys-DpM3uKv7.js";import"./SearchMd-BeBVRrdw.js";import"./use-create-virtual-mcp-D-7Y6G3j.js";import"./useSuspenseInfiniteQuery-jy6MmqiZ.js";import"./infiniteQueryObserver-DmKtj9SR.js";import"./Image01-DvLyxsOA.js";const Mn=Q("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 Pn=Q("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 qt=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Kt=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Fo=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Vo=Q("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Bo=Q("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 Ln=Q("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 zn=Q("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 Dn=Q("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 Wn=Q("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 Hn=Q("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"}]]),Jt=({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"}));Jt.displayName="AlertOctagon";const Fn=({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"}));Fn.displayName="Box";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:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));Vn.displayName="ClockFastForward";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:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Bn.displayName="Code02";const Je=({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"}));Je.displayName="Columns01";const Un=({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"}));Un.displayName="CornerDownRight";const qn=({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"}));qn.displayName="Database01";const Kn=({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:"M3 3v10.2c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 18 6.12 18 7.8 18H15m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0ZM3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Z"}));Kn.displayName="GitBranch01";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:"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"}));Jn.displayName="Repeat03";const Gt=({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"}));Gt.displayName="Save02";As({title:mt().min(1),description:mt().nullable(),body:mt()});function xt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Uo(){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 qo(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(pt,{control:n.control,name:"title",render:Go}),o.jsx(pt,{control:n.control,name:"description",render:Jo})]})]}),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(pt,{control:n.control,name:"body",render:Ko})]}),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(Qs,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function Ko(t){const{field:e}=t;return o.jsx(Lt,{children:o.jsx(zt,{children:o.jsx(yt,{...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 Jo(t){const{field:e}=t;return o.jsxs(Lt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(zt,{children:o.jsx(Dt,{...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 Go(t){const{field:e}=t;return o.jsxs(Lt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(zt,{children:o.jsx(Dt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Xo(t){const e=N.c(52),{providerId:n,promptId:s,onBack:i}=t,l=It().location.href,{org:c}=Y(),a=n||null;let d;e[0]!==c.id||e[1]!==a?(d={connectionId:a,orgId:c.id},e[0]=c.id,e[1]=a,e[2]=d):d=e[2];const u=ee(d),f=Et(n,"PROMPT",s,u),m=Ot(n,"PROMPT",u),x=m.update.isPending;let p;e[3]!==f?(p=f?{title:f.title,description:f.description??null,body:xt(f)}:void 0,e[3]=f,e[4]=p):p=e[4];let h;e[5]!==p?(h={values:p},e[5]=p,e[6]=h):h=e[6];const g=Ms(h);let b;e[7]!==g||e[8]!==f?(b=()=>{f&&g.reset({title:f.title,description:f.description??null,body:xt(f)})},e[7]=g,e[8]=f,e[9]=b):b=e[9];const j=b;let y;e[10]!==m.update||e[11]!==g||e[12]!==s?(y=g.handleSubmit(async D=>{const G=await m.update.mutateAsync({id:s,data:{title:D.title,description:D.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:D.body}}]}});g.reset({title:G.title,description:G.description??null,body:xt(G)})}),e[10]=m.update,e[11]=g,e[12]=s,e[13]=y):y=e[13];const S=y;if(!f){let D;return e[14]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(wn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=D):D=e[14],D}let v;e[15]!==f.title?(v=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:f.title}),e[15]=f.title,e[16]=v):v=e[16];let w;e[17]!==f.description?(w=f.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:f.description})]}):null,e[17]=f.description,e[18]=w):w=e[18];let k;e[19]!==v||e[20]!==w?(k=o.jsx(Cn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,w]})}),e[19]=v,e[20]=w,e[21]=k):k=e[21];let I;e[22]!==f.title||e[23]!==l?(I=o.jsx(Pt,{title:f.title,url:l,icon:"description"}),e[22]=f.title,e[23]=l,e[24]=I):I=e[24];const T=!g.formState.isDirty||x;let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx(kn,{size:14}),e[25]=M):M=e[25];let R;e[26]!==j||e[27]!==T?(R=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:T,onClick:j,"aria-label":"Cancel",children:M})})}),e[26]=j,e[27]=T,e[28]=R):R=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=o.jsx(ce,{side:"bottom",children:"Cancel"}),e[29]=P):P=e[29];let z;e[30]!==R?(z=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[R,P]})}),e[30]=R,e[31]=z):z=e[31];const q=!g.formState.isDirty||x;let A;e[32]!==S?(A=()=>{S()},e[32]=S,e[33]=A):A=e[33];let J;e[34]===Symbol.for("react.memo_cache_sentinel")?(J=o.jsx(Gt,{size:14}),e[34]=J):J=e[34];let _;e[35]!==q||e[36]!==A?(_=o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:q,onClick:A,"aria-label":"Save",children:J})})}),e[35]=q,e[36]=A,e[37]=_):_=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=o.jsx(ce,{side:"bottom",children:"Save"}),e[38]=$):$=e[38];let E;e[39]!==_?(E=o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[_,$]})}),e[39]=_,e[40]=E):E=e[40];let L;e[41]!==I||e[42]!==z||e[43]!==E?(L=o.jsxs(Wt,{children:[I,z,E]}),e[41]=I,e[42]=z,e[43]=E,e[44]=L):L=e[44];let H;e[45]!==g?(H=o.jsx("div",{className:"h-full",children:o.jsx(qo,{form:g})}),e[45]=g,e[46]=H):H=e[46];let Z;return e[47]!==i||e[48]!==L||e[49]!==H||e[50]!==k?(Z=o.jsxs(Ee,{onBack:i,children:[k,L,H]}),e[47]=i,e[48]=L,e[49]=H,e[50]=k,e[51]=Z):Z=e[51],Z}function Zo(t){const e=N.c(5),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Uo(),e[0]=i):i=e[0];const r=i;if(!r){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(wn,{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(Nn,{children:o.jsx(C.Suspense,{fallback:null,children:o.jsx(Xo,{providerId:r,promptId:n,onBack:s})})}),e[2]=n,e[3]=s,e[4]=l):l=e[4],l}const Qo=Ps("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 Yo(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(Qo({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 er(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 tr(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 nr=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function sr(t){const e=N.c(10),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=oo(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(ro,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(io,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==i||e[7]!==c||e[8]!==n?(a=o.jsx(or,{toolName:n,connectionId:s,onBack:i},c),e[5]=s,e[6]=i,e[7]=c,e[8]=n,e[9]=a):a=e[9],a}function or({toolName:t,connectionId:e,onBack:n}){const i=It().location.href,{replayId:r}=Ls({strict:!1}),l=(()=>{if(!r)return null;const _=`replay-${r}`,$=sessionStorage.getItem(_);if(!$)return null;sessionStorage.removeItem(_);try{return JSON.parse($)}catch{return null}})(),c=(()=>{if(!l)return null;const _={};for(const[$,E]of Object.entries(l))E!==null&&typeof E=="object"?_[$]=JSON.stringify(E,null,2):_[$]=E;return _})(),[a,d]=C.useState(c??{}),[u,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[m,x]=C.useState(null),[p,h]=C.useState(null),[g,b]=C.useState(!1),[j,y]=C.useState(null),{org:S}=Y(),v=Vt(e),w=ee({connectionId:e,orgId:S.id}),k=Rt({client:w}),I=k.data?.tools?.find(_=>_.name===t),T=I?.inputSchema?.properties,M=T?Object.keys(T):[],R=M.length>0,P={};if(R&&I?.inputSchema?.properties)for(const _ of M)P[_]=I.inputSchema.required?.includes(_)?"":void 0;const z=_=>Object.prototype.hasOwnProperty.call(a,_),q=async()=>{b(!0),h(null),x(null),y(null);const _=performance.now();try{if(!w)throw new Error("MCP client is not available");const $=R?{...P,...a}:(()=>{const B=u.trim();if(!B)return{};const K=JSON.parse(B);if(K&&typeof K=="object")return K;throw new Error("Raw JSON input must be an object.")})();R&&I?.inputSchema?.properties&&Object.entries(I.inputSchema.properties).forEach(([B,K])=>{if((K.type==="object"||K.type==="array")&&typeof $[B]=="string")try{$[B]=JSON.parse($[B])}catch{}});const E=await w.callTool({name:t,arguments:$}),L=E.structuredContent??E,H=performance.now(),Z=Math.round(H-_);x(L);const D=JSON.stringify(L),G=new TextEncoder().encode(D).length;y({duration:`${Z}ms`,bytes:`${G} bytes`,tokens:`~${Math.ceil(G/4)} tokens`,cost:"$0.0000"})}catch($){const E=$ instanceof Error?$.message:String($);h(E||"Unknown error occurred");const L=performance.now();y({duration:`${Math.round(L-_)}ms`})}finally{b(!1)}},A=(_,$)=>{d(E=>({...E,[_]:$}))},J=()=>{x(null),h(null),y(null)};return o.jsxs(Ee,{onBack:n,children:[o.jsx(Wt,{children:o.jsx(Pt,{title:I?.name??nr(t),url:i,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(Ye,{icon:v?.icon||null,name:v?.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:[k.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):k.isLoading?o.jsx(ze,{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:k.isSuccess?"ready":k.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:I?.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"}),I?.inputSchema?.required&&I.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&&I?.inputSchema?.properties?Object.entries(I.inputSchema.properties).map(([_,$])=>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.inputSchema?.required?.includes(_)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.type})]}),$.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:$.description}),$.type==="object"||$.type==="array"?o.jsx(yt,{className:"font-mono text-xs",value:z(_)?a[_]??"":P[_]??"",onChange:E=>A(_,E.target.value),placeholder:`Enter ${_} as JSON...`,rows:3}):$.type==="boolean"?o.jsxs(In,{value:z(_)?String(a[_]??""):"",onValueChange:E=>A(_,E==="true"),children:[o.jsx(_n,{children:o.jsx(Tn,{placeholder:"Select true or false..."})}),o.jsxs($n,{children:[o.jsx(St,{value:"true",children:"true"}),o.jsx(St,{value:"false",children:"false"})]})]}):o.jsx(Dt,{value:z(_)?a[_]??"":P[_]??"",onChange:E=>A(_,E.target.value),placeholder:`Enter ${_}...`})]},_)):I?.inputSchema&&!R?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(yt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:_=>f(_.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"}),j&&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(to,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Fn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(qn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:j.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(V,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:q,disabled:g,children:g?o.jsxs(o.Fragment,{children:[o.jsx(ze,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Ht,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(ae,{children:o.jsxs(de,{children:[o.jsx(le,{asChild:!0,children:o.jsx(V,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:J,disabled:!m&&!p,children:o.jsx(Ft,{size:14})})}),o.jsx(ce,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),p&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(Yo,{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(eo,{className:"h-4 w-4"}),o.jsx(er,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(tr,{className:"text-xs text-destructive",children:p})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:m?o.jsxs(o.Fragment,{children:[o.jsx(Oe,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(V,{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)),gn.success("Copied to clipboard")},children:o.jsx(so,{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(no,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function rr(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=oe(i).connectionId;if(!Vt(l)||!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(ze,{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(sr,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const an=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},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},Xt=(t=>t?an(t):an),ir=t=>t;function wt(t,e=ir){const n=F.useSyncExternalStore(t.subscribe,F.useCallback(()=>e(t.getState()),[t,e]),F.useCallback(()=>e(t.getInitialState()),[t,e]));return F.useDebugValue(n),n}const lr=t=>{const e=Xt(t),n=s=>wt(e,s);return Object.assign(n,e),n},cr=(t=>lr);function Gn(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 Nt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Nt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Nt(s)(n)}}}},ar=(t,e)=>(n,s,i)=>{let r={storage:Gn(()=>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})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(S=>{var v;return S((v=s())!=null?v:x)});const y=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Nt(u.getItem.bind(u))(r.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==r.version){if(r.migrate){const v=r.migrate(S.state,S.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}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 v;if(j!==c)return;const[w,k]=S;if(p=r.merge(k,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(y?.(p,void 0),p=s(),l=!0,d.forEach(S=>S(p)))}).catch(S=>{j===c&&y?.(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(),p||x},Xn=ar,{useSyncExternalStoreWithSelector:dr}=zs,ur=t=>t;function fr(t,e=ur,n){const s=dr(t.subscribe,t.getState,t.getInitialState,e,n);return F.useDebugValue(s),s}const dn=t=>Symbol.iterator in t,un=t=>"entries"in t,fn=(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},mr=(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 pr(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:dn(t)&&dn(e)?un(t)&&un(e)?fn(t,e):mr(t,e):fn({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function xr(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 ht(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 hr(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 gt(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...uo,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const Zn=C.createContext(null),gr=t=>Xt()(Xn(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??gt(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:ht(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.originalWorkflow})),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 m=r.steps.find(x=>x.name===f);m?.outputSchema&&(c[f]=m.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=gt("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=xr(a,"Input"),m=d.action,x=hr(m.code,f);d={...d,action:{...m,code:x}}}const u=ht(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=gt("tool",Number((Math.random()*1e6).toFixed(0)));const i=ht(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),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:Gn(()=>localStorage),version:1,partialize:e=>({trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedVirtualMcpId:e.selectedVirtualMcpId})}));function br(t){const e=N.c(8),{children:n,initialState:s}=t,i=En();let r;e[0]!==s.currentStepTab||e[1]!==s.trackingExecutionId||e[2]!==s.workflow||e[3]!==i?.[0]?.id?(r=()=>gr({workflow:s.workflow,originalWorkflow: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(Zn.Provider,{value:l,children:n}),e[5]=n,e[6]=l,e[7]=c):c=e[7],c}function We(t,e){const n=C.useContext(Zn);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return fr(n,t,pr)}function Re(){return We(jr)}function jr(t){return t.workflow}function X(){return We(vr)}function vr(t){return t.actions}function Qn(){const t=Fe();return We(yr)??t[0]?.name}function yr(t){return t.currentStepName}function He(){const t=N.c(5),e=Qn(),n=Fe();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 Fe(){return Re().steps}function kt(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!=typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!kt(t[n],e[n]))return!1;return!0}if(typeof t=="object"){const n=t,s=e,i=Object.keys(n),r=Object.keys(s);if(i.length!==r.length)return!1;for(const l of i)if(!(l in s)||!kt(n[l],s[l]))return!1;return!0}return!1}function Yn(){const t=N.c(5),e=Re();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=Is(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=kt(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function W(){return We(Sr)}function Sr(t){return t.trackingExecutionId}function Ae(){return We(wr)}function wr(t){return t.selectedVirtualMcpId}function Nr(t){const e=N.c(18),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=En()??[],a=In,d=n??void 0;let u;e[0]!==s?(u=j=>s(j===""?void 0:j),e[0]=s,e[1]=u):u=e[1];let f;e[2]!==i?(f=O("text-xs",i),e[2]=i,e[3]=f):f=e[3];let m;e[4]!==l?(m=o.jsx(Tn,{placeholder:l}),e[4]=l,e[5]=m):m=e[5];let x;e[6]!==f||e[7]!==m?(x=o.jsx(_n,{size:"sm",className:f,children:m}),e[6]=f,e[7]=m,e[8]=x):x=e[8];const p=$n,h=c.filter(Cr).map(kr);let g;e[9]!==p||e[10]!==h?(g=o.jsx(p,{children:h}),e[9]=p,e[10]=h,e[11]=g):g=e[11];let b;return e[12]!==a||e[13]!==d||e[14]!==u||e[15]!==x||e[16]!==g?(b=o.jsxs(a,{value:d,onValueChange:u,children:[x,g]}),e[12]=a,e[13]=d,e[14]=u,e[15]=x,e[16]=g,e[17]=b):b=e[17],b}function kr(t){return o.jsx(St,{value:t.id,children:t.title},t.id)}function Cr(t){return t.id!==null&&!Zs(t.id)}function Me(){const t=N.c(2),e=ao();let n;t[0]!==e?(n={connections:e,binding:"WORKFLOW"},t[0]=e,t[1]=n):n=t[1];const s=fo(n);if(!s||s.length===0||!s[0])throw new Error("No workflow connection found");return s[0]}const mn=[100,1e3,2e3];function re(t){const e=N.c(15),{org:n}=Y(),s=Me(),i=C.useRef(0);let r;e[0]!==s.id||e[1]!==n.id?(r={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=r):r=e[2];const l=ee(r);let c;e[3]!==t?(c={id:t},e[3]=t,e[4]=c):c=e[4];const a=!!t;let d;e[5]!==t?(d=t?h=>{const b=h.state?.data,y=(b?.structuredContent??b)?.item?.status;if(y==="running"||y==="enqueued"){const S=mn[i.current]??1;return i.current=(i.current+1)%mn.length,S}return i.current=0,!1}:!1,e[5]=t,e[6]=d):d=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==a||e[10]!==d?(u={client:l,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:c,gcTime:0,enabled:a,select:Ir,refetchInterval:d},e[7]=l,e[8]=c,e[9]=a,e[10]=d,e[11]=u):u=e[11];const{data:f,isLoading:m}=At(u),x=f?.item;let p;return e[12]!==m||e[13]!==x?(p={item:x,isLoading:m},e[12]=m,e[13]=x,e[14]=p):p=e[14],p}function Ir(t){return t.structuredContent??t}function es(t,e,n){const s=N.c(15),{org:i}=Y(),r=Me();let l;s[0]!==r.id||s[1]!==i.id?(l={connectionId:r.id,orgId:i.id},s[0]=r.id,s[1]=i.id,s[2]=l):l=s[2];const c=ee(l),a=(n?.enabled??!0)&&!!t&&!!e;let d;s[3]!==t||s[4]!==e?(d={executionId:t,stepId:e},s[3]=t,s[4]=e,s[5]=d):d=s[5];const u=n?.refetchInterval;let f;s[6]!==c||s[7]!==a||s[8]!==d||s[9]!==u?(f={client:c,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:d,enabled:a,refetchInterval:u,select:_r},s[6]=c,s[7]=a,s[8]=d,s[9]=u,s[10]=f):f=s[10];const{data:m,isLoading:x}=At(f),p=m?.output,h=m?.error;let g;return s[11]!==x||s[12]!==p||s[13]!==h?(g={output:p,error:h,isLoading:x},s[11]=x,s[12]=p,s[13]=h,s[14]=g):g=s[14],g}function _r(t){return t.structuredContent??t}function Tr(){const t=N.c(19),{org:e}=Y(),n=Me(),s=Re();let i;t[0]!==n.id||t[1]!==e.id?(i={connectionId:n.id,orgId:e.id},t[0]=n.id,t[1]=e.id,t[2]=i):i=t[2];const r=ee(i);let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=["workflow"],t[3]=l):l=t[3];let c;t[4]!==s.id?(c={field:l,operator:"eq",value:s.id},t[4]=s.id,t[5]=c):c=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=[{field:["created_at"],direction:"desc"}],t[6]=a):a=t[6];let d;t[7]!==c?(d={where:c,orderBy:a,limit:100},t[7]=c,t[8]=d):d=t[8];const u=!!s.id;let f;t[9]!==r||t[10]!==d||t[11]!==u?(f={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolArguments:d,enabled:u,staleTime:5e3,select:$r},t[9]=r,t[10]=d,t[11]=u,t[12]=f):f=t[12];const{data:m,isLoading:x,refetch:p}=At(f);let h;t[13]!==m?.items?(h=m?.items??[],t[13]=m?.items,t[14]=h):h=t[14];let g;return t[15]!==x||t[16]!==p||t[17]!==h?(g={executions:h,isLoading:x,refetch:p},t[15]=x,t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function $r(t){return t.structuredContent??t}function ts(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 Er(t){const e=[];for(const n of t){const s=ts(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function Or(t){for(const e of t)if(ts(e.input).includes("__entire_input__"))return!0;return!1}function Rr(t){const e=Er(t);if(e.length===0)return Or(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 Ar(){const t=N.c(2),e=Re();let n;return t[0]!==e.steps?(n=Rr(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function Mr(){const t=N.c(15),{org:e}=Y(),{id:n}=Me(),{setTrackingExecutionId:s}=X(),i=Re(),r=Ae(),l=Ar();let c;t[0]!==n||t[1]!==e.id?(c={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=c):c=t[2];const a=ee(c);let d;t[3]!==a?(d={client:a},t[3]=a,t[4]=d):d=t[4];const{mutateAsync:u,isPending:f}=Mt(d);let m;t[5]!==r||t[6]!==s||t[7]!==u||t[8]!==i?(m=async g=>{const b=g===void 0?{}:g;if(!r)throw new Error("Please select an Agent before running the workflow");const j=Date.now(),y=await u({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:r,start_at_epoch_ms:j,workflow_collection_id:i.id}}),v=(y.structuredContent??y)?.item?.id??void 0;return s(v),v},t[5]=r,t[6]=s,t[7]=u,t[8]=i,t[9]=m):m=t[9];const x=m,p=l!==null;let h;return t[10]!==x||t[11]!==l||t[12]!==f||t[13]!==p?(h={handleRunWorkflow:x,isPending:f,requiresInput:p,inputSchema:l},t[10]=x,t[11]=l,t[12]=f,t[13]=p,t[14]=h):h=t[14],h}function Pr(){const t=N.c(10),{org:e}=Y(),{id:n}=Me();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ee(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=Mt(r);let a;t[5]!==l?(a=async f=>await l({name:"CANCEL_EXECUTION",arguments:{executionId:f}}),t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleCancelWorkflow:d,isCancelling:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function Lr(){const t=N.c(10),{org:e}=Y(),{id:n}=Me();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ee(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=Mt(r);let a;t[5]!==l?(a=async f=>{const m=await l({name:"RESUME_EXECUTION",arguments:{executionId:f}});return(m.structuredContent??m)?.success??!1},t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleResumeWorkflow:d,isResuming:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function zr(){const t=N.c(3),e=W(),{item:n}=re(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 Dr(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 Zt=cr()(Xn(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"})),ns=C.createContext([]);function ss(){return C.useContext(ns)}function Wr({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new vo;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 os(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>Wr({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function pn(t,e){const n=os(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var Hr=ho.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",Ke(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=pn(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Ke({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Ke({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Ke({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...jo({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:pn(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 bo,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 os(this).map(go)}}),Fr=Hr,bt,et="HoverCard",[rs]=yn(et,[jn]),tt=jn(),[Vr,nt]=rs(et),is=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=tt(e),d=C.useRef(0),u=C.useRef(0),f=C.useRef(!1),m=C.useRef(!1),[x,p]=Tt({prop:s,defaultProp:i??!1,onChange:r,caller:et}),h=C.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=C.useCallback(()=>{clearTimeout(d.current),!f.current&&!m.current&&(u.current=window.setTimeout(()=>p(!1),c))},[c,p]),b=C.useCallback(()=>p(!1),[p]);return C.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(Vr,{scope:e,open:x,onOpenChange:p,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:m,children:o.jsx(Hs,{...a,children:n})})};is.displayName=et;var ls="HoverCardTrigger",cs=C.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=nt(ls,n),r=tt(n);return o.jsx(Ds,{asChild:!0,...r,children:o.jsx(_t.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:ne(t.onPointerEnter,Ze(i.onOpen)),onPointerLeave:ne(t.onPointerLeave,Ze(i.onClose)),onFocus:ne(t.onFocus,i.onOpen),onBlur:ne(t.onBlur,i.onClose),onTouchStart:ne(t.onTouchStart,l=>l.preventDefault())})})});cs.displayName=ls;var Qt="HoverCardPortal",[Br,Ur]=rs(Qt,{forceMount:void 0}),as=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=nt(Qt,e);return o.jsx(Br,{scope:e,forceMount:n,children:o.jsx(bn,{present:n||r.open,children:o.jsx(Ws,{asChild:!0,container:i,children:s})})})};as.displayName=Qt;var Xe="HoverCardContent",ds=C.forwardRef((t,e)=>{const n=Ur(Xe,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=nt(Xe,t.__scopeHoverCard);return o.jsx(bn,{present:s||r.open,children:o.jsx(qr,{"data-state":r.open?"open":"closed",...i,onPointerEnter:ne(t.onPointerEnter,Ze(r.onOpen)),onPointerLeave:ne(t.onPointerLeave,Ze(r.onClose)),ref:e})})});ds.displayName=Xe;var qr=C.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=nt(Xe,n),d=tt(n),u=C.useRef(null),f=vn(e,u),[m,x]=C.useState(!1);return C.useEffect(()=>{if(m){const p=document.body;return bt=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=bt,p.style.webkitUserSelect=bt}}},[m]),C.useEffect(()=>{if(u.current){const p=()=>{x(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),C.useEffect(()=>{u.current&&Gr(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(Fs,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ne(r,p=>{p.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(Vs,{...d,...c,onPointerDown:ne(c.onPointerDown,p=>{p.currentTarget.contains(p.target)&&x(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:m?"text":void 0,WebkitUserSelect:m?"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)"}})})}),Kr="HoverCardArrow",Jr=C.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=tt(n);return o.jsx(Bs,{...i,...s,ref:e})});Jr.displayName=Kr;function Ze(t){return e=>e.pointerType==="touch"?void 0:t()}function Gr(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 Xr=is,Zr=cs,Qr=as,Yr=ds;function ei(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(Xr,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function ti(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(Zr,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function ni(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(Qr,{"data-slot":"hover-card-portal",children:o.jsx(Yr,{"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 us=C.createContext(void 0);function si(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 oi(t){const e=N.c(20),{node:n}=t,s=C.useContext(us),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?si(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(ln,{as:"span",children:d}),e[6]=d,e[7]=h):h=e[7],h}let u;e[8]!==d?(u=o.jsx(ti,{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 m;e[12]!==c?(m=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]=m):m=e[13];let x;e[14]!==f||e[15]!==m?(x=o.jsx(ni,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,m]})}),e[14]=f,e[15]=m,e[16]=x):x=e[16];let p;return e[17]!==u||e[18]!==x?(p=o.jsx(ln,{as:"span",children:o.jsxs(ei,{openDelay:200,children:[u,x]})}),e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function fs(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 se=ms();function ms(){return Xt(()=>({items:[],selectedIndex:0,command:null}))}function xn(t,e){se.setState({items:t,command:e,selectedIndex:0})}function ri(){const{items:t,selectedIndex:e}=se.getState();t.length&&se.setState({selectedIndex:(e-1+t.length)%t.length})}function ii(){const{items:t,selectedIndex:e}=se.getState();t.length&&se.setState({selectedIndex:(e+1)%t.length})}function ps(){const{items:t,selectedIndex:e,command:n}=se.getState(),s=t[e];return s?(n?.(s),!0):!1}function hn(){se=ms()}function li(){const t=N.c(7),e=wt(se,ai),n=wt(se,ci);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:()=>{se.setState({selectedIndex:c}),ps()},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 ci(t){return t.selectedIndex}function ai(t){return t.items}function di(){let t=null,e=null;return{onStart:n=>{xn(n.items,n.command),t=new No(li,{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=>{xn(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(),hn(),!0):n.key==="ArrowUp"?(ri(),!0):n.key==="ArrowDown"?(ii(),!0):n.key==="Enter"?ps():!1,onExit:()=>{e?.remove(),t?.destroy(),hn()}}}const jt=/@([\w.]+)/g;function ui(t,e){if(!t)return null;const n=fs(e),s=new Map(n.map(a=>[a.id,a]));if(!jt.test(t))return t;jt.lastIndex=0;const r=[];let l=0,c;for(;(c=jt.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 Yt(t){const e=N.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=zr();let d;e[0]!==n||e[1]!==s?(d=ui(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,m=!c;let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=yo.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=x):x=e[3];let p;if(e[4]!==n||e[5]!==f){let T;e[7]!==n?(T=M=>{const{query:R}=M;return fs(n).filter(z=>z.label.toLowerCase().includes(R.toLowerCase())||z.id.toLowerCase().includes(R.toLowerCase()))},e[7]=n,e[8]=T):T=e[8],p=Fr.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:xi,renderHTML:pi,suggestion:{items:T,render:di,command:mi}}).extend(f?{addNodeView(){return So(oi)}}:{}),e[4]=n,e[5]=f,e[6]=p}else p=e[6];let h;e[9]!==p?(h=[x,p],e[9]=p,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:fi},e[11]=g,e[12]=b):b=e[12];let j;e[13]!==i?(j=T=>{const{editor:M}=T;return i?.(M.getText().trim())},e[13]=i,e[14]=j):j=e[14];let y;e[15]!==u||e[16]!==m||e[17]!==h||e[18]!==b||e[19]!==j?(y={content:u,editable:m,extensions:h,editorProps:b,onUpdate:j},e[15]=u,e[16]=m,e[17]=h,e[18]=b,e[19]=j,e[20]=y):y=e[20];const S=wo(y);let v;e[21]!==l?(v=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]=v):v=e[22];let w;e[23]!==S?(w=o.jsx(ko,{editor:S}),e[23]=S,e[24]=w):w=e[24];let k;e[25]!==v||e[26]!==w?(k=o.jsx("div",{className:v,children:w}),e[25]=v,e[26]=w,e[27]=k):k=e[27];const I=k;if(a!==void 0){let T;return e[28]!==I||e[29]!==a?(T=o.jsx(us.Provider,{value:a,children:I}),e[28]=I,e[29]=a,e[30]=T):T=e[30],T}return I}function fi(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function mi(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function pi(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function xi(t){const{node:e}=t;return`@${e.attrs.id}`}function hi(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=ss(),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(Yt,{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 gi(t){const e=N.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=ss(),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(Yt,{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 bi(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 ji(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=m=>s(m.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 vi(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,m;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"),m=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=m):(f=e[4],m=e[5]);let x;e[6]!==a?(x=a.map(yi),e[6]=a,e[7]=x):x=e[7];let p;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==x?(p=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[m,x]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=x,e[13]=p):p=e[13],p}function yi(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Si={TextWidget:hi,TextareaWidget:gi,NumberWidget:bi,CheckboxWidget:ji,SelectWidget:vi};function wi(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:Hn,color:"text-blue-500"};case"number":case"integer":return{Icon:Dn,color:"text-blue-500"};case"array":return{Icon:Pn,color:"text-purple-500"};case"object":return{Icon:Mn,color:"text-orange-500"};case"boolean":return{Icon:Wn,color:"text-pink-500"};case"null":return{Icon:$t,color:"text-gray-500"};default:return{Icon:Ln,color:"text-muted-foreground"}}}function Ni(t){const e=N.c(36),{id:n,label:s,required:i,description:r,children:l,schema:c,hidden:a}=t;if(a){let v;return e[0]!==l?(v=o.jsx("div",{className:"hidden",children:l}),e[0]=l,e[1]=v):v=e[1],v}if(n==="root"){let v;return e[2]!==l?(v=o.jsx("div",{className:"space-y-4",children:l}),e[2]=l,e[3]=v):v=e[3],v}const d=Array.isArray(c.type)?c.type[0]:c.type??"string";let u,f,m,x,p,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:v,color:w}=wi(d);g="space-y-2",x="flex items-center gap-2",e[15]!==n||e[16]!==s?(p=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=p):p=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=v,f=14,m=O(w,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=m,e[11]=x,e[12]=p,e[13]=h,e[14]=g}else u=e[8],f=e[9],m=e[10],x=e[11],p=e[12],h=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==m?(b=o.jsx(u,{size:f,className:m}),e[20]=u,e[21]=f,e[22]=m,e[23]=b):b=e[23];let j;e[24]!==x||e[25]!==p||e[26]!==h||e[27]!==b?(j=o.jsxs("div",{className:x,children:[p,h,b]}),e[24]=x,e[25]=p,e[26]=h,e[27]=b,e[28]=j):j=e[28];let y;e[29]!==r?(y=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=y):y=e[30];let S;return e[31]!==l||e[32]!==g||e[33]!==j||e[34]!==y?(S=o.jsxs("div",{className:g,children:[j,y,l]}),e[31]=l,e[32]=g,e[33]=j,e[34]=y,e[35]=S):S=e[35],S}function ki(t){const e=N.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(Ii),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(Ci),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 Ci(t){return o.jsx("div",{children:t.content},t.name)}function Ii(t){return o.jsx("div",{children:t.content},t.name)}function _i(t){const e=N.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(Ti),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(V,{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 Ti(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 $i(){return null}function Ei(){return null}const Oi={FieldTemplate:Ni,ObjectFieldTemplate:ki,ArrayFieldTemplate:_i,UnsupportedFieldTemplate:$i,ErrorListTemplate:Ei};function Ri(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??""),m=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:m})]}),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(Yt,{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 xs({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(Ri,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=C.useRef(e??{}),d=u=>{const f=u.formData??{},m=a.current;if(n?.(f),s){for(const[x,p]of Object.entries(f))m[x]!==p&&s(x,p);for(const x of Object.keys(m))x in f||s(x,void 0)}a.current=f};return o.jsx(ns.Provider,{value:l,children:o.jsx(lo,{schema:c,formData:e,onChange:d,validator:co,widgets:Si,templates:Oi,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function Ai(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 m;e[5]!==s?(m=I=>{I||d({}),s(I)},e[5]=s,e[6]=m):m=e[6];const x=m;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(Io,{children:[o.jsx(_o,{children:"Workflow Input"}),o.jsx(To,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=p):p=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(xs,{inputSchema:i,inputParams:a,setInputParams:d,mentions:h})}),e[9]=a,e[10]=i,e[11]=g):g=e[11];let b;e[12]!==x?(b=()=>x(!1),e[12]=x,e[13]=b):b=e[13];let j;e[14]!==l||e[15]!==b?(j=o.jsx(V,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=j):j=e[16];let y;e[17]!==l?(y=l?o.jsx(De,{size:"xs"}):o.jsx(Ht,{size:14}),e[17]=l,e[18]=y):y=e[18];let S;e[19]!==f||e[20]!==l||e[21]!==y?(S=o.jsxs(V,{onClick:f,disabled:l,className:"gap-2",children:[y,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=y,e[22]=S):S=e[22];let v;e[23]!==S||e[24]!==j?(v=o.jsxs($o,{children:[j,S]}),e[23]=S,e[24]=j,e[25]=v):v=e[25];let w;e[26]!==v||e[27]!==g?(w=o.jsxs(Eo,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[p,g,v]}),e[26]=v,e[27]=g,e[28]=w):w=e[28];let k;return e[29]!==x||e[30]!==n||e[31]!==w?(k=o.jsx(Oo,{open:n,onOpenChange:x,children:w}),e[29]=x,e[30]=n,e[31]=w,e[32]=k):k=e[32],k}function Mi(t){const e=N.c(27),{title:n,description:s,onSave:i,isSaving:r}=t,c=It().location.href,{viewMode:a,setViewMode:d,showExecutionsList:u,toggleExecutionsList:f}=Zt(),{resetToOriginalWorkflow:m,setSelectedVirtualMcpId:x}=X(),p=Yn(),h=Ae(),g=W();let b;e[0]!==n?(b=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=b):b=e[1];let j;e[2]!==s?(j=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]=j):j=e[3];let y;e[4]!==b||e[5]!==j?(y=o.jsx(Cn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,j]})}),e[4]=b,e[5]=j,e[6]=y):y=e[6];let S;e[7]!==p||e[8]!==r||e[9]!==i||e[10]!==m||e[11]!==h||e[12]!==x||e[13]!==d||e[14]!==u||e[15]!==n||e[16]!==f||e[17]!==g||e[18]!==c||e[19]!==a?(S=!g&&o.jsxs(o.Fragment,{children:[o.jsx(Pt,{title:n,url:c,icon:"workflow"}),o.jsx(C.Suspense,{fallback:o.jsx(De,{size:"xs"}),children:o.jsx(Nr,{selectedVirtualMcpId:h,onVirtualMcpChange:x,placeholder:"Select Agent"})}),o.jsx(xo,{value:a,onValueChange:d,size:"sm",options:[{value:"visual",icon:o.jsx(Kn,{})},{value:"code",icon:o.jsx(Bn,{})}]}),o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:m,disabled:!p,"aria-label":"Reset changes",children:o.jsx(kn,{size:14})})})}),o.jsx(ce,{side:"bottom",children:"Reset changes"})]})}),o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:i,disabled:!p||r,"aria-label":"Save workflow",children:r?o.jsx(De,{size:"xs"}):o.jsx(Gt,{size:14})})})}),o.jsx(ce,{side:"bottom",children:"Save workflow"})]})}),o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(V,{variant:u?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:f,"aria-label":u?"Hide runs":"Show runs",children:o.jsx(Vn,{size:14})})})}),o.jsx(ce,{side:"bottom",children:u?"Hide runs":"Show runs"})]})})]}),e[7]=p,e[8]=r,e[9]=i,e[10]=m,e[11]=h,e[12]=x,e[13]=d,e[14]=u,e[15]=n,e[16]=f,e[17]=g,e[18]=c,e[19]=a,e[20]=S):S=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(zi,{}),e[21]=v):v=e[21];let w;e[22]!==S?(w=o.jsxs(Wt,{children:[S,v]}),e[22]=S,e[23]=w):w=e[23];let k;return e[24]!==y||e[25]!==w?(k=o.jsxs(o.Fragment,{children:[y,w]}),e[24]=y,e[25]=w,e[26]=k):k=e[26],k}function Pi(){const t=W(),{item:e}=re(t);return e?.completed_at_epoch_ms!=null}function Li(){const t=W(),{item:e}=re(t);return e?.status==="cancelled"}function zi(){const t=N.c(58),e=Yn(),n=Pi(),s=Li(),i=W(),r=Ae(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=Mr(),u=Fe(),[f,m]=C.useState(!1),{handleCancelWorkflow:x,isCancelling:p}=Pr(),{handleResumeWorkflow:h,isResuming:g}=Lr(),b=i&&!n;let j;t[0]!==u?(j=u.some(Di),t[0]=u,t[1]=j):j=t[1];const y=j,S=!r,v=u.length===0,w=e||v||y||S||c||p,k=b||c;let I;t[2]!==y||t[3]!==S||t[4]!==e||t[5]!==s||t[6]!==k||t[7]!==v?(I=()=>s?"Workflow is currently cancelled":k?"Workflow is currently running":e?"Save your changes before running":S?"Select an Agent first":v||y?"Add at least one step to the workflow":null,t[2]=y,t[3]=S,t[4]=e,t[5]=s,t[6]=k,t[7]=v,t[8]=I):I=t[8];const M=I();let R;t[9]!==x||t[10]!==h||t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==k||t[15]!==a||t[16]!==i?(R=async()=>{if(a&&d){m(!0);return}if(s&&i){await h(i);return}if(k&&i){await x(i);return}await l({})},t[9]=x,t[10]=h,t[11]=l,t[12]=d,t[13]=s,t[14]=k,t[15]=a,t[16]=i,t[17]=R):R=t[17];const P=R;let z;t[18]!==l?(z=async Pe=>{await l(Pe)},t[18]=l,t[19]=z):z=t[19];const q=z,A=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",J=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let _;t[20]!==J?(_=O("gap-2 h-7 px-3",J),t[20]=J,t[21]=_):_=t[21];let $;t[22]!==p||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?($=(!b&&!c&&!p&&!g||s)&&o.jsx(Ht,{size:14}),t[22]=p,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=$):$=t[27];let E;t[28]!==p||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?(E=b&&!c&&!p&&!g&&!s&&o.jsx(Co,{size:14}),t[28]=p,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=E):E=t[33];let L;t[34]!==p||t[35]!==c||t[36]!==g?(L=(c||p||g)&&o.jsx(De,{size:"xs"}),t[34]=p,t[35]=c,t[36]=g,t[37]=L):L=t[37];let H;t[38]!==A||t[39]!==P||t[40]!==w||t[41]!==_||t[42]!==$||t[43]!==E||t[44]!==L?(H=o.jsxs(V,{variant:"default",size:"sm",className:_,disabled:w,onClick:P,children:[$,E,L,A]}),t[38]=A,t[39]=P,t[40]=w,t[41]=_,t[42]=$,t[43]=E,t[44]=L,t[45]=H):H=t[45];const Z=H;let D;t[46]!==Z||t[47]!==M?(D=M?o.jsx(ae,{children:o.jsxs(de,{delayDuration:0,children:[o.jsx(le,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:Z})}),o.jsx(ce,{side:"bottom",children:M})]})}):Z,t[46]=Z,t[47]=M,t[48]=D):D=t[48];const G=D;let B;t[49]!==q||t[50]!==d||t[51]!==c||t[52]!==a||t[53]!==f?(B=a&&d&&o.jsx(Ai,{open:f,onOpenChange:m,inputSchema:d,onSubmit:q,isPending:c}),t[49]=q,t[50]=d,t[51]=c,t[52]=a,t[53]=f,t[54]=B):B=t[54];let K;return t[55]!==G||t[56]!==B?(K=o.jsxs(o.Fragment,{children:[G,B]}),t[55]=G,t[56]=B,t[57]=K):K=t[57],K}function Di(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function Wi(){const t=N.c(15),e=W(),n=Fe(),{item:s}=re(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=new Set(s.completed_steps?.success?.map(Hi)??[]),t[5]=s.completed_steps?.success,t[6]=r):r=t[6];const l=r;let c;t[7]!==s.completed_steps?.error?(c=s.completed_steps?.error??[],t[7]=s.completed_steps?.error,t[8]=c):c=t[8];let a;t[9]!==c?(a=new Set(c),t[9]=c,t[10]=a):a=t[10];const d=a;let u;t[11]!==d||t[12]!==n||t[13]!==l?(u=-1,n.forEach((f,m)=>{(l.has(f.name)||d.has(f.name))&&(u=m)}),t[11]=d,t[12]=n,t[13]=l,t[14]=u):u=t[14],n.forEach((f,m)=>{let x="pending";d.has(f.name)?x="error":l.has(f.name)?x="success":s.status==="running"&&m===u+1&&(x="running"),i[f.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 Hi(t){return t.name}function Fi(t){const e=N.c(94),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=W(),{item:m}=re(f),x=m?.completed_steps,p=x?.success;let h;e[0]!==n.name||e[1]!==p?(h=p?.find(U=>U.name===n.name),e[0]=n.name,e[1]=p,e[2]=h):h=e[2];const g=h,b=g?.completed_at_epoch_ms,j=g!=null,y=x?.error?.includes(n.name),S="toolName"in n.action,v=S&&"connectionId"in n.action?n.action.connectionId:null,k=!!(S&&"toolName"in n.action?n.action.toolName:null),I=Yi(n),T=j?"success":y?"error":r?.status,M=r!==void 0,R=T==="success"||T==="error";let P=I.length>0?60:12;(T==="success"||T==="error")&&(P=P+32);const z=Ui(T);let q;e[3]!==T?(q=qi(T),e[3]=T,e[4]=q):q=e[4];const A=q;let J;e[5]===Symbol.for("react.memo_cache_sentinel")?(J=function(qe,Os){const on=Os.split(".").slice(1);if(on.length===0)return Array.isArray(qe)?qe:void 0;let ie=qe;for(const Rs of on){if(ie==null)return;if(typeof ie=="object")ie=ie[Rs];else return}return Array.isArray(ie)?ie:void 0},e[5]=J):J=e[5];const _=J,$=n.forEach!==void 0,E=n.forEach?.ref;let L;e[6]!==E?(L=E?.replace("@","").split(".")[0],e[6]=E,e[7]=L):L=e[7];const H=L,Z=m?.status==="running"||m?.status==="enqueued";let D;e[8]!==p||e[9]!==H?(D=p?.some(U=>U.name===H),e[8]=p,e[9]=H,e[10]=D):D=e[10];const G=D,B=Z?500:!1;let K;e[11]!==G||e[12]!==B?(K={refetchInterval:B,enabled:G},e[11]=G,e[12]=B,e[13]=K):K=e[13];const{output:Pe}=es(f,H,K);let Ve;if(e[14]!==Pe||e[15]!==E){const U=E?.replace("@","");Ve=U?_(Pe,U):void 0,e[14]=Pe,e[15]=E,e[16]=Ve}else Ve=e[16];const Le=Ve;let Be;e[17]!==m?.completed_steps?.success||e[18]!==n.name?(Be=m?.completed_steps?.success?.filter(U=>new RegExp(`^${n.name}\\[\\d+\\]$`).test(U.name)),e[17]=m?.completed_steps?.success,e[18]=n.name,e[19]=Be):Be=e[19];const rt=Be,it=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",lt=T==="running"&&"bg-accent/50",ct=l&&"opacity-50";let ue;e[20]!==it||e[21]!==lt||e[22]!==ct?(ue=O("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",it,lt,ct),e[20]=it,e[21]=lt,e[22]=ct,e[23]=ue):ue=e[23];const _s="button",Ts=0;let fe;e[24]!==a?(fe=U=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),a())},e[24]=a,e[25]=fe):fe=e[25];const $s="w-5 flex flex-col items-center justify-center shrink-0 pt-3",at=O("text-xs font-mono opacity-75 h-8 flex items-center",z),dt=s+1;let me;e[26]!==at||e[27]!==dt?(me=o.jsx("div",{className:$s,children:o.jsxs("span",{className:at,children:[dt,"."]})}),e[26]=at,e[27]=dt,e[28]=me):me=e[28];let pe;e[29]!==A||e[30]!==s?(pe=s>0?o.jsx(vt,{height:12,color:A}):o.jsx("div",{className:"h-3"}),e[29]=A,e[30]=s,e[31]=pe):pe=e[31];let xe;e[32]!==v||e[33]!==k||e[34]!==S||e[35]!==n.name?(xe=o.jsx(Zi,{connectionId:v,isToolStep:S,hasToolSelected:k,stepName:n.name}),e[32]=v,e[33]=k,e[34]=S,e[35]=n.name,e[36]=xe):xe=e[36];let he;e[37]!==A||e[38]!==R||e[39]!==T?(he=R&&o.jsxs(o.Fragment,{children:[o.jsx(vt,{height:8,color:A}),o.jsx(Ki,{status:T})]}),e[37]=A,e[38]=R,e[39]=T,e[40]=he):he=e[40];let ge;e[41]!==A||e[42]!==P||e[43]!==c||e[44]!==f?(ge=c&&f?null:o.jsx(vt,{height:P,color:A}),e[41]=A,e[42]=P,e[43]=c,e[44]=f,e[45]=ge):ge=e[45];let be;e[46]!==pe||e[47]!==xe||e[48]!==he||e[49]!==ge?(be=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[pe,xe,he,ge]}),e[46]=pe,e[47]=xe,e[48]=he,e[49]=ge,e[50]=be):be=e[50];const Es="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3",ut=k?"font-medium text-foreground":"text-foreground";let je;e[51]!==ut?(je=O("text-sm truncate flex-1",ut),e[51]=ut,e[52]=je):je=e[52];let ve;e[53]!==n?(ve=Qi(n),e[53]=n,e[54]=ve):ve=e[54];let ye;e[55]!==je||e[56]!==ve?(ye=o.jsx("span",{className:je,children:ve}),e[55]=je,e[56]=ve,e[57]=ye):ye=e[57];let Se;e[58]!==rt?.length||e[59]!==$||e[60]!==Le?(Se=$&&Le&&Le.length>0&&o.jsx("span",{className:"text-xs font-mono opacity-75 h-8 flex items-center",children:`${rt?.length??0} / ${Le.length}`}),e[58]=rt?.length,e[59]=$,e[60]=Le,e[61]=Se):Se=e[61];let we;e[62]!==M||e[63]!==T?(we=M&&o.jsx(Ji,{status:T}),e[62]=M,e[63]=T,e[64]=we):we=e[64];let Ne;e[65]!==Se||e[66]!==we?(Ne=o.jsxs("div",{className:"flex items-center gap-2",children:[Se,we]}),e[65]=Se,e[66]=we,e[67]=Ne):Ne=e[67];let ke;e[68]!==M||e[69]!==d||e[70]!==u?(ke=!M&&o.jsxs(Mo,{children:[o.jsx(Po,{asChild:!0,children:o.jsx(V,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",onClick:Bi,children:o.jsx(Ao,{size:14})})}),o.jsxs(Lo,{align:"end",children:[o.jsxs(cn,{onClick:U=>{U.stopPropagation(),u()},children:[o.jsx(Bo,{size:14}),"Duplicate"]}),o.jsxs(cn,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:U=>{U.stopPropagation(),d()},children:[o.jsx(Us,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[68]=M,e[69]=d,e[70]=u,e[71]=ke):ke=e[71];let Ce;e[72]!==ye||e[73]!==Ne||e[74]!==ke?(Ce=o.jsxs("div",{className:"flex items-center h-8",children:[ye,Ne,ke]}),e[72]=ye,e[73]=Ne,e[74]=ke,e[75]=Ce):Ce=e[75];const ft=I.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:I.map(Vi)});let Ie;e[76]!==T||e[77]!==b?(Ie=T==="success"&&o.jsx(Gi,{completedAtEpochMs:b}),e[76]=T,e[77]=b,e[78]=Ie):Ie=e[78];let _e;e[79]!==r?.error||e[80]!==T?(_e=T==="error"&&o.jsx(Xi,{error:r?.error}),e[79]=r?.error,e[80]=T,e[81]=_e):_e=e[81];let Te;e[82]!==Ce||e[83]!==ft||e[84]!==Ie||e[85]!==_e?(Te=o.jsxs("div",{className:Es,children:[Ce,ft,Ie,_e]}),e[82]=Ce,e[83]=ft,e[84]=Ie,e[85]=_e,e[86]=Te):Te=e[86];let Ue;return e[87]!==a||e[88]!==ue||e[89]!==fe||e[90]!==me||e[91]!==be||e[92]!==Te?(Ue=o.jsxs("div",{className:ue,onClick:a,role:_s,tabIndex:Ts,onKeyDown:fe,children:[me,be,Te]}),e[87]=a,e[88]=ue,e[89]=fe,e[90]=me,e[91]=be,e[92]=Te,e[93]=Ue):Ue=e[93],Ue}function Vi(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 Bi(t){return t.stopPropagation()}function Ui(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function qi(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function Ki(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(Ut,{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(Ft,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function Ji(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(Ut,{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(Ft,{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(ze,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function Gi(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(Ro,{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 Xi(t){const e=N.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(Jt,{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 Zi(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(Ye,{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(Ys,{size:16,className:"text-muted-foreground"}):o.jsx(Vo,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function vt(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 Qi(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 Yi(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties??e.items?.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function el(t){const e=N.c(32),{className:n}=t,s=Fe(),i=Qn(),r=Wi(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=X(),d=W();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(y=>r[y.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{children:"Loading..."}),e[3]=m):m=e[3];let x;e[4]!==n?(x=O("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=x):x=e[5];let p;if(e[6]!==i||e[7]!==c||e[8]!==a||e[9]!==f||e[10]!==l||e[11]!==r||e[12]!==s){let y;e[14]!==i||e[15]!==c||e[16]!==a||e[17]!==f||e[18]!==l||e[19]!==r||e[20]!==s.length?(y=(S,v)=>{const w=r?.[S.name],k=f!==-1&&v>f&&w?.status==="pending",I=v===s.length-1;return o.jsx(Fi,{step:S,index:v,isSelected:S.name===i,executionStatus:w,isSkipped:k,isLastStep:I,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]=y):y=e[21],p=s.map(y),e[6]=i,e[7]=c,e[8]=a,e[9]=f,e[10]=l,e[11]=r,e[12]=s,e[13]=p}else p=e[13];let h;e[22]!==p?(h=o.jsx("div",{className:"pt-3 -space-y-1",children:p}),e[22]=p,e[23]=h):h=e[23];let g;e[24]!==d?(g=d?null:o.jsx(tl,{}),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]!==x||e[30]!==b?(j=o.jsx(C.Suspense,{fallback:m,children:o.jsx("div",{className:x,children:b})}),e[29]=x,e[30]=b,e[31]=j):j=e[31],j}function tl(){const t=N.c(8),{addToolStep:e}=X();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(On,{size:14}),t[2]=i):i=t[2];let r;t[3]!==e?(r=o.jsx(V,{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 nl(){const t=N.c(11),{org:e}=Y(),s=Ae()??null;let i;t[0]!==e.id||t[1]!==s?(i={connectionId:s,orgId:e.id},t[0]=e.id,t[1]=s,t[2]=i):i=t[2];const r=ee(i);let l;t[3]!==r?(l={client:r},t[3]=r,t[4]=l):l=t[4];const c=Rt(l);let a;t[5]!==c.data?.tools?(a=c.data?.tools??[],t[5]=c.data?.tools,t[6]=a):a=t[6];let d;return t[7]!==a||t[8]!==c.error||t[9]!==c.isLoading?(d={tools:a,isLoading:c.isLoading,error:c.error},t[7]=a,t[8]=c.error,t[9]=c.isLoading,t[10]=d):d=t[10],d}function sl(t){const e=N.c(7),{className:n}=t;if(!Ae()){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(ol,{className:n}),e[5]=n,e[6]=i):i=e[6],i}function ol(t){const e=N.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=nl(),l=He(),{updateStep:c}=X(),d=l&&"toolName"in l.action&&"toolName"in l.action?l.action.toolName:null;let u;if(e[0]!==d||e[1]!==s){let v;e[3]!==d?(v=w=>w.name===d,e[3]=d,e[4]=v):v=e[4],u=s.find(v),e[0]=d,e[1]=s,e[2]=u}else u=e[2];const m=Dr(s,u??null,il,rl);let x;e[5]!==l||e[6]!==c?(x=v=>{l&&c(l.name,{action:{...l.action,toolName:v.name},outputSchema:v.outputSchema??{}})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const p=x;if(i){let v;e[8]!==n?(v=O("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=v):v=e[9];let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(De,{size:"sm"})}),e[10]=w):w=e[10];let k;return e[11]!==v?(k=o.jsx("div",{className:v,children:w}),e[11]=v,e[12]=k):k=e[12],k}if(r){let v;e[13]!==n?(v=O("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=v):v=e[14];let w;e[15]!==r.message?(w=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]=w):w=e[16];let k;return e[17]!==v||e[18]!==w?(k=o.jsx("div",{className:v,children:w}),e[17]=v,e[18]=w,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]!==p||e[26]!==m||e[27]!==d){let v;e[29]!==p||e[30]!==d?(v=w=>o.jsx(ll,{icon:null,title:w.name,description:w.description,isSelected:w.name===d,onClick:()=>p(w)},w.name),e[29]=p,e[30]=d,e[31]=v):v=e[31],j=m.map(v),e[25]=p,e[26]=m,e[27]=d,e[28]=j}else j=e[28];let y;e[32]!==j?(y=o.jsx("div",{className:"flex-1 overflow-auto",children:j}),e[32]=j,e[33]=y):y=e[33];let S;return e[34]!==h||e[35]!==b||e[36]!==y?(S=o.jsxs("div",{className:h,children:[b,y]}),e[34]=h,e[35]=b,e[36]=y,e[37]=S):S=e[37],S}function rl(t,e){return t.name.localeCompare(e.name)}function il(t){return t.name}function ll(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(Ye,{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 m;e[9]!==i?(m=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=m):m=e[10];let x;e[11]!==f||e[12]!==m?(x=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,m]}),e[11]=f,e[12]=m,e[13]=x):x=e[13];let p;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==x?(p=o.jsxs("div",{className:a,onClick:l,role:"button",tabIndex:0,onKeyDown:d,children:[u,x]}),e[14]=l,e[15]=a,e[16]=d,e[17]=u,e[18]=x,e[19]=p):p=e[19],p}var te="Accordion",cl=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[en,al,dl]=Ks(te),[st]=yn(te,[dl,Rn]),tn=Rn(),hs=F.forwardRef((t,e)=>{const{type:n,...s}=t,i=s,r=s;return o.jsx(en.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?o.jsx(pl,{...r,ref:e}):o.jsx(ml,{...i,ref:e})})});hs.displayName=te;var[gs,ul]=st(te),[bs,fl]=st(te,{collapsible:!1}),ml=F.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},collapsible:r=!1,...l}=t,[c,a]=Tt({prop:n,defaultProp:s??"",onChange:i,caller:te});return o.jsx(gs,{scope:t.__scopeAccordion,value:F.useMemo(()=>c?[c]:[],[c]),onItemOpen:a,onItemClose:F.useCallback(()=>r&&a(""),[r,a]),children:o.jsx(bs,{scope:t.__scopeAccordion,collapsible:r,children:o.jsx(js,{...l,ref:e})})})}),pl=F.forwardRef((t,e)=>{const{value:n,defaultValue:s,onValueChange:i=()=>{},...r}=t,[l,c]=Tt({prop:n,defaultProp:s??[],onChange:i,caller:te}),a=F.useCallback(u=>c((f=[])=>[...f,u]),[c]),d=F.useCallback(u=>c((f=[])=>f.filter(m=>m!==u)),[c]);return o.jsx(gs,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:d,children:o.jsx(bs,{scope:t.__scopeAccordion,collapsible:!0,children:o.jsx(js,{...r,ref:e})})})}),[xl,ot]=st(te),js=F.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:s,dir:i,orientation:r="vertical",...l}=t,c=F.useRef(null),a=vn(c,e),d=al(n),f=Js(i)==="ltr",m=ne(t.onKeyDown,x=>{if(!cl.includes(x.key))return;const p=x.target,h=d().filter(I=>!I.ref.current?.disabled),g=h.findIndex(I=>I.ref.current===p),b=h.length;if(g===-1)return;x.preventDefault();let j=g;const y=0,S=b-1,v=()=>{j=g+1,j>S&&(j=y)},w=()=>{j=g-1,j<y&&(j=S)};switch(x.key){case"Home":j=y;break;case"End":j=S;break;case"ArrowRight":r==="horizontal"&&(f?v():w());break;case"ArrowDown":r==="vertical"&&v();break;case"ArrowLeft":r==="horizontal"&&(f?w():v());break;case"ArrowUp":r==="vertical"&&w();break}const k=j%b;h[k].ref.current?.focus()});return o.jsx(xl,{scope:n,disabled:s,direction:i,orientation:r,children:o.jsx(en.Slot,{scope:n,children:o.jsx(_t.div,{...l,"data-orientation":r,ref:a,onKeyDown:s?void 0:m})})})}),Qe="AccordionItem",[hl,nn]=st(Qe),vs=F.forwardRef((t,e)=>{const{__scopeAccordion:n,value:s,...i}=t,r=ot(Qe,n),l=ul(Qe,n),c=tn(n),a=qs(),d=s&&l.value.includes(s)||!1,u=r.disabled||t.disabled;return o.jsx(hl,{scope:n,open:d,disabled:u,triggerId:a,children:o.jsx(Do,{"data-orientation":r.orientation,"data-state":Cs(d),...c,...i,ref:e,disabled:u,open:d,onOpenChange:f=>{f?l.onItemOpen(s):l.onItemClose(s)}})})});vs.displayName=Qe;var ys="AccordionHeader",Ss=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=ot(te,n),r=nn(ys,n);return o.jsx(_t.h3,{"data-orientation":i.orientation,"data-state":Cs(r.open),"data-disabled":r.disabled?"":void 0,...s,ref:e})});Ss.displayName=ys;var Ct="AccordionTrigger",ws=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=ot(te,n),r=nn(Ct,n),l=fl(Ct,n),c=tn(n);return o.jsx(en.ItemSlot,{scope:n,children:o.jsx(zo,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...c,...s,ref:e})})});ws.displayName=Ct;var Ns="AccordionContent",ks=F.forwardRef((t,e)=>{const{__scopeAccordion:n,...s}=t,i=ot(te,n),r=nn(Ns,n),l=tn(n);return o.jsx(Wo,{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}})});ks.displayName=Ns;function Cs(t){return t?"open":"closed"}var gl=hs,bl=vs,jl=Ss,vl=ws,yl=ks;function Sl(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(gl,{"data-slot":"accordion",...n}),e[2]=n,e[3]=s):s=e[3],s}function wl(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(bl,{"data-slot":"accordion-item",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Nl(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(Ho,{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(jl,{className:"flex",children:o.jsxs(vl,{"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 kl(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(yl,{"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}function Cl(t){const{updateStep:e}=X(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=sn(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function Il(t){const e=N.c(32),{className:n}=t,s=He(),{appendStep:i}=X();Cl(s);const r=W(),{item:l}=re(r);if(!s){let b;e[0]!==n?(b=O("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=b):b=e[1];let j;e[2]!==i?(j=()=>{i({type:"tool"})},e[2]=i,e[3]=j):j=e[3];let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx(On,{size:14}),e[4]=y):y=e[4];let S;e[5]!==j?(S=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(V,{variant:"ghost",size:"icon",className:"size-7",onClick:j,children:y})]}),e[5]=j,e[6]=S):S=e[6];let v;return e[7]!==b||e[8]!==S?(v=o.jsx("div",{className:b,children:S}),e[7]=b,e[8]=S,e[9]=v):v=e[9],v}const c=s?.name,a=!!(l?.completed_steps?.success?.some(b=>b.name===c)||l?.completed_steps?.error?.includes(c));let d;e[10]!==n?(d=O("flex flex-col h-full bg-sidebar overflow-scroll",n),e[10]=n,e[11]=d):d=e[11];let u,f;e[12]!==s?(u=o.jsx(_l,{step:s}),f=o.jsx($l,{step:s}),e[12]=s,e[13]=u,e[14]=f):(u=e[13],f=e[14]);const m=a?"open":"closed";let x;e[15]!==s||e[16]!==a||e[17]!==m?(x=o.jsx(Ol,{step:s,defaultOpen:a},m),e[15]=s,e[16]=a,e[17]=m,e[18]=x):x=e[18];let p;e[19]!==s||e[20]!==r?(p=!r&&o.jsx(Pl,{step:s}),e[19]=s,e[20]=r,e[21]=p):p=e[21];let h;e[22]!==s||e[23]!==r?(h=!r&&o.jsx(Dl,{step:s}),e[22]=s,e[23]=r,e[24]=h):h=e[24];let g;return e[25]!==d||e[26]!==u||e[27]!==f||e[28]!==x||e[29]!==p||e[30]!==h?(g=o.jsxs("div",{className:d,children:[u,f,x,p,h]}),e[25]=d,e[26]=u,e[27]=f,e[28]=x,e[29]=p,e[30]=h,e[31]=g):g=e[31],g}function _l(t){const e=N.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=W(),l=i??"";let c;e[0]!==l?(c=o.jsx(Ye,{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(Tl,{}),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 m;return e[12]!==u||e[13]!==f?(m=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]=m):m=e[14],m}function Tl(){const t=N.c(9),e=He(),{updateStep:n,startReplacingTool:s}=X(),i=W(),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){gn.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(Jn,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(V,{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 sn(t){const e=N.c(13),{org:n}=Y(),i=Ae()??null;let r;e[0]!==n.id||e[1]!==i?(r={connectionId:i,orgId:n.id},e[0]=n.id,e[1]=i,e[2]=r):r=e[2];const l=ee(r);let c;e[3]!==l?(c={client:l},e[3]=l,e[4]=c):c=e[4];const a=Rt(c);let d;e[5]!==t||e[6]!==a.data?.tools?(d=a.data?.tools?.find(m=>m.name===t),e[5]=t,e[6]=a.data?.tools,e[7]=d):d=e[7];const u=d;let f;return e[8]!==u||e[9]!==a.error||e[10]!==a.isLoading||e[11]!==a.isSuccess?(f={tool:u,isLoading:a.isLoading,isReady:a.isSuccess,error:a.error},e[8]=u,e[9]=a.error,e[10]=a.isLoading,e[11]=a.isSuccess,e[12]=f):f=e[12],f}function $l(t){const e=N.c(18),{step:n}=t,{updateStep:s}=X(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=W(),{tool:c}=sn(r??"");if(!c||!c.inputSchema)return null;let a;e[0]!==n.name||e[1]!==s?(a=v=>{s(n.name,{input:v})},e[0]=n.name,e[1]=s,e[2]=a):a=e[2];const d=a;let u;e[3]!==n.input||e[4]!==c.inputSchema||e[5]!==l?(u=l?El(c.inputSchema,n.input):c.inputSchema,e[3]=n.input,e[4]=c.inputSchema,e[5]=l,e[6]=u):u=e[6];const f=u,m=l?"output":"input";let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Nl,{className:"px-5 py-5",children:o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),e[7]=x):x=e[7];const p=n.name+l,h=!!l,g=f,b=n.input;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=[],e[8]=j):j=e[8];let y;e[9]!==d||e[10]!==p||e[11]!==h||e[12]!==g||e[13]!==b?(y=o.jsxs(wl,{value:"input",className:"border-b-0",children:[x,o.jsx(kl,{className:"px-5 pt-2",children:o.jsx(xs,{readOnly:h,inputSchema:g,inputParams:b,setInputParams:d,mentions:j},p)})]}),e[9]=d,e[10]=p,e[11]=h,e[12]=g,e[13]=b,e[14]=y):y=e[14];let S;return e[15]!==y||e[16]!==m?(S=o.jsx(Sl,{type:"single",collapsible:!0,defaultValue:m,className:"border-b border-border shrink-0",children:y}),e[15]=y,e[16]=m,e[17]=S):S=e[17],S}function El(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function Ol(t){const e=N.c(24),{step:n,defaultOpen:s}=t,i=n.outputSchema,r=W(),{item:l}=re(r),c=!!(l?.completed_steps?.success?.some(T=>T.name===n.name)||l?.completed_steps?.error?.includes(n.name)),[a,d]=C.useState(s),{output:u,error:f}=es(r,c?n.name:void 0);let m;e[0]!==f||e[1]!==u?(m=u||(f?{error:f}:void 0),e[0]=f,e[1]=u,e[2]=m):m=e[2];const x=m,p=i&&typeof i=="object"?i.properties:void 0;let h;e[3]!==p?(h=p?Object.entries(p):[],e[3]=p,e[4]=h):h=e[4];const g=h,b=a?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[5]!==b?(j=O("flex flex-col border-b border-border",b),e[5]=b,e[6]=j):j=e[6];let y;e[7]!==a?(y=()=>d(!a),e[7]=a,e[8]=y):y=e[8];let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Output"}),e[9]=S):S=e[9];let v;e[10]!==a?(v=o.jsxs("div",{className:"flex items-center justify-between",children:[S,a?o.jsx(Kt,{size:14,className:"text-muted-foreground"}):o.jsx(qt,{size:14,className:"text-muted-foreground"})]}),e[10]=a,e[11]=v):v=e[11];let w;e[12]!==y||e[13]!==v?(w=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:y,children:v}),e[12]=y,e[13]=v,e[14]=w):w=e[14];let k;e[15]!==x||e[16]!==a||e[17]!==g||e[18]!==r?(k=a&&o.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:[r&&x?o.jsx(Oe,{code:JSON.stringify(x,null,2),language:"json",height:"100%",readOnly:!0}):null,!r&&g.map(Rl)]}),e[15]=x,e[16]=a,e[17]=g,e[18]=r,e[19]=k):k=e[19];let I;return e[20]!==j||e[21]!==w||e[22]!==k?(I=o.jsxs("div",{className:j,children:[w,k]}),e[20]=j,e[21]=w,e[22]=k,e[23]=I):I=e[23],I}function Rl(t){const[e,n]=t;return o.jsx(Ml,{name:e,schema:n},e)}function Al(t){switch(t){case"string":return{Icon:Hn,color:"text-blue-500"};case"number":case"integer":return{Icon:Dn,color:"text-blue-500"};case"array":return{Icon:Pn,color:"text-purple-500"};case"object":return{Icon:Mn,color:"text-orange-500"};case"boolean":return{Icon:Wn,color:"text-pink-500"};case"null":return{Icon:$t,color:"text-gray-500"};default:return{Icon:Ln,color:"text-muted-foreground"}}}function Ml(t){const e=N.c(28),{name:n,schema:s}=t,i=He(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:S,color:v}=Al(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=S,c=14,a=O(v),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 m;e[10]!==n?(m=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=m):m=e[11];let x;e[12]!==d||e[13]!==f||e[14]!==m?(x=o.jsxs("div",{className:d,children:[f,m]}),e[12]=d,e[13]=f,e[14]=m,e[15]=x):x=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(Un,{size:14,className:"opacity-50"}),e[16]=p):p=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:[p,g,b]}),e[21]=g,e[22]=b,e[23]=j):j=e[23];let y;return e[24]!==j||e[25]!==u||e[26]!==x?(y=o.jsxs("div",{className:u,children:[x,j]}),e[24]=j,e[25]=u,e[26]=x,e[27]=y):y=e[27],y}function Pl(t){const e=N.c(29),{step:n}=t,{updateStep:s}=X(),i=W(),[r,l]=C.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=sn(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 I=d.outputSchema,T=I.properties;return T?`interface Input {
10
- ${Object.entries(T).map(R=>{const[P,z]=R,q=Ge(z),A=!I.required?.includes(P);return` ${P}${A?"?":""}: ${q};`}).join(`
11
- `)}
12
- }`:`interface Input {
13
- [key: string]: unknown;
14
- }`},e[0]=d,e[1]=f):f=e[1];const m=f;let x;e[2]!==m||e[3]!==n.action||e[4]!==n.name||e[5]!==s?(x=()=>{if("transformCode"in n.action&&n.action.transformCode){l(zl);return}const T=`${m()}
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:T}}),l(Ll)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const p=x;let h;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(h=(I,T)=>{s(n.name,{action:{...n.action,transformCode:I},...T?{outputSchema:T}:{}})},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 y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=y):y=e[13];let S;e[14]!==r?(S=o.jsxs("div",{className:"flex items-center justify-between",children:[y,r?o.jsx(Kt,{size:14,className:"text-muted-foreground"}):o.jsx(qt,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=S):S=e[15];let v;e[16]!==S||e[17]!==p?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:S}),e[16]=S,e[17]=p,e[18]=v):v=e[18];let w;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(w=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Oe,{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]=w):w=e[24];let k;return e[25]!==j||e[26]!==v||e[27]!==w?(k=o.jsxs("div",{className:j,children:[v,w]}),e[25]=j,e[26]=v,e[27]=w,e[28]=k):k=e[28],k}function Ll(t){return!t}function zl(t){return!t}function Dl(t){const e=N.c(24),{step:n}=t,[s,i]=C.useState(!1),{updateStep:r}=X(),l="code"in n.action&&n.action.code?n.action.code:null,c=W();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,y)=>{r(n.name,{action:{...n.action,code:j},...y?{outputSchema:y}:{}})},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 m;e[6]!==s?(m=()=>i(!s),e[6]=s,e[7]=m):m=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[8]=x):x=e[8];let p;e[9]!==s?(p=o.jsxs("div",{className:"flex items-center justify-between",children:[x,s?o.jsx(Kt,{size:14,className:"text-muted-foreground"}):o.jsx(qt,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=p):p=e[10];let h;e[11]!==m||e[12]!==p?(h=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:m,children:p}),e[11]=m,e[12]=p,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(Oe,{onSave:(j,y)=>d(j,y),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 Ge(t){if(Array.isArray(t.type))return t.type.map(n=>Ge({...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?`${Ge(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Ge(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function Wl(t){switch(t){case"success":return o.jsxs($e,{variant:"success",className:"gap-1",children:[o.jsx(Ut,{size:11}),"Success"]});case"error":case"failed":return o.jsxs($e,{variant:"destructive",className:"gap-1",children:[o.jsx(Jt,{size:11}),"Error"]});case"running":return o.jsxs($e,{variant:"secondary",className:"gap-1",children:[o.jsx(Je,{size:11}),"Running"]});case"enqueued":return o.jsxs($e,{variant:"secondary",className:"gap-1",children:[o.jsx(Je,{size:11}),"On hold"]});case"cancelled":return o.jsxs($e,{variant:"secondary",className:"gap-1",children:[o.jsx(An,{size:11}),"Cancelled"]});default:return o.jsxs($e,{variant:"secondary",className:"gap-1",children:[o.jsx(Je,{size:11}),t]})}}function Hl(t){return`Run #${t.slice(-4).toUpperCase()}`}function Fl(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=Tr(),{setShowExecutionsList:r}=Zt(),{setTrackingExecutionId:l}=X(),c=W();let a;e[0]!==l?(a=y=>{l(y)},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 m;e[4]!==n?(m=O("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=x):x=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(An,{size:11}),e[7]=p):p=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:[x,o.jsx(V,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),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((y,S)=>o.jsx(Vl,{execution:y,isSelected:y.id===c,isFirst:S===0,onSelect:()=>d(y.id)},y.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]!==m||e[18]!==h||e[19]!==b?(j=o.jsxs("div",{className:m,children:[h,b]}),e[17]=m,e[18]=h,e[19]=b,e[20]=j):j=e[20],j}function Vl(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=Wl(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=Hl(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==u||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==x?(p=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=p):p=e[16],p}function Is(t){const e=N.c(11),{itemId:n}=t,[s,i]=C.useState(!1);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=r):r=e[0];const{connectionId:l}=oe(r),c=l??"no-connection",{org:a}=Y(),d=l??null;let u;e[1]!==a.id||e[2]!==d?(u={connectionId:d,orgId:a.id},e[1]=a.id,e[2]=d,e[3]=u):u=e[3];const f=ee(u),m=Et(c,"WORKFLOW",n,f),x=Ot(c,"WORKFLOW",f);let p;e[4]!==x||e[5]!==n?(p=async b=>{i(!0),await x.update.mutateAsync({id:n,data:b}).finally(()=>{i(!1)})},e[4]=x,e[5]=n,e[6]=p):p=e[6];const h=p;let g;return e[7]!==s||e[8]!==m||e[9]!==h?(g={item:m,update:h,isUpdating:s},e[7]=s,e[8]=m,e[9]=h,e[10]=g):g=e[10],g}function Bl(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=X();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=Oe,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 m=JSON.parse(f);i({...n,...m}),s(m)},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 Ul(){const t=N.c(9),e=W(),{item:n}=re(e),s=n?.start_at_epoch_ms,i=n?.completed_at_epoch_ms,r=n?.status==="running"&&s&&!i;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=Date.now(),t[0]=l):l=t[0];const c=C.useRef(l);let a;t[1]!==r?(a=h=>{if(!r)return ql;const g=setInterval(()=>{c.current=Date.now(),h()},50);return()=>clearInterval(g)},t[1]=r,t[2]=a):a=t[2];const d=a;let u;t[3]!==r?(u=()=>r?c.current:0,t[3]=r,t[4]=u):u=t[4];const f=u,m=C.useSyncExternalStore(d,f,f),x=i&&s?Math.max(0,i-s):null;let p=null;if(s){let h;t[5]!==s?(h=new Date(s).getTime(),t[5]=s,t[6]=h):h=t[6];const g=h;if(i){let b;t[7]!==i?(b=new Date(i).getTime(),t[7]=i,t[8]=b):b=t[8],p=Math.max(0,b-g)}else r&&(p=Math.max(0,m-g))}return p??x}function ql(){}function Kl(t){if(t<1e3)return`${t}ms`;const e=t/1e3,n=e%60,s=Math.floor(e/60),i=s%60,r=Math.floor(s/60);return r>0?`${r}h ${i}m ${n.toFixed(3)}s`:i>0?`${i}m ${n.toFixed(3)}s`:`${n.toFixed(3)}s`}function Jl(){const t=N.c(20),{setTrackingExecutionId:e}=X(),n=W(),s=Ul();let i;t[0]!==s?(i=s!=null?Kl(s):null,t[0]=s,t[1]=i):i=t[1];const r=i;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=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[2]=l):l=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=c):c=t[3];let a;t[4]!==n?(a=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[c,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=a):a=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(Fo,{className:"w-4 h-4 text-muted-foreground"}),t[6]=d):d=t[6];let u;t[7]!==r?(u=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[d,o.jsx("span",{className:"text-sm text-muted-foreground",children:r})]}),t[7]=r,t[8]=u):u=t[8];let f;t[9]!==a||t[10]!==u?(f=o.jsxs("div",{className:"flex items-center h-full",children:[l,a,u]}),t[9]=a,t[10]=u,t[11]=f):f=t[11];let m;t[12]!==e?(m=()=>e(void 0),t[12]=e,t[13]=m):m=t[13];let x;t[14]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx($t,{className:"w-4 h-4 text-muted-foreground"}),t[14]=x):x=t[14];let p;t[15]!==m?(p=o.jsx(V,{variant:"ghost",size:"xs",onClick:m,children:x}),t[15]=m,t[16]=p):p=t[16];let h;return t[17]!==f||t[18]!==p?(h=o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between border-b border-border",children:[f,p]}),t[17]=f,t[18]=p,t[19]=h):h=t[19],h}function Gl(t){const e=N.c(18),{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}=oe(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l,update:c,isUpdating:a}=Is(r);let d;e[3]!==l?(d=JSON.stringify(l),e[3]=l,e[4]=d):d=e[4];const u=d;if(!l){let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bt,{icon:o.jsx(zn,{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]=p):p=e[5];let h;return e[6]!==n?(h=o.jsx(Ee,{onBack:n,children:p}),e[6]=n,e[7]=h):h=e[7],h}let f;e[8]!==l?(f={workflow:l,trackingExecutionId:void 0,currentStepTab:"input"},e[8]=l,e[9]=f):f=e[9];let m;e[10]!==a||e[11]!==n||e[12]!==c?(m=o.jsx(Xl,{onBack:n,onUpdate:c,isUpdating:a}),e[10]=a,e[11]=n,e[12]=c,e[13]=m):m=e[13];let x;return e[14]!==u||e[15]!==f||e[16]!==m?(x=o.jsx(br,{initialState:f,children:m},u),e[14]=u,e[15]=f,e[16]=m,e[17]=x):x=e[17],x}function Xl(t){const e=N.c(24),{onBack:n,onUpdate:s,isUpdating:i}=t,r=Re(),l=W(),{viewMode:c,showExecutionsList:a}=Zt(),d=He();let u;e[0]!==s||e[1]!==r?(u=async()=>{await s(r)},e[0]=s,e[1]=r,e[2]=u):u=e[2];const f=u,m=d&&"toolName"in d.action,x=m?d.action.toolName:null,p=m&&!x&&!l,h=!p&&(d||l||!a);let g;e[3]!==f||e[4]!==i||e[5]!==r.description||e[6]!==r.title?(g=o.jsx(Mi,{title:r.title,description:r.description,onSave:f,isSaving:i}),e[3]=f,e[4]=i,e[5]=r.description,e[6]=r.title,e[7]=g):g=e[7];let b;e[8]!==l?(b=l&&o.jsx(Jl,{}),e[8]=l,e[9]=b):b=e[9];let j;e[10]!==s||e[11]!==a||e[12]!==h||e[13]!==p||e[14]!==c||e[15]!==r?(j=o.jsx("div",{className:"flex-1 overflow-hidden",children:c==="code"?o.jsx(Bl,{workflow:r,onUpdate:s}):o.jsxs(mo,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(rn,{defaultSize:50,minSize:30,children:o.jsx(el,{})}),o.jsx(po,{}),o.jsxs(rn,{defaultSize:50,minSize:25,children:[p&&o.jsx(sl,{className:"border-l border-border"}),a&&o.jsx(Fl,{}),h&&o.jsx(Il,{className:"border-l border-border"})]})]})}),e[10]=s,e[11]=a,e[12]=h,e[13]=p,e[14]=c,e[15]=r,e[16]=j):j=e[16];let y;e[17]!==g||e[18]!==b||e[19]!==j?(y=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]=y):y=e[20];let S;return e[21]!==n||e[22]!==y?(S=o.jsx(Ee,{onBack:n,children:y}),e[21]=n,e[22]=y,e[23]=S):S=e[23],S}function Zl(t){const e=N.c(3),{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}=oe(s),l=Et(i??"no-connection","WORKFLOW_EXECUTION",n,i);let c;return e[1]!==l?(c={item:l},e[1]=l,e[2]=c):c=e[2],c}function Ql(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}=oe(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l}=Zl(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(Bt,{icon:o.jsx(zn,{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(Ee,{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(Oe,{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(Ee,{onBack:n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}const Yl={workflow:Gl,workflow_execution:Ql,prompt:Zo};function ec(){const t=N.c(6),e=Sn();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=oe(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=tc;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(rr,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function tc(t){return Promise.resolve()}function nc(){const t=N.c(19),e=Sn();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=oe(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??"no-connection",{org:u}=Y(),f=i??null;let m;t[3]!==u.id||t[4]!==f?(m={connectionId:f,orgId:u.id},t[3]=u.id,t[4]=f,t[5]=m):m=t[5];const x=ee(m),p=Ot(d,r,x);let h;t[6]!==p||t[7]!==l?(h=async w=>{l&&await p.update.mutateAsync({id:l,data:w})},t[6]=p,t[7]=l,t[8]=h):h=t[8];const g=h;let b;t[9]!==r?(b=r?.toLowerCase(),t[9]=r,t[10]=b):b=t[10];const j=b,y=j&&Yl[j];if(y){let w;return t[11]!==y||t[12]!==a||t[13]!==g||t[14]!==l?(w=o.jsx(y,{itemId:l,onBack:a,onUpdate:g}),t[11]=y,t[12]=a,t[13]=g,t[14]=l,t[15]=w):w=t[15],w}let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(Xs,{size:36,className:"text-muted-foreground"}),t[16]=S):S=t[16];let v;return t[17]!==a?(v=o.jsx(Bt,{icon:S,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[17]=a,t[18]=v):v=t[18],v}function sc(){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=oe(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(ec,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(nc,{}),t[2]=r):r=t[2],r}function wa(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Nn,{children:o.jsx(C.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(sc,{})})}),t[0]=e):e=t[0],e}export{wa as default};