n8n-editor-ui 1.47.0 → 1.47.1

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 (160) hide show
  1. package/.turbo/turbo-build.log +78 -78
  2. package/dist/assets/{AuthView-BgFWzBDm.js → AuthView-CMxdNKZJ.js} +2 -2
  3. package/dist/assets/{AuthView-BgFWzBDm.js.map → AuthView-CMxdNKZJ.js.map} +1 -1
  4. package/dist/assets/{CanvasControls-m_3acPPd.js → CanvasControls-3FMjwMqA.js} +2 -2
  5. package/dist/assets/{CanvasControls-m_3acPPd.js.map → CanvasControls-3FMjwMqA.js.map} +1 -1
  6. package/dist/assets/{ChangePasswordView-CN6JWR-N.js → ChangePasswordView-_NkkcUVb.js} +2 -2
  7. package/dist/assets/{ChangePasswordView-CN6JWR-N.js.map → ChangePasswordView-_NkkcUVb.js.map} +1 -1
  8. package/dist/assets/{CollectionParameter-DHmcKhO-.js → CollectionParameter-BXMOfisf.js} +2 -2
  9. package/dist/assets/CollectionParameter-BXMOfisf.js.map +1 -0
  10. package/dist/assets/{CredentialsView-D9TXjOnK.js → CredentialsView-B2UF3tK_.js} +2 -2
  11. package/dist/assets/{CredentialsView-D9TXjOnK.js.map → CredentialsView-B2UF3tK_.js.map} +1 -1
  12. package/dist/assets/{ErrorView-CYag8fsg.js → ErrorView-B_lpOlen.js} +2 -2
  13. package/dist/assets/{ErrorView-CYag8fsg.js.map → ErrorView-B_lpOlen.js.map} +1 -1
  14. package/dist/assets/{ExecutionsFilter-Cf35yNfd.js → ExecutionsFilter-dNFZor7l.js} +2 -2
  15. package/dist/assets/{ExecutionsFilter-Cf35yNfd.js.map → ExecutionsFilter-dNFZor7l.js.map} +1 -1
  16. package/dist/assets/{ExecutionsView-ztrgLYNP.js → ExecutionsView-BYe-KERG.js} +2 -2
  17. package/dist/assets/{ExecutionsView-ztrgLYNP.js.map → ExecutionsView-BYe-KERG.js.map} +1 -1
  18. package/dist/assets/{ForgotMyPasswordView-C-0yB-bx.js → ForgotMyPasswordView-D97J06wc.js} +2 -2
  19. package/dist/assets/{ForgotMyPasswordView-C-0yB-bx.js.map → ForgotMyPasswordView-D97J06wc.js.map} +1 -1
  20. package/dist/assets/MainHeader-CT4nF2mY.js +2 -0
  21. package/dist/assets/{MainHeader-CMxbwL4C.js.map → MainHeader-CT4nF2mY.js.map} +1 -1
  22. package/dist/assets/{MainSidebar-BuwaBgG9.js → MainSidebar-CTg5wPzP.js} +2 -2
  23. package/dist/assets/{MainSidebar-BuwaBgG9.js.map → MainSidebar-CTg5wPzP.js.map} +1 -1
  24. package/dist/assets/{NodeCreation-B7Uimsok.js → NodeCreation-BF_L2-99.js} +3 -3
  25. package/dist/assets/{NodeCreation-B7Uimsok.js.map → NodeCreation-BF_L2-99.js.map} +1 -1
  26. package/dist/assets/{NodeCreator-IRjqf3_R.js → NodeCreator-B_yCtSu6.js} +2 -2
  27. package/dist/assets/{NodeCreator-IRjqf3_R.js.map → NodeCreator-B_yCtSu6.js.map} +1 -1
  28. package/dist/assets/{NodeDetailsView-CSnjluIR.js → NodeDetailsView-ggolOsHM.js} +4 -4
  29. package/dist/assets/{NodeDetailsView-CSnjluIR.js.map → NodeDetailsView-ggolOsHM.js.map} +1 -1
  30. package/dist/assets/{NodeView-DMzj-gox.css → NodeView--67hs6V6.css} +1 -1
  31. package/dist/assets/NodeView-B2MlTl6g.js +3 -0
  32. package/dist/assets/NodeView-B2MlTl6g.js.map +1 -0
  33. package/dist/assets/{NodeView.v2-DyU_S0rY.js → NodeView.v2-D_CKj9CS.js} +3 -3
  34. package/dist/assets/{NodeView.v2-DyU_S0rY.js.map → NodeView.v2-D_CKj9CS.js.map} +1 -1
  35. package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-C1N0EZCM.js → ProjectCardBadge.vue_vue_type_script_setup_true_lang-DdHOM703.js} +2 -2
  36. package/dist/assets/{ProjectCardBadge.vue_vue_type_script_setup_true_lang-C1N0EZCM.js.map → ProjectCardBadge.vue_vue_type_script_setup_true_lang-DdHOM703.js.map} +1 -1
  37. package/dist/assets/{ProjectSettings-CbNlX27g.js → ProjectSettings-DpJesEZX.js} +2 -2
  38. package/dist/assets/{ProjectSettings-CbNlX27g.js.map → ProjectSettings-DpJesEZX.js.map} +1 -1
  39. package/dist/assets/{ProjectTabs-Cx2VWeba.js → ProjectTabs-D7nNxtFO.js} +2 -2
  40. package/dist/assets/{ProjectTabs-Cx2VWeba.js.map → ProjectTabs-D7nNxtFO.js.map} +1 -1
  41. package/dist/assets/{PushConnectionTracker-C_r8Zv-p.js → PushConnectionTracker-YJuy57g2.js} +2 -2
  42. package/dist/assets/{PushConnectionTracker-C_r8Zv-p.js.map → PushConnectionTracker-YJuy57g2.js.map} +1 -1
  43. package/dist/assets/{ResourcesListLayout-CKSHiUAP.js → ResourcesListLayout-mZ4ijKRB.js} +2 -2
  44. package/dist/assets/{ResourcesListLayout-CKSHiUAP.js.map → ResourcesListLayout-mZ4ijKRB.js.map} +1 -1
  45. package/dist/assets/{RunDataAi-BVqsN7UN.js → RunDataAi-D0m0Vg_p.js} +2 -2
  46. package/dist/assets/{RunDataAi-BVqsN7UN.js.map → RunDataAi-D0m0Vg_p.js.map} +1 -1
  47. package/dist/assets/{RunDataJson-6Yfwd78r.js → RunDataJson-DkHNIqVj.js} +3 -3
  48. package/dist/assets/{RunDataJson-6Yfwd78r.js.map → RunDataJson-DkHNIqVj.js.map} +1 -1
  49. package/dist/assets/{RunDataJsonActions-5ig3g4km.js → RunDataJsonActions-Cgxcpw8t.js} +2 -2
  50. package/dist/assets/{RunDataJsonActions-5ig3g4km.js.map → RunDataJsonActions-Cgxcpw8t.js.map} +1 -1
  51. package/dist/assets/{RunDataSchema-CrW957BW.js → RunDataSchema-C6aZoC0a.js} +3 -3
  52. package/dist/assets/{RunDataSchema-CrW957BW.js.map → RunDataSchema-C6aZoC0a.js.map} +1 -1
  53. package/dist/assets/{RunDataSearch-BrIWOZXO.js → RunDataSearch-D2CDg21N.js} +2 -2
  54. package/dist/assets/{RunDataSearch-BrIWOZXO.js.map → RunDataSearch-D2CDg21N.js.map} +1 -1
  55. package/dist/assets/RunDataTable-D597NRFD.js +2 -0
  56. package/dist/assets/{RunDataTable-B01U16vv.js.map → RunDataTable-D597NRFD.js.map} +1 -1
  57. package/dist/assets/{SamlOnboarding-CfbBlTNm.js → SamlOnboarding-Me669myi.js} +2 -2
  58. package/dist/assets/{SamlOnboarding-CfbBlTNm.js.map → SamlOnboarding-Me669myi.js.map} +1 -1
  59. package/dist/assets/{SettingsApiView-CuliNEKo.js → SettingsApiView-DV8pIHDw.js} +2 -2
  60. package/dist/assets/{SettingsApiView-CuliNEKo.js.map → SettingsApiView-DV8pIHDw.js.map} +1 -1
  61. package/dist/assets/{SettingsCommunityNodesView-CeY4uqH-.js → SettingsCommunityNodesView-D_gtSdk3.js} +2 -2
  62. package/dist/assets/{SettingsCommunityNodesView-CeY4uqH-.js.map → SettingsCommunityNodesView-D_gtSdk3.js.map} +1 -1
  63. package/dist/assets/{SettingsExternalSecrets-CE7ObFx_.js → SettingsExternalSecrets-xprYKjAW.js} +2 -2
  64. package/dist/assets/{SettingsExternalSecrets-CE7ObFx_.js.map → SettingsExternalSecrets-xprYKjAW.js.map} +1 -1
  65. package/dist/assets/{SettingsFakeDoorView-DQqNf_Q9.js → SettingsFakeDoorView-CKaSOYh5.js} +2 -2
  66. package/dist/assets/{SettingsFakeDoorView-DQqNf_Q9.js.map → SettingsFakeDoorView-CKaSOYh5.js.map} +1 -1
  67. package/dist/assets/{SettingsLdapView-9hy5C87y.js → SettingsLdapView-BBCv2tmk.js} +2 -2
  68. package/dist/assets/{SettingsLdapView-9hy5C87y.js.map → SettingsLdapView-BBCv2tmk.js.map} +1 -1
  69. package/dist/assets/{SettingsLogStreamingView-Cc0h5DhT.js → SettingsLogStreamingView-HRIp8kyL.js} +2 -2
  70. package/dist/assets/{SettingsLogStreamingView-Cc0h5DhT.js.map → SettingsLogStreamingView-HRIp8kyL.js.map} +1 -1
  71. package/dist/assets/{SettingsPersonalView-Cs82ezMX.js → SettingsPersonalView-CsUb3SvK.js} +2 -2
  72. package/dist/assets/{SettingsPersonalView-Cs82ezMX.js.map → SettingsPersonalView-CsUb3SvK.js.map} +1 -1
  73. package/dist/assets/{SettingsSourceControl-Dr7R-QpH.js → SettingsSourceControl-BkPpVGsk.js} +2 -2
  74. package/dist/assets/{SettingsSourceControl-Dr7R-QpH.js.map → SettingsSourceControl-BkPpVGsk.js.map} +1 -1
  75. package/dist/assets/{SettingsSso-Di6lHXV2.js → SettingsSso-BueUV3RH.js} +2 -2
  76. package/dist/assets/{SettingsSso-Di6lHXV2.js.map → SettingsSso-BueUV3RH.js.map} +1 -1
  77. package/dist/assets/{SettingsUsageAndPlan-g86Q7EQY.js → SettingsUsageAndPlan-DzDC9m54.js} +2 -2
  78. package/dist/assets/{SettingsUsageAndPlan-g86Q7EQY.js.map → SettingsUsageAndPlan-DzDC9m54.js.map} +1 -1
  79. package/dist/assets/{SettingsUsersView-dOWjUJTW.js → SettingsUsersView-CTd5MQLw.js} +2 -2
  80. package/dist/assets/{SettingsUsersView-dOWjUJTW.js.map → SettingsUsersView-CTd5MQLw.js.map} +1 -1
  81. package/dist/assets/{SettingsView-DQ0hQWFt.js → SettingsView-DMxqsNh0.js} +2 -2
  82. package/dist/assets/{SettingsView-DQ0hQWFt.js.map → SettingsView-DMxqsNh0.js.map} +1 -1
  83. package/dist/assets/{SetupView-CqT8d0D8.js → SetupView-tkyttChl.js} +2 -2
  84. package/dist/assets/{SetupView-CqT8d0D8.js.map → SetupView-tkyttChl.js.map} +1 -1
  85. package/dist/assets/{SetupWorkflowCredentialsButton-BR-ObOqw.js → SetupWorkflowCredentialsButton-B3HZvKQp.js} +2 -2
  86. package/dist/assets/{SetupWorkflowCredentialsButton-BR-ObOqw.js.map → SetupWorkflowCredentialsButton-B3HZvKQp.js.map} +1 -1
  87. package/dist/assets/{SetupWorkflowFromTemplateView-DHHtk6_-.js → SetupWorkflowFromTemplateView-DL3b-TZS.js} +2 -2
  88. package/dist/assets/{SetupWorkflowFromTemplateView-DHHtk6_-.js.map → SetupWorkflowFromTemplateView-DL3b-TZS.js.map} +1 -1
  89. package/dist/assets/{SigninView-2eLLF8DU.js → SigninView-BPLGsvzz.js} +2 -2
  90. package/dist/assets/{SigninView-2eLLF8DU.js.map → SigninView-BPLGsvzz.js.map} +1 -1
  91. package/dist/assets/{SignoutView-BQyCyjsK.js → SignoutView-BySf9D7k.js} +2 -2
  92. package/dist/assets/{SignoutView-BQyCyjsK.js.map → SignoutView-BySf9D7k.js.map} +1 -1
  93. package/dist/assets/{SignupView-ByYEkUpW.js → SignupView-EU3JWt4T.js} +2 -2
  94. package/dist/assets/{SignupView-ByYEkUpW.js.map → SignupView-EU3JWt4T.js.map} +1 -1
  95. package/dist/assets/{TemplateDetails-I6WMCxGm.js → TemplateDetails-Cemx-ozB.js} +2 -2
  96. package/dist/assets/{TemplateDetails-I6WMCxGm.js.map → TemplateDetails-Cemx-ozB.js.map} +1 -1
  97. package/dist/assets/{TemplateList-DRf0Cbhg.js → TemplateList-h3b91b7e.js} +2 -2
  98. package/dist/assets/{TemplateList-DRf0Cbhg.js.map → TemplateList-h3b91b7e.js.map} +1 -1
  99. package/dist/assets/{TemplatesCollectionView-BYkDe49v.js → TemplatesCollectionView-aBX3f7Pp.js} +2 -2
  100. package/dist/assets/{TemplatesCollectionView-BYkDe49v.js.map → TemplatesCollectionView-aBX3f7Pp.js.map} +1 -1
  101. package/dist/assets/{TemplatesSearchView-CiZ7aZcy.js → TemplatesSearchView-DyoC9WUR.js} +2 -2
  102. package/dist/assets/{TemplatesSearchView-CiZ7aZcy.js.map → TemplatesSearchView-DyoC9WUR.js.map} +1 -1
  103. package/dist/assets/{TemplatesView-zULLoEwu.js → TemplatesView-GQmC_sY8.js} +2 -2
  104. package/dist/assets/{TemplatesView-zULLoEwu.js.map → TemplatesView-GQmC_sY8.js.map} +1 -1
  105. package/dist/assets/{TemplatesWorkflowView-DptRLbdX.js → TemplatesWorkflowView-C-0pXdDh.js} +2 -2
  106. package/dist/assets/{TemplatesWorkflowView-DptRLbdX.js.map → TemplatesWorkflowView-C-0pXdDh.js.map} +1 -1
  107. package/dist/assets/{VariablesView-NcNcsjHY.js → VariablesView-BO5fdkwt.js} +2 -2
  108. package/dist/assets/{VariablesView-NcNcsjHY.js.map → VariablesView-BO5fdkwt.js.map} +1 -1
  109. package/dist/assets/{WorkerView-dtJzfgCM.js → WorkerView-C3Rdbsfq.js} +2 -2
  110. package/dist/assets/{WorkerView-dtJzfgCM.js.map → WorkerView-C3Rdbsfq.js.map} +1 -1
  111. package/dist/assets/{WorkflowActivator-D6Zad1X2.js → WorkflowActivator-DQXSsw0V.js} +2 -2
  112. package/dist/assets/{WorkflowActivator-D6Zad1X2.js.map → WorkflowActivator-DQXSsw0V.js.map} +1 -1
  113. package/dist/assets/{WorkflowExecutionsInfoAccordion-C86A1CHv.js → WorkflowExecutionsInfoAccordion-DJPF47om.js} +2 -2
  114. package/dist/assets/{WorkflowExecutionsInfoAccordion-C86A1CHv.js.map → WorkflowExecutionsInfoAccordion-DJPF47om.js.map} +1 -1
  115. package/dist/assets/{WorkflowExecutionsLandingPage-DAfHDMth.js → WorkflowExecutionsLandingPage-DoSsHWxH.js} +2 -2
  116. package/dist/assets/{WorkflowExecutionsLandingPage-DAfHDMth.js.map → WorkflowExecutionsLandingPage-DoSsHWxH.js.map} +1 -1
  117. package/dist/assets/{WorkflowExecutionsPreview-C_EBlNX6.js → WorkflowExecutionsPreview-Dt23N5A4.js} +2 -2
  118. package/dist/assets/WorkflowExecutionsPreview-Dt23N5A4.js.map +1 -0
  119. package/dist/assets/WorkflowExecutionsView-CpAIVxYQ.js +2 -0
  120. package/dist/assets/WorkflowExecutionsView-CpAIVxYQ.js.map +1 -0
  121. package/dist/assets/{WorkflowHistory-DkdQ1koF.js → WorkflowHistory-D1-E_J_s.js} +2 -2
  122. package/dist/assets/{WorkflowHistory-DkdQ1koF.js.map → WorkflowHistory-D1-E_J_s.js.map} +1 -1
  123. package/dist/assets/{WorkflowOnboardingView-BPMBW_hz.js → WorkflowOnboardingView-fzAZuVh5.js} +2 -2
  124. package/dist/assets/{WorkflowOnboardingView-BPMBW_hz.js.map → WorkflowOnboardingView-fzAZuVh5.js.map} +1 -1
  125. package/dist/assets/{WorkflowPreview-CLzyAzmJ.js → WorkflowPreview-BkL2jDRm.js} +2 -2
  126. package/dist/assets/{WorkflowPreview-CLzyAzmJ.js.map → WorkflowPreview-BkL2jDRm.js.map} +1 -1
  127. package/dist/assets/{WorkflowsView-CzJx_-P5.js → WorkflowsView-rbygROmM.js} +2 -2
  128. package/dist/assets/{WorkflowsView-CzJx_-P5.js.map → WorkflowsView-rbygROmM.js.map} +1 -1
  129. package/dist/assets/{cloud-CRMEbZfJ.js → cloud-B90x0-JC.js} +2 -2
  130. package/dist/assets/{cloud-CRMEbZfJ.js.map → cloud-B90x0-JC.js.map} +1 -1
  131. package/dist/assets/{collaboration.store-Co5wlk8y.js → collaboration.store-ElxCV91F.js} +2 -2
  132. package/dist/assets/{collaboration.store-Co5wlk8y.js.map → collaboration.store-ElxCV91F.js.map} +1 -1
  133. package/dist/assets/index-BE0Xl-jy.js +341 -0
  134. package/dist/assets/index-BE0Xl-jy.js.map +1 -0
  135. package/dist/assets/{nodeCreator.store-CTXKjjQB.js → nodeCreator.store-Q1T99YCl.js} +2 -2
  136. package/dist/assets/{nodeCreator.store-CTXKjjQB.js.map → nodeCreator.store-Q1T99YCl.js.map} +1 -1
  137. package/dist/assets/{templateActions-CIRsIG2W.js → templateActions-B7R6qRak.js} +2 -2
  138. package/dist/assets/{templateActions-CIRsIG2W.js.map → templateActions-B7R6qRak.js.map} +1 -1
  139. package/dist/assets/{useExecutionDebugging-BzC-1xF-.js → useExecutionDebugging-BJ0CgMh8.js} +2 -2
  140. package/dist/assets/{useExecutionDebugging-BzC-1xF-.js.map → useExecutionDebugging-BJ0CgMh8.js.map} +1 -1
  141. package/dist/assets/{useExecutionHelpers-C2K8pfbF.js → useExecutionHelpers-D3294Pbg.js} +2 -2
  142. package/dist/assets/{useExecutionHelpers-C2K8pfbF.js.map → useExecutionHelpers-D3294Pbg.js.map} +1 -1
  143. package/dist/assets/{usePushConnection-EMXpPhl-.js → usePushConnection-CsYeEXN4.js} +2 -2
  144. package/dist/assets/{usePushConnection-EMXpPhl-.js.map → usePushConnection-CsYeEXN4.js.map} +1 -1
  145. package/dist/assets/{useUserHelpers-Bn_ZV9Jv.js → useUserHelpers-CzNhI0vP.js} +2 -2
  146. package/dist/assets/{useUserHelpers-Bn_ZV9Jv.js.map → useUserHelpers-CzNhI0vP.js.map} +1 -1
  147. package/dist/assets/{useWorkflowActivate-BwVActuc.js → useWorkflowActivate-D8iK20ua.js} +2 -2
  148. package/dist/assets/{useWorkflowActivate-BwVActuc.js.map → useWorkflowActivate-D8iK20ua.js.map} +1 -1
  149. package/dist/index.html +1 -1
  150. package/package.json +1 -1
  151. package/dist/assets/CollectionParameter-DHmcKhO-.js.map +0 -1
  152. package/dist/assets/MainHeader-CMxbwL4C.js +0 -2
  153. package/dist/assets/NodeView-C-hQ3_xD.js +0 -3
  154. package/dist/assets/NodeView-C-hQ3_xD.js.map +0 -1
  155. package/dist/assets/RunDataTable-B01U16vv.js +0 -2
  156. package/dist/assets/WorkflowExecutionsPreview-C_EBlNX6.js.map +0 -1
  157. package/dist/assets/WorkflowExecutionsView-Nm1Oo9El.js +0 -2
  158. package/dist/assets/WorkflowExecutionsView-Nm1Oo9El.js.map +0 -1
  159. package/dist/assets/index-Dtri_pSJ.js +0 -341
  160. package/dist/assets/index-Dtri_pSJ.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ const __vite__fileDeps=["assets/NodeCreation-BF_L2-99.js","assets/n8n-4UEsHtUL.js","assets/axios-Mm4CS0gO.js","assets/esprima-next-nhoSXAeq.js","assets/luxon-CLwAIbs0.js","assets/vendor-Dv5OeN6t.js","assets/lodash-es-CZ1inz46.js","assets/n8n-C4uNEd0H.css","assets/index-BE0Xl-jy.js","assets/pinia-sugP77Im.js","assets/flatted-DN8lQ2XG.js","assets/@vueuse/core-BBHtM40w.js","assets/@n8n/permissions-BxxteU-C.js","assets/dateformat-CIxnBJXX.js","assets/vue-i18n-Delvyc9x.js","assets/uuid-SoommWqA.js","assets/@n8n/codemirror-lang-sql-DBO6T13I.js","assets/@lezer/common-B6ct0j_v.js","assets/prettier-bS6l4Vb1.js","assets/@jsplumb/util-DS-9vq_E.js","assets/@jsplumb/core-CVBraiyY.js","assets/@jsplumb/common-CF-b-6-M.js","assets/@jsplumb/connector-bezier-BGU0Ovbw.js","assets/@jsplumb/browser-ui-BVF2KoJK.js","assets/codemirror-lang-html-n8n-CWDO6_kP.js","assets/@n8n/codemirror-lang-Dl0FW_KM.js","assets/fast-json-stable-stringify-BOfzoJX1.js","assets/timeago.js-CiyKClrF.js","assets/qrcode.vue-BGkPba5A.js","assets/vue3-touch-events-mV0oX_Sl.js","assets/chart.js-343vZi4M.js","assets/index-BhLXy8h2.css","assets/nodeCreator.store-Q1T99YCl.js","assets/NodeCreation-gfazfzcF.css","assets/CanvasControls-3FMjwMqA.js","assets/CanvasControls-BsWaXMAp.css","assets/SetupWorkflowCredentialsButton-B3HZvKQp.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
+ import{ac as Se,al as po,_ as ke,o as pe,N as E,k as _e,aj as fo,m as fe,x as wo,am as mo,an as it,h as rt,j as go,p as vo,n as yo,e as vt}from"./n8n-4UEsHtUL.js";import{m as yt,s as No}from"./pinia-sugP77Im.js";import{_ as Ct,$ as Dt,a0 as Ot,a1 as Le}from"./@jsplumb/core-CVBraiyY.js";import{e as we,a4 as Te,j as ue,n as eo,a5 as Ye,N as oe,a6 as Re,x as Qe,a7 as to,m as et,a8 as So,a9 as It,aa as Ee,ab as We,ac as ko,ad as at,ae as To,af as bo,ag as Eo,ah as Co,ai as At,aj as Ce,ak as Do,al as Oo,am as Io,an as Ao,ao as Po,ap as oo,d as so,aq as Nt,K as Je,ar as xo,as as Mo,at as _o,au as Ro,av as Wo,X as mt,aw as $o,ax as Vo,a3 as no,ay as Pt,az as Me,u as io,aA as dt,aB as Ue,aC as Bo,aD as ro,aE as ao,G as Lo,aF as Uo,aG as xt,aH as Ho,aI as He,J as De,V as B,A as Fe,P as Oe,aJ as Mt,aK as Fo,q as jo,aL as Ko,aM as zo,I as qo,H as Go,aN as K,p as Yo,o as Jo,L as Xo,aO as Zo,aP as Qo,aQ as es,a as ts,$ as os,b as ss,l as ns,aR as is,c as rs,aS as as,aT as ds,aU as ls,aV as lt,E as ct,aW as cs,aX as us,aY as hs,aZ as ps,Z as _t,z,a_ as q,a$ as je,b0 as fs,b1 as ws,b2 as ut,b3 as ms,b4 as gs,b5 as vs,b6 as ys,b7 as ve,b8 as Ns,b9 as Ie,ba as Ss,bb as ks,bc as ht,bd as Ts,be as Rt,bf as Ke,bg as pt,bh as bs,bi as Es,bj as Cs,bk as Ds,bl as Os,bm as Is,bn as As,bo as Ps,bp as Wt,bq as $t,br as Vt,bs as ft,bt as xs,bu as Bt,bv as Ms,bw as _s,bx as Lt,by as Ut,bz as Ht,bA as Rs,bB as Ws,bC as Ft,bD as jt,bE as Kt,bF as $s,T as Vs,bG as Bs,bH as zt,bI as Ls,bJ as Us,bK as Hs,bL as qt,bM as Fs,bN as js,bO as Ks,bP as zs}from"./index-BE0Xl-jy.js";import{r as j,e as X,d as lo,b as qs,G as be,u as se,l as N,M as F,p as C,U as O,O as W,I as $,J as ie,a5 as Gs,R as L,a as Ys,ag as R,aq as tt,m as D,P as ne,V as Ne,a2 as le,T as G,S as co,aw as Js,ax as Xs,F as Xe,a7 as Ze,aH as Zs,n as Qs,aK as St,aM as Ae}from"./vendor-Dv5OeN6t.js";import{u as en}from"./useExecutionDebugging-BJ0CgMh8.js";import{N as tn}from"./NodeDetailsView-ggolOsHM.js";import{g as on}from"./lodash-es-CZ1inz46.js";import{u as gt,a as sn}from"./nodeCreator.store-Q1T99YCl.js";import{a as nn,u as rn}from"./collaboration.store-ElxCV91F.js";import{g as an,f as ze,h as Gt,a as Yt,E as Jt,b as Xt,d as Zt,i as qe}from"./@jsplumb/browser-ui-BVF2KoJK.js";import{v as ye}from"./uuid-SoommWqA.js";import"./axios-Mm4CS0gO.js";import"./esprima-next-nhoSXAeq.js";import"./luxon-CLwAIbs0.js";import"./@jsplumb/util-DS-9vq_E.js";import"./@jsplumb/common-CF-b-6-M.js";import"./flatted-DN8lQ2XG.js";import"./@vueuse/core-BBHtM40w.js";import"./@n8n/permissions-BxxteU-C.js";import"./dateformat-CIxnBJXX.js";import"./vue-i18n-Delvyc9x.js";import"./@n8n/codemirror-lang-sql-DBO6T13I.js";import"./@lezer/common-B6ct0j_v.js";import"./prettier-bS6l4Vb1.js";import"./@jsplumb/connector-bezier-BGU0Ovbw.js";import"./codemirror-lang-html-n8n-CWDO6_kP.js";import"./@n8n/codemirror-lang-Dl0FW_KM.js";import"./fast-json-stable-stringify-BOfzoJX1.js";import"./timeago.js-CiyKClrF.js";import"./qrcode.vue-BGkPba5A.js";import"./vue3-touch-events-mV0oX_Sl.js";import"./chart.js-343vZi4M.js";import"./file-saver-By8WREO3.js";import"./vue-json-pretty-Cqx2Hpq3.js";import"./dateFormatter-CfbOITvW.js";import"./RunDataAi-D0m0Vg_p.js";import"./useWorkflowActivate-D8iK20ua.js";const wt=j([0,0]),Pe=j(!1),xe=j({source:"canvas"}),Ge=j([]),Qt=j(()=>{}),$e=(e=()=>{})=>{const t=we(),o=Te(),s=ue(),n=eo(),i=Qe(),a=X(()=>n.preferences.branchReadOnly||t.isReadOnlyView),l=X(()=>{if(!Pe.value)return[];const f=t.selectedNodes.map(w=>s.getNodeByName(w.name)),m=xe.value;return m.source==="canvas"?f:m.source==="node-right-click"?f.some(S=>S.name===m.node.name)?f:[m.node]:[m.node]}),r=f=>{const m=s.allNodes.filter(w=>w.type===f.name);return f.maxNodes===void 0||m.length<f.maxNodes},d=f=>{const m=o.getNodeType(f.type,f.typeVersion);return!m||to.includes(m.name)?!1:r(m)},h=f=>!!s.pinDataByNodeName(f.name),c=()=>{xe.value={source:"canvas"},Pe.value=!1,Ge.value=[],wt.value=[0,0]},p=(f,m={source:"canvas"})=>{if(f.stopPropagation(),Pe.value&&m.source===xe.value.source){c();return}f.preventDefault(),Qt.value=e,xe.value=m,wt.value=Ye(f),Pe.value=!0;const w=l.value,S=w.every(_=>_.type===oe),k={adjustToNumber:w.length,interpolate:{subject:S?i.baseText("contextMenu.sticky",{adjustToNumber:w.length}):i.baseText("contextMenu.node",{adjustToNumber:w.length})}},v=[{id:"select_all",divided:!0,label:i.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:w.length===s.allNodes.length},{id:"deselect_all",label:i.baseText("contextMenu.deselectAll"),disabled:w.length===0}];if(w.length===0)Ge.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:i.baseText("contextMenu.addNode"),disabled:a.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:i.baseText("contextMenu.addSticky"),disabled:a.value},...v];else{const _=[!S&&{id:"toggle_activation",label:w.every(V=>V.disabled)?i.baseText("contextMenu.activate",k):i.baseText("contextMenu.deactivate",k),shortcut:{keys:["D"]},disabled:a.value},!S&&{id:"toggle_pin",label:w.every(V=>h(V))?i.baseText("contextMenu.unpin",k):i.baseText("contextMenu.pin",k),shortcut:{keys:["p"]},disabled:a.value||!w.every(V=>Re(V).canPinNode(!0))},{id:"copy",label:i.baseText("contextMenu.copy",k),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:i.baseText("contextMenu.duplicate",k),shortcut:{metaKey:!0,keys:["D"]},disabled:a.value||!w.every(d)},...v,{id:"delete",divided:!0,label:i.baseText("contextMenu.delete",k),shortcut:{keys:["Del"]},disabled:a.value}].filter(Boolean);if(w.length===1){const V=S?[{id:"open",label:i.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:a.value},{id:"change_color",label:i.baseText("contextMenu.changeColor"),disabled:a.value}]:[{id:"open",label:i.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:i.baseText("contextMenu.test"),disabled:a.value},{id:"rename",label:i.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:a.value}];_.unshift(...V)}Ge.value=_}},u=f=>{Qt.value(f,l.value)};return lo(()=>t.nodeViewOffsetPosition,()=>{c()}),{isOpen:Pe,position:wt,target:xe,actions:Ge,targetNodes:l,open:p,close:c,_dispatchAction:u}};function dn(){const e=j(!1),t=j(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:s}=Se(),n=we(),i=et(),a=ue(),{isOpen:l}=$e();function r(y){Object.assign(t.value.style,y)}function d(y){const[x,H]=k(y);t.value=Object.assign(t.value,{x,y:H}),r({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h(y){const x=p(y);r({left:x.x+"px",top:x.y+"px",width:x.width+"px",height:x.height+"px"})}function c(){t.value.x=0,t.value.y=0,r({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function p(y){const[x,H]=k(y);return{x:Math.min(x,t.value.x),y:Math.min(H,t.value.y),width:Math.abs(x-t.value.x),height:Math.abs(H-t.value.y)}}function u(y){const x=[],H=p(y);return a.allNodes.forEach(de=>{de.position[0]<H.x||de.position[0]>H.x+H.width||de.position[1]<H.y||de.position[1]>H.y+H.height||x.push(de)}),x}function f(){t.value.id="select-box",r({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",w),document.querySelector("#node-view").appendChild(t.value)}function m(y){if(y.buttons===0){w(y);return}h(y)}function w(y){if("button"in y&&y.button===2||l.value)return;if(!e.value){o&&y.target instanceof HTMLElement&&y.target&&y.target.id.includes("node-view")&&V();return}document.removeEventListener("mousemove",m),V();const x=u(y);x.forEach(H=>{_(H)}),x.length===1&&(n.lastSelectedNode=x[0].name),c()}function S(y,x){s(y)||x||y.button===2||n.isActionActive("dragActive")||(d(y),document.addEventListener("mousemove",m))}function k(y){const x=Ye(y),[H,de]=i.canvasPositionFromPagePosition(x),ot=i.nodeViewScale,g=n.nodeViewOffsetPosition;return So(H,de,ot,g)}function v(y){n.removeNodeFromSelection(y),re.value.removeFromDragSelection(re.value.getManagedElement(y==null?void 0:y.id))}function _(y){n.addSelectedNode(y),re.value.addToDragSelection(re.value.getManagedElement(y==null?void 0:y.id))}function V(){re.value.clearDragSelection(),n.resetSelectedNodes(),n.lastSelectedNode=null,n.lastSelectedNodeOutputIndex=null,i.newNodeInsertPosition=null,i.setLastSelectedConnection(void 0)}const re=X(()=>i.jsPlumbInstance);return qs(()=>{f()}),{selectActive:e,getMousePositionWithinNodeView:k,mouseUpMouseSelect:w,mouseDownMouseSelect:S,nodeDeselected:v,nodeSelected:_,deselectAllNodes:V}}function ln(){function e(){return Te().allNodeTypes.reduce((o,s)=>{if(typeof s.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(s.defaults.name)&&o.push(s.defaults.name),o},[])}function t(o,s=[]){var h,c;const{canvasNames:n}=ue();if(!n.has(o)&&!s.includes(o))return o;const a=e().find(p=>o.startsWith(p));if(a){let p="",u=1;const f=o.split(a).pop(),m=f==null?void 0:f[f.length-1];for(m&&Number.isInteger(Number(m))&&(u=parseInt(m,10),o=o.slice(0,-1)),p=o;n.has(p)||s.includes(p);)p=o+u++;return p}if(/^\d+-?\d*$/.test(o)){let p="",u=1;const f=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(f!=null&&f.groups))throw new Error("Failed to find match for unique name");for(((h=f==null?void 0:f.groups)==null?void 0:h.suffix)!==""&&(u=parseInt(f.groups.suffix,10)),p=f.groups.base;n.has(p)||s.includes(p);)p=f.groups.base+"-"+u++;return p}let l="",r=1;const d=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(d!=null&&d.groups))throw new Error("Failed to find match for unique name");for(((c=d==null?void 0:d.groups)==null?void 0:c.suffix)!==""&&(r=parseInt(d.groups.suffix,10)),l=d.groups.base;n.has(l)||s.includes(l);)l=d.groups.base+r++;return l}return{uniqueNodeName:t}}const cn=be({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=$e(),{position:s,isOpen:n,actions:i,target:a}=o,l=j(),r=t;lo(n,()=>{var c,p;n?(c=l.value)==null||c.open():(p=l.value)==null||p.close()},{flush:"post"});function d(c){const p=c;o._dispatchAction(p),r("action",p,o.targetNodes.value)}function h(c){c||o.close()}return(c,p)=>se(n)?(N(),F(Gs,{key:0,to:"body"},[C("div",{class:$(c.$style.contextMenu),style:ie({left:`${se(s)[0]}px`,top:`${se(s)[1]}px`})},[O(se(po),{ref_key:"dropdown",ref:l,items:se(i),placement:"bottom-start","data-test-id":"context-menu","hide-arrow":se(a).source!=="node-button",onSelect:d,onVisibleChange:h},{activator:W(()=>[C("div",{class:$(c.$style.activator)},null,2)]),_:1},8,["items","hide-arrow"])],6)])):L("",!0)}}),un="_contextMenu_1t4kq_1",hn="_activator_1t4kq_5",pn={contextMenu:un,activator:hn},fn={$style:pn},wn=ke(cn,[["__cssModules",fn]]);function uo({name:e,instance:t,workflowObject:o,isReadOnly:s,emit:n}){const i=we(),a=Se(),l=ue(),r=Te(),d=Qe(),h=X(()=>{var g;return((g=Ys())==null?void 0:g.refs)??{}}),c=X(()=>l.getNodeByName(e)),p=X(()=>{var g;return((g=c.value)==null?void 0:g.id)??""}),u=j([]),f=j([]),m=(g,b)=>{const M=Io.includes(g);return{type:"N8nAddInput",options:{width:24,height:72,color:b,multiple:M}}},w=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),S=g=>g<=2?"small":g<=6?"medium":"large";function k(g,b,M){var I;if(window!=null&&window.Cypress&&"canvas"in g.endpoint&&t){const A=g.endpoint.canvas;t.setAttribute(A,"data-endpoint-name",((I=c.value)==null?void 0:I.name)??""),t.setAttribute(A,"data-input-index",M.toString()),t.setAttribute(A,"data-endpoint-type",b)}}function v(g,b){var U;const M={},I={};u.value=pe(o,c.value,b)||[];const A=[...u.value];A.sort((ae,Z)=>typeof ae=="string"?1:typeof Z=="string"||ae.required&&!Z.required?-1:!ae.required&&Z.required?1:0),A.forEach((ae,Z)=>{var kt,Tt,bt;let Y;typeof ae=="string"?Y={type:ae}:Y=ae;const T=Y.type,P=T===E.Main?E.Main:"other";M.hasOwnProperty(P)?M[P]++:M[P]=0,I.hasOwnProperty(T)?I[T]++:I[T]=0;const me=M[P],ge=I[T],J=u.value.filter(te=>{const Et=typeof te=="string"?te:te.type;return T===E.Main?Et===E.Main:Et!==E.Main}),he=J.filter(te=>te!==E.Main),Ve=he.filter(te=>typeof te!="string"&&te.required),st=he.filter(te=>typeof te!="string"&&!te.required),nt=_(Ve.length,st.length),ce=It(T,"input",J.length,nt)[me];if(!Ee(T))return;const Be=We(T),Q={uuid:ko(p.value,T,ge),anchor:ce,maxConnections:Y.maxConnections??-1,endpoint:"Rectangle",paintStyle:at(b,"--color-foreground-xdark",T),hoverPaintStyle:at(b,"--color-primary",T),scope:To(Be),source:T!==E.Main,target:!s&&u.value.length>1,parameters:{connection:"target",nodeId:p.value,type:T,index:ge},enabled:!s,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...x(T,b)},ee=t==null?void 0:t.addEndpoint(h.value[((kt=c.value)==null?void 0:kt.name)??""],Q);k(ee,"input",ge),(Y.displayName??((Tt=b.inputNames)==null?void 0:Tt[Z]))&&ee.addOverlay(bo(Y.displayName??((bt=b.inputNames)==null?void 0:bt[Z])??"",T,Y.required)),Array.isArray(ee)||(ee.__meta={nodeName:g.name,nodeId:p.value,index:ge,totalEndpoints:J.length,nodeType:g.type})}),A.length===0&&(t==null||t.manage(h.value[((U=c.value)==null?void 0:U.name)??""]))}function _(g,b,M=Eo,I=Co){const A=[];if(g>0&&b>0){if(M)A.push(g);else if(g+b<I)for(let U=g;U<I-b;U++)A.push(U)}else if(g>0&&g<I&&b===0)for(let U=0;U<I-g;U++)A.push(U+g);else if(g===0&&b>0&&b<I)for(let U=0;U<I-b;U++)A.push(U);return A}function V(g,b){const M={},I={};if(!c.value)return;f.value=_e(o,c.value,b)||[];let A=0;const U=[];f.value.forEach((Z,Y)=>{var P;let T;typeof Z=="string"?T={type:Z}:T=Z,(P=b.outputNames)!=null&&P[Y]&&(T.displayName=b.outputNames[Y]),T.displayName&&(A=T.displayName.length>A?T.displayName.length:A),U.push(T)});const ae=S(A);f.value.forEach((Z,Y)=>{var Be;const T=U[Y],P=T.type,me=P===E.Main?E.Main:"other";M.hasOwnProperty(me)?M[me]++:M[me]=0,I.hasOwnProperty(P)?I[P]++:I[P]=0;const ge=M[me],J=I[P],he=f.value.filter(Q=>{const ee=typeof Q=="string"?Q:Q.type;return P===E.Main?ee===E.Main:ee!==E.Main}),Ve=It(P,"output",he.length)[ge];if(!Ee(P))return;const st=We(P),nt={uuid:At(p.value,P,J),anchor:Ve,maxConnections:-1,endpoint:{type:"Dot",options:{radius:b&&he.length>2?7:9}},hoverPaintStyle:Ce(b,"--color-primary"),scope:st,source:!0,target:P!==E.Main,enabled:!s,parameters:{connection:"source",nodeId:p.value,type:P,index:J},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...H(P,T,b)},ce=t==null?void 0:t.addEndpoint(h.value[((Be=c.value)==null?void 0:Be.name)??""],nt);if(ce){if(k(ce,"output",J),T.displayName&&Ee(P)){const Q=Do(T.displayName,P,T==null?void 0:T.category);ce.addOverlay(Q)}if(Array.isArray(ce)||(ce.__meta={nodeName:g.name,nodeId:p.value,index:J,totalEndpoints:he.length,endpointLabelLength:ae}),!s&&P===E.Main){const Q={uuid:At(p.value,P,J),anchor:Ve,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:ce,showOutputLabel:f.value.length===1,size:f.value.length>=3?"small":"medium",endpointLabelLength:ae,hoverMessage:d.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!s,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:p.value,type:P,index:J,category:T==null?void 0:T.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};if(T!=null&&T.category&&(Q.cssClass=`${Q.cssClass} ${T==null?void 0:T.category}`),!t||!c.value)return;const ee=t.addEndpoint(h.value[c.value.name],Q);k(ee,"plus",J),Array.isArray(ee)||(ee.__meta={nodeName:g.name,nodeId:p.value,index:J,nodeType:g.type,totalEndpoints:he.length})}}})}function re(g){const b=r.getNodeType(g.type,g.typeVersion)??r.getNodeType(Oo);v(g,b),V(g,b)}function y(g){return`--node-type-${g}-color`}function x(g,b){return g===E.Main?{paintStyle:at(b,y(E.Main),g)}:Ee(g)?(I=>({endpoint:m(I,y(I))}))(g):{}}function H(g,b,M){const I=U=>({endpoint:w(),paintStyle:Ce(M,y(U)),hoverPaintStyle:Ce(M,y(U))}),A="output";return g===E.Main?b.category==="error"?{paintStyle:{...Ce(M,y(E.Main)),fill:"var(--color-danger)"},cssClass:`dot-${A}-endpoint`}:{paintStyle:Ce(M,y(E.Main)),cssClass:`dot-${A}-endpoint`}:Ee(g)?I(g):{}}function de(g){a.isTouchDevice&&i.isActionActive("dragActive")&&i.removeActiveAction("dragActive")}function ot(g){var M,I;const b=g.path||((M=g.composedPath)==null?void 0:M.call(g));for(let A=0;A<b.length;A++)if(b[A].className&&typeof b[A].className=="string"&&b[A].className.includes("no-select-on-click"))return;a.isTouchDevice||(i.isActionActive("dragActive")?i.removeActiveAction("dragActive"):(a.isCtrlKeyPressed(g)||n("deselectAllNodes"),i.isNodeSelected(((I=c.value)==null?void 0:I.name)??"")?n("deselectNode",e):n("nodeSelected",e)))}return{getSpacerIndexes:_,addInputEndpoints:v,addOutputEndpoints:V,addEndpointTestingData:k,addNode:re,getEndpointColor:y,getInputConnectionStyle:x,getOutputConnectionStyle:H,mouseLeftClick:ot,touchEnd:de,inputs:u,outputs:f}}const mn=be({name:"Node",components:{TitledList:Ao,FontAwesomeIcon:fo,NodeIcon:Po},props:{isProductionExecutionPreview:{type:Boolean,default:!1},disablePointerEvents:{type:Boolean,default:!1},hideNodeIssues:{type:Boolean,default:!1},name:{type:String,required:!0},instance:{type:Object,required:!0},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},emits:{run:null,runWorkflow:null,removeNode:null,toggleDisableNode:null},setup(e,{emit:t}){const o=ue(),s=$e(),n=no(),i=oo(),a=o.getNodeByName(e.name),l=Re(a),r=Se(),{callDebounced:d}=so(),h=uo({name:e.name,instance:e.instance,workflowObject:e.workflow,isReadOnly:e.isReadOnly,emit:t});return{contextMenu:s,externalHooks:n,nodeHelpers:i,pinnedData:l,deviceSupport:r,...h,callDebounced:d}},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},computed:{...yt(Te,et,Je,we,ue,Nt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""},showPinnedDataInfo(){return this.pinnedData.hasData.value&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?to.includes(this.nodeType.name)?!1:this.nodeType.maxNodes===void 0||this.sameTypeNodes.length<this.nodeType.maxNodes:!0},isScheduledGroup(){var e;return((e=this.nodeType)==null?void 0:e.group.includes("schedule"))===!0},iconColorDefault(){if(this.isConfigNode)return"var(--color-text-base)"},nodeRunData(){return this.data?this.workflowsStore.getWorkflowResultDataByNodeName(this.data.name)??[]:[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error"].includes(this.nodeExecutionStatus)?!0:this.pinnedData.hasData.value?!1:!!(((e=this.data)==null?void 0:e.issues)!==void 0&&Object.keys(this.data.issues).length)},workflowDataItems(){const e=this.nodeRunData;return e===null?0:e.length},canvasOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},getTriggerNodeTooltip(){if(this.nodeType!==null&&this.nodeType.hasOwnProperty("eventTriggerDescription")){const e=this.$locale.shortNodeType(this.nodeType.name),{eventTriggerDescription:t}=this.nodeType;return this.$locale.nodeText().eventTriggerDescription(e,t??"")}else return this.$locale.baseText("node.waitingForYouToCreateAnEventIn",{interpolate:{nodeType:this.nodeType?xo(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.data?this.workflowsStore.isNodeExecuting(this.data.name):!1},isSingleActiveTriggerNode(){return this.workflowsStore.workflowTriggerNodes.filter(t=>{const o=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);return o&&o.eventTriggerDescription!==""&&!t.disabled}).length===1},isManualTypeNode(){var e;return((e=this.data)==null?void 0:e.type)===Mo},isConfigNode(){return this.data?this.nodeTypesStore.isConfigNode(this.workflow,this.data,this.data.type??""):!1},isConfigurableNode(){var e;return this.data?this.nodeTypesStore.isConfigurableNode(this.workflow,this.data,((e=this.data)==null?void 0:e.type)??""):!1},isTriggerNode(){return this.data?this.nodeTypesStore.isTriggerNode(this.data.type):!1},isTriggerNodeTooltipEmpty(){return this.nodeType!==null?this.nodeType.eventTriggerDescription==="":!1},isNodeDisabled(){return this.node&&this.node.disabled},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.nodesByName[this.name]},sameTypeNodes(){return this.workflowsStore.allNodes.filter(e=>{var t;return e.type===((t=this.data)==null?void 0:t.type)})},nodeWrapperClass(){const e={"node-wrapper":!0,"node-wrapper--trigger":this.isTriggerNode,"node-wrapper--configurable":this.isConfigurableNode,"node-wrapper--config":this.isConfigNode};if(this.outputs.length){const o=fe(this.outputs).filter(s=>s!==E.Main);o.length&&o.forEach(s=>{e[`node-wrapper--connection-type-${s}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=pe(this.workflow,this.node,this.nodeType)||[],s=fe(t).filter(l=>l!==E.Main);if(s.length){t.filter(r=>typeof r!="string"&&r.required);let l=0;e["--configurable-node-input-count"]=s.length+l}let n=[];this.workflow.nodes[this.node.name]&&(n=_e(this.workflow,this.node,this.nodeType));const a=fe(n).filter(l=>l===E.Main);e["--node-main-output-count"]=a.length}return e},nodeClass(){var e;return{"node-box":!0,disabled:(e=this.data)==null?void 0:e.disabled,executing:this.isExecuting}},nodeExecutionStatus(){var t;const e=(t=this.workflowsStore.getWorkflowRunData)==null?void 0:t[this.name];return e?e.filter(Boolean)[0].executionStatus??"":""},nodeIssues(){var o,s;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(n=>{if(n!=null&&n.error){const{message:i,description:a}=n.error,l=`${i}${a?` (${a})`:""}`;e.push(wo(l))}}),((s=this.data)==null?void 0:s.issues)!==void 0&&e.push(...mo(this.data.issues,this.data)),e},nodeDisabledTitle(){var e;return(e=this.data)!=null&&e.disabled?this.$locale.baseText("node.enable"):this.$locale.baseText("node.disable")},position(){return this.node?this.node.position:[0,0]},showDisabledLineThrough(){var e;return!this.isConfigurableNode&&!!((e=this.data)!=null&&e.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){var e;return this.$locale.shortNodeType(((e=this.data)==null?void 0:e.type)??"")},nodeTitle(){var e,t;return((e=this.data)==null?void 0:e.name)==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):((t=this.data)==null?void 0:t.name)??""},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=on(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===_o?this.$locale.baseText("node.theNodeIsWaitingIndefinitelyForAnIncomingWebhookCall"):this.$locale.baseText("node.nodeIsWaitingTill",{interpolate:{date:o.toLocaleDateString(),time:o.toLocaleTimeString()}})}}},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},nodeStyle(){var o,s,n,i;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),(o=this.data)!=null&&o.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues&&!this.hideNodeIssues?((i=(n=(s=this.nodeRunData)==null?void 0:s[0])==null?void 0:n.error)==null?void 0:i.functionality)!=="configuration-node"&&(t="--color-danger",e["border-width"]="2px",e["border-style"]="solid"):this.waiting||this.showPinnedDataInfo?t="--color-node-pinned-border":this.nodeExecutionStatus==="unknown"?t="--color-foreground-xdark":this.workflowDataItems&&(e["border-width"]="2px",e["border-style"]="solid",t="--color-success")),e["border-color"]=`var(${t})`,e},isSelected(){return this.uiStore.getSelectedNodes.find(e=>{var t;return e.name===((t=this.data)==null?void 0:t.name)})!==void 0},shiftOutputCount(){return!!(this.nodeType&&this.outputs.length>2)},shouldShowTriggerTooltip(){return!!this.node&&this.isTriggerNode&&!this.isPollingTypeNode&&!this.pinnedData.hasData.value&&!this.isNodeDisabled&&this.workflowRunning&&this.workflowDataItems===0&&this.isSingleActiveTriggerNode&&!this.isTriggerNodeTooltipEmpty&&!this.hasIssues&&!this.dragging},isContextMenuOpen(){var e;return this.contextMenu.isOpen.value&&this.contextMenu.target.value.source==="node-button"&&this.contextMenu.target.value.node.name===((e=this.data)==null?void 0:e.name)},iconNodeType(){var e,t,o;if(((e=this.data)==null?void 0:e.type)===Ro||((t=this.data)==null?void 0:t.type)===Wo){const s=(o=this.data.parameters)==null?void 0:o.icon,n=this.workflow.expression.getSimpleParameterValue(this.data,s,"internal",{});if(n&&typeof n=="string")return this.nodeTypesStore.getNodeType(n)}return this.nodeType}},watch:{isActive(e,t){!e&&t&&this.setSubtitle()},canvasOffsetPosition(){this.showTriggerNodeTooltip&&(this.showTriggerNodeTooltip=!1,setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},200)),this.pinDataDiscoveryTooltipVisible&&(this.pinDataDiscoveryTooltipVisible=!1,setTimeout(()=>{this.pinDataDiscoveryTooltipVisible=!0},200))},shouldShowTriggerTooltip(e){e?setTimeout(()=>{this.showTriggerNodeTooltip=this.shouldShowTriggerTooltip},2500):this.showTriggerNodeTooltip=!1},nodeRunData:{deep:!0,handler(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}}},created(){mt(Pt).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){if(this.data!==null)try{this.addNode(this.data)}catch{}setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{var e;this.$emit("run",{name:(e=this.data)==null?void 0:e.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isAnyModalOpen||e===0||(mt(Pt).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){if(!(!this.data||!this.nodeType))try{const e=this.nodeHelpers.getNodeSubtitle(this.data,this.nodeType,this.workflow)??"";this.nodeSubtitle=e.includes($o)?"":e}catch{}},disableNode(){this.data!==null&&(this.nodeHelpers.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new Vo(this.data.name,!this.data.disabled,this.data.disabled===!0)),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}))},executeNode(){var e,t;this.$emit("runWorkflow",(e=this.data)==null?void 0:e.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:(t=this.data)==null?void 0:t.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},deleteNode(){var e,t;this.$telemetry.track("User clicked node hover button",{node_type:(e=this.data)==null?void 0:e.type,button_name:"delete",workflow_id:this.workflowsStore.workflowId}),this.$emit("removeNode",(t=this.data)==null?void 0:t.name)},toggleDisableNode(e){var t;e.currentTarget.blur(),this.$telemetry.track("User clicked node hover button",{node_type:(t=this.data)==null?void 0:t.type,button_name:"disable",workflow_id:this.workflowsStore.workflowId}),this.$emit("toggleDisableNode",this.data)},onClick(e){this.callDebounced(this.onClickDebounced,{debounceTime:50,trailing:!0},e)},onClickDebounced(...e){const t=e[0];t.detail>=2?this.setNodeActive():this.mouseLeftClick(t)},setNodeActive(){this.ndvStore.activeNodeName=this.data?this.data.name:"",this.pinDataDiscoveryTooltipVisible=!1},touchStart(){this.deviceSupport.isTouchDevice&&!this.deviceSupport.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},openContextMenu(e,t){this.data&&this.contextMenu.open(e,{source:t,node:this.data})}}}),ho=e=>(Js("data-v-b3e246ea"),e=e(),Xs(),e),gn=["id","data-name","data-node-type"],vn={class:"select-background"},yn={key:0,class:"trigger-icon"},Nn=["innerHTML"],Sn={key:0,class:"node-issues","data-test-id":"node-issues"},kn={key:1,class:"waiting"},Tn=["textContent"],bn={key:2,class:"node-pin-data-icon"},En={key:0,class:"items-count"},Cn={key:3},Dn={key:4,class:"data-count"},On={key:0,class:"items-count"},In=["title"],An={class:"node-trigger-tooltip__wrapper"},Pn=["textContent"],xn=ho(()=>C("span",null,null,-1)),Mn=ho(()=>C("span",null,null,-1)),_n={class:"node-description"},Rn=["title"],Wn={"data-test-id":"canvas-node-box-title"},$n={key:0},Vn=["title"],Bn={class:"node-options-inner"};function Ln(e,t,o,s,n,i){var p;const a=R("FontAwesomeIcon"),l=R("n8n-tooltip"),r=R("TitledList"),d=R("NodeIcon"),h=R("n8n-icon-button"),c=tt("touch");return e.data?(N(),D("div",{key:0,id:e.nodeId,ref:e.data.name,class:$(e.nodeWrapperClass),style:ie(e.nodeWrapperStyles),"data-test-id":"canvas-node","data-name":e.data.name,"data-node-type":(p=e.nodeType)==null?void 0:p.name,onContextmenu:t[4]||(t[4]=u=>e.openContextMenu(u,"node-right-click"))},[ne(C("div",vn,null,512),[[Ne,e.isSelected]]),C("div",{class:$({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"menu-open":e.isContextMenuOpen,"disable-pointer-events":e.disablePointerEvents})},[ne((N(),D("div",{class:$(e.nodeClass),style:ie(e.nodeStyle),onClick:t[0]||(t[0]=le((...u)=>e.onClick&&e.onClick(...u),["left"]))},[e.isTriggerNode?(N(),D("i",yn,[O(l,{placement:"bottom"},{content:W(()=>[C("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,Nn)]),default:W(()=>[O(a,{icon:"bolt",size:"lg"})]),_:1})])):L("",!0),e.data.disabled?L("",!0):(N(),D("div",{key:1,class:$({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues&&!e.hideNodeIssues?(N(),D("div",Sn,[O(l,{"show-after":500,placement:"bottom"},{content:W(()=>[O(r,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:W(()=>[O(a,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(N(),D("div",kn,[O(l,{placement:"bottom"},{content:W(()=>[C("div",{textContent:G(e.waiting)},null,8,Tn)]),default:W(()=>[O(a,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(N(),D("span",bn,[O(a,{icon:"thumbtack"}),e.workflowDataItems>1?(N(),D("span",En,G(e.workflowDataItems),1)):L("",!0)])):e.nodeExecutionStatus==="unknown"?(N(),D("span",Cn)):e.workflowDataItems?(N(),D("span",Dn,[O(a,{icon:"check"}),e.workflowDataItems>1?(N(),D("span",On,G(e.workflowDataItems),1)):L("",!0)])):L("",!0)],2)),C("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[O(a,{icon:"sync-alt",spin:""})],8,In),C("div",An,[O(l,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:W(()=>[C("div",{textContent:G(e.getTriggerNodeTooltip)},null,8,Pn)]),default:W(()=>[xn]),_:1},8,["visible"]),e.isTriggerNode?(N(),F(l,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:W(()=>[co(G(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:W(()=>[Mn]),_:1},8,["visible"])):L("",!0)]),O(d,{class:"node-icon","node-type":e.iconNodeType,size:40,shrink:!1,"color-default":e.iconColorDefault,disabled:e.data.disabled},null,8,["node-type","color-default","disabled"])],6)),[[c,e.touchStart,"start"],[c,e.touchEnd,"end"]]),e.showDisabledLineThrough?(N(),D("div",{key:0,class:$({"disabled-line-through":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):L("",!0)],2),C("div",_n,[C("div",{class:"node-name",title:e.nodeTitle},[C("p",Wn,G(e.nodeTitle),1),e.data.disabled?(N(),D("p",$n,"("+G(e.$locale.baseText("node.disabled"))+")",1)):L("",!0)],8,Rn),e.nodeSubtitle!==void 0?(N(),D("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},G(e.nodeSubtitle),9,Vn)):L("",!0)]),e.isReadOnly?L("",!0):ne((N(),D("div",{key:0,class:"node-options no-select-on-click",onContextmenu:t[2]||(t[2]=le(()=>{},["stop"])),onMousedown:t[3]||(t[3]=le(()=>{},["stop"]))},[C("div",Bn,[e.isConfigNode?L("",!0):(N(),F(h,{key:0,"data-test-id":"execute-node-button",type:"tertiary",text:"",size:"small",icon:"play",disabled:e.workflowRunning,title:e.$locale.baseText("node.testStep"),onClick:e.executeNode},null,8,["disabled","title","onClick"])),O(h,{"data-test-id":"disable-node-button",type:"tertiary",text:"",size:"small",icon:"power-off",title:e.nodeDisabledTitle,onClick:e.toggleDisableNode},null,8,["title","onClick"]),O(h,{"data-test-id":"delete-node-button",type:"tertiary",size:"small",text:"",icon:"trash",title:e.$locale.baseText("node.delete"),onClick:e.deleteNode},null,8,["title","onClick"]),O(h,{"data-test-id":"overflow-node-button",type:"tertiary",size:"small",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=u=>e.openContextMenu(u,"node-button"))})])],544)),[[Ne,!e.hideActions]])],46,gn)):L("",!0)}const Un=ke(mn,[["render",Ln],["__scopeId","data-v-b3e246ea"]]),Hn=be({name:"Sticky",props:{nodeViewScale:{type:Number,default:1},gridSize:{type:Number,default:Me},name:{type:String,required:!0},instance:{type:Object,required:!0},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean},workflow:{type:Object,required:!0}},emits:{removeNode:null,nodeSelected:null},setup(e,{emit:t}){const o=Se(),s=io(),n=j(),i=j(!1),a=d=>{i.value=d},l=$e(d=>{var h;d==="change_color"&&(a(!0),(h=n.value)==null||h.click())}),r=uo({name:e.name,instance:e.instance,workflowObject:e.workflow,isReadOnly:e.isReadOnly,emit:t});return{deviceSupport:o,toast:s,colorPopoverTrigger:n,contextMenu:l,forceActions:i,...r,setForceActions:a}},data(){return{isResizing:!1,isTouchActive:!1}},computed:{...yt(Te,we,Je,et,ue,Nt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""},defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&dt(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>{var t;return e.name===((t=this.data)==null?void 0:t.name)})!==void 0},nodeType(){return this.data&&this.nodeTypesStore.getNodeType(this.data.type,this.data.typeVersion)},node(){return this.workflowsStore.getNodeByName(this.name)},position(){return this.node?this.node.position:[0,0]},height(){return this.node&&Ue(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&Ue(this.node.parameters.width)?this.node.parameters.width:0},stickySize(){return{height:this.height+"px",width:this.width+"px"}},stickyPosition(){return{left:this.position[0]+"px",top:this.position[1]+"px",zIndex:this.isActive?9999999:-1*Math.floor(this.height*this.width/1e3)}},showActions(){return!(this.hideActions||this.isReadOnly||this.workflowRunning||this.isResizing)||this.forceActions},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")}},mounted(){if(this.data!==null)try{this.addNode(this.data)}catch{}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){Bo(this.data),await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){var t,o;this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...(t=this.node)==null?void 0:t.parameters,color:e},position:((o=this.node)==null?void 0:o.position)??[0,0]}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e){if(e){const t=this.name===ro,o=e.querySelector('img[alt="n8n quickstart video"]'),s=t&&o?"welcome_video":t&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:s})}},onInputChange(e){this.node&&(this.node.parameters.content=e,this.setParameters({content:e}))},onResizeStart(){this.isResizing=!0,!this.isSelected&&this.node&&this.$emit("nodeSelected",this.node.name,!1,!0)},onResize({height:e,width:t,dX:o,dY:s}){this.node&&((o!==0||s!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(s||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:dt(e.content)?e.content:this.node.parameters.content,height:Ue(e.height)?e.height:this.node.parameters.height,width:Ue(e.width)?e.width:this.node.parameters.width,color:dt(e.color)?e.color:this.node.parameters.color},o={key:this.node.id,name:this.node.name,value:t};this.workflowsStore.setNodeParameters(o)}},setPosition(e){if(!this.node)return;const t={name:this.node.name,properties:{position:e}};this.workflowsStore.updateNodeProperties(t)},touchStart(){this.deviceSupport.isTouchDevice&&!this.deviceSupport.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},onContextMenu(e){this.node&&!this.isActive?this.contextMenu.open(e,{source:"node-right-click",node:this.node}):e.stopPropagation()}}}),Fn=["id","data-name"],jn={class:"select-sticky-background"},Kn=["title"],zn=["title"],qn={class:"content"},Gn=["onClick"];function Yn(e,t,o,s,n,i){var h,c;const a=R("n8n-sticky"),l=R("font-awesome-icon"),r=R("n8n-popover"),d=tt("touch");return N(),D("div",{id:e.nodeId,ref:(h=e.data)==null?void 0:h.name,class:"sticky-wrapper",style:ie(e.stickyPosition),"data-name":(c=e.data)==null?void 0:c.name,"data-test-id":"sticky"},[C("div",{class:$({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.deviceSupport.isTouchDevice,"is-read-only":e.isReadOnly}),style:ie(e.stickySize)},[ne(C("div",jn,null,512),[[Ne,e.isSelected]]),ne((N(),D("div",{class:"sticky-box",onClick:t[0]||(t[0]=le((...p)=>e.mouseLeftClick&&e.mouseLeftClick(...p),["left"])),onContextmenu:t[1]||(t[1]=(...p)=>e.onContextMenu&&e.onContextMenu(...p))},[e.node?(N(),F(a,{key:0,id:e.node.id,"model-value":e.node.parameters.content,height:e.node.parameters.height,width:e.node.parameters.width,scale:e.nodeViewScale,"background-color":e.node.parameters.color,"read-only":e.isReadOnly,"default-text":e.defaultText,"edit-mode":e.isActive&&!e.isReadOnly,"grid-size":e.gridSize,onEdit:e.onEdit,onResizestart:e.onResizeStart,onResize:e.onResize,onResizeend:e.onResizeEnd,onMarkdownClick:e.onMarkdownClick,"onUpdate:modelValue":e.onInputChange},null,8,["id","model-value","height","width","scale","background-color","read-only","default-text","edit-mode","grid-size","onEdit","onResizestart","onResize","onResizeend","onMarkdownClick","onUpdate:modelValue"])):L("",!0)],32)),[[d,e.touchStart,"start"],[d,e.touchEnd,"end"]]),ne(C("div",{class:$({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[ne((N(),D("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.delete")},[O(l,{icon:"trash"})],8,Kn)),[[d,e.deleteNode,"tap"]]),O(r,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:W(()=>[C("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[O(l,{icon:"palette"})],8,zn)]),default:W(()=>[C("div",qn,[(N(!0),D(Xe,null,Ze(Array.from({length:7}),(p,u)=>{var f,m;return N(),D("div",{key:u,class:$(["color",`sticky-color-${u+1}`]),"data-test-id":"color",style:ie({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${u+1})`,"box-shadow":u===0&&((f=e.node)==null?void 0:f.parameters.color)===""||u+1===((m=e.node)==null?void 0:m.parameters.color)?`0 0 0 1px var(--color-sticky-background-${u+1})`:"none"}),onClick:w=>e.changeColor(u+1)},null,14,Gn)}),128))])]),_:1},8,["onShow","onHide"])],2),[[Ne,e.showActions]])],6)],12,Fn)}const Jn=ke(Hn,[["render",Yn],["__scopeId","data-v-0582f633"]]),Xn=["textContent"],Zn=be({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=gt(),s=X(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(n,i)=>{const a=R("font-awesome-icon"),l=R("n8n-tooltip");return N(),D("div",{ref:"container",class:$(n.$style.canvasAddButton),style:ie(s.value),"data-test-id":"canvas-add-button"},[O(l,{placement:"top",visible:n.showTooltip,disabled:se(o).showScrim,"popper-class":n.$style.tooltip,"show-after":700},{content:W(()=>[co(G(n.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:W(()=>[C("button",{class:$(n.$style.button),"data-test-id":"canvas-plus-button",onClick:i[0]||(i[0]=r=>n.$emit("click"))},[O(a,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),C("p",{class:$(n.$style.label),textContent:G(n.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,Xn)],6)}}}),Qn="_canvasAddButton_1easi_1",ei="_button_1easi_13",ti="_label_1easi_34",oi={canvasAddButton:Qn,button:ei,label:ti},si={$style:oi},ni=ke(Zn,[["__cssModules",si]]),ii=["onClick"],ri=be({__name:"NextStepPopup",emits:["optionSelected"],setup(e,{emit:t}){const o=ao(),s=Qe(),n=Lo(),i=t,a=X(()=>o.assistantChatOpen),l=X(()=>o.nextStepPopupConfig.title),r=X(()=>[{label:s.baseText("nextStepPopup.option.choose"),icon:"➕",key:"choose",disabled:!1},{label:s.baseText("nextStepPopup.option.generate"),icon:"✨",key:"generate",disabled:a.value}]),d=X(()=>[o.nextStepPopupConfig.position[0],o.nextStepPopupConfig.position[1]]),h=X(()=>({left:`${d.value[0]}px`,top:`${d.value[1]}px`})),c=()=>{o.closeNextStepPopup()},p=u=>{u==="choose"?i("optionSelected",u):u==="generate"&&(n.track("User clicked generate AI button",{},{withPostHog:!0}),o.assistantChatOpen=!0),c()};return(u,f)=>{const m=tt("on-click-outside");return ne((N(),D("div",{class:$(u.$style.container),style:ie(h.value)},[C("div",{class:$(u.$style.title)},G(l.value),3),C("ul",{class:$(u.$style.options)},[(N(!0),D(Xe,null,Ze(r.value,w=>(N(),D("li",{key:w.key,class:$({[u.$style.option]:!0,[u.$style.disabled]:w.disabled}),onClick:S=>p(w.key)},[C("div",{class:$(u.$style.icon)},G(w.icon),3),C("div",{class:$(u.$style.label)},G(w.label),3)],10,ii))),128))],2)],6)),[[m,c]])}}}),ai="_container_1bss5_1",di="_title_1bss5_33",li="_options_1bss5_39",ci="_option_1bss5_39",ui="_disabled_1bss5_57",hi={container:ai,title:di,options:li,option:ci,disabled:ui},pi={$style:hi},fi=ke(ri,[["__cssModules",pi]]);function wi(e,t={}){const o=we(),s=j([0,0]),n=Se();function i(d){const h=o.nodeViewOffsetPosition,[c,p]=Ye(d),u=h[0]+(c-s.value[0]),f=h[1]+(p-s.value[1]);return o.nodeViewOffsetPosition=[u,f],s.value=[c,p],[u,f]}function a(d,h){if(!(n.isCtrlKeyPressed(d)||h)||o.isActionActive("dragActive"))return;d.button!==Uo.MIDDLE&&(o.nodeViewMoveInProgress=!0);const[c,p]=Ye(d);s.value=[c,p];const u=se(e);u==null||u.addEventListener("mousemove",r)}function l(){if(!o.nodeViewMoveInProgress)return;const d=se(e);d==null||d.removeEventListener("mousemove",r),o.nodeViewMoveInProgress=!1}function r(d){const h=se(e);if(!(d.target&&!(h===d.target||h!=null&&h.contains(d.target)))&&!o.isActionActive("dragActive")){if(d instanceof MouseEvent&&d.buttons===xt.MIDDLE&&(o.nodeViewMoveInProgress=!0),d instanceof MouseEvent&&d.buttons===xt.NONE){const c=se(t.onMouseMoveEnd);c==null||c(d);return}i(d)}}return{moveLastPosition:s,onMouseDown:a,onMouseUp:l,onMouseMove:r,panCanvas:i}}const mi=St(async()=>await vt(()=>import("./NodeCreation-BF_L2-99.js").then(e=>e.N),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),gi=St(async()=>await vt(()=>import("./CanvasControls-3FMjwMqA.js"),__vite__mapDeps([34,9,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,35]))),vi=St(async()=>await vt(()=>import("./SetupWorkflowCredentialsButton-B3HZvKQp.js"),__vite__mapDeps([36,8,5,9,1,2,3,4,6,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))),yi=be({name:"NodeView",components:{NodeDetailsView:tn,Node:Un,Sticky:Jn,CanvasAddButton:ni,KeyboardShortcutTooltip:Ho,NodeCreation:mi,CanvasControls:gi,ContextMenu:wn,SetupWorkflowCredentialsButton:vi,NextStepPopup:fi},async beforeRouteLeave(e,t,o){if(He(e)===De.EXECUTIONS||t.name===B.TEMPLATE_IMPORT||He(e)===De.WORKFLOW&&t.name===B.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const s=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});s===Fe?(this.workflowsStore.setWorkflowId(Oe),await this.workflowHelpers.saveCurrentWorkflow({},!1)&&await this.npsSurveyStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===B.NEW_WORKFLOW?(await this.$router.replace({name:B.WORKFLOW,params:{name:this.currentWorkflow}}),await this.$router.push(e)):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):s===Mt&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Oe),this.resetWorkspace(),this.uiStore.stateIsDirty=!1,o())}else this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o()},setup(){const e=j(null),t=j(null),o=j(null),s=Zs(),n=Je(),i=no(),a=Qe(),l=$e(),r=Fs(),d=oo(),h=Fo(),{activeNode:c}=No(n),p=Re(c),u=Se(),{callDebounced:f}=so(),m=wi(e,{onMouseMoveEnd:o}),w=jo({router:s}),{runWorkflow:S,stopCurrentExecution:k}=Ko({router:s});return{locale:a,contextMenu:l,dataSchema:r,nodeHelpers:d,externalHooks:i,clipboard:h,pinnedData:p,deviceSupport:u,canvasPanning:m,nodeViewRootRef:e,nodeViewRef:t,onMouseMoveEnd:o,workflowHelpers:w,runWorkflow:S,stopCurrentExecution:k,callDebounced:f,...dn(),...zo(),...qo(),...io(),...Go(),...ln(),...en()}},data(){return{GRID_SIZE:Me,STICKY_NODE_TYPE:oe,createNodeActive:!1,lastClickPosition:[450,450],ctrlKeyPressed:!1,moveCanvasKeyPressed:!1,stopExecutionInProgress:!1,blankRedirect:!1,pullConnActive:!1,dropPrevented:!1,connectionDragScope:{type:null,connection:null},renamingActive:!1,showStickyButton:!1,isExecutionPreview:!1,showTriggerMissingTooltip:!1,workflowData:null,activeConnection:null,enterTimer:void 0,exitTimer:void 0,readOnlyNotification:null,suspendRecordingDetachedConnections:!1,NODE_CREATOR_OPEN_SOURCES:K,eventsAttached:!1,unloadTimeout:void 0,canOpenNDV:!0,hideNodeIssues:!1}},computed:{...yt(et,rs,is,gt,Te,Je,ns,ss,os,we,ue,ts,gt,es,Qo,Nt,Zo,rn,nn,eo,Xo,Jo,ao,Yo),nativelyNumberSuffixedDefaults(){return this.nodeTypesStore.nativelyNumberSuffixedDefaults},currentUser(){return this.usersStore.currentUser},activeNode(){return this.ndvStore.activeNode},executionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},isDemo(){return this.$route.name===B.DEMO},showCanvasAddButton(){return!this.isLoading&&!this.containsTrigger&&!this.isDemo&&!this.readOnlyEnv},lastSelectedNode(){return this.uiStore.getLastSelectedNode},nodes(){return this.workflowsStore.allNodes},nodesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type!==oe)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===oe)},runButtonText(){return this.workflowRunning?this.executionWaitingForWebhook?this.$locale.baseText("nodeView.runButtonText.waitingForTriggerEvent"):this.$locale.baseText("nodeView.runButtonText.executingWorkflow"):this.$locale.baseText("nodeView.runButtonText.executeWorkflow")},workflowStyle(){const e=this.uiStore.nodeViewOffsetPosition;return{left:e[0]+"px",top:e[1]+"px"}},canvasAddButtonStyle(){return{"pointer-events":this.createNodeActive?"none":"all"}},backgroundStyle(){return as(this.nodeViewScale,this.uiStore.nodeViewOffsetPosition,this.isExecutionPreview)},workflowClasses(){const e=[];return(this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&(this.uiStore.nodeViewMoveInProgress?e.push("move-in-process"):e.push("move-active")),(this.selectActive||this.ctrlKeyPressed||this.moveCanvasKeyPressed)&&e.push("do-not-select"),this.connectionDragScope.type&&(e.push("connection-drag-scope-active"),e.push(`connection-drag-scope-active-type-${this.connectionDragScope.type}`),e.push(`connection-drag-scope-active-connection-${this.connectionDragScope.connection}`)),e},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){var e;return((e=this.$route.params.name)==null?void 0:e.toString())||this.workflowsStore.workflowId},workflowName(){return this.workflowsStore.workflowName},allTriggersDisabled(){return this.triggerNodes.filter(t=>t.disabled).length===this.triggerNodes.length},triggerNodes(){return this.nodes.filter(e=>e.type===ds||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!this.executionWaitingForWebhook&&!!this.nodes.find(e=>[ls,lt].includes(e.type)&&e.disabled!==!0)},isManualChatOnly(){return this.canvasChatNode?this.containsChatNodes&&this.triggerNodes.length===1&&!this.pinnedChatNodeData:!1},canvasChatNode(){return this.nodes.find(e=>e.type===lt)},pinnedChatNodeData(){return this.canvasChatNode?this.workflowsStore.pinDataByNodeName(this.canvasChatNode.name):null},isExecutionDisabled(){return this.containsChatNodes&&this.triggerNodes.every(e=>e.disabled||e.type===lt)&&!this.pinnedChatNodeData?!0:!this.containsTrigger||this.allTriggersDisabled},getNodeViewOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},nodeViewScale(){return this.canvasStore.nodeViewScale},instance(){return this.canvasStore.jsPlumbInstance},isLoading(){return this.canvasStore.isLoading},currentWorkflowObject(){return this.workflowsStore.getCurrentWorkflow()},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},isReadOnlyRoute(){var e,t;return((t=(e=this.$route)==null?void 0:e.meta)==null?void 0:t.readOnlyCanvas)===!0},isNextStepPopupVisible(){return this.aiStore.nextStepPopupConfig.open},shouldShowNextStepDialog(){const e=mt(js).value==="true",t=this.aiStore.isAssistantExperimentEnabled;return this.settingsStore.isCloudDeployment&&t&&!e},isProductionExecutionPreview(){return this.nodeHelpers.isProductionExecutionPreview.value}},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=He(e),s=!this.uiStore.nodeViewInitialized;let n=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Oe)&&t.name!==B.NEW_WORKFLOW&&e.params.action!=="workflowSave";const i=e.name===B.TEMPLATE_IMPORT;if(o===De.WORKFLOW||i){if(n||s||i){if(this.canvasStore.startLoading(),s){const a=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=a}await this.initView(),this.canvasStore.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===De.EXECUTIONS&&(n=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),n&&(this.uiStore.nodeViewInitialized=!1))},activeNode(){this.createNodeActive=!1},containsTrigger(e){e===!1&&this.canvasStore.setRecenteredCanvasAddButtonPosition(this.getNodeViewOffsetPosition)},nodeViewScale(e){const t=this.nodeViewRef;t&&(t.style.transform=`scale(${e})`)}},errorCaptured:e=>{console.error("errorCaptured"),console.error(e)},async mounted(){var t;if(this.onMouseMoveEnd=this.mouseUp,this.resetWorkspace(),!this.nodeViewRef){this.showError(new Error("NodeView reference not found"),this.$locale.baseText("nodeView.showError.mounted1.title"),this.$locale.baseText("nodeView.showError.mounted1.message")+":");return}this.canvasStore.initInstance(this.nodeViewRef),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.clipboard.onPaste.value=this.onClipboardPasteEvent,this.canvasStore.startLoading();const e=(()=>{if(this.settingsStore.isPreviewMode&&this.isDemo)return[];const o=[this.loadActiveWorkflows(),this.loadCredentialTypes()];return this.settingsStore.isEnterpriseFeatureEnabled(ct.Variables)&&o.push(this.loadVariables()),this.settingsStore.isEnterpriseFeatureEnabled(ct.ExternalSecrets)&&o.push(this.loadSecrets()),o})();this.nodeTypesStore.allNodeTypes.length===0&&e.push(this.loadNodeTypes());try{await Promise.all(e)}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted1.title"),this.$locale.baseText("nodeView.showError.mounted1.message")+":");return}if(an(async()=>{try{try{this.bindCanvasEvents()}catch{}await this.initView(),window.parent&&window.parent.postMessage(JSON.stringify({command:"n8nReady",version:this.rootStore.versionCli}),"*")}catch(o){this.showError(o,this.$locale.baseText("nodeView.showError.mounted2.title"),this.$locale.baseText("nodeView.showError.mounted2.message")+":")}this.canvasStore.stopLoading(),setTimeout(()=>{this.usersStore.showPersonalizationSurvey(),this.nodeHelpers.addPinDataConnections(this.workflowsStore.pinnedWorkflowData)},0)}),this.externalHooks.run("nodeView.mount").catch(()=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&cs(this.currentUser)<=us){const o=await this.uiStore.getNextOnboardingPrompt(),s=(o==null?void 0:o.toast_sequence_number)===1?hs:1e3;o!=null&&o.title&&(o!=null&&o.description)&&setTimeout(async()=>{this.showToast({type:"info",title:o.title,message:o.description,duration:0,customClass:"clickable",closeOnClick:!0,onClick:()=>{this.$telemetry.track("user clicked onboarding toast",{seq_num:o.toast_sequence_number,title:o.title,description:o.description}),this.uiStore.openModal(ps)}})},s)}_t.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:this.openSelectiveNodeCreator}),this.registerCustomAction({key:"showNodeCreator",action:()=>{this.ndvStore.activeNodeName=null,this.$nextTick(()=>{this.showTriggerCreator(K.TAB)})}}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(K.TRIGGER_PLACEHOLDER_BUTTON),this.uiStore.addFirstStepOnLoad=!1,this.bindCanvasEvents(),document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("message",this.onPostMessageReceived),window.addEventListener("pageshow",this.onPageShow),z.on("newWorkflow",this.newWorkflow),z.on("importWorkflowData",this.onImportWorkflowDataEvent),z.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),z.on("openChat",this.onOpenChat),q.on("nodeMove",this.onMoveNode),q.on("revertAddNode",this.onRevertAddNode),q.on("revertRemoveNode",this.onRevertRemoveNode),q.on("revertAddConnection",this.onRevertAddConnection),q.on("revertRemoveConnection",this.onRevertRemoveConnection),q.on("revertRenameNode",this.onRevertNameChange),q.on("enableNodeToggle",this.onRevertEnableToggle),je.on("pin-data",this.nodeHelpers.addPinDataConnections),je.on("unpin-data",this.nodeHelpers.removePinDataConnections),z.on("saveWorkflow",this.saveCurrentWorkflowExternal),this.canvasStore.isDemo=this.isDemo},deactivated(){this.unbindCanvasEvents(),document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),window.removeEventListener("message",this.onPostMessageReceived),window.removeEventListener("beforeunload",this.onBeforeUnload),window.removeEventListener("pageshow",this.onPageShow),z.off("newWorkflow",this.newWorkflow),z.off("importWorkflowData",this.onImportWorkflowDataEvent),z.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),z.off("openChat",this.onOpenChat),q.off("nodeMove",this.onMoveNode),q.off("revertAddNode",this.onRevertAddNode),q.off("revertRemoveNode",this.onRevertRemoveNode),q.off("revertAddConnection",this.onRevertAddConnection),q.off("revertRemoveConnection",this.onRevertRemoveConnection),q.off("revertRenameNode",this.onRevertNameChange),q.off("enableNodeToggle",this.onRevertEnableToggle),je.off("pin-data",this.nodeHelpers.addPinDataConnections),je.off("unpin-data",this.nodeHelpers.removePinDataConnections),z.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect(),this.collaborationStore.initialize()},beforeUnmount(){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp),this.unregisterCustomAction("showNodeCreator"),this.unregisterCustomAction("openNodeDetail"),this.unregisterCustomAction("openSelectiveNodeCreator"),this.isDemo||this.pushStore.pushDisconnect(),this.collaborationStore.terminate(),this.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,this.workflowsStore.resetChatMessages(),window.removeEventListener("message",this.onPostMessageReceived),z.off("newWorkflow",this.newWorkflow),z.off("importWorkflowData",this.onImportWorkflowDataEvent),z.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Oe),_t.off("pull",this.onSourceControlPull)},methods:{async openSelectiveNodeCreator({connectiontype:e,node:t,creatorview:o}){const s=t??this.ndvStore.activeNodeName,n=s?this.workflowsStore.getNodeByName(s):null;this.ndvStore.activeNodeName=null,await this.redrawNode(t),setTimeout(()=>{o?this.onToggleNodeCreator({createNodeActive:!0,nodeCreatorView:o}):e&&n&&this.insertNodeAfterSelected({index:0,endpointUuid:`${n.id}-input${e}0`,eventSource:K.NOTICE_ERROR_MESSAGE,outputType:e,sourceId:n.id})})},editAllowedCheck(){return this.readOnlyNotification?!1:this.isReadOnlyRoute||this.readOnlyEnv?(this.readOnlyNotification=this.showMessage({title:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.title`:"readOnly.showMessage.executions.title"),message:this.$locale.baseText(this.readOnlyEnv?`readOnlyEnv.showMessage.${this.isReadOnlyRoute?"executions":"workflows"}.message`:"readOnly.showMessage.executions.message"),type:"info",dangerouslyUseHTMLString:!0,onClose:()=>{this.readOnlyNotification=null}}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),s={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",push_ref:this.ndvStore.pushRef};this.$telemetry.track("User clicked execute node button",s),this.externalHooks.run("nodeView.onRunNode",s),this.runWorkflow({destinationNode:e,source:t})},async onOpenChat(){const e={workflow_id:this.workflowsStore.workflowId};this.$telemetry.track("User clicked chat open button",e),this.externalHooks.run("nodeView.onOpenChat",e),this.uiStore.openModal(fs)},async onRunWorkflow(){this.workflowHelpers.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(it(e,this.workflowHelpers.getNodeTypes(),{isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph)};this.$telemetry.track("User clicked execute workflow button",t),this.externalHooks.run("nodeView.onRunWorkflow",t)}),await this.runWorkflow({}),this.refreshEndpointsErrorsState()},resetEndpointsErrors(){Object.values(this.instance.getManagedElements()).flatMap(t=>t.endpoints).filter(t=>(t==null?void 0:t.endpoint.type)===ws).forEach(t=>{const o=t==null?void 0:t.endpoint;o&&((t==null?void 0:t.connections)??[]).length>0&&o.resetError()})},refreshEndpointsErrorsState(){const e=this.workflowsStore.allNodes.filter(t=>t.issues);this.resetEndpointsErrors(),e.forEach(t=>{var n;const o=this.instance.getManagedElement(t.id),s=this.instance.getEndpoints(o);Object.keys(((n=t==null?void 0:t.issues)==null?void 0:n.input)??{}).forEach(i=>{s.filter(l=>l._defaultType.scope===i).forEach(l=>{const r=l==null?void 0:l.endpoint;r&&r.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst"),t=this.showMessage({type:"info",title:this.$locale.baseText("nodeView.cantExecuteNoTrigger"),message:e,duration:3e3,onClick:()=>setTimeout(()=>{this.createNodeActive&&t.close()},0),dangerouslyUseHTMLString:!0})},clearExecutionData(){this.workflowsStore.workflowExecutionData=null,this.nodeHelpers.updateNodesExecutionIssues()},async onSaveKeyboardShortcut(e){let t=await this.workflowHelpers.saveCurrentWorkflow();t&&(await this.npsSurveyStore.fetchPromptsData(),this.$route.name===B.EXECUTION_DEBUG&&await this.$router.replace({name:B.WORKFLOW,params:{name:this.currentWorkflow}})),this.activeNode&&(e.target instanceof HTMLInputElement?t=e.target.readOnly:t=!0,t&&this.showMessage({title:this.$locale.baseText("generic.workflowSaved"),type:"success"}))},async onCanvasAddButtonCLick(e){if(e){if(this.shouldShowNextStepDialog){const t=e.target.closest("button");t&&(this.aiStore.latestConnectionInfo=null,this.aiStore.openNextStepPopup(this.$locale.baseText("nextStepPopup.title.firstStep"),t));return}this.showTriggerCreator(K.TRIGGER_PLACEHOLDER_BUTTON);return}},onNextStepSelected(e){if(e==="choose"){const t=this.aiStore.latestConnectionInfo;t===null?this.showTriggerCreator(K.TRIGGER_PLACEHOLDER_BUTTON):this.insertNodeAfterSelected(t)}},showTriggerCreator(e){this.createNodeActive||(this.ndvStore.activeNodeName=null,this.nodeCreatorStore.setSelectedView(ut),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0,nodeCreatorView:ut}))},async openExecution(e){var o,s;this.canvasStore.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(n){this.showError(n,this.$locale.baseText("nodeView.showError.openExecution.title"));return}if(t===void 0)throw new Error(`Execution with id "${e}" could not be found!`);if(this.workflowsStore.setWorkflowName({newName:t.workflowData.name,setStateDirty:!1}),this.workflowsStore.setWorkflowId(Oe),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.sharedWithProjects&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWithProjects:t.workflowData.sharedWithProjects}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.nodeHelpers.addNodes(rt(t.workflowData.nodes),rt(t.workflowData.connections)),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!1,this.externalHooks.run("execution.open",{workflowId:t.workflowData.id,workflowName:t.workflowData.name,executionId:e}),this.$telemetry.track("User opened read-only execution",{workflow_id:t.workflowData.id,execution_mode:t.mode,execution_finished:t.finished}),!t.finished&&((s=(o=t.data)==null?void 0:o.resultData)!=null&&s.error)){let n=!1;if(t.data.resultData.runData){const i=t.data.resultData.runData;e:for(const a of Object.keys(i))for(const l of i[a])if(l.error){n=!0;break e}}!n&&(t.data.resultData.error.stack||t.data.resultData.error.message)&&(console.error(`Execution ${e} error:`),console.error(t.data.resultData.error.stack),this.showMessage({title:this.$locale.baseText("nodeView.showError.workflowError"),message:t.data.resultData.error.message,type:"error",duration:0}))}t.waitTill&&this.showMessage({title:this.$locale.baseText("nodeView.thisExecutionHasntFinishedYet"),message:`<a data-action="reload">${this.$locale.baseText("nodeView.refresh")}</a> ${this.$locale.baseText("nodeView.toSeeTheLatestStatus")}.<br/> <a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.wait/" target="_blank">${this.$locale.baseText("nodeView.moreInfo")}</a>`,type:"warning",duration:0}),this.canvasStore.stopLoading()},async importWorkflowExact(e){if(!e.workflow.nodes||!e.workflow.connections)throw new Error("Invalid workflow object");this.resetWorkspace(),e.workflow.nodes=ms(e.workflow.nodes),await this.nodeHelpers.addNodes(e.workflow.nodes,e.workflow.connections),e.workflow.pinData&&this.workflowsStore.setWorkflowPinData(e.workflow.pinData),await this.$nextTick(),this.canvasStore.zoomToFit()},async openWorkflowTemplate(e){this.canvasStore.startLoading(),this.canvasStore.setLoadingText(this.$locale.baseText("nodeView.loadingTemplate")),this.resetWorkspace(),this.workflowsStore.currentWorkflowExecutions=[],this.executionsStore.activeExecution=null;let t;try{if(this.externalHooks.run("template.requested",{templateId:e}),t=await this.templatesStore.getFixedWorkflowTemplate(e),!t)throw new Error(this.$locale.baseText("nodeView.workflowTemplateWithIdCouldNotBeFound",{interpolate:{templateId:e}}))}catch(s){this.showError(s,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:B.NEW_WORKFLOW});return}this.$telemetry.track("User inserted workflow template",{source:"workflow",template_id:gs(e),wf_template_repo_session_id:this.templatesStore.previousSessionId},{withPostHog:!0}),this.blankRedirect=!0,await this.$router.replace({name:B.NEW_WORKFLOW,query:{templateId:e}});const o=t.workflow.nodes.map(this.workflowsStore.convertTemplateNodeToNodeUi);await this.nodeHelpers.addNodes(o,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name,this.projectsStore.currentProjectId)||{},this.workflowsStore.addToWorkflowMetadata({templateId:e}),await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!0,this.externalHooks.run("template.open",{templateId:e,templateName:t.name,workflow:t.workflow}),this.canvasStore.stopLoading()},async openWorkflow(e){this.canvasStore.startLoading();const t=this.executionsStore.activeExecution;this.resetWorkspace(),await this.workflowHelpers.initState(e),e.sharedWithProjects&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWithProjects:e.sharedWithProjects}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials),await this.nodeHelpers.addNodes(e.nodes,e.connections),this.nodeHelpers.credentialsUpdated.value||(this.uiStore.stateIsDirty=!1),this.canvasStore.zoomToFit(),this.externalHooks.run("workflow.open",{workflowId:e.id,workflowName:e.name}),(t==null?void 0:t.workflowId)!==e.id?(this.executionsStore.activeExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.executionsStore.activeExecution=t,this.canvasStore.stopLoading(),this.collaborationStore.notifyWorkflowOpened(e.id)},touchTap(e){this.deviceSupport.isTouchDevice&&this.mouseDown(e)},mouseDown(e){this.lastClickPosition=this.getMousePositionWithinNodeView(e),e instanceof MouseEvent&&e.button===1&&(this.aiStore.closeNextStepPopup(),this.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.canvasPanning.onMouseDown(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e instanceof MouseEvent&&e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.canvasPanning.onMouseUp()},keyUp(e){e.key===this.deviceSupport.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){this.contextMenu.close(),this.aiStore.closeNextStepPopup();const t=this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,o=e.shiftKey&&!e.altKey&&!this.deviceSupport.isCtrlKeyPressed(e),s=this.deviceSupport.isCtrlKeyPressed(e)&&e.altKey&&!e.shiftKey,n=!this.deviceSupport.isCtrlKeyPressed(e)&&!e.shiftKey&&!e.altKey,i=this.isReadOnlyRoute||this.readOnlyEnv;if(e.key==="s"&&t&&!i){e.stopPropagation(),e.preventDefault();const r=!this.uiStore.stateIsDirty;if(this.isReadOnlyRoute||this.readOnlyEnv||r)return;this.callDebounced(this.onSaveKeyboardShortcut,{debounceTime:1e3},e);return}const a=(e==null?void 0:e.composedPath())??[];for(const r of a)if(r instanceof HTMLElement&&r.className&&typeof r.className=="string"&&r.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"&&n){this.createNodeActive=!1,this.activeNode&&(this.externalHooks.run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const l=this.uiStore.getSelectedNodes.map(r=>r&&this.workflowsStore.getNodeByName(r.name)).filter(r=>!!r);if(e.key==="d"&&n&&!i)this.callDebounced(this.toggleActivationNodes,{debounceTime:350},l);else if(e.key==="d"&&t&&!i)l.length>0&&(e.preventDefault(),this.duplicateNodes(l));else if(e.key==="p"&&n&&!i)l.length>0&&(e.preventDefault(),this.togglePinNodes(l,"keyboard-shortcut"));else if((e.key==="Delete"||e.key==="Backspace")&&n&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.deleteNodes,{debounceTime:500},l);else if(e.key==="Tab"&&n&&!i)this.onToggleNodeCreator({source:K.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&t&&!i&&!this.isExecutionDisabled)this.onRunWorkflow();else if(e.key==="S"&&o&&!i)this.onAddNodes({nodes:[{type:oe}],connections:[]});else if(e.key===this.deviceSupport.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&n&&!i){const r=this.lastSelectedNode;r!==null&&r.type!==oe&&this.callDebounced(this.renameNodePrompt,{debounceTime:1500},r.name)}else if(e.key==="a"&&t)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectAllNodes,{debounceTime:1e3});else if(e.key==="c"&&t)this.callDebounced(this.copyNodes,{debounceTime:1e3},l);else if(e.key==="x"&&t&&!i)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.cutNodes,{debounceTime:1e3},l);else if(e.key==="n"&&s){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.value.name===B.NEW_WORKFLOW?z.emit("newWorkflow"):this.$router.push({name:B.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"&&n){const r=this.lastSelectedNode;if(r!==null){if(r.type===oe&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=r.name}}else if(e.key==="ArrowRight"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectDownstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowRight"&&n){const r=this.lastSelectedNode;if(r===null)return;const d=this.workflowsStore.outgoingConnectionsByNodeName(r.name);if(d.main===void 0||d.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},d.main[0][0].node,!1,!0)}else if(e.key==="ArrowLeft"&&o)e.stopPropagation(),e.preventDefault(),this.callDebounced(this.selectUpstreamNodes,{debounceTime:1e3});else if(e.key==="ArrowLeft"&&n){const r=this.lastSelectedNode;if(r===null)return;const d=this.workflowHelpers.getCurrentWorkflow();if(!d.connectionsByDestinationNode.hasOwnProperty(r.name))return;const h=d.connectionsByDestinationNode[r.name];if(h.main===void 0||h.main.length===0)return;this.callDebounced(this.nodeSelectedByName,{debounceTime:100},h.main[0][0].node,!1,!0)}else if(["ArrowUp","ArrowDown"].includes(e.key)&&n){const r=this.lastSelectedNode;if(r===null)return;const d=this.workflowHelpers.getCurrentWorkflow();if(!d.connectionsByDestinationNode.hasOwnProperty(r.name))return;const h=d.connectionsByDestinationNode[r.name];if(!Array.isArray(h.main)||!h.main.length)return;const c=h.main[0][0].node,p=this.workflowsStore.outgoingConnectionsByNodeName(c);if(!Array.isArray(p.main)||!p.main.length)return;let u,f=e.key==="ArrowUp"?-99999999:99999999,m=null;for(const w of p.main)for(const S of w)S.node!==r.name&&(u=this.workflowsStore.getNodeByName(S.node),u&&(e.key==="ArrowUp"?u.position[1]<=r.position[1]&&u.position[1]>f&&(m=u.name,f=u.position[1]):u.position[1]>=r.position[1]&&u.position[1]<f&&(m=u.name,f=u.position[1])));m!==null&&this.callDebounced(this.nodeSelectedByName,{debounceTime:100},m,!1,!0)}},toggleActivationNodes(e){this.editAllowedCheck()&&this.nodeHelpers.disableNodes(e,!0)},togglePinNodes(e,t){if(!this.editAllowedCheck())return;this.historyStore.startRecordingUndo();const o=e.some(s=>!this.workflowsStore.pinDataByNodeName(s.name));for(const s of e){const n=Re(s);if(o){const i=this.dataSchema.getInputDataWithPinned(s);i.length!==0&&n.setData(i,t)}else n.unsetData(t)}this.historyStore.stopRecordingUndo()},deleteNodes(e){this.historyStore.startRecordingUndo(),e.forEach(t=>{this.removeNode(t.name,!0,!1)}),setTimeout(()=>{this.historyStore.stopRecordingUndo()},200)},selectAllNodes(){this.nodes.forEach(e=>{this.nodeSelectedByName(e.name)})},selectUpstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("upstream",t,e.name);for(const s of o)this.nodeSelectedByName(s);this.nodeSelectedByName(e.name)},selectDownstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.workflowHelpers.getCurrentWorkflow(),o=this.workflowHelpers.getConnectedNodes("downstream",t,e.name);for(const s of o)this.nodeSelectedByName(s);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const s=this.workflowsStore.nodesByName[e],n=this.workflowHelpers.getCurrentWorkflow(),i=this.workflowHelpers.getConnectedNodes("downstream",n,e);for(const a of i){const l=this.workflowsStore.nodesByName[a],r=l.position;if(l.position[0]<s.position[0])continue;const d={name:a,properties:{position:[l.position[0]+t,l.position[1]]}};this.workflowsStore.updateNodeProperties(d),this.onNodeMoved(l),(o&&r[0]!==d.properties.position[0]||r[1]!==d.properties.position[1])&&this.historyStore.pushCommandToUndo(new vs(a,r,d.properties.position),o)}},cutNodes(e){const t=!this.isReadOnlyRoute&&!this.readOnlyEnv;this.copyNodes(e,t),t&&this.deleteNodes(e)},copyNodes(e,t=!1){this.getNodesToSave(e).then(o=>{const s={meta:{...this.workflowsStore.workflow.meta,instanceId:this.rootStore.instanceId},...o};delete s.meta.templateCredsSetupCompleted,this.workflowHelpers.removeForeignCredentialsFromWorkflow(s,this.credentialsStore.allCredentials);const n=JSON.stringify(s,null,2);this.clipboard.copy(n),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(i=>i.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.executionsStore.stopCurrentExecution(e)}catch(t){const o=await this.workflowsStore.getExecution(e);if(o===void 0)this.workflowsStore.finishActiveExecution({executionId:e,data:{finished:!0,stoppedAt:new Date}}),this.workflowsStore.executingNode.length=0,this.uiStore.removeActiveAction("workflowRunning"),this.titleSet(this.workflowsStore.workflowName,"IDLE"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.unsaved.message"),type:"success"});else if(o!=null&&o.finished){const s={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},n={data:s,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(n),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(s),this.uiStore.removeActiveAction("workflowRunning"),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.title"),message:this.$locale.baseText("nodeView.showMessage.stopExecutionCatch.message"),type:"success"})}else this.showError(t,this.$locale.baseText("nodeView.showError.stopExecution.title"))}this.stopExecutionInProgress=!1,this.workflowHelpers.getWorkflowDataToSave().then(t=>{const o={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(it(t,this.workflowHelpers.getNodeTypes(),{isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph)};this.$telemetry.track("User clicked stop workflow execution",o)})}},async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("nodeView.showError.stopWaitingForWebhook.title"));return}},async onClipboardPasteEvent(e){if(this.readOnlyEnv)return;if(He(this.$route)===De.WORKFLOW){let o;if(!this.editAllowedCheck())return;if(e.match(/^http[s]?:\/\/.*\.json$/i)){if(!this.editAllowedCheck()||await this.confirm(this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.message",{interpolate:{plainTextData:e}}),this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.headline"),{type:"warning",confirmButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.confirmButtonText"),cancelButtonText:this.$locale.baseText("nodeView.confirmMessage.onClipboardPasteEvent.cancelButtonText"),dangerouslyUseHTMLString:!0})!==Fe||(o=await this.getWorkflowDataFromUrl(e),o===void 0))return}else try{if(o=JSON.parse(e),!this.editAllowedCheck())return}catch{return}return o?await this.importWorkflowData(o,"paste",!1):void 0}},async getWorkflowDataFromUrl(e){let t;this.canvasStore.startLoading();try{t=await this.workflowsStore.getWorkflowFromUrl(e)}catch(o){this.canvasStore.stopLoading(),this.showError(o,this.$locale.baseText("nodeView.showError.getWorkflowDataFromUrl.title"));return}return this.canvasStore.stopLoading(),t},async importWorkflowData(e,t,o=!0){if(!(!e.hasOwnProperty("nodes")||!e.hasOwnProperty("connections")))try{const s={};if(e.nodes){const r=e.nodes.map(d=>d.name);e.nodes.forEach(d=>{if(!d.name){const h=this.nodeTypesStore.getNodeType(d.type),c=this.uniqueNodeName((h==null?void 0:h.displayName)??d.type,r);d.name=c,r.push(c)}if(d.webhookId&&ys.includes(d.type)&&Object.values(this.workflowHelpers.getCurrentWorkflow().nodes).some(c=>c.webhookId===d.webhookId)&&(d.webhookId=ye()),d.id){const h=ye();s[h]=d.id,d.id=h}else d.id=ye()})}this.removeUnknownCredentials(e);const n=this.rootStore.instanceId,i=JSON.stringify(it(e,this.workflowHelpers.getNodeTypes(),{nodeIdMap:s,sourceInstanceId:e.meta&&e.meta.instanceId!==n?e.meta.instanceId:"",isCloudDeployment:this.settingsStore.isCloudDeployment}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:i}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:i}),this.deselectAllNodes(),this.workflowHelpers.updateNodePositions(e,ve(this.nodes,this.lastClickPosition));const a=await this.addNodesToWorkflow(e);setTimeout(()=>{((a==null?void 0:a.nodes)??[]).forEach(r=>{this.nodeSelectedByName(r.name)})});const l=this.settingsStore.areTagsEnabled;if(o&&l&&Array.isArray(e.tags)){const r=await this.tagsStore.fetchAll(),d=new Set(r.map(f=>f.name)),h=e.tags,c=h.filter(f=>!d.has(f.name)),p=[];for(const f of c){const m=this.tagsStore.create(f.name).then(w=>(r.push(w),w));p.push(m)}await Promise.all(p);const u=h.reduce((f,m)=>{const w=r.find(S=>S.name===m.name);return w&&f.push(w.id),f},[]);this.workflowsStore.addWorkflowTagIds(u),setTimeout(()=>{this.nodeHelpers.addPinDataConnections(this.workflowsStore.pinnedWorkflowData)})}}catch(s){this.showError(s,this.$locale.baseText("nodeView.showError.importWorkflowData.title"))}},removeUnknownCredentials(e){if(e!=null&&e.nodes){for(const t of e.nodes)if(t.credentials)for(const[o,s]of Object.entries(t.credentials))typeof s=="string"||s.id===null||this.credentialsStore.getCredentialById(s.id)||delete t.credentials[o]}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=go(e.dataTransfer.getData(Ns));if(t){const o=this.getMousePositionWithinNodeView(e),s=[o[0]-Ie/2+Me,o[1]-Ie/2];await this.onAddNodes(t,!0,s),this.createNodeActive=!1}},nodeDeselectedByName(e){const t=this.workflowsStore.getNodeByName(e);t&&this.nodeDeselected(t)},nodeSelectedByName(e,t=!1,o){o===!0&&this.deselectAllNodes();const s=this.workflowsStore.getNodeByName(e);s&&(this.nodeSelected(s),this.uiStore.lastSelectedNode=s.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.newNodeInsertPosition=null,this.canvasStore.setLastSelectedConnection(void 0),t&&(this.ndvStore.activeNodeName=s.name))},showMaxNodeTypeError(e){const t=e.maxNodes;this.showMessage({title:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.title"),message:this.$locale.baseText("nodeView.showMessage.showMaxNodeTypeError.message",{adjustToNumber:t,interpolate:{nodeTypeDataDisplayName:e.displayName}}),type:"error",duration:0})},async getNewNodeWithDefaultCredential(e,t){var i,a,l,r;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const s={id:ye(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},n=(i=e.credentials)==null?void 0:i.map(d=>this.credentialsStore.getUsableCredentialByType(d.name)).flat();if(n&&n.length===1){const d=n[0],h=this.credentialsStore.getCredentialById(d.id),c={id:h.id,name:h.name},p={[d.type]:c};await this.nodeHelpers.loadNodesProperties([s].map(m=>({name:m.type,version:m.typeVersion})));const u=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),f=vo((u==null?void 0:u.properties)||[],{},!0,!1,s);if(e.credentials){const m=e.credentials.find(S=>S.name===d.type);if((a=m==null?void 0:m.displayOptions)!=null&&a.hide)return s;const w=(l=m==null?void 0:m.displayOptions)==null?void 0:l.show;if(!w)return s.credentials=p,s;if(Object.keys(w).length===1&&w.authentication){s.credentials=p;let S={};for(const k of Object.keys(w)){if(f&&!f[k]){S={},s.credentials=void 0;break}const v=(r=w[k])==null?void 0:r[0];v&&typeof v=="string"&&(S[k]=v),s.parameters={...s.parameters,...S}}}}}return s},async injectNode(e,t={},o=!0,s=!1,n=!1){var d,h;const i=this.nodeTypesStore.getNodeType(e);if(i===null){this.showMessage({title:this.$locale.baseText("nodeView.showMessage.addNodeButton.title"),message:this.$locale.baseText("nodeView.showMessage.addNodeButton.message",{interpolate:{nodeTypeName:e}}),type:"error"});return}if(i.maxNodes!==void 0&&this.workflowHelpers.getNodeTypeCount(e)>=i.maxNodes){this.showMaxNodeTypeError(i);return}const a=await this.getNewNodeWithDefaultCredential(i,{name:t.name}),l=this.lastSelectedNode;if(t.position)a.position=ve(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(l){const c=this.canvasStore.lastSelectedConnection;if(c){const[p]=Ss(c);p<=ks&&this.pushDownstreamNodes(l.name,ht,s)}if(this.canvasStore.newNodeInsertPosition)a.position=ve(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+Me,this.canvasStore.newNodeInsertPosition[1]-Ie/2]),this.canvasStore.newNodeInsertPosition=null;else{let p=0;const u=this.workflowHelpers.getCurrentWorkflow();if(c){const k=this.nodeTypesStore.getNodeType(l.type,l.typeVersion);if(k){const v=[[-100,100],[-140,0,140],[-240,-100,100,240]],_=_e(u,l,k),re=fe(_).filter(y=>y===E.Main);if(re.length>1){const y=v[re.length-2],x=c.__meta?c.__meta.sourceOutputIndex:0;p=y[x]}}}let f=[];try{f=_e(u,a,i)}catch{}const m=fe(f),w=this.nodeTypesStore.getNodeType(l.type,l.typeVersion),S=u.getNode(l.name);if(!S||!w){console.error("Could not find last selected node or node type");return}if(m.length>0&&m.every(k=>k!==E.Main)){const k=pe(u,S,w),_=(fe(k)||[]).filter(V=>V!==E.Main).findIndex(V=>f[0]===V);a.position=ve(this.nodes,[l.position[0]+Ie/(Math.max(((d=w==null?void 0:w.inputs)==null?void 0:d.length)??1),1)*_,l.position[1]+ht],[100,0])}else{const k=pe(u,l,w),v=fe(k);let _=ht;v.find(V=>V!==E.Main)&&(_+=150),a.position=ve(this.nodes,[l.position[0]+_,l.position[1]+p],[100,0])}}}else{const c=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;a.position=ve(this.nodes,c)}const r=this.locale.localizeNodeName(a.name,a.type);if(a.name=this.uniqueNodeName(r),(h=i.webhooks)!=null&&h.length&&(a.webhookId=ye()),await this.nodeHelpers.addNodes([a],void 0,s),this.workflowsStore.setNodePristine(a.name,!0),this.uiStore.stateIsDirty=!0,e===oe)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.externalHooks.run("nodeView.addNodeButton",{nodeTypeName:e}),Ts().trackAddedTrigger(e);const c={node_type:e,node_version:a.typeVersion,is_auto_add:n,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};l&&(c.input_node_type=l.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",c)}return s&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(a.name,o&&e!==oe)})),a},getConnection(e,t,o,s,n){const i=this.workflowsStore.outgoingConnectionsByNodeName(e)[n];if(i){const a=i[t];if(a)return a.find(l=>l.node===o&&l.index===s)}},connectTwoNodes(e,t,o,s,n){this.uiStore.stateIsDirty=!0;const i=this.workflowsStore.getNodeByName(e),a=this.workflowsStore.getNodeByName(o);if(i&&a&&!this.checkNodeConnectionAllowed(i,a,n)||this.getConnection(e,t,o,s,n))return;const l=[{node:e,type:n,index:t},{node:o,type:n,index:s}];this.nodeHelpers.addConnection(l)},async addNode(e,t={},o=!0,s=!1,n=!1){var p;if(!this.editAllowedCheck())return;const i=this.lastSelectedNode,a=this.uiStore.lastSelectedNodeOutputIndex,l=this.uiStore.lastSelectedNodeEndpointUuid,r=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const d=await this.injectNode(e,t,o,s,n);if(!d)return;const h=a||0,c=l||"";if(l&&!n&&i){const u=this.instance.getEndpoint(l);if(u&&this.checkNodeConnectionAllowed(i,d,u.scope)){const f=u.scope,m=this.instance.getManagedElement(d.id),S=this.instance.getEndpoints(m).find(k=>k.scope===f&&u.parameters.connection!==k.parameters.connection);(p=this.instance)==null||p.connect({uuids:[c,(S==null?void 0:S.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(i&&!n){if(await this.$nextTick(),r!=null&&r.__meta){this.nodeHelpers.deleteJSPlumbConnection(r,s);const u=r.__meta.targetNodeName,f=r.__meta.targetOutputIndex;this.connectTwoNodes(d.name,0,u,f,E.Main)}this.connectTwoNodes(i.name,h,d.name,0,E.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const s=this.workflowHelpers.getCurrentWorkflow(),n=s.getNode(e);if(!n)return{nodes:[]};const i=this.nodeTypesStore.getNodeType(n==null?void 0:n.type,n.typeVersion);if(i){const l=pe(s,n,i).filter(r=>!(typeof r=="string"||r.type!==t||!r.filter));l.length&&(o=l[0].filter)}return o},insertNodeAfterSelected(e){var i,a,l;const t=e.outputType??E.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((a=(i=e.connection)==null?void 0:i.target.jtk)==null?void 0:a.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&this.canvasStore.setLastSelectedConnection(e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const s=((l=e.connection)==null?void 0:l.endpoints[0].parameters.connection)==="source";t!==E.Main&&yo.includes(t)&&sn().gotoCompatibleConnectionView(t,s,this.getNodeCreatorFilter(o.name,t)).catch(()=>{})},async onEventConnectionAbort(e){var t,o,s;try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.nodeHelpers.pullConnActiveNodeName.value){const r=this.workflowsStore.getNodeById(e.parameters.nodeId),d=e.parameters.type??E.Main,h=(t=e==null?void 0:e.connector)==null?void 0:t.overrideTargetEndpoint;if(r){const c=e.parameters.connection==="target",p=c?this.nodeHelpers.pullConnActiveNodeName.value:r.name,u=c?r.name:this.nodeHelpers.pullConnActiveNodeName.value,f=e.parameters.index;Rt(e),await this.$nextTick(),this.connectTwoNodes(p,f,u,((o=h==null?void 0:h.parameters)==null?void 0:o.index)??0,d),this.nodeHelpers.pullConnActiveNodeName.value=null,this.dropPrevented=!1}return}const n=`${e.parameters.nodeId}-output${e.parameters.index}`,i=e.instance.getEndpoint(n);if(!((s=i==null?void 0:i.endpoint)!=null&&s.canvas)||!this.shouldShowNextStepDialog){this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:K.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type});return}const a=i.endpoint.canvas,l=new MutationObserver(r=>{if(r.find(h=>{var p,u;const c=h.target;return Ke(c)&&((u=(p=c.jtk)==null?void 0:p.endpoint)==null?void 0:u.uuid)===i.uuid&&c.style.display==="block"})){const h={sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:K.NODE_CONNECTION_DROP,outputType:e.parameters.type,endpointUuid:i.uuid,stepName:i.__meta.nodeName};this.aiStore.latestConnectionInfo=h,this.aiStore.openNextStepPopup(this.$locale.baseText("nextStepPopup.title.nextStep"),a),l.disconnect();return}});l.observe(this.$refs.nodeViewRef,{attributes:!0,attributeFilter:["style"],subtree:!0})}catch(n){console.error(n)}},checkNodeConnectionAllowed(e,t,o){var n;const s=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((n=s==null?void 0:s.inputs)!=null&&n.length){const i=this.workflowHelpers.getCurrentWorkflow(),a=i.getNode(t.name);let l=[];s&&a&&(l=pe(i,a,s));for(const r of l||[])if(!(typeof r=="string"||r.type!==o||!r.filter)&&r.filter.nodes.length&&!r.filter.nodes.includes(e.type))return this.dropPrevented=!0,this.showToast({title:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.title"),message:this.$locale.baseText("nodeView.showError.nodeNodeCompatible.message",{interpolate:{sourceNodeName:e.name,targetNodeName:t.name}}),type:"error",duration:5e3}),!1}return!0},onInterceptBeforeDrop(e){try{let t,o;if(e.connection.endpoints[0].parameters.connection==="target"?(t=e.dropEndpoint.parameters,o=e.connection.endpoints[0].parameters):(t=e.connection.endpoints[0].parameters,o=e.dropEndpoint.parameters),t.type!==o.type||t.connection===o.connection)return this.dropPrevented=!0,!1;const s=this.workflowsStore.getNodeById(t.nodeId),n=this.workflowsStore.getNodeById(o.nodeId),i=(s==null?void 0:s.name)||"",a=(n==null?void 0:n.name)||"";return s&&n&&!this.checkNodeConnectionAllowed(s,n,o.type)?!1:this.getConnection(i,t.index,a,o.index,t.type)?(this.dropPrevented=!0,this.nodeHelpers.pullConnActiveNodeName.value=null,!1):!0}catch(t){return console.error(t),!0}},onEventConnection(e){var t,o;try{if(e.sourceEndpoint.parameters.connection==="target"){const r=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=r}const s=e.sourceEndpoint.parameters,n=e.targetEndpoint.parameters,i=(t=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:t.name,a=(o=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:o.name;if(i&&a&&(e.connection.__meta={sourceNodeName:i,sourceOutputIndex:s.index,targetNodeName:a,targetOutputIndex:n.index}),pt(e.connection),bs(e.targetEndpoint),!i||!a){console.error("Could not find source or target node name");return}const l=[{node:i,type:s.type,index:s.index},{node:a,type:n.type,index:n.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:l}),!this.isReadOnlyRoute&&!this.readOnlyEnv){Es(e.sourceEndpoint),Cs(e.connection,()=>{this.activeConnection=null,this.nodeHelpers.deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:s.index,connection:e.connection,eventSource:K.NODE_CONNECTION_ACTION})});const r=Ds(e.connection,Os);s.type!==E.Main&&(e.connection.setPaintStyle(Is(e.connection,e.sourceEndpoint.parameters.category)),r==null||r.setVisible(!1))}this.dropPrevented=!1,this.isLoading||(this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new As(l)),this.nodeHelpers.isInsertingNodes.value||(this.nodeHelpers.updateNodesInputIssues(),this.resetEndpointsErrors(),setTimeout(()=>{var r,d;Ps(e.source,e.target,(d=(r=e.connection)==null?void 0:r.connector)!=null&&d.hasOwnProperty("canvas")?e.connection.connector.canvas:void 0)},0)))}catch(s){console.error(s)}},onDragMove(){const e=this.nodes.length;this.callDebounced(this.updateConnectionsOverlays,{debounceTime:e>20?200:0})},updateConnectionsOverlays(){var e;(e=this.instance)==null||e.connections.forEach(t=>{Wt(t),$t(t),Object.values(t.overlays).forEach(o=>{var s;o.canvas&&((s=this.instance)==null||s.repaint(o.canvas))})})},isConnectionActive(e){var t,o;return!(e!=null&&e.id)||!((t=this.activeConnection)!=null&&t.id)?!1:((o=this.activeConnection)==null?void 0:o.id)===e.id},onConnectionMouseOver(e){try{if(this.exitTimer!==void 0&&(clearTimeout(this.exitTimer),this.exitTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??this.enterTimer??!e??this.isConnectionActive(e))return;this.enterTimer=setTimeout(()=>{this.activeConnection&&!this.isConnectionActive(e)&&Vt(this.activeConnection)&&ft(this.activeConnection),this.enterTimer=void 0,e&&(xs(e),this.activeConnection=e)},150)}catch(t){console.error(t)}},onConnectionMouseOut(e){try{if(this.exitTimer||(this.enterTimer&&(clearTimeout(this.enterTimer),this.enterTimer=void 0),this.isReadOnlyRoute??this.readOnlyEnv??!e??!this.isConnectionActive(e)))return;this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,e&&this.isConnectionActive(e)&&Vt(this.activeConnection)&&(ft(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Bt(e.connection);const s=e.connection.parameters,n=e.originalEndpoint.parameters,i=[{node:((t=this.workflowsStore.getNodeById(s.nodeId))==null?void 0:t.name)||"",type:s.type,index:s.index},{node:((o=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:o.name)||"",type:n.type,index:n.index}];this.nodeHelpers.removeConnection(i,!1)}catch(s){console.error(s)}},onEndpointMouseOver(e,t){!e.isTarget||t.target!==e.endpoint.canvas||this.instance.setHover(e,!0)},onEndpointMouseOut(e){e.isTarget&&this.instance.setHover(e,!1)},async onConnectionDetached(e){var t;try{if(e.sourceEndpoint.parameters.connection==="target"){const s=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=s}const o=Ms(e);if(Bt(e.targetEndpoint),_s(e.sourceEndpoint,e.connection),e.connection.removeOverlays(),this.nodeHelpers.removeConnectionByConnectionInfo(e,!1,!1),this.nodeHelpers.pullConnActiveNodeName.value){this.historyStore.startRecordingUndo();const s=this.workflowsStore.getNodeById(e.connection.parameters.nodeId);if(!s)throw new Error("Could not find source node");const n=s.name,i=e.connection.parameters.index,a=e.connection.connector.overrideTargetEndpoint;o&&this.historyStore.pushCommandToUndo(new Lt(o)),this.connectTwoNodes(n,i,this.nodeHelpers.pullConnActiveNodeName.value,((t=a==null?void 0:a.parameters)==null?void 0:t.index)??0,E.Main),this.nodeHelpers.pullConnActiveNodeName.value=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&o){const s=new Lt(o);this.historyStore.pushCommandToUndo(s)}this.nodeHelpers.updateNodesInputIssues()}catch(o){console.error(o)}},onConnectionDrag(e){var t;(t=e.overlays["midpoint-arrow"])==null||t.setVisible(!1);try{this.nodeHelpers.pullConnActiveNodeName.value=null,this.pullConnActive=!0,this.canvasStore.newNodeInsertPosition=null,ft(e),pt(e);const o=e.scope,s=Array.from(document.querySelectorAll(`[data-jtk-scope-${o}=true]`)),i=e.parameters.connection==="source"?"target":"source",a=s.filter(d=>{if(!Ke(d))return!1;const h=d.jtk.endpoint;if(!h)return!1;const c=h.parameters.nodeId===e.parameters.nodeId,p=h.parameters.connection;return!c&&p===i}),l=d=>{if(!e)return;const h=a.filter(c=>{if(!Ke(c))return!1;const p=c.jtk.endpoint;if(c.classList.contains("jtk-floating-endpoint"))return!1;const u=Ut(c,d,50),f=Ut(p.element,d,30);if(u||f){const m=this.workflowsStore.getNodeById(p.parameters.nodeId);if(m)return!!this.nodeTypesStore.getNodeType(m.type,m.typeVersion)}return!1}).sort((c,p)=>{const u=Ht(c,d,50),f=Ht(p,d,50);return!(u!=null&&u.y)&&!(f!=null&&f.y)?0:u!=null&&u.y?f!=null&&f.y?f.y-u.y:-1:1});if(h.length>0&&Ke(h[0])){const p=h[0].jtk.endpoint,u=this.workflowsStore.getNodeById(p.parameters.nodeId);this.nodeHelpers.pullConnActiveNodeName.value=(u==null?void 0:u.name)??null,Rs(e,p)}else Ws(e),this.nodeHelpers.pullConnActiveNodeName.value=null},r=d=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(d),Rt(e),window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",r),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",l),window.addEventListener("touchmove",l),window.addEventListener("mouseup",r),window.addEventListener("touchend",l),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(){var e;Object.values((e=this.instance)==null?void 0:e.endpointsByElement).flatMap(t=>Object.values(t)).filter(t=>t.endpoint.type==="N8nPlus").forEach(t=>setTimeout(()=>t.instance.revalidate(t.element),0))},onPlusEndpointClick(e){if(this.shouldShowNextStepDialog){if(e!=null&&e.__meta){this.aiStore.latestConnectionInfo={sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:K.PLUS_ENDPOINT,outputType:We(e.scope),endpointUuid:e.uuid,stepName:e.__meta.nodeName};const t=e.endpoint.canvas;this.aiStore.openNextStepPopup(this.$locale.baseText("nextStepPopup.title.nextStep"),t)}}else this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:K.PLUS_ENDPOINT,outputType:We(e.scope),endpointUuid:e.uuid,stepName:e.__meta.nodeName})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:K.ADD_INPUT_ENDPOINT,nodeCreatorView:Ft,outputType:We(e.scope),endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(ze,this.onEventConnectionAbort),this.instance.bind(Ct,this.onInterceptBeforeDrop),this.instance.bind(Dt,this.onEventConnection),this.instance.bind(Gt,this.onDragMove),this.instance.bind(Yt,this.onConnectionMouseOver),this.instance.bind(Jt,this.onConnectionMouseOut),this.instance.bind(Ot,this.onConnectionMoved),this.instance.bind(Xt,this.onEndpointMouseOver),this.instance.bind(Zt,this.onEndpointMouseOut),this.instance.bind(Le,this.onConnectionDetached),this.instance.bind(qe,this.onConnectionDrag),this.instance.bind([qe,ze,Le],this.onConnectionDragAbortDetached),this.instance.bind(jt,this.onPlusEndpointClick),this.instance.bind(Kt,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(ze,this.onEventConnectionAbort),this.instance.unbind(Ct,this.onInterceptBeforeDrop),this.instance.unbind(Dt,this.onEventConnection),this.instance.unbind(Gt,this.onDragMove),this.instance.unbind(Yt,this.onConnectionMouseOver),this.instance.unbind(Jt,this.onConnectionMouseOut),this.instance.unbind(Ot,this.onConnectionMoved),this.instance.unbind(Xt,this.onEndpointMouseOver),this.instance.unbind(Zt,this.onEndpointMouseOut),this.instance.unbind(Le,this.onConnectionDetached),this.instance.unbind(qe,this.onConnectionDrag),this.instance.unbind(qe,this.onConnectionDragAbortDetached),this.instance.unbind(ze,this.onConnectionDragAbortDetached),this.instance.unbind(Le,this.onConnectionDragAbortDetached),this.instance.unbind(jt,this.onPlusEndpointClick),this.instance.unbind(Kt,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(){if(this.instance){const e=this.instance.getManagedElements();for(const t of Object.values(e)){const o=t.endpoints;for(const s of o||[]){const n=s==null?void 0:s.endpoint;n&&n.type===$s&&n.unbindEvents()}}}this.eventsAttached=!1},onBeforeUnload(e){if(!(this.isDemo||window.preventNodeViewBeforeUnload)){if(this.uiStore.stateIsDirty)return this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId),this.unloadTimeout=setTimeout(()=>{this.collaborationStore.notifyWorkflowOpened(this.workflowsStore.workflowId)},5*Vs.SECOND),e.returnValue=!0,!0;this.canvasStore.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},makeNewWorkflowShareable(){const{currentProject:e,personalProject:t}=this.projectsStore,o=e??t??{},s=(e==null?void 0:e.scopes)??(t==null?void 0:t.scopes)??[];this.workflowsStore.workflow.homeProject=o,this.workflowsStore.workflow.scopes=s},async newWorkflow(){const{getVariant:e}=Bs();if(this.canvasStore.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(void 0,this.projectsStore.currentProjectId),this.workflowsStore.currentWorkflowExecutions=[],this.executionsStore.activeExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),this.canvasStore.zoomToFit(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.executionsStore.activeExecution=null,this.makeNewWorkflowShareable(),this.canvasStore.stopLoading(),e(zt.name)===zt.variant){const t=this.canvasStore.getAutoAddManualTriggerNode();t&&(await this.nodeHelpers.addNodes([t]),this.uiStore.lastSelectedNode=t.name)}},async initView(){var e,t;if(this.$route.params.action==="workflowSave"){this.uiStore.stateIsDirty=!1;return}if(this.blankRedirect)this.blankRedirect=!1;else if(this.$route.name===B.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o.toString())}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const s=await this.confirm(this.$locale.baseText("generic.unsavedWork.confirmMessage.message"),{title:this.$locale.baseText("generic.unsavedWork.confirmMessage.headline"),type:"warning",confirmButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.confirmButtonText"),cancelButtonText:this.$locale.baseText("generic.unsavedWork.confirmMessage.cancelButtonText"),showClose:!0});if(s===Fe)await this.workflowHelpers.saveCurrentWorkflow()&&await this.npsSurveyStore.fetchPromptsData();else if(s===Mt)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name.toString()),o!==null){let s;try{s=await this.workflowsStore.fetchWorkflow(o)}catch(n){this.showError(n,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:B.NEW_WORKFLOW})}s&&(this.titleSet(s.name,"IDLE"),await this.openWorkflow(s),await this.checkAndInitDebugMode(),await this.projectsStore.setProjectNavActiveIdByWorkflowHomeProject(s.homeProject),(e=s.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${s.meta.onboardingId}`,{workflow_id:s.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}await this.loadCredentials(),this.historyStore.reset(),this.uiStore.nodeViewInitialized=!0,document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),window.addEventListener("beforeunload",this.onBeforeUnload),window.addEventListener("unload",this.onUnload),this.showNotificationForViews([B.WORKFLOW,B.NEW_WORKFLOW])},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=rt(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getIncomingOutgoingConnections(e){var o,s;const t=this.workflowsStore.getNodeByName(e);if(t){const n=document.getElementById(t.id);if(!n)return{incoming:[],outgoing:[]};const i=(o=this.instance)==null?void 0:o.getConnections({source:n}),a=(s=this.instance)==null?void 0:s.getConnections({target:n});return{incoming:Array.isArray(a)?a:Object.values(a),outgoing:Array.isArray(i)?i:Object.values(i)}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(s=>{$t(s),Wt(s)})},onNodeRun({name:e,data:t,waiting:o}){var l;const s=this.workflowsStore.pinnedWorkflowData;if(s!=null&&s[e]){const{outgoing:r}=this.getIncomingOutgoingConnections(e);r.forEach(d=>{var h;if(((h=d.__meta)==null?void 0:h.sourceNodeName)===e){const c=this.workflowsStore.getWorkflowResultDataByNodeName(e)!==null;Ls({connection:d,overlayIds:[Ks],classNames:c?["has-run"]:[],includeConnector:!0})}});return}const n=e,i=this.workflowsStore.getNodeByName(n),a=i!==null?i.id:"";if(t===null||t.length===0||o){const r=document.getElementById(a);if(!r)return;const d=(l=this.instance)==null?void 0:l.getConnections({source:r});(Array.isArray(d)?d:Object.values(d)).forEach(c=>{pt(c)}),Us(i,this.instance).forEach(c=>{c.endpoint.type==="N8nPlus"&&c.endpoint.clearSuccessOutput()});return}this.nodeHelpers.setSuccessOutput(t,i)},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const s=this.workflowsStore.getNodeByName(e);if(!s)return;t&&o&&this.historyStore.startRecordingUndo();const n=[];if(n.includes(s.type)){let c=!1;for(const p of this.nodes)if(p.name!==s.name&&n.includes(p.type)){c=!0;break}if(!c)return}s.type===oe?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:s.name===ro}):(this.externalHooks.run("node.deleteNode",{node:s}),this.$telemetry.track("User deleted node",{node_type:s.type,workflow_id:this.workflowsStore.workflowId}));let i=!1;const a=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),l=this.workflowHelpers.getCurrentWorkflow(),r=l.getNode(s.name);let d=[],h=[];if(a&&r&&(d=pe(l,r,a),h=_e(l,r,a)),h.length===1&&d.length===1){const{incoming:c,outgoing:p}=this.getIncomingOutgoingConnections(s.name);if(c.length===1&&p.length===1){const u=c[0],f=p[0];if(u.__meta&&f.__meta){i=!0;const m=u.__meta.sourceNodeName,w=u.__meta.sourceOutputIndex,S=f.__meta.targetNodeName,k=f.__meta.targetOutputIndex;setTimeout(()=>{var v;this.connectTwoNodes(m,w,S,k,E.Main),i&&((v=this.instance)==null||v.setSuspendDrawing(!1,!0),i=!1)},100)}}}Qs(()=>{var c,p,u;(c=this.instance)==null||c.setSuspendDrawing(!0),(((p=this.instance)==null?void 0:p.endpointsByElement[s.id])||[]).flat().forEach(f=>{var m;return(m=this.instance)==null?void 0:m.deleteEndpoint(f)}),this.workflowsStore.removeAllNodeConnection(s),this.workflowsStore.removeNode(s),this.workflowsStore.clearNodeExecutionData(s.name),i||(u=this.instance)==null||u.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(s),t&&this.historyStore.pushCommandToUndo(new zs(s))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},i?100:0)},async onSwitchSelectedNode(e){this.nodeSelectedByName(e,!0,!0)},async onOpenConnectionNodeCreator(e,t){await this.openSelectiveNodeCreator({connectiontype:t,node:e})},async redrawNode(e){const t="x____XXXX____x";await this.renameNode(e,t),await this.renameNode(t,e)},valueChanged(e){e.name==="name"&&e.oldValue&&this.renameNode(e.oldValue,e.value)},async renameNodePrompt(e){try{const t=this.prompt(this.$locale.baseText("nodeView.prompt.newName")+":",this.$locale.baseText("nodeView.prompt.renameNode")+`: ${e}`,{customClass:"rename-prompt",confirmButtonText:this.$locale.baseText("nodeView.prompt.rename"),cancelButtonText:this.$locale.baseText("nodeView.prompt.cancel"),inputErrorMessage:this.$locale.baseText("nodeView.prompt.invalidName"),inputValue:e,inputValidator:n=>n.trim()?!0:this.$locale.baseText("nodeView.prompt.invalidName")});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const s=await t;if((s==null?void 0:s.action)!==Fe)return;await this.renameNode(e,s.value,!0)}catch{}},async renameNode(e,t,o=!1){var a;if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const n=((a=this.activeNode)==null?void 0:a.name)===e;n&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const i=this.workflowHelpers.getCurrentWorkflow(!0);i.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new Hs(e,t)),this.workflowsStore.renameNodeSelectedAndExecution({old:e,new:t}),this.deleteEveryEndpoint(),this.workflowsStore.removeAllConnections({setStateDirty:!1}),this.workflowsStore.removeAllNodes({removePinData:!1,setStateDirty:!0}),await this.$nextTick(),await this.nodeHelpers.addNodes(Object.values(i.nodes),i.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),n&&(this.ndvStore.activeNodeName=t,this.renamingActive=!1),o&&this.historyStore.stopRecordingUndo(),this.suspendRecordingDetachedConnections=!1},deleteEveryEndpoint(){var e,t;this.instance&&((e=this.instance)==null||e.reset(),Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>o).forEach(o=>o.destroy()),this.instance.deleteEveryConnection({fireEvent:!0}))},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const s=this.workflowHelpers.getNodeTypesMaxCount();let n,i;const a=[];await this.nodeHelpers.loadNodesProperties(e.nodes.map(w=>({name:w.type,version:w.typeVersion}))),e.nodes.forEach(w=>{if(s[w.type]!==void 0)if(s[w.type].exist>=s[w.type].max){t[w.name]=s[w.type].nodeNames[0];return}else s[w.type].exist+=1;n=w.name;const S=this.locale.localizeNodeName(w.name,w.type);i=this.uniqueNodeName(S,o),o.push(i),t[n]=i,a.push(w)});const l={},r=e.connections,d=a.map(w=>w.name);let h,c,p,u,f;for(h of Object.keys(r)){if(!d.includes(h))continue;const w={};for(c of Object.keys(r[h]))for(w[c]=[],p=0;p<r[h][c].length;p++){const S=[];if(r[h][c][p])for(u=0;u<r[h][c][p].length;u++)f=r[h][c][p][u],d.includes(f.node)&&S.push(f);w[c].push(S)}l[h]=w}const m=this.workflowHelpers.getWorkflow(a,l);for(n in t)n!==t[n]&&m.renameNode(n,t[n]);if(e.pinData){let w=!0;for(const S of Object.keys(e.pinData)){if(!w){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const k=m.nodes[t[S]];try{Re(k).setData(e.pinData[S],"add-nodes"),w=!0}catch(v){w=!1,console.error(v)}}}return this.historyStore.startRecordingUndo(),await this.nodeHelpers.addNodes(Object.values(m.nodes),m.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(m.nodes),connections:m.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const s=[];for(const c of e){o=this.workflowHelpers.getNodeDataToSave(c),s.push(c.name),t.nodes.push(o);const p=this.workflowsStore.pinDataByNodeName(c.name);if(p&&(t.pinData[c.name]=p),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(ct.Sharing)){const u=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([f,m])=>{var w;return m.id&&(!u[m.id]||((w=u[m.id])==null?void 0:w.currentUserHasAccess))}))}}let n,i,a,l,r,d,h;return t.nodes.forEach(c=>{if(i=this.workflowsStore.outgoingConnectionsByNodeName(c.name),Object.keys(i).length!==0){h={};for(a of Object.keys(i))for(r=0;r<i[a].length;r++){for(n=[],l=0;l<i[a][r].length;l++)d=i[a][r][l],s.indexOf(d.node)!==-1&&n.push(d);n.length&&(h.hasOwnProperty(a)||(h[a]=[]),h[a][r]=n)}Object.keys(h).length&&(t.connections[c.name]=h)}}),t},resetWorkspace(){if(this.workflowsStore.resetWorkflow(),this.onToggleNodeCreator({createNodeActive:!1}),this.nodeCreatorStore.setShowScrim(!1),this.canvasStore.resetZoom(),this.unbindEndpointEventListeners(),this.deleteEveryEndpoint(),this.executionWaitingForWebhook)try{this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch{}this.workflowsStore.resetState(),this.uiStore.removeActiveAction("workflowRunning"),this.uiStore.resetSelectedNodes(),this.uiStore.nodeViewOffsetPosition=[0,0],this.nodeHelpers.credentialsUpdated.value=!1},async loadActiveWorkflows(){await this.workflowsStore.fetchActiveWorkflows()},async loadNodeTypes(){await this.nodeTypesStore.getNodeTypes()},async loadCredentialTypes(){await this.credentialsStore.fetchCredentialTypes(!0)},async loadCredentials(){var o,s,n;const e=this.workflowsStore.getWorkflowById(this.currentWorkflow);let t;if(e)t={workflowId:e.id};else{const a=(typeof((o=this.$route.query)==null?void 0:o.projectId)=="string"?(s=this.$route.query)==null?void 0:s.projectId:void 0)??((n=this.projectsStore.personalProject)==null?void 0:n.id);if(a===void 0)throw new Error("Could not find projectId in the query nor could I find the personal project in the project store");t={projectId:a}}await this.credentialsStore.fetchAllCredentialsForWorkflow(t)},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async onPostMessageReceived(e){var t,o;if(!(!e||typeof e.data!="string"||!((o=(t=e.data)==null?void 0:t.includes)!=null&&o.call(t,'"command"'))))try{const s=JSON.parse(e.data);if(s&&s.command==="openWorkflow")try{await this.importWorkflowExact(s),this.canOpenNDV=s.canOpenNDV??!0,this.hideNodeIssues=s.hideNodeIssues??!1,this.isExecutionPreview=!1}catch(n){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("openWorkflow.workflowImportError")}),"*"),this.showMessage({title:this.$locale.baseText("openWorkflow.workflowImportError"),message:n.message,type:"error"})}else if(s&&s.command==="openExecution")try{this.nodeHelpers.isProductionExecutionPreview.value=s.executionMode!=="manual",await this.openExecution(s.executionId),this.canOpenNDV=s.canOpenNDV??!0,this.hideNodeIssues=s.hideNodeIssues??!1,this.isExecutionPreview=!0}catch(n){window.top&&window.top.postMessage(JSON.stringify({command:"error",message:this.$locale.baseText("nodeView.showError.openExecution.title")}),"*"),this.showMessage({title:this.$locale.baseText("nodeView.showError.openExecution.title"),message:n.message,type:"error"})}else(s==null?void 0:s.command)==="setActiveExecution"&&(this.executionsStore.activeExecution=await this.executionsStore.fetchExecution(s.executionId))}catch{}},async onImportWorkflowDataEvent(e){await this.importWorkflowData(e.data,"file")},async onImportWorkflowUrlEvent(e){const t=await this.getWorkflowDataFromUrl(e.url);t!==void 0&&await this.importWorkflowData(t,"url")},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?qt:ut),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let s;switch(this.nodeCreatorStore.selectedView){case Ft:s="ai";break;case qt:s="regular";break;default:s="regular"}t&&e&&this.nodeCreatorStore.setOpenSource(e),this.externalHooks.run("nodeView.createNodeActiveChanged",{source:e,mode:s,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:s,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,s){let n=s;for(const{type:d,isAutoAdd:h,name:c,openDetail:p,position:u}of e){await this.addNode(d,{position:u??n,dragAndDrop:o,name:c},p??!1,!0,h);const f=this.nodes[this.nodes.length-1];n=[f.position[0]+Ie*2+Me,f.position[1]]}const i=this.nodes.length-e.length;for(const{from:d,to:h}of t){const c=this.nodes[i+d.nodeIndex],p=this.nodes[i+h.nodeIndex];this.connectTwoNodes(c.name,d.outputIndex??0,p.name,h.inputIndex??0,E.Main)}const a=this.nodes[this.nodes.length-1],r=this.workflowHelpers.getCurrentWorkflow().getParentNodesByDepth(a.name,1);r.length>1&&r.slice(1).forEach((d,h)=>{const c=this.workflowsStore.getNodeByName(d.name);c&&this.onMoveNode({nodeName:c.name,position:[c.position[0],c.position[1]+100*(h+1)]})}),this.nodeHelpers.addPinDataConnections(this.workflowsStore.pinnedWorkflowData)},async saveCurrentWorkflowExternal(e){await this.workflowHelpers.saveCurrentWorkflow(),e==null||e()},setSuspendRecordingDetachedConnections(e){this.suspendRecordingDetachedConnections=e},onMoveNode({nodeName:e,position:t}){this.workflowsStore.updateNodeProperties({name:e,properties:{position:t}});const o=this.workflowsStore.getNodeByName(e);setTimeout(()=>{var s;o&&((s=this.instance)==null||s.repaintEverything(),this.onNodeMoved(o))},0)},onRevertAddNode({node:e}){this.removeNode(e.name,!1)},async onRevertRemoveNode({node:e}){this.workflowsStore.workflow.nodes.find(o=>o.id===e.id)||(e.id=ye(),await this.nodeHelpers.addNodes([e]))},onRevertAddConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.nodeHelpers.removeConnection(e,!0),this.suspendRecordingDetachedConnections=!1},async onRevertRemoveConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.nodeHelpers.addConnection(e),this.suspendRecordingDetachedConnections=!1},async onRevertNameChange({currentName:e,newName:t}){await this.renameNode(t,e)},onRevertEnableToggle({nodeName:e}){const t=this.workflowsStore.getNodeByName(e);t&&this.nodeHelpers.disableNodes([t])},onPageShow(e){e.persisted&&this.canvasStore.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&(this.$route.name===B.NEW_WORKFLOW||this.$route.name===B.TEMPLATE_IMPORT)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:B.HOMEPAGE})})},async checkAndInitDebugMode(){this.$route.name===B.EXECUTION_DEBUG&&(this.titleSet(this.workflowName,"DEBUG"),this.workflowsStore.isInDebugMode||(await this.applyExecutionData(this.$route.params.executionId),this.workflowsStore.isInDebugMode=!0))},onContextMenuAction(e,t){switch(e){case"copy":this.copyNodes(t);break;case"delete":this.deleteNodes(t);break;case"duplicate":this.duplicateNodes(t);break;case"execute":this.onRunNode(t[0].name,"NodeView.onContextMenuAction");break;case"open":this.ndvStore.activeNodeName=t[0].name;break;case"rename":this.renameNodePrompt(t[0].name);break;case"toggle_activation":this.toggleActivationNodes(t);break;case"toggle_pin":this.togglePinNodes(t,"context-menu");break;case"add_node":this.onToggleNodeCreator({source:K.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:oe}],connections:[]});break;case"select_all":this.selectAllNodes();break;case"deselect_all":this.deselectAllNodes();break}},async onSourceControlPull(){let e=null;this.$route.params.name&&(e=this.$route.params.name.toString());try{if(e!==null&&!this.uiStore.stateIsDirty){const t=await this.workflowsStore.fetchWorkflow(e);t&&(this.titleSet(t.name,"IDLE"),await this.openWorkflow(t))}await Promise.all([this.loadVariables(),this.tagsStore.fetchAll(),this.loadCredentials()])}catch(t){console.error(t)}}}}),Ni="_content_yewsk_1",Si="_shake_yewsk_9",ki="_setupCredentialsButtonWrapper_yewsk_27",Ti={content:Ni,shake:Si,setupCredentialsButtonWrapper:ki},bi=["textContent"],Ei={key:0,class:"workflow-execute-wrapper"};function Ci(e,t,o,s,n,i){const a=R("CanvasAddButton"),l=R("Node"),r=R("Sticky"),d=R("NodeDetailsView"),h=R("SetupWorkflowCredentialsButton"),c=R("NodeCreation"),p=R("CanvasControls"),u=R("ContextMenu"),f=R("NextStepPopup"),m=R("n8n-button"),w=R("KeyboardShortcutTooltip"),S=R("n8n-icon-button"),k=tt("touch");return N(),D("div",{ref:"nodeViewRootRef",class:$(e.$style.content)},[C("div",{id:"node-view-root",class:"node-view-root do-not-select","data-test-id":"node-view-root",onDragover:t[13]||(t[13]=(...v)=>e.onDragOver&&e.onDragOver(...v)),onDrop:t[14]||(t[14]=(...v)=>e.onDrop&&e.onDrop(...v))},[ne((N(),D("div",{class:$(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[3]||(t[3]=(...v)=>e.mouseDown&&e.mouseDown(...v)),onTouchend:t[4]||(t[4]=(...v)=>e.mouseUp&&e.mouseUp(...v)),onTouchmove:t[5]||(t[5]=(...v)=>e.canvasPanning.onMouseMove&&e.canvasPanning.onMouseMove(...v)),onMousedown:t[6]||(t[6]=(...v)=>e.mouseDown&&e.mouseDown(...v)),onMouseup:t[7]||(t[7]=(...v)=>e.mouseUp&&e.mouseUp(...v)),onContextmenu:t[8]||(t[8]=(...v)=>e.contextMenu.open&&e.contextMenu.open(...v)),onWheel:t[9]||(t[9]=(...v)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...v))},[C("div",{id:"node-view-background",class:"node-view-background",style:ie(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),C("div",{id:"node-view",ref:"nodeViewRef",class:"node-view",style:ie(e.workflowStyle),"data-test-id":"node-view"},[ne(O(a,{ref:"canvasAddButton",style:ie(e.canvasAddButtonStyle),"show-tooltip":!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,"data-test-id":"canvas-add-button",onClick:e.onCanvasAddButtonCLick,"onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition},null,8,["style","show-tooltip","position","onClick","onHook:mounted"]),[[Ne,e.showCanvasAddButton]]),(N(!0),D(Xe,null,Ze(e.nodesToRender,v=>(N(),F(l,{key:`${v.id}_node`,name:v.name,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===v.name,"hide-actions":e.pullConnActive,"is-production-execution-preview":e.isProductionExecutionPreview,workflow:e.currentWorkflowObject,"disable-pointer-events":!e.canOpenNDV,"hide-node-issues":e.hideNodeIssues,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRunWorkflow:e.onRunNode,onMoved:e.onNodeMoved,onRun:e.onNodeRun,onRemoveNode:t[0]||(t[0]=_=>e.removeNode(_,!0)),onToggleDisableNode:t[1]||(t[1]=_=>e.toggleActivationNodes([_]))},{"custom-tooltip":W(()=>[C("span",{textContent:G(e.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting"))},null,8,bi)]),_:2},1032,["name","is-read-only","instance","is-active","hide-actions","is-production-execution-preview","workflow","disable-pointer-events","hide-node-issues","onDeselectAllNodes","onDeselectNode","onNodeSelected","onRunWorkflow","onMoved","onRun"]))),128)),(N(!0),D(Xe,null,Ze(e.stickiesToRender,v=>(N(),F(r,{key:`${v.id}_sticky`,name:v.name,workflow:e.currentWorkflowObject,"is-read-only":e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,"is-active":!!e.activeNode&&e.activeNode.name===v.name,"node-view-scale":e.nodeViewScale,"grid-size":e.GRID_SIZE,"hide-actions":e.pullConnActive,onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRemoveNode:t[2]||(t[2]=_=>e.removeNode(_,!0))},null,8,["name","workflow","is-read-only","instance","is-active","node-view-scale","grid-size","hide-actions","onDeselectAllNodes","onDeselectNode","onNodeSelected"]))),128))],4)],34)),[[k,e.touchTap,"tap"]]),O(d,{"read-only":e.isReadOnlyRoute||e.readOnlyEnv,renaming:e.renamingActive,"is-production-execution-preview":e.isProductionExecutionPreview,onRedrawNode:e.redrawNode,onSwitchSelectedNode:e.onSwitchSelectedNode,onOpenConnectionNodeCreator:e.onOpenConnectionNodeCreator,onValueChanged:e.valueChanged,onStopExecution:e.stopExecution,onSaveKeyboardShortcut:e.onSaveKeyboardShortcut},null,8,["read-only","renaming","is-production-execution-preview","onRedrawNode","onSwitchSelectedNode","onOpenConnectionNodeCreator","onValueChanged","onStopExecution","onSaveKeyboardShortcut"]),(N(),F(Ae,null,{default:W(()=>[C("div",{class:$(e.$style.setupCredentialsButtonWrapper)},[O(h)],2)]),_:1})),(N(),F(Ae,null,{default:W(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(N(),F(c,{key:0,"create-node-active":e.createNodeActive,"node-view-scale":e.nodeViewScale,onToggleNodeCreator:e.onToggleNodeCreator,onAddNodes:e.onAddNodes},null,8,["create-node-active","node-view-scale","onToggleNodeCreator","onAddNodes"])):L("",!0)]),_:1})),(N(),F(Ae,null,{default:W(()=>[O(p)]),_:1})),(N(),F(Ae,null,{default:W(()=>[O(u,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),(N(),F(Ae,null,{default:W(()=>[ne(O(f,{onOptionSelected:e.onNextStepSelected},null,8,["onOptionSelected"]),[[Ne,e.isNextStepPopupVisible]])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(N(),D("div",Ei,[e.isManualChatOnly?L("",!0):(N(),D("span",{key:0,onMouseenter:t[10]||(t[10]=v=>e.showTriggerMissingToltip(!0)),onMouseleave:t[11]||(t[11]=v=>e.showTriggerMissingToltip(!1)),onClick:t[12]||(t[12]=(...v)=>e.onRunContainerClick&&e.onRunContainerClick(...v))},[O(w,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:W(()=>[O(m,{loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"flask",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button",onClick:le(e.onRunWorkflow,["stop"])},null,8,["loading","label","disabled","onClick"])]),_:1},8,["label"])],32)),e.containsChatNodes?(N(),F(m,{key:1,label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button",onClick:le(e.onOpenChat,["stop"])},null,8,["onClick"])):L("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(N(),F(S,{key:2,icon:"stop",size:"large",class:"stop-execution",type:"secondary",title:e.stopExecutionInProgress?e.$locale.baseText("nodeView.stoppingCurrentExecution"):e.$locale.baseText("nodeView.stopCurrentExecution"),loading:e.stopExecutionInProgress,"data-test-id":"stop-execution-button",onClick:le(e.stopExecution,["stop"])},null,8,["title","loading","onClick"])):L("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(N(),F(S,{key:3,class:"stop-execution",icon:"stop",size:"large",title:e.$locale.baseText("nodeView.stopWaitingForWebhookCall"),type:"secondary","data-test-id":"stop-execution-waiting-for-webhook-button",onClick:le(e.stopWaitingForWebhook,["stop"])},null,8,["title","onClick"])):L("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(N(),F(S,{key:4,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large","data-test-id":"clear-execution-data-button",onClick:le(e.clearExecutionData,["stop"])},null,8,["title","onClick"])):L("",!0)])):L("",!0)],32)],2)}const Di={$style:Ti},hr=ke(yi,[["render",Ci],["__cssModules",Di],["__scopeId","data-v-2e14f91f"]]);export{hr as default};
3
+ //# sourceMappingURL=NodeView-B2MlTl6g.js.map