n8n-editor-ui 1.19.1 → 1.19.3

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 (114) hide show
  1. package/.turbo/turbo-build.log +60 -60
  2. package/dist/assets/{AuthView-pnWQAK0S.js → AuthView-KzKyZSHz.js} +2 -2
  3. package/dist/assets/{AuthView-pnWQAK0S.js.map → AuthView-KzKyZSHz.js.map} +1 -1
  4. package/dist/assets/{CanvasControls-kb3__O2G.js → CanvasControls-6jR1_mnm.js} +2 -2
  5. package/dist/assets/{CanvasControls-kb3__O2G.js.map → CanvasControls-6jR1_mnm.js.map} +1 -1
  6. package/dist/assets/{ChangePasswordView-w8ZDdsHs.js → ChangePasswordView-TW8EQPS0.js} +2 -2
  7. package/dist/assets/{ChangePasswordView-w8ZDdsHs.js.map → ChangePasswordView-TW8EQPS0.js.map} +1 -1
  8. package/dist/assets/{CredentialsView-9EPVLguD.js → CredentialsView-AVQZL_tm.js} +2 -2
  9. package/dist/assets/{CredentialsView-9EPVLguD.js.map → CredentialsView-AVQZL_tm.js.map} +1 -1
  10. package/dist/assets/{ExecutionFilter-xWjqUjz0.js → ExecutionFilter-tcX3bN8y.js} +2 -2
  11. package/dist/assets/{ExecutionFilter-xWjqUjz0.js.map → ExecutionFilter-tcX3bN8y.js.map} +1 -1
  12. package/dist/assets/{ExecutionPreview-IQ7v5u01.js → ExecutionPreview-OuL-2qRR.js} +2 -2
  13. package/dist/assets/{ExecutionPreview-IQ7v5u01.js.map → ExecutionPreview-OuL-2qRR.js.map} +1 -1
  14. package/dist/assets/{ExecutionsInfoAccordion-GNoSEKPt.js → ExecutionsInfoAccordion-J0VUGzOg.js} +2 -2
  15. package/dist/assets/{ExecutionsInfoAccordion-GNoSEKPt.js.map → ExecutionsInfoAccordion-J0VUGzOg.js.map} +1 -1
  16. package/dist/assets/{ExecutionsLandingPage-bMbJUz4X.js → ExecutionsLandingPage-LNx1ct-F.js} +2 -2
  17. package/dist/assets/{ExecutionsLandingPage-bMbJUz4X.js.map → ExecutionsLandingPage-LNx1ct-F.js.map} +1 -1
  18. package/dist/assets/{ExecutionsList-VqMNpnno.js → ExecutionsList-1jr8ziaw.js} +2 -2
  19. package/dist/assets/ExecutionsList-1jr8ziaw.js.map +1 -0
  20. package/dist/assets/{ExecutionsView-cib3hepc.js → ExecutionsView-vfalxf-N.js} +2 -2
  21. package/dist/assets/{ExecutionsView-cib3hepc.js.map → ExecutionsView-vfalxf-N.js.map} +1 -1
  22. package/dist/assets/{FixedCollectionParameter-2NZhE0YP.js → FixedCollectionParameter-i4v0_RBC.js} +3 -3
  23. package/dist/assets/{FixedCollectionParameter-2NZhE0YP.js.map → FixedCollectionParameter-i4v0_RBC.js.map} +1 -1
  24. package/dist/assets/{ForgotMyPasswordView-JpQD0IzR.js → ForgotMyPasswordView-n-WXfUXB.js} +2 -2
  25. package/dist/assets/{ForgotMyPasswordView-JpQD0IzR.js.map → ForgotMyPasswordView-n-WXfUXB.js.map} +1 -1
  26. package/dist/assets/{MainHeader-_EB1A67D.js → MainHeader-it41_mme.js} +2 -2
  27. package/dist/assets/{MainHeader-_EB1A67D.js.map → MainHeader-it41_mme.js.map} +1 -1
  28. package/dist/assets/{MainSidebar-QaJ5uvnW.js → MainSidebar-K22ttpb5.js} +2 -2
  29. package/dist/assets/{MainSidebar-QaJ5uvnW.js.map → MainSidebar-K22ttpb5.js.map} +1 -1
  30. package/dist/assets/{NodeCreation-OxTpBRfP.js → NodeCreation-3pcb_BwC.js} +3 -3
  31. package/dist/assets/{NodeCreation-OxTpBRfP.js.map → NodeCreation-3pcb_BwC.js.map} +1 -1
  32. package/dist/assets/{NodeCreator-_GxUysbY.js → NodeCreator-r6gxY14d.js} +2 -2
  33. package/dist/assets/{NodeCreator-_GxUysbY.js.map → NodeCreator-r6gxY14d.js.map} +1 -1
  34. package/dist/assets/{NodeView-CdR2fi_x.js → NodeView-LzPrYfwG.js} +3 -3
  35. package/dist/assets/{NodeView-CdR2fi_x.js.map → NodeView-LzPrYfwG.js.map} +1 -1
  36. package/dist/assets/{ResourcesListLayout-XUIQQpyB.js → ResourcesListLayout-XbNZXU-j.js} +2 -2
  37. package/dist/assets/{ResourcesListLayout-XUIQQpyB.js.map → ResourcesListLayout-XbNZXU-j.js.map} +1 -1
  38. package/dist/assets/{RunDataAi-4m1wWDUf.js → RunDataAi-ueFTZBht.js} +2 -2
  39. package/dist/assets/{RunDataAi-4m1wWDUf.js.map → RunDataAi-ueFTZBht.js.map} +1 -1
  40. package/dist/assets/{RunDataJson-FZZoF8ao.js → RunDataJson-VFzb6R4m.js} +3 -3
  41. package/dist/assets/{RunDataJson-FZZoF8ao.js.map → RunDataJson-VFzb6R4m.js.map} +1 -1
  42. package/dist/assets/{RunDataJsonActions-LZGsgNyW.js → RunDataJsonActions-LDR8SlAW.js} +2 -2
  43. package/dist/assets/{RunDataJsonActions-LZGsgNyW.js.map → RunDataJsonActions-LDR8SlAW.js.map} +1 -1
  44. package/dist/assets/{RunDataSchema-wjyR7MiY.js → RunDataSchema-BB0j0bVA.js} +2 -2
  45. package/dist/assets/{RunDataSchema-wjyR7MiY.js.map → RunDataSchema-BB0j0bVA.js.map} +1 -1
  46. package/dist/assets/{RunDataTable-690SZ7_1.js → RunDataTable-Qas85Wnj.js} +2 -2
  47. package/dist/assets/{RunDataTable-690SZ7_1.js.map → RunDataTable-Qas85Wnj.js.map} +1 -1
  48. package/dist/assets/{SamlOnboarding-9tSVzIi2.js → SamlOnboarding-4D4QjACf.js} +2 -2
  49. package/dist/assets/{SamlOnboarding-9tSVzIi2.js.map → SamlOnboarding-4D4QjACf.js.map} +1 -1
  50. package/dist/assets/{SettingsApiView-95Wb-oA5.js → SettingsApiView-0Ne2kemN.js} +2 -2
  51. package/dist/assets/{SettingsApiView-95Wb-oA5.js.map → SettingsApiView-0Ne2kemN.js.map} +1 -1
  52. package/dist/assets/{SettingsCommunityNodesView-WW65T1Gl.js → SettingsCommunityNodesView-zzzz0aj6.js} +2 -2
  53. package/dist/assets/{SettingsCommunityNodesView-WW65T1Gl.js.map → SettingsCommunityNodesView-zzzz0aj6.js.map} +1 -1
  54. package/dist/assets/{SettingsExternalSecrets-6YJbQ8LH.js → SettingsExternalSecrets-bsdr9nMJ.js} +2 -2
  55. package/dist/assets/{SettingsExternalSecrets-6YJbQ8LH.js.map → SettingsExternalSecrets-bsdr9nMJ.js.map} +1 -1
  56. package/dist/assets/{SettingsFakeDoorView-6ZiGYnHw.js → SettingsFakeDoorView-0ioWE56l.js} +2 -2
  57. package/dist/assets/{SettingsFakeDoorView-6ZiGYnHw.js.map → SettingsFakeDoorView-0ioWE56l.js.map} +1 -1
  58. package/dist/assets/{SettingsLdapView-G9lNDLq4.js → SettingsLdapView-nV_D5CDp.js} +2 -2
  59. package/dist/assets/{SettingsLdapView-G9lNDLq4.js.map → SettingsLdapView-nV_D5CDp.js.map} +1 -1
  60. package/dist/assets/{SettingsLogStreamingView-hOxp5upg.js → SettingsLogStreamingView-GPC6oqoB.js} +2 -2
  61. package/dist/assets/{SettingsLogStreamingView-hOxp5upg.js.map → SettingsLogStreamingView-GPC6oqoB.js.map} +1 -1
  62. package/dist/assets/{SettingsSourceControl-A4p6uSTm.js → SettingsSourceControl-YlWPbedb.js} +2 -2
  63. package/dist/assets/{SettingsSourceControl-A4p6uSTm.js.map → SettingsSourceControl-YlWPbedb.js.map} +1 -1
  64. package/dist/assets/{SettingsSso-kXl38iOM.js → SettingsSso-o3FTQjpW.js} +2 -2
  65. package/dist/assets/{SettingsSso-kXl38iOM.js.map → SettingsSso-o3FTQjpW.js.map} +1 -1
  66. package/dist/assets/{SettingsUsageAndPlan-E00t5N2Z.js → SettingsUsageAndPlan-lypv7X6a.js} +2 -2
  67. package/dist/assets/{SettingsUsageAndPlan-E00t5N2Z.js.map → SettingsUsageAndPlan-lypv7X6a.js.map} +1 -1
  68. package/dist/assets/{SettingsUsersView-4PoSbZc_.js → SettingsUsersView-BP40GKuA.js} +2 -2
  69. package/dist/assets/{SettingsUsersView-4PoSbZc_.js.map → SettingsUsersView-BP40GKuA.js.map} +1 -1
  70. package/dist/assets/{SettingsView-ITSZzUOy.js → SettingsView-UI5wnO8B.js} +2 -2
  71. package/dist/assets/{SettingsView-ITSZzUOy.js.map → SettingsView-UI5wnO8B.js.map} +1 -1
  72. package/dist/assets/{SetupView-iFHyYLKM.js → SetupView-jUHcBldc.js} +2 -2
  73. package/dist/assets/{SetupView-iFHyYLKM.js.map → SetupView-jUHcBldc.js.map} +1 -1
  74. package/dist/assets/{SetupWorkflowFromTemplateView-1mq-ZIl2.js → SetupWorkflowFromTemplateView-xZok8Ro-.js} +2 -2
  75. package/dist/assets/{SetupWorkflowFromTemplateView-1mq-ZIl2.js.map → SetupWorkflowFromTemplateView-xZok8Ro-.js.map} +1 -1
  76. package/dist/assets/{SigninView-eqdMLCtk.js → SigninView-jH2VFMFu.js} +2 -2
  77. package/dist/assets/{SigninView-eqdMLCtk.js.map → SigninView-jH2VFMFu.js.map} +1 -1
  78. package/dist/assets/{SignupView-a26ywVgy.js → SignupView-cQJowW7M.js} +2 -2
  79. package/dist/assets/{SignupView-a26ywVgy.js.map → SignupView-cQJowW7M.js.map} +1 -1
  80. package/dist/assets/{TemplateDetails-neZvQLcE.js → TemplateDetails-FXwRGgg3.js} +2 -2
  81. package/dist/assets/{TemplateDetails-neZvQLcE.js.map → TemplateDetails-FXwRGgg3.js.map} +1 -1
  82. package/dist/assets/{TemplateList-apw79EVp.js → TemplateList-ygiFPwW5.js} +2 -2
  83. package/dist/assets/{TemplateList-apw79EVp.js.map → TemplateList-ygiFPwW5.js.map} +1 -1
  84. package/dist/assets/{TemplatesCollectionView-2NGTxXTg.js → TemplatesCollectionView-iJK5C7dQ.js} +2 -2
  85. package/dist/assets/{TemplatesCollectionView-2NGTxXTg.js.map → TemplatesCollectionView-iJK5C7dQ.js.map} +1 -1
  86. package/dist/assets/{TemplatesSearchView-0FL2pP83.js → TemplatesSearchView-HA2xad9U.js} +2 -2
  87. package/dist/assets/{TemplatesSearchView-0FL2pP83.js.map → TemplatesSearchView-HA2xad9U.js.map} +1 -1
  88. package/dist/assets/{TemplatesWorkflowView-D4Lnmnhg.js → TemplatesWorkflowView-KdHMuTUs.js} +2 -2
  89. package/dist/assets/{TemplatesWorkflowView-D4Lnmnhg.js.map → TemplatesWorkflowView-KdHMuTUs.js.map} +1 -1
  90. package/dist/assets/{VariablesView-tzHYYMLV.js → VariablesView-BGFOVdr1.js} +2 -2
  91. package/dist/assets/{VariablesView-tzHYYMLV.js.map → VariablesView-BGFOVdr1.js.map} +1 -1
  92. package/dist/assets/{WorkerView-AmUPKGBk.js → WorkerView-FnskutaO.js} +2 -2
  93. package/dist/assets/{WorkerView-AmUPKGBk.js.map → WorkerView-FnskutaO.js.map} +1 -1
  94. package/dist/assets/{WorkflowActivator-haTVfR4g.js → WorkflowActivator-B2Cg8gE_.js} +2 -2
  95. package/dist/assets/{WorkflowActivator-haTVfR4g.js.map → WorkflowActivator-B2Cg8gE_.js.map} +1 -1
  96. package/dist/assets/{WorkflowOnboardingView-azyuxv8R.js → WorkflowOnboardingView-ZBFcAyXB.js} +2 -2
  97. package/dist/assets/{WorkflowOnboardingView-azyuxv8R.js.map → WorkflowOnboardingView-ZBFcAyXB.js.map} +1 -1
  98. package/dist/assets/{WorkflowsView-oE-PnjgI.js → WorkflowsView-ZCzM_7eW.js} +2 -2
  99. package/dist/assets/{WorkflowsView-oE-PnjgI.js.map → WorkflowsView-ZCzM_7eW.js.map} +1 -1
  100. package/dist/assets/{cloud-TMu3mk45.js → cloud-B6sgy7jV.js} +2 -2
  101. package/dist/assets/{cloud-TMu3mk45.js.map → cloud-B6sgy7jV.js.map} +1 -1
  102. package/dist/assets/{executionsHelpers-jpam7Sff.js → executionsHelpers-8_uqSfWi.js} +2 -2
  103. package/dist/assets/{executionsHelpers-jpam7Sff.js.map → executionsHelpers-8_uqSfWi.js.map} +1 -1
  104. package/dist/assets/{index-hMVAffQ3.js → index-sMRiWGJS.js} +4 -4
  105. package/dist/assets/{index-hMVAffQ3.js.map → index-sMRiWGJS.js.map} +1 -1
  106. package/dist/assets/{pushConnection-NKwmlD0l.js → pushConnection-SP3wVlD4.js} +2 -2
  107. package/dist/assets/{pushConnection-NKwmlD0l.js.map → pushConnection-SP3wVlD4.js.map} +1 -1
  108. package/dist/assets/{useExecutionDebugging-WpRAbEhr.js → useExecutionDebugging-vYjc-e7j.js} +2 -2
  109. package/dist/assets/{useExecutionDebugging-WpRAbEhr.js.map → useExecutionDebugging-vYjc-e7j.js.map} +1 -1
  110. package/dist/assets/{workflowActivate-UB1_xc5U.js → workflowActivate-FonyQsS3.js} +2 -2
  111. package/dist/assets/{workflowActivate-UB1_xc5U.js.map → workflowActivate-FonyQsS3.js.map} +1 -1
  112. package/dist/index.html +1 -1
  113. package/package.json +1 -1
  114. package/dist/assets/ExecutionsList-VqMNpnno.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import{l as ue,O as Y,Q as G,dT as vt,S as re,as as Ee,dU as Jo,dV as Xo,dC as Qo,u as He,ac as ee,c$ as fe,N as $,dW as In,dX as Pn,dY as st,dZ as On,d_ as Rn,d$ as Nt,_ as H,e0 as $n,e1 as An,bg as Zo,aL as en,e2 as Gt,cT as Ue,b8 as ot,a3 as Le,aa as We,R as tn,d7 as qt,K as ge,e3 as Mn,e4 as _e,T as Te,a8 as Ve,e5 as gt,d3 as De,e6 as Jt,e7 as _n,e8 as Xt,e9 as on,ai as It,ea as Wn,eb as Vn,ec as Bn,cP as Qt,b5 as Zt,ax as eo,ed as Ln,ab as ve,ee as we,ef as to,eg as Un,eh as xn,ei as oo,ej as Wt,d0 as Ce,ek as Fn,el as Hn,s as nn,d5 as pt,B as j,d1 as zn,t as sn,em as Kn,en as jn,z as an,eo as Yn,ep as Gn,eq as qn,er as Jn,es as Xn,cR as Qn,et as Zn,G as ei,eu as Pt,W as at,ev as rn,ew as le,ex as nt,cX as Lt,D as ti,ey as xe,ez as et,eA as Ut,eB as no,eC as io,eD as so,eE as ao,eF as ro,eG as lo,eH as uo,eI as co,eJ as ho,eK as po,eL as oi,b9 as go,eM as fo,eN as mo,eO as Vt,eP as yo,eQ as wo,eR as vo,eS as No,cZ as ni,cY as ii,c_ as si,cQ as ai,a4 as Ye,dB as Ge,eT as ri,p as li,v as di,cW as ui,eU as he,cV as ci,cS as Ot,df as oe,eV as hi,eW as pi,dR as gi,eX as fi,U as mi,cJ as yi,cK as wi,cL as vi,bu as Ni}from"./n8n-NE7NqrvB.js";import{m as q,d as kt}from"./pinia-IhuTtYiV.js";import{_ as ko,$ as bo,a0 as To,a1 as rt}from"./@jsplumb/core-MKwKlGip.js";import{j as Fe,k as bt,b as ln,l as ki,P as So,m as ke,n as bi,o as Ti,p as Si,q as Di,r as Ei,t as Ci,v as Ii,x as Pi,C as Oi,y as Ri,z as $i,A as Ai,G as Be,M as dn,D as Mi,B as _i,E as un,F as Wi,N as Tt,H as Ie,I as St,w as Pe,f as ft,a as xt,J as Oe,K as Vi,L as Bi,O as cn,R as hn,d as Ft,g as pn,Q as Li,U as Ui,V as Do,W as mt,X as Bt,Y as Rt,Z as xi,_ as Fi,$ as yt,a0 as qe,a1 as Hi,a2 as zi,a3 as Ki,a4 as ji,a5 as Yi,a6 as lt,a7 as Gi,a8 as qi,a9 as Ji,u as Xi,aa as Qi,ab as Zi,ac as es,ad as Je,ae as ts,af as os,ag as $t,ah as ns,ai as Xe,aj as is,ak as ss,al as as,am as rs,an as ls,ao as ds,ap as us,aq as cs,ar as Eo,as as Co,at as Io,au as hs,av as Po,aw as Oo,ax as ps,ay as dt,az as Ro,aA as gs,aB as fs,aC as $o,aD as Ao,aE as ms,aF as ys,aG as ws,aH as Mo,aI as vs,aJ as Ns,s as _o,aK as ne,aL as ks}from"./index-hMVAffQ3.js";import{G as x,r as F,e as Q,d as Ht,b as gn,ag as S,l as u,m as T,p as g,T as v,I as D,O as y,S as I,R as b,M as P,Q as C,a8 as Wo,a2 as ie,F as Z,a7 as de,aw as fn,ax as mn,K as bs,V as z,U as J,P as yn,H as ae,a5 as wn,J as se,y as Ts,aD as Re,a9 as Dt,aF as Se,aL as Ss,W as Ds,u as be,aq as zt,n as vn}from"./vendor-2CfOYFi2.js";import{n as Es,f as ut,g as Vo,a as Bo,E as Lo,b as Uo,d as xo,h as ct,i as Cs}from"./@jsplumb/browser-ui-QL7QI0sV.js";import{v as pe}from"./uuid-McvpxQtQ.js";import{u as Is}from"./useExecutionDebugging-WpRAbEhr.js";import{g as me,s as Ae,x as Fo,y as Ps}from"./lodash-es-s_m9YyW7.js";import{F as At}from"./file-saver-_vO_MOS2.js";import{V as Nn}from"./vue-json-pretty-HTL9TWGq.js";import Os from"./RunDataAi-4m1wWDUf.js";import{w as Ho}from"./workflowActivate-UB1_xc5U.js";import{F as Rs}from"./@fortawesome/vue-fontawesome-GVmvJ_gj.js";import{a as $s,u as As}from"./collaboration.store-lUjjktP5.js";const kn=x({data(){return{isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isMacOs:/(ipad|iphone|ipod|mac)/i.test(navigator.platform)}},computed:{controlKeyCode(){return this.isMacOs?"Meta":"Control"}},methods:{isCtrlKeyPressed(e){return this.isTouchDevice===!0&&e instanceof MouseEvent?!0:this.isMacOs?e.metaKey:e.ctrlKey}}}),Ms=x({mixins:[kn],data(){return{moveLastPosition:[0,0]}},computed:{...q(ue)},methods:{moveWorkflow(e){const t=this.uiStore.nodeViewOffsetPosition,[o,n]=Fe(e),i=t[0]+(o-this.moveLastPosition[0]),s=t[1]+(n-this.moveLastPosition[1]);this.uiStore.nodeViewOffsetPosition=[i,s],this.moveLastPosition[0]=o,this.moveLastPosition[1]=n},mouseDownMoveWorkflow(e,t){if(!this.isCtrlKeyPressed(e)&&!t||this.uiStore.isActionActive("dragActive"))return;e.button!==1&&(this.uiStore.nodeViewMoveInProgress=!0);const[o,n]=Fe(e);this.moveLastPosition[0]=o,this.moveLastPosition[1]=n,this.$el.addEventListener("mousemove",this.mouseMoveNodeWorkflow)},mouseUpMoveWorkflow(e){this.uiStore.nodeViewMoveInProgress&&(this.$el.removeEventListener("mousemove",this.mouseMoveNodeWorkflow),this.uiStore.nodeViewMoveInProgress=!1)},mouseMoveNodeWorkflow(e){if(!(e.target&&!e.target.id.includes("node-view"))&&!this.uiStore.isActionActive("dragActive")){if(e.buttons===4&&(this.uiStore.nodeViewMoveInProgress=!0),e.buttons===0){this.mouseUp(e);return}this.moveWorkflow(e)}}}}),Kt=kt("canvas",()=>{const e=Y(),t=G(),o=ue(),n=bt(),i=ln(),s=F(),a=F(!1),r=F(null),l=F(null),p=Q(()=>e.allNodes),h=Q(()=>p.value.filter(B=>B.type===vt||t.isTriggerNode(B.type))),d=F(!1),m=F(1),N=F([1,1]),k=Q(()=>i.preferences.branchReadOnly);Ht(k,B=>{s.value&&(s.value.elementsDraggable=!B)});const w=B=>{const M=ki(m.value,B??[0,0]);M[0]-=So/2,M[1]-=So/2,N.value=ke(p.value,M)},c=()=>(w(),{id:pe(),...Mi,position:N.value}),f=()=>h.value.length>0?p.value:[c(),...p.value],E=B=>{const M=d.value?0:o.sidebarMenuCollapsed?bi:Ti,U=B[0]-M,K=d.value?B[1]:B[1]-o.bannersHeight-o.headerHeight;return[U,K]},O=(B,M)=>{var U;m.value=B,(U=s.value)==null||U.setZoom(B),o.nodeViewOffsetPosition=M},R=()=>{const{scale:B,offset:M}=Si({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E([window.innerWidth/2,window.innerHeight/2])});O(B,M)},W=()=>{const{scale:B,offset:M}=Di({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E([window.innerWidth/2,window.innerHeight/2])});O(B,M)},V=()=>{const{scale:B,offset:M}=Ei({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E([window.innerWidth/2,window.innerHeight/2])});O(B,M)},A=()=>{const B=f();if(!B.length)return;const{zoomLevel:M,offset:U}=Ci(B,!d.value);O(M,U)},L=(B,M,U=!1)=>{const K=o.nodeViewOffsetPosition,X=K[0]-(U?M:B),ce=K[1]-(U?B:M);o.nodeViewOffsetPosition=[X,ce]},_=B=>{B.preventDefault();const{deltaX:M,deltaY:U}=Ii(B);if(B.ctrlKey||B.metaKey){const K=_i(U),{scale:X,offset:ce}=Pi(K)({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E(Fe(B))});O(X,ce);return}L(M,U,B.shiftKey)};function te(B){var M;s.value&&(s.value.destroy(),s.value.reset(),s.value=void 0),s.value=Es({container:B,connector:Oi,resizeObserver:!1,endpoint:{type:"Dot",options:{radius:5}},paintStyle:Ri,hoverPaintStyle:$i,connectionOverlays:Ai,elementsDraggable:!k.value,dragOptions:{cursor:"pointer",grid:{w:Be,h:Be},start:U=>{var ye;const X=U.drag.getDragElement().getAttribute("data-name");if(!X)return;a.value=!0;const ce=o.isNodeSelected(X);return U.e&&!ce&&((ye=s.value)==null||ye.clearDragSelection(),o.resetSelectedNodes()),o.addActiveAction("dragActive"),!0},stop:U=>{const X=U.drag.getDragElement().getAttribute("data-name");if(!X)return;const ce=e.getNodeByName(X);if(a.value=!1,o.isActionActive("dragActive")&&ce){const ye=o.getSelectedNodes.slice();ye.map($e=>$e.name).includes(ce.name)||ye.push(ce),ye.length>1&&n.startRecordingUndo();let je;ye.forEach($e=>{const Et=document.getElementById($e.id);if(Et===null)return;je=[parseInt(Et.style.left.slice(0,-2),10),parseInt(Et.style.top.slice(0,-2),10)];const Cn={name:$e.name,properties:{position:je}},Ct=$e.position;(Ct[0]!==je[0]||Ct[1]!==je[1])&&(n.pushCommandToUndo(new dn($e.name,Ct,je)),e.updateNodeProperties(Cn))}),ye.length>1&&n.stopRecordingUndo(),o.isActionActive("dragActive")&&o.removeActiveAction("dragActive")}},filter:".node-description, .node-description .node-name, .node-description .node-subtitle"}}),(M=s.value)==null||M.setDragConstrainFunction(U=>o.isReadOnlyView?null:U)}const Ke=Q(()=>s.value);return{isDemo:d,nodeViewScale:m,canvasAddButtonPosition:N,lastSelectedConnection:r,newNodeInsertPosition:l,jsPlumbInstance:Ke,setRecenteredCanvasAddButtonPosition:w,getNodesWithPlaceholderNode:f,canvasPositionFromPagePosition:E,setZoomLevel:O,resetZoom:R,zoomIn:W,zoomOut:V,zoomToFit:A,wheelScroll:_,initInstance:te}}),Mt=F([0,0]),Qe=F(!1),Ze=F({source:"canvas"}),ht=F([]),zo=F(()=>{}),it=(e=()=>{})=>{const t=ue(),o=G(),n=Y(),i=ln(),{getInputDataWithPinned:s}=un(),a=Ee(),r=Q(()=>i.preferences.branchReadOnly||t.isReadOnlyView),l=Q(()=>{if(!Qe.value)return[];const c=t.selectedNodes.map(E=>n.getNodeByName(E.name)),f=Ze.value;return f.source==="canvas"?c:f.source==="node-right-click"?c.some(O=>O.name===f.node.name)?c:[f.node]:[f.node]}),p=c=>{const f=n.allNodes.filter(E=>E.type===c.name);return c.maxNodes===void 0||f.length<c.maxNodes},h=c=>{const f=o.getNodeType(c.type,c.typeVersion);return!f||Jo.includes(f.name)?!1:p(f)},d=c=>{const f=o.getNodeType(c.type,c.typeVersion),E=s(c);return!f||E.length===0?!1:f.outputs.length===1&&!Xo.includes(c.type)},m=c=>!!n.pinDataByNodeName(c.name),N=()=>{Ze.value={source:"canvas"},Qe.value=!1,ht.value=[],Mt.value=[0,0]},k=(c,f={source:"canvas"})=>{if(c.stopPropagation(),Qe.value&&f.source===Ze.value.source){N();return}c.preventDefault(),zo.value=e,Ze.value=f,Mt.value=Fe(c),Qe.value=!0;const E=l.value,O=E.every(V=>V.type===re),R={adjustToNumber:E.length,interpolate:{subject:O?a.baseText("contextMenu.sticky",{adjustToNumber:E.length}):a.baseText("contextMenu.node",{adjustToNumber:E.length})}},W=[{id:"select_all",divided:!0,label:a.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:E.length===n.allNodes.length},{id:"deselect_all",label:a.baseText("contextMenu.deselectAll"),disabled:E.length===0}];if(E.length===0)ht.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:a.baseText("contextMenu.addNode"),disabled:r.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:a.baseText("contextMenu.addSticky"),disabled:r.value},...W];else{const V=[!O&&{id:"toggle_activation",label:E.every(A=>A.disabled)?a.baseText("contextMenu.activate",R):a.baseText("contextMenu.deactivate",R),shortcut:{keys:["D"]},disabled:r.value},!O&&{id:"toggle_pin",label:E.every(A=>m(A))?a.baseText("contextMenu.unpin",R):a.baseText("contextMenu.pin",R),shortcut:{keys:["p"]},disabled:r.value||!E.every(d)},{id:"copy",label:a.baseText("contextMenu.copy",R),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:a.baseText("contextMenu.duplicate",R),shortcut:{metaKey:!0,keys:["D"]},disabled:r.value||!E.every(h)},...W,{id:"delete",divided:!0,label:a.baseText("contextMenu.delete",R),shortcut:{keys:["Del"]},disabled:r.value}].filter(Boolean);if(E.length===1){const A=O?[{id:"open",label:a.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:r.value},{id:"change_color",label:a.baseText("contextMenu.changeColor"),disabled:r.value}]:[{id:"open",label:a.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:a.baseText("contextMenu.execute"),disabled:r.value},{id:"rename",label:a.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:r.value}];V.unshift(...A)}ht.value=V}},w=c=>{zo.value(c,l.value)};return Ht(()=>t.nodeViewOffsetPosition,()=>{N()}),{isOpen:Qe,position:Mt,target:Ze,actions:ht,targetNodes:l,open:k,close:N,_dispatchAction:w}};function _s(){const e=F(!1),t=F(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:n}=Qo(),i=ue(),s=Kt(),a=Y(),{isOpen:r}=it();function l(A){Object.assign(t.value.style,A)}function p(A){const[L,_]=E(A);t.value=Object.assign(t.value,{x:L,y:_}),l({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h(A){const L=m(A);l({left:L.x+"px",top:L.y+"px",width:L.width+"px",height:L.height+"px"})}function d(){t.value.x=0,t.value.y=0,l({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function m(A){const[L,_]=E(A);return{x:Math.min(L,t.value.x),y:Math.min(_,t.value.y),width:Math.abs(L-t.value.x),height:Math.abs(_-t.value.y)}}function N(A){const L=[],_=m(A);return a.allNodes.forEach(te=>{te.position[0]<_.x||te.position[0]>_.x+_.width||te.position[1]<_.y||te.position[1]>_.y+_.height||L.push(te)}),L}function k(){t.value.id="select-box",l({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",c),document.querySelector("#node-view").appendChild(t.value)}function w(A){if(A.buttons===0){c(A);return}h(A)}function c(A){if(A.button===2||r.value)return;if(!e.value){o&&A.target instanceof HTMLElement&&A.target&&A.target.id.includes("node-view")&&W();return}document.removeEventListener("mousemove",w),W();const L=N(A);L.forEach(_=>{R(_)}),L.length===1&&(i.lastSelectedNode=L[0].name),d()}function f(A,L){n(A)||L||A.button===2||i.isActionActive("dragActive")||(p(A),document.addEventListener("mousemove",w))}function E(A){const L=Fe(A),[_,te]=s.canvasPositionFromPagePosition(L),Ke=s.nodeViewScale,B=i.nodeViewOffsetPosition;return Wi(_,te,Ke,B)}function O(A){i.removeNodeFromSelection(A),V.value.removeFromDragSelection(V.value.getManagedElement(A==null?void 0:A.id))}function R(A){i.addSelectedNode(A),V.value.addToDragSelection(V.value.getManagedElement(A==null?void 0:A.id))}function W(){V.value.clearDragSelection(),i.resetSelectedNodes(),i.lastSelectedNode=null,i.lastSelectedNodeOutputIndex=null,s.lastSelectedConnection=null,s.newNodeInsertPosition=null}const V=Q(()=>s.jsPlumbInstance);return gn(()=>{k()}),{selectActive:e,getMousePositionWithinNodeView:E,mouseUpMouseSelect:c,mouseDownMouseSelect:f,nodeDeselected:O,nodeSelected:R,deselectAllNodes:W}}function Ws(){function e(){return G().allNodeTypes.reduce((o,n)=>{if(typeof n.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(n.defaults.name)&&o.push(n.defaults.name),o},[])}function t(o,n=[]){var h,d;const{canvasNames:i}=Y();if(!i.has(o)&&!n.includes(o))return o;const a=e().find(m=>o.startsWith(m));if(a){let m="",N=1;const k=o.split(a).pop(),w=k==null?void 0:k[k.length-1];for(w&&Number.isInteger(Number(w))&&(N=parseInt(w,10),o=o.slice(0,-1)),m=o;i.has(m)||n.includes(m);)m=o+N++;return m}if(/^\d+-?\d*$/.test(o)){let m="",N=1;const k=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(k!=null&&k.groups))throw new Error("Failed to find match for unique name");for(((h=k==null?void 0:k.groups)==null?void 0:h.suffix)!==""&&(N=parseInt(k.groups.suffix,10)),m=k.groups.base;i.has(m)||n.includes(m);)m=k.groups.base+"-"+N++;return m}let r="",l=1;const p=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(p!=null&&p.groups))throw new Error("Failed to find match for unique name");for(((d=p==null?void 0:p.groups)==null?void 0:d.suffix)!==""&&(l=parseInt(p.groups.suffix,10)),r=p.groups.base;i.has(r)||n.includes(r);)r=p.groups.base+l++;return r}return{uniqueNodeName:t}}const ze=x({setup(){return{...He()}},computed:{...q(Y,ee),pinData(){return this.node?this.workflowsStore.pinDataByNodeName(this.node.name):void 0},hasPinData(){return!!this.node&&typeof this.pinData<"u"},isSubNode(){if(!this.nodeType.outputs||typeof this.nodeType.outputs=="string")return!1;const e=fe(this.nodeType.outputs);return e?e.filter(t=>t!==$.Main).length>0:!1},isPinDataNodeType(){return!!this.node&&!this.isSubNode&&!this.isMultipleOutputsNodeType&&!Xo.includes(this.node.type)},isMultipleOutputsNodeType(){var e;return((e=this.nodeType)==null?void 0:e.outputs.length)>1}},methods:{isValidPinDataJSON(e){try{return JSON.parse(e),!0}catch(t){const o=this.$locale.baseText("runData.editOutputInvalid"),n=new RegExp(/JSON\.parse:|of the JSON data/,"g"),i=t.message.replace(n,"").trim(),s=/at position (\d+)/,a=t.message.match(s);if(t.message=i.charAt(0).toUpperCase()+i.slice(1),t.message=t.message.replace("Unexpected token ' in JSON",this.$locale.baseText("runData.editOutputInvalid.singleQuote")),a){const r=parseInt(a[1],10),l=(e.slice(0,r).match(/\n/g)||[]).length;t.message=t.message.replace(s,this.$locale.baseText("runData.editOutputInvalid.atPosition",{interpolate:{position:`${r}`}})),t.message=`${this.$locale.baseText("runData.editOutputInvalid.onLine",{interpolate:{line:`${l+1}`}})} ${t.message}`}return this.showError(t,o),!1}},isValidPinDataSize(e,t){typeof e=="object"&&(e=JSON.stringify(e));const{pinData:o,...n}=this.workflowsStore.getCurrentWorkflow(),i=In(n,{replaceCircularRefs:!0}),s={...o,[t]:e},a=this.workflowsStore.getPinDataSize(s);return a>Pn?(this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title")),!1):st(i)+a>On-Rn?(this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLargeWorkflow.description")),this.$locale.baseText("ndv.pinData.error.tooLargeWorkflow.title")),!1):!0},setPinData(e,t,o){if(typeof t=="string"){if(!this.isValidPinDataJSON(t))throw this.onDataPinningError({errorType:"invalid-json",source:o}),new Error("Invalid JSON");t=Nt(t)}if(!this.isValidPinDataSize(t,e.name))throw this.onDataPinningError({errorType:"data-too-large",source:o}),new Error("Data too large");this.onDataPinningSuccess({source:o}),this.workflowsStore.pinData({node:e,data:t})},unsetPinData(e,t){this.onDataUnpinning({source:t}),this.workflowsStore.unpinData({node:e})},onDataPinningSuccess({source:e}){var o;const t={pinning_source:e,node_type:(o=this.activeNode)==null?void 0:o.type,session_id:this.sessionId,data_size:st(this.pinData),view:this.displayMode,run_index:this.runIndex};this.$externalHooks().run("runData.onDataPinningSuccess",t),this.$telemetry.track("Ndv data pinning success",t)},onDataPinningError({errorType:e,source:t}){var o;this.$telemetry.track("Ndv data pinning failure",{pinning_source:t,node_type:(o=this.activeNode)==null?void 0:o.type,session_id:this.sessionId,data_size:st(this.pinData),view:this.displayMode,run_index:this.runIndex,error_type:e})},onDataUnpinning({source:e}){var t;this.$telemetry.track("User unpinned ndv data",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,source:e,data_size:st(this.pinData)})}}}),Vs=x({name:"NodeTitle",components:{NodeIcon:Tt},props:{modelValue:{type:String,default:""},nodeType:{},readOnly:{type:Boolean,default:!1}},data(){return{editName:!1,newName:""}},computed:{editable(){return!this.readOnly&&window===window.parent}},methods:{async onEdit(){this.newName=this.modelValue,this.editName=!0,await this.$nextTick();const e=this.$refs.input;e&&e.focus()},onRename(){this.newName.trim()!==""&&this.$emit("update:modelValue",this.newName.trim()),this.editName=!1}}}),Bs="_container_15oh7_5",Ls="_title_15oh7_15",Us="_hoverable_15oh7_23",xs="_editIcon_15oh7_26",Fs="_iconWrapper_15oh7_30",Hs="_editIconContainer_15oh7_43",zs="_editButtons_15oh7_49",Ks="_editContainer_15oh7_57",js={container:Bs,title:Ls,hoverable:Us,editIcon:xs,iconWrapper:Fs,editIconContainer:Hs,editButtons:zs,editContainer:Ks};function Ys(e,t,o,n,i,s){const a=S("NodeIcon"),r=S("n8n-text"),l=S("n8n-input"),p=S("n8n-button"),h=S("font-awesome-icon"),d=S("n8n-popover");return u(),T("span",{class:D(e.$style.container),"data-test-id":"node-title-container",onClick:t[5]||(t[5]=(...m)=>e.onEdit&&e.onEdit(...m))},[g("span",{class:D(e.$style.iconWrapper)},[v(a,{nodeType:e.nodeType,size:18},null,8,["nodeType"])],2),v(d,{placement:"right",width:"200",visible:e.editName,disabled:!e.editable},{reference:y(()=>[g("div",{class:D({[e.$style.title]:!0,[e.$style.hoverable]:e.editable})},[I(b(e.modelValue)+" ",1),g("div",{class:D(e.$style.editIconContainer)},[e.editable?(u(),P(h,{key:0,class:D(e.$style.editIcon),icon:"pencil-alt"},null,8,["class"])):C("",!0)],2)],2)]),default:y(()=>[g("div",{class:D(e.$style.editContainer),onKeydown:[t[2]||(t[2]=Wo((...m)=>e.onRename&&e.onRename(...m),["enter"])),t[3]||(t[3]=ie(()=>{},["stop"])),t[4]||(t[4]=Wo(m=>e.editName=!1,["esc"]))]},[v(r,{bold:!0,color:"text-base",tag:"div"},{default:y(()=>[I(b(e.$locale.baseText("ndv.title.renameNode")),1)]),_:1}),v(l,{ref:"input",size:"small",modelValue:e.newName,"onUpdate:modelValue":t[0]||(t[0]=m=>e.newName=m),"data-test-id":"node-rename-input"},null,8,["modelValue"]),g("div",{class:D(e.$style.editButtons)},[v(p,{type:"secondary",size:"small",onClick:t[1]||(t[1]=m=>e.editName=!1),label:e.$locale.baseText("ndv.title.cancel")},null,8,["label"]),v(p,{type:"primary",size:"small",onClick:e.onRename,label:e.$locale.baseText("ndv.title.rename")},null,8,["onClick","label"])],2)],34)]),_:1},8,["visible","disabled"])],2)}const Gs={$style:js},qs=H(Vs,[["render",Ys],["__cssModules",Gs]]),Js=x({name:"NodeSettingsTabs",mixins:[Ie],props:{modelValue:{type:String,default:""},nodeType:{},sessionId:{type:String}},computed:{...q(ee,Y),activeNode(){return this.ndvStore.activeNode},documentationUrl(){var n,i,s,a;const e=this.nodeType;if(!e)return"";if(e.documentationUrl&&e.documentationUrl.startsWith("http"))return e.documentationUrl;const t="?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign="+e.name,o=(a=(s=(i=(n=e.codex)==null?void 0:n.resources)==null?void 0:i.primaryDocumentation)==null?void 0:s[0])==null?void 0:a.url;return o?o+t:this.isCommunityNode?`${$n}${e.name.split(".")[0]}`:An+t},isCommunityNode(){const e=this.nodeType;return e?Zo(e.name):!1},packageName(){return this.nodeType.name.split(".")[0]},options(){const e=[{label:this.$locale.baseText("nodeSettings.parameters"),value:"params"}];this.documentationUrl&&e.push({label:this.$locale.baseText("nodeSettings.docs"),value:"docs",href:this.documentationUrl}),this.isCommunityNode&&e.push({icon:"cube",value:"communityNode",align:"right",tooltip:this.$locale.baseText("generic.communityNode.tooltip",{interpolate:{docUrl:en,packageName:this.packageName}})});const t=!this.isCommunityNode;return e.push({icon:"cog",value:"settings",align:t?"right":void 0}),e}},methods:{onTabSelect(e){e==="docs"&&this.nodeType&&(this.$externalHooks().run("dataDisplay.onDocumentationUrlClick",{nodeType:this.nodeType,documentationUrl:this.documentationUrl}),this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:$.Main,type:"docs"})),e==="settings"&&this.nodeType&&this.$telemetry.track("User viewed node settings",{node_type:this.nodeType.name,workflow_id:this.workflowsStore.workflowId}),(e==="settings"||e==="params")&&this.$emit("update:modelValue",e)},onTooltipClick(e,t){e==="communityNode"&&t.target.localName==="a"&&this.$telemetry.track("user clicked cnr docs link",{source:"node details view"})}}});function Xs(e,t,o,n,i,s){const a=S("n8n-tabs");return u(),P(a,{options:e.options,modelValue:e.modelValue,"onUpdate:modelValue":e.onTabSelect,onTooltipClick:e.onTooltipClick},null,8,["options","modelValue","onUpdate:modelValue","onTooltipClick"])}const Qs=H(Js,[["render",Xs]]),Zs=x({name:"NodeWebhooks",mixins:[St,Pe],props:["node","nodeType"],setup(){return{...He()}},data(){return{isMinimized:this.nodeType&&!Gt.includes(this.nodeType.name),showUrlFor:"test"}},computed:{webhooksNode(){return this.nodeType===null||this.nodeType.webhooks===void 0?[]:this.nodeType.webhooks.filter(e=>e.restartWebhook!==!0)},baseText(){switch(this.nodeType.name){case Ue:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.formTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.formTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.formTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.formTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.formTrigger")};default:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title"),copyMessage:void 0}}}},methods:{copyWebhookUrl(e){const t=this.getWebhookUrlDisplay(e);this.copyToClipboard(t),this.showMessage({title:this.baseText.copyTitle,message:this.baseText.copyMessage,type:"success"}),this.$telemetry.track("User copied webhook URL",{pane:"parameters",type:`${this.showUrlFor} url`})},getWebhookUrlDisplay(e){return this.node?this.getWebhookUrl(e,this.node,this.showUrlFor):""}},watch:{node(){this.isMinimized=!Gt.includes(this.nodeType.name)}}}),jt=e=>(fn("data-v-59e2355b"),e=e(),mn(),e),ea={key:0,class:"webhooks"},ta=["title"],oa={key:0,class:"node-webhooks"},na={class:"url-selection"},ia={key:0,class:"webhook-wrapper"},sa={class:"http-field"},aa={class:"http-method"},ra=jt(()=>g("br",null,null,-1)),la={class:"url-field"},da=["onClick"],ua=jt(()=>g("br",null,null,-1)),ca={key:1,class:"webhook-wrapper"},ha={class:"url-field-full-width"},pa=["onClick"],ga=jt(()=>g("br",null,null,-1));function fa(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("n8n-radio-buttons"),l=S("el-col"),p=S("el-row"),h=S("n8n-tooltip"),d=S("el-collapse-transition");return e.webhooksNode.length?(u(),T("div",ea,[g("div",{class:D(["clickable headline",{expanded:!e.isMinimized}]),onClick:t[0]||(t[0]=m=>e.isMinimized=!e.isMinimized),title:e.isMinimized?e.baseText.clickToDisplay:e.baseText.clickToHide},[v(a,{icon:"angle-down",class:"minimize-button minimize-icon"}),I(" "+b(e.baseText.toggleTitle),1)],10,ta),v(d,null,{default:y(()=>[e.isMinimized?C("",!0):(u(),T("div",oa,[g("div",na,[v(p,null,{default:y(()=>[v(l,{span:24},{default:y(()=>[v(r,{modelValue:e.showUrlFor,"onUpdate:modelValue":t[1]||(t[1]=m=>e.showUrlFor=m),options:[{label:e.baseText.testUrl,value:"test"},{label:e.baseText.productionUrl,value:"production"}]},null,8,["modelValue","options"])]),_:1})]),_:1})]),(u(!0),T(Z,null,de(e.webhooksNode.filter(m=>!m.ndvHideUrl),(m,N)=>(u(),P(h,{key:N,class:"item",content:e.baseText.clickToCopy,placement:"left"},{default:y(()=>[m.ndvHideMethod?(u(),T("div",ca,[g("div",ha,[g("div",{class:"webhook-url left-ellipsis clickable",onClick:k=>e.copyWebhookUrl(m)},[I(b(e.getWebhookUrlDisplay(m)),1),ga],8,pa)])])):(u(),T("div",ia,[g("div",sa,[g("div",aa,[I(b(e.getWebhookExpressionValue(m,"httpMethod")),1),ra])]),g("div",la,[g("div",{class:"webhook-url left-ellipsis clickable",onClick:k=>e.copyWebhookUrl(m)},[I(b(e.getWebhookUrlDisplay(m)),1),ua],8,da)])]))]),_:2},1032,["content"]))),128))]))]),_:1})])):C("",!0)}const ma=H(Zs,[["render",fa],["__scopeId","data-v-59e2355b"]]),ya=x({inheritAttrs:!1,mixins:[ft,ze],props:{nodeName:{type:String},disabled:{type:Boolean,default:!1},label:{type:String},type:{type:String},size:{type:String},transparent:{type:Boolean,default:!1},telemetrySource:{type:String}},setup(e){var t,o;return{...He(),...xt(),...(o=(t=ft).setup)==null?void 0:o.call(t,e)}},computed:{...q(G,ee,Y),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},nodeRunning(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&(this.workflowsStore.isNodeExecuting(this.node.name)||e===this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isTriggerNode(){return this.node?this.nodeTypesStore.isTriggerNode(this.node.type):!1},isManualTriggerNode(){return!!(this.nodeType&&this.nodeType.name===ot)},isFormTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Ue)},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){var e;return!!((e=this.nodeType)!=null&&e.group.includes("schedule"))},isWebhookNode(){return!!(this.nodeType&&this.nodeType.name===Le)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return this.node&&!this.node.disabled&&this.isTriggerNode&&e&&(!t||t===this.nodeName)},isListeningForWorkflowEvents(){return this.nodeRunning&&this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},disabledHint(){if(this.isListeningForEvents)return"";if(this.isTriggerNode&&this.node.disabled)return this.$locale.baseText("ndv.execute.nodeIsDisabled");if(this.isTriggerNode&&this.hasIssues){const e=this.ndvStore.activeNode;return e&&e.name!==this.nodeName?this.$locale.baseText("ndv.execute.fixPrevious"):this.$locale.baseText("ndv.execute.requiredFieldsMissing")}return this.workflowRunning&&!this.nodeRunning?this.$locale.baseText("ndv.execute.workflowAlreadyRunning"):""},buttonLabel(){var e;return this.isListeningForEvents||this.isListeningForWorkflowEvents?this.$locale.baseText("ndv.execute.stopListening"):this.label?this.label:this.isWebhookNode?this.$locale.baseText("ndv.execute.listenForTestEvent"):this.isFormTriggerNode?this.$locale.baseText("ndv.execute.testStep"):this.isPollingTypeNode||(e=this.nodeType)!=null&&e.mockManualExecution?this.$locale.baseText("ndv.execute.fetchEvent"):this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode&&!this.isFormTriggerNode?this.$locale.baseText("ndv.execute.listenForEvent"):this.$locale.baseText("ndv.execute.executeNode")}},methods:{async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("ndv.execute.stopWaitingForWebhook.error"));return}},async onClick(){if(this.isListeningForEvents)await this.stopWaitingForWebhook();else if(this.isListeningForWorkflowEvents)this.$emit("stopExecution");else{let e=!1;if(this.hasPinData&&(e=await this.confirm(this.$locale.baseText("ndv.pinData.unpinAndExecute.description"),this.$locale.baseText("ndv.pinData.unpinAndExecute.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.cancel")})===We,e&&this.node&&this.unsetPinData(this.node,"unpin-and-execute-modal")),!this.hasPinData||e){const t={node_type:this.nodeType?this.nodeType.name:null,workflow_id:this.workflowsStore.workflowId,source:this.telemetrySource,session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",t),await this.$externalHooks().run("nodeExecuteButton.onClick",t),await this.runWorkflow({destinationNode:this.nodeName,source:"RunData.ExecuteNodeButton"}),this.$emit("execute")}}}}});function wa(e,t,o,n,i,s){const a=S("n8n-button"),r=S("n8n-tooltip");return u(),T("div",null,[v(r,{placement:"bottom",disabled:!e.disabledHint},{content:y(()=>[g("div",null,b(e.disabledHint),1)]),default:y(()=>[g("div",null,[v(a,bs(e.$attrs,{loading:e.nodeRunning&&!e.isListeningForEvents&&!e.isListeningForWorkflowEvents,disabled:e.disabled||!!e.disabledHint,label:e.buttonLabel,type:e.type,size:e.size,icon:e.isFormTriggerNode&&"flask",transparentBackground:e.transparent,onClick:e.onClick}),null,16,["loading","disabled","label","type","size","icon","transparentBackground","onClick"])])]),_:1},8,["disabled"])])}const Yt=H(ya,[["render",wa]]),va=x({name:"NodeSettings",mixins:[Ie,Oe],components:{NodeTitle:qs,NodeCredentials:Vi,ParameterInputList:Bi,NodeSettingsTabs:Qs,NodeWebhooks:ma,NodeExecuteButton:Yt},computed:{...q(bt,G,ee,ue,tn,Y,cn),isCurlImportModalOpen(){return this.uiStore.isModalOpen(qt)},isReadOnly(){return this.readOnly||this.hasForeignCredential},isExecutable(){if(this.nodeType&&this.node){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=ge(e,t,this.nodeType);if(!fe(o).includes($.Main)&&!this.isTriggerNode)return!1}return this.executable||this.hasForeignCredential},nodeTypeName(){if(this.nodeType){const e=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${e}.displayName`,fallback:this.nodeType.name})}return""},nodeTypeVersions(){return this.node?this.nodeTypesStore.getNodeVersions(this.node.type):[]},latestVersion(){return Math.max(...this.nodeTypeVersions)},isLatestNodeVersion(){var e;return this.latestVersion===((e=this.node)==null?void 0:e.typeVersion)},nodeVersionTag(){return!this.nodeType||this.nodeType.hidden?this.$locale.baseText("nodeSettings.deprecated"):this.isLatestNodeVersion?this.$locale.baseText("nodeSettings.latest"):this.$locale.baseText("nodeSettings.latestVersion",{interpolate:{version:this.latestVersion.toString()}})},nodeTypeDescription(){var e;if((e=this.nodeType)!=null&&e.description){const t=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${t}.description`,fallback:this.nodeType.description})}else return this.$locale.baseText("nodeSettings.noDescriptionFound")},headerStyle(){return this.node?{"background-color":this.node.color}:{}},node(){return this.ndvStore.activeNode},parametersSetting(){return this.parameters.filter(e=>e.isNodeSetting)},parametersNoneSetting(){return this.parameters.filter(e=>!e.isNodeSetting)},parameters(){return this.nodeType===null?[]:this.nodeType.properties},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isCommunityNode(){var e;return Zo((e=this.node)==null?void 0:e.type)},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode((e=this.node)==null?void 0:e.type)},workflowOwnerName(){return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowsStore.workflowId}`)},hasForeignCredential(){return this.foreignCredentials.length>0},usedCredentials(){return Object.values(this.workflowsStore.usedCredentials).filter(e=>{var t;return Object.values(((t=this.node)==null?void 0:t.credentials)||[]).find(o=>o.id===e.id)})},credentialOwnerName(){const e=this.usedCredentials?Object.values(this.usedCredentials).find(t=>t.id===this.foreignCredentials[0]):void 0;return this.credentialsStore.getCredentialOwnerName(e)}},props:{eventBus:{type:Object},dragging:{type:Boolean},sessionId:{type:String},nodeType:{type:Object},readOnly:{type:Boolean,default:!1},foreignCredentials:{type:Array,default:()=>[]},blockUI:{type:Boolean,default:!1},executable:{type:Boolean,default:!0}},data(){return{nodeValid:!0,nodeColor:null,openPanel:"params",nodeValues:{color:"#ff0000",alwaysOutputData:!1,executeOnce:!1,notesInFlow:!1,onError:"stopWorkflow",retryOnFail:!1,maxTries:3,waitBetweenTries:1e3,notes:"",parameters:{}},nodeValuesInitialized:!1,nodeSettings:[],COMMUNITY_NODES_INSTALLATION_DOCS_URL:en,CUSTOM_NODES_DOCS_URL:Mn,MAIN_NODE_PANEL_WIDTH:_e,hiddenIssuesInputs:[]}},watch:{node(e,t){this.setNodeValues()},isCurlImportModalOpen(e,t){if(e===!1){let o=this.uiStore.getHttpNodeParameters||"";if(!o)return;try{o=JSON.parse(o),this.valueChanged({node:this.node.name,name:"parameters",value:o}),this.uiStore.setHttpNodeParameters({name:qt,parameters:""})}catch{}}}},methods:{populateHiddenIssuesSet(){!this.node||!this.workflowsStore.isNodePristine(this.node.name)||(this.hiddenIssuesInputs.push("credentials"),this.parametersNoneSetting.forEach(e=>{this.hiddenIssuesInputs.push(e.name)}),this.workflowsStore.setNodePristine(this.node.name,!1))},populateSettings(){this.isExecutable&&!this.isTriggerNode&&this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.alwaysOutputData.displayName"),name:"alwaysOutputData",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.alwaysOutputData.description")},{displayName:this.$locale.baseText("nodeSettings.executeOnce.displayName"),name:"executeOnce",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.executeOnce.description")},{displayName:this.$locale.baseText("nodeSettings.retryOnFail.displayName"),name:"retryOnFail",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.retryOnFail.description")},{displayName:this.$locale.baseText("nodeSettings.maxTries.displayName"),name:"maxTries",type:"number",typeOptions:{minValue:2,maxValue:5},default:3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.maxTries.description")},{displayName:this.$locale.baseText("nodeSettings.waitBetweenTries.displayName"),name:"waitBetweenTries",type:"number",typeOptions:{minValue:0,maxValue:5e3},default:1e3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.waitBetweenTries.description")},{displayName:this.$locale.baseText("nodeSettings.onError.displayName"),name:"onError",type:"options",options:[{name:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.displayName"),value:"stopWorkflow",description:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.displayName"),value:"continueRegularOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.displayName"),value:"continueErrorOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.description")}],default:"stopWorkflow",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.onError.description")}),this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.notes.displayName"),name:"notes",type:"string",typeOptions:{rows:5},default:"",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notes.description")},{displayName:this.$locale.baseText("nodeSettings.notesInFlow.displayName"),name:"notesInFlow",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notesInFlow.description")})},onParameterBlur(e){this.hiddenIssuesInputs=this.hiddenIssuesInputs.filter(t=>t!==e)},onWorkflowActivate(){this.hiddenIssuesInputs=[],this.$emit("activate")},onNodeExecute(){this.hiddenIssuesInputs=[],this.$emit("execute")},setValue(e,t){const o=e.split(".");let n=o.pop(),i=!1;if(n!==void 0&&n.includes("[")){const s=n.match(/(.*)\[(\d+)\]$/);s&&(o.push(s[1]),n=s[2],i=!0)}if(o.length===0)if(t===null){const{[n]:s,...a}=this.nodeValues;this.nodeValues=a}else this.nodeValues={...this.nodeValues,[n]:t};else if(t===null){let s=me(this.nodeValues,o.join("."));const{[n]:a,...r}=s;if(s=r,i&&s.length===0){n=o.pop(),s=me(this.nodeValues,o.join("."));const{[n]:l,...p}=s;s=p}}else typeof t=="object"?Ae(me(this.nodeValues,o.join(".")),n,Te(t)):Ae(me(this.nodeValues,o.join(".")),n,t);this.nodeValues={...this.nodeValues}},credentialSelected(e){this.workflowsStore.updateNodeProperties(e);const t=this.workflowsStore.getNodeByName(e.name);t&&this.updateNodeCredentialIssues(t),this.$externalHooks().run("nodeSettings.credentialSelected",{updateInformation:e})},nameChanged(e){this.node&&this.historyStore.pushCommandToUndo(new hn(this.node.name,e)),this.valueChanged({value:e,name:"name"})},valueChanged(e){var i;let t;e.hasOwnProperty("value")?t=e.value:t=me(this.nodeValues,e.name);const o=e.node||((i=this.node)==null?void 0:i.name),n=this.workflowsStore.getNodeByName(o);if(n!==null)if(e.name==="onError"&&this.$emit("redrawRequired"),e.name==="name"){const s={value:t,oldValue:o,name:e.name};this.$emit("valueChanged",s)}else if(e.name==="parameters"){const s=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!s)return;let a=Ve(s.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Te(a);for(const l of Object.keys(e.value)){t=e.value[l];const p=l.split(".").slice(1).join("."),h=p.match(/(.*)\[(\d+)\]$/);if(e[l]===void 0&&h!==null){const d=h[1],m=h[2],N=me(a,d);Array.isArray(N)&&(N.splice(parseInt(m,10),1),Ae(a,d,N))}else t===void 0?Fo(a,p):Ae(a,p,t);this.$externalHooks().run("nodeSettings.valueChanged",{parameterPath:p,newValue:t,parameters:this.parameters,oldNodeParameters:r})}a=Ve(s.properties,a,!0,!1,n);for(const l of Object.keys(a))a&&a[l]!==null&&a[l]!==void 0&&this.setValue(`parameters.${l}`,a[l]);if(a){const l={name:n.name,value:a};this.workflowsStore.setNodeParameters(l),this.updateNodeParameterIssuesByName(n.name),this.updateNodeCredentialIssuesByName(n.name)}}else if(e.name.startsWith("parameters.")){const s=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!s)return;let a=Ve(s.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Te(a);const l=e.name.split(".").slice(1).join("."),p=l.match(/(.*)\[(\d+)\]$/);if(e.value===void 0&&p!==null){const d=p[1],m=p[2],N=me(a,d);Array.isArray(N)&&(N.splice(parseInt(m,10),1),Ae(a,d,N))}else t===void 0?Fo(a,l):Ae(a,l,t);a=Ve(s.properties,a,!0,!1,n);for(const d of Object.keys(a))a&&a[d]!==null&&a[d]!==void 0&&this.setValue(`parameters.${d}`,a[d]);const h={name:n.name,value:a};this.workflowsStore.setNodeParameters(h),this.$externalHooks().run("nodeSettings.valueChanged",{parameterPath:l,newValue:t,parameters:this.parameters,oldNodeParameters:r}),this.updateNodeParameterIssuesByName(n.name),this.updateNodeCredentialIssuesByName(n.name),this.$telemetry.trackNodeParametersValuesChange(s.name,e)}else{this.nodeValues={...this.nodeValues,[e.name]:t};const s={name:n.name,key:e.name,value:t};this.workflowsStore.setNodeValue(s)}},setNodeValues(){if(!this.node){this.nodeValuesInitialized=!0;return}if(this.nodeType!==null){this.nodeValid=!0;const e=[];this.node.color&&(e.push("color"),this.nodeValues={...this.nodeValues,color:this.node.color}),this.node.notes&&(e.push("notes"),this.nodeValues={...this.nodeValues,notes:this.node.notes}),this.node.alwaysOutputData&&(e.push("alwaysOutputData"),this.nodeValues={...this.nodeValues,alwaysOutputData:this.node.alwaysOutputData}),this.node.executeOnce&&(e.push("executeOnce"),this.nodeValues={...this.nodeValues,executeOnce:this.node.executeOnce}),this.node.continueOnFail&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:"continueRegularOutput"}),this.node.onError&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:this.node.onError}),this.node.notesInFlow&&(e.push("notesInFlow"),this.nodeValues={...this.nodeValues,notesInFlow:this.node.notesInFlow}),this.node.retryOnFail&&(e.push("retryOnFail"),this.nodeValues={...this.nodeValues,retryOnFail:this.node.retryOnFail}),this.node.maxTries&&(e.push("maxTries"),this.nodeValues={...this.nodeValues,maxTries:this.node.maxTries}),this.node.waitBetweenTries&&(e.push("waitBetweenTries"),this.nodeValues={...this.nodeValues,waitBetweenTries:this.node.waitBetweenTries});for(const t of this.nodeSettings)e.includes(t.name)||(this.nodeValues={...this.nodeValues,[t.name]:t.default});this.nodeValues={...this.nodeValues,parameters:Te(this.node.parameters)}}else this.nodeValid=!1;this.nodeValuesInitialized=!0},onMissingNodeTextClick(e){e.target.localName==="a"&&this.$telemetry.track("user clicked cnr browse button",{source:"cnr missing node modal"})},onMissingNodeLearnMoreLinkClick(){var e,t;this.$telemetry.track("user clicked cnr docs link",{source:"missing node modal source",package_name:(e=this.node)==null?void 0:e.type.split(".")[0],node_type:(t=this.node)==null?void 0:t.type})},onStopExecution(){this.$emit("stopExecution")},openSettings(){this.openPanel="settings"}},mounted(){var e;this.populateHiddenIssuesSet(),this.populateSettings(),this.setNodeValues(),(e=this.eventBus)==null||e.on("openSettings",this.openSettings),this.updateNodeParameterIssues(this.node,this.nodeType)},beforeUnmount(){var e;(e=this.eventBus)==null||e.off("openSettings",this.openSettings)}}),Na="_header_1uxvz_5",ka="_warningIcon_1uxvz_9",ba="_descriptionContainer_1uxvz_14",Ta={header:Na,warningIcon:ka,descriptionContainer:ba},Sa={class:"header-side-menu"},Da={key:1},Ea={key:0,class:"node-is-not-valid"},Ca={class:"missingNodeTitleContainer mt-s mb-xs"},Ia={class:"mb-l"},Pa=["href"],Oa=["href","textContent"],Ra={key:1,class:"node-parameters-wrapper","data-test-id":"node-parameters"},$a={key:1,class:"no-parameters"},Aa={key:2,class:"parameter-item parameter-notice","data-test-id":"node-parameters-http-notice"},Ma={class:"node-version","data-test-id":"node-version"};function _a(e,t,o,n,i,s){var E;const a=S("NodeTitle"),r=S("NodeExecuteButton"),l=S("NodeSettingsTabs"),p=S("font-awesome-icon"),h=S("n8n-text"),d=S("i18n-t"),m=S("n8n-link"),N=S("n8n-notice"),k=S("node-webhooks"),w=S("node-credentials"),c=S("parameter-input-list"),f=S("n8n-block-ui");return u(),T("div",{class:D({"node-settings":!0,dragging:e.dragging}),onKeydown:t[1]||(t[1]=ie(()=>{},["stop"]))},[g("div",{class:D(e.$style.header)},[g("div",Sa,[e.node?(u(),P(a,{key:0,class:"node-name",modelValue:e.node.name,nodeType:e.nodeType,readOnly:e.isReadOnly,"onUpdate:modelValue":e.nameChanged},null,8,["modelValue","nodeType","readOnly","onUpdate:modelValue"])):C("",!0),e.isExecutable?(u(),T("div",Da,[!e.blockUI&&e.node&&e.nodeValid?(u(),P(r,{key:0,"data-test-id":"node-execute-button",nodeName:e.node.name,disabled:e.outputPanelEditMode.enabled&&!e.isTriggerNode,size:"small",telemetrySource:"parameters",onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution},null,8,["nodeName","disabled","onExecute","onStopExecution"])):C("",!0)])):C("",!0)]),e.node&&e.nodeValid?(u(),P(l,{key:0,modelValue:e.openPanel,"onUpdate:modelValue":t[0]||(t[0]=O=>e.openPanel=O),nodeType:e.nodeType,sessionId:e.sessionId},null,8,["modelValue","nodeType","sessionId"])):C("",!0)],2),e.node&&!e.nodeValid?(u(),T("div",Ea,[g("p",{class:D(e.$style.warningIcon)},[v(p,{icon:"exclamation-triangle"})],2),g("div",Ca,[v(h,{size:"large",color:"text-dark",bold:""},{default:y(()=>[I(b(e.$locale.baseText("nodeSettings.communityNodeUnknown.title")),1)]),_:1})]),e.isCommunityNode?(u(),T("div",{key:0,class:D(e.$style.descriptionContainer)},[g("div",Ia,[v(d,{keypath:"nodeSettings.communityNodeUnknown.description",tag:"span",onClick:e.onMissingNodeTextClick},{action:y(()=>[g("a",{href:`https://www.npmjs.com/package/${e.node.type.split(".")[0]}`,target:"_blank"},b(e.node.type.split(".")[0]),9,Pa)]),_:1},8,["onClick"])]),v(m,{to:e.COMMUNITY_NODES_INSTALLATION_DOCS_URL,onClick:e.onMissingNodeLearnMoreLinkClick},{default:y(()=>[I(b(e.$locale.baseText("nodeSettings.communityNodeUnknown.installLink.text")),1)]),_:1},8,["to","onClick"])],2)):(u(),P(d,{key:1,keypath:"nodeSettings.nodeTypeUnknown.description",tag:"span"},{action:y(()=>[g("a",{href:e.CUSTOM_NODES_DOCS_URL,target:"_blank",textContent:b(e.$locale.baseText("nodeSettings.nodeTypeUnknown.description.customNode"))},null,8,Oa)]),_:1}))])):C("",!0),e.node&&e.nodeValid?(u(),T("div",Ra,[e.hasForeignCredential?(u(),P(N,{key:0,content:e.$locale.baseText("nodeSettings.hasForeignCredential",{interpolate:{owner:e.credentialOwnerName}})},null,8,["content"])):C("",!0),z(g("div",null,[v(k,{node:e.node,nodeType:e.nodeType},null,8,["node","nodeType"]),e.nodeValuesInitialized?(u(),P(c,{key:0,parameters:e.parametersNoneSetting,hideDelete:!0,nodeValues:e.nodeValues,isReadOnly:e.isReadOnly,hiddenIssuesInputs:e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onActivate:e.onWorkflowActivate,onParameterBlur:e.onParameterBlur},{default:y(()=>[v(w,{node:e.node,readonly:e.isReadOnly,showAll:!0,onCredentialSelected:e.credentialSelected,onValueChanged:e.valueChanged,onBlur:e.onParameterBlur,"hide-issues":e.hiddenIssuesInputs.includes("credentials")},null,8,["node","readonly","onCredentialSelected","onValueChanged","onBlur","hide-issues"])]),_:1},8,["parameters","nodeValues","isReadOnly","hiddenIssuesInputs","onValueChanged","onActivate","onParameterBlur"])):C("",!0),e.parametersNoneSetting.length===0?(u(),T("div",$a,[v(h,null,{default:y(()=>[I(b(e.$locale.baseText("nodeSettings.thisNodeDoesNotHaveAnyParameters")),1)]),_:1})])):C("",!0),e.isCustomApiCallSelected(e.nodeValues)?(u(),T("div",Aa,[v(N,{content:e.$locale.baseText("nodeSettings.useTheHttpRequestNode",{interpolate:{nodeTypeDisplayName:e.nodeType.displayName}})},null,8,["content"])])):C("",!0)],512),[[J,e.openPanel==="params"]]),z(g("div",null,[v(c,{parameters:e.parametersSetting,nodeValues:e.nodeValues,isReadOnly:e.isReadOnly,hiddenIssuesInputs:e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","nodeValues","isReadOnly","hiddenIssuesInputs","onValueChanged","onParameterBlur"]),v(c,{parameters:e.nodeSettings,hideDelete:!0,nodeValues:e.nodeValues,isReadOnly:e.isReadOnly,hiddenIssuesInputs:e.hiddenIssuesInputs,path:"",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","nodeValues","isReadOnly","hiddenIssuesInputs","onValueChanged","onParameterBlur"]),g("div",Ma,[I(b(e.$locale.baseText("nodeSettings.nodeVersion",{interpolate:{node:(E=e.nodeType)==null?void 0:E.displayName,version:e.node.typeVersion.toString()}}))+" ",1),g("span",null,"("+b(e.nodeVersionTag)+")",1)])],512),[[J,e.openPanel==="settings"]])])):C("",!0),v(f,{show:e.blockUI},null,8,["show"])],34)}const Wa={$style:Ta},Va=H(va,[["render",_a],["__cssModules",Wa],["__scopeId","data-v-7be9a1a3"]]),Ba=x({name:"draggable",props:{disabled:{type:Boolean},type:{type:String},data:{type:String},tag:{type:String,default:"div"},targetDataKey:{type:String}},data(){const e={x:-100,y:-100};return{isDragging:!1,draggablePosition:e,draggingEl:null,draggableStyle:{transform:`translate(${e.x}px, ${e.y}px)`},animationFrameId:0}},computed:{...q(ee),canDrop(){return this.ndvStore.canDraggableDrop},stickyPosition(){return this.ndvStore.draggableStickyPos}},methods:{setDraggableStyle(){this.draggableStyle={transform:`translate(${this.draggablePosition.x}px, ${this.draggablePosition.y}px)`}},onDragStart(e){var o,n,i;if(this.disabled||(this.draggingEl=e.target,this.targetDataKey&&((o=this.draggingEl.dataset)==null?void 0:o.target)!==this.targetDataKey&&(this.draggingEl=this.draggingEl.closest(`[data-target="${this.targetDataKey}"]`)),this.targetDataKey&&((i=(n=this.draggingEl)==null?void 0:n.dataset)==null?void 0:i.target)!==this.targetDataKey))return;e.preventDefault(),e.stopPropagation(),this.isDragging=!1,this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),window.addEventListener("mousemove",this.onDrag),window.addEventListener("mouseup",this.onDragEnd);const t=document.activeElement;t&&t.blur()},onDrag(e){if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(!this.isDragging){this.isDragging=!0;const t=this.targetDataKey&&this.draggingEl?this.draggingEl.dataset.value:this.data||"";this.ndvStore.draggableStartDragging({type:this.type,data:t||""}),this.$emit("dragstart",this.draggingEl),document.body.style.cursor="grabbing"}this.animationFrameId=window.requestAnimationFrame(()=>{this.canDrop&&this.stickyPosition?this.draggablePosition={x:this.stickyPosition[0],y:this.stickyPosition[1]}:this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),this.$emit("drag",this.draggablePosition)})}},onDragEnd(){this.disabled||(document.body.style.cursor="unset",window.removeEventListener("mousemove",this.onDrag),window.removeEventListener("mouseup",this.onDragEnd),window.cancelAnimationFrame(this.animationFrameId),setTimeout(()=>{this.$emit("dragend",this.draggingEl),this.isDragging=!1,this.draggingEl=null,this.ndvStore.draggableStopDragging()},0))}}}),La="_dragging_bt5wj_5",Ua="_draggable_bt5wj_10",xa={dragging:La,draggable:Ua,"draggable-data-transfer":"_draggable-data-transfer_bt5wj_17"};function Fa(e,t,o,n,i,s){return u(),P(yn(e.tag),{class:D({[e.$style.dragging]:e.isDragging}),onMousedown:e.onDragStart,ref:"wrapper"},{default:y(()=>[ae(e.$slots,"default",{isDragging:e.isDragging}),(u(),P(wn,{to:"body"},[z(g("div",{ref:"draggable",class:D(e.$style.draggable),style:se(e.draggableStyle)},[ae(e.$slots,"preview",{canDrop:e.canDrop,el:e.draggingEl})],6),[[J,e.isDragging]])]))]),_:3},40,["class","onMousedown"])}const Ha={$style:xa},za=H(Ba,[["render",Fa],["__cssModules",Ha]]),Ka=x({components:{Draggable:za},props:{canMoveRight:{type:Boolean},canMoveLeft:{type:Boolean}},methods:{onDrag(e){this.$emit("drag",e)},onDragStart(){this.$emit("dragstart")},onDragEnd(){this.$emit("dragend")}}}),ja="_dragContainer_4rvyw_5",Ya="_dragButton_4rvyw_9",Ga="_leftArrow_4rvyw_23 _arrow_4rvyw_32",qa="_rightArrow_4rvyw_24 _arrow_4rvyw_32",Ja="_visible_4rvyw_28",Xa="_arrow_4rvyw_32",Qa="_grid_4rvyw_50",Za={dragContainer:ja,dragButton:Ya,leftArrow:Ga,rightArrow:qa,visible:Ja,arrow:Xa,grid:Qa},er=g("div",null,[g("div"),g("div"),g("div"),g("div"),g("div")],-1),tr=g("div",null,[g("div"),g("div"),g("div"),g("div"),g("div")],-1),or=[er,tr];function nr(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("Draggable");return u(),P(r,{type:"panel-resize",onDrag:e.onDrag,onDragstart:e.onDragStart,onDragend:e.onDragEnd,class:D(e.$style.dragContainer)},{default:y(({isDragging:l})=>[g("div",{class:D({[e.$style.dragButton]:!0})},[e.canMoveLeft?(u(),T("span",{key:0,class:D({[e.$style.leftArrow]:!0,[e.$style.visible]:l})},[v(a,{icon:"arrow-left"})],2)):C("",!0),e.canMoveRight?(u(),T("span",{key:1,class:D({[e.$style.rightArrow]:!0,[e.$style.visible]:l})},[v(a,{icon:"arrow-right"})],2)):C("",!0),g("div",{class:D(e.$style.grid)},or,2)],2)]),_:1},8,["onDrag","onDragstart","onDragend","class"])}const ir={$style:Za},sr=H(Ka,[["render",nr],["__cssModules",ir]]),ar=["onClick","data-node-name","data-node-placement"],rr=x({__name:"NDVFloatingNodes",props:{rootNode:{},type:{}},emits:["switchSelectedNode"],setup(e,{expose:t,emit:o}){const n=e,i=Y(),s=G(),a=i.getCurrentWorkflow();function r(N){const k=h.value[N][0];k&&o("switchSelectedNode",k.node.name)}function l(N){if(N.shiftKey&&N.altKey&&(N.ctrlKey||N.metaKey)){const w={ArrowUp:"outputSub",ArrowRight:"outputMain",ArrowDown:"inputSub",ArrowLeft:"inputMain"}[N.key]||null;w&&r(w)}}function p(N){return N.map(k=>{const w=i.getNodeByName(k);if(w){const c=s.getNodeType(w.type);if(c)return{node:w,nodeType:c}}return null}).filter(k=>k!==null)}const h=Q(()=>{const N=n.rootNode.name;return{outputSub:p(a.getChildNodes(N,"ALL_NON_MAIN")),outputMain:p(a.getChildNodes(N,"main",1)),inputSub:p(a.getParentNodes(N,"ALL_NON_MAIN")),inputMain:p(a.getParentNodes(N,"main",1))}}),d=["outputSub","outputMain","inputSub","inputMain"],m={outputSub:"bottom",outputMain:"left",inputSub:"top",inputMain:"right"};return gn(()=>{document.addEventListener("keydown",l,!0)}),Ts(()=>{document.removeEventListener("keydown",l,!0)}),t({moveNodeDirection:r}),(N,k)=>{const w=S("n8n-tooltip");return u(),T("aside",{class:D(N.$style.floatingNodes)},[(u(),T(Z,null,de(d,c=>g("ul",{class:D([N.$style.nodesList,N.$style[c]]),key:c},[(u(!0),T(Z,null,de(h.value[c],({node:f,nodeType:E})=>(u(),T(Z,null,[f&&E?(u(),P(w,{placement:m[c],teleported:!1,key:f.name,offset:60},{content:y(()=>[I(b(f.name),1)]),default:y(()=>[g("li",{class:D(N.$style.connectedNode),onClick:O=>N.$emit("switchSelectedNode",f.name),"data-test-id":"floating-node","data-node-name":f.name,"data-node-placement":c},[v(Tt,{nodeType:E,nodeName:f.name,"tooltip-position":m[c],size:35,circle:""},null,8,["nodeType","nodeName","tooltip-position"])],10,ar)]),_:2},1032,["placement"])):C("",!0)],64))),256))],2)),64))],2)}}}),lr="_floatingNodes_htxl9_5",dr="_nodesList_htxl9_19",ur="_inputSub_htxl9_33",cr="_outputSub_htxl9_33",hr="_outputMain_htxl9_44",pr="_inputMain_htxl9_44",gr="_connectedNode_htxl9_67",fr={floatingNodes:lr,nodesList:dr,inputSub:ur,outputSub:cr,outputMain:hr,inputMain:pr,connectedNode:gr},mr={$style:fr},yr=H(rr,[["__cssModules",mr]]),Ne=24,Ko=80,Me=280,wr=320,vr=420,Nr={regular:_e,dragless:_e,unknown:_e,inputless:_e,wide:_e*2},kr=x({name:"NDVDraggablePanels",mixins:[Ft],components:{PanelDragButton:sr,NDVFloatingNodes:yr},props:{isDraggable:{type:Boolean},hideInputAndOutput:{type:Boolean},position:{type:Number},nodeType:{type:Object,default:()=>({})}},data(){return{windowWidth:1,isDragging:!1,MIN_PANEL_WIDTH:Me,initialized:!1}},mounted(){this.setTotalWidth(),this.mainPanelDimensions.relativeLeft===1&&this.mainPanelDimensions.relativeRight===1&&(this.setMainPanelWidth(),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)),this.restorePositionData()),window.addEventListener("resize",this.setTotalWidth),this.$emit("init",{position:this.mainPanelDimensions.relativeLeft}),setTimeout(()=>{this.initialized=!0},0),gt.on("setPositionByName",this.setPositionByName)},beforeUnmount(){window.removeEventListener("resize",this.setTotalWidth),gt.off("setPositionByName",this.setPositionByName)},computed:{...q(ee),mainPanelDimensions(){return this.ndvStore.getMainPanelDimensions(this.currentNodePaneType)},activeNode(){return this.ndvStore.activeNode},supportedResizeDirections(){const e=["right"];return this.isDraggable&&e.push("left"),e},currentNodePaneType(){return this.hasInputSlot?this.isDraggable?this.nodeType===null?"unknown":me(this,"nodeType.parameterPane")||"regular":"dragless":"inputless"},hasInputSlot(){return this.$slots.input!==void 0},inputPanelMargin(){return this.pxToRelativeWidth(Ko)},minWindowWidth(){return 2*(Ne+Ko)+Me},minimumLeftPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.hasInputSlot?this.pxToRelativeWidth(Ne+20)+this.inputPanelMargin:this.pxToRelativeWidth(Ne)},maximumRightPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.pxToRelativeWidth(Ne+20)+this.inputPanelMargin},canMoveLeft(){return this.mainPanelDimensions.relativeLeft>this.minimumLeftPosition},canMoveRight(){return this.mainPanelDimensions.relativeRight>this.maximumRightPosition},mainPanelStyles(){return{left:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeLeft)}px`,right:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeRight)}px`}},inputPanelStyles(){return{right:`${this.relativeWidthToPx(this.calculatedPositions.inputPanelRelativeRight)}px`}},outputPanelStyles(){return{left:`${this.relativeWidthToPx(this.calculatedPositions.outputPanelRelativeLeft)}px`,transform:`translateX(-${this.relativeWidthToPx(this.outputPanelRelativeTranslate)}px)`}},calculatedPositions(){const e=this.$slots.input!==void 0,t=this.mainPanelDimensions.relativeLeft+this.mainPanelDimensions.relativeWidth;return{inputPanelRelativeRight:e?1-t+this.mainPanelDimensions.relativeWidth:1-this.pxToRelativeWidth(Ne),outputPanelRelativeLeft:t}},outputPanelRelativeTranslate(){const e=1-this.pxToRelativeWidth(Me+Ne),t=this.calculatedPositions.outputPanelRelativeLeft-e;return t>0?t:0},hasDoubleWidth(){return me(this,"nodeType.parameterPane")==="wide"},fixedPanelWidth(){const e=this.hasDoubleWidth?2:1;return this.windowWidth>1700?vr*e:wr*e},isBelowMinWidthMainPanel(){const e=this.pxToRelativeWidth(Me);return this.mainPanelDimensions.relativeWidth<e}},watch:{windowWidth(e){const t=this.pxToRelativeWidth(Me);this.isBelowMinWidthMainPanel&&this.setMainPanelWidth(t);const o=this.minimumLeftPosition>this.mainPanelDimensions.relativeLeft,n=this.maximumRightPosition>this.mainPanelDimensions.relativeRight;e>this.minWindowWidth&&o&&n&&(this.setMainPanelWidth(t),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth))),this.setPositions(this.mainPanelDimensions.relativeLeft)}},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},getInitialLeftPosition(e){return this.currentNodePaneType==="dragless"?this.pxToRelativeWidth(Ne+1+this.fixedPanelWidth):this.hasInputSlot?.5-e/2:this.minimumLeftPosition},setMainPanelWidth(e){const t=e||this.pxToRelativeWidth(Nr[this.currentNodePaneType]);this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeWidth:t}})},setPositions(e){const t=e||1-this.calculatedPositions.inputPanelRelativeRight,o=1-t-this.mainPanelDimensions.relativeWidth,n=this.maximumRightPosition>o,i=this.minimumLeftPosition>t,s=this.currentNodePaneType==="inputless";if(i){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:this.minimumLeftPosition,relativeRight:1-this.mainPanelDimensions.relativeWidth-this.minimumLeftPosition}});return}if(n){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:1-this.mainPanelDimensions.relativeWidth-this.maximumRightPosition,relativeRight:this.maximumRightPosition}});return}this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:s?this.minimumLeftPosition:t,relativeRight:o}})},setPositionByName(e){const t={minLeft:this.minimumLeftPosition,maxRight:this.maximumRightPosition,initial:this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)};this.setPositions(t[e])},pxToRelativeWidth(e){return e/this.windowWidth},relativeWidthToPx(e){return e*this.windowWidth},onResizeStart(){this.setTotalWidth()},onResizeEnd(){this.storePositionData()},onResizeDebounced(e){this.initialized&&this.callDebounced("onResize",{debounceTime:10,trailing:!0},e)},onResize({direction:e,x:t,width:o}){const n=this.pxToRelativeWidth(t),i=this.pxToRelativeWidth(o);e==="left"&&n<=this.minimumLeftPosition||e==="right"&&1-n<=this.maximumRightPosition||o<=Me||(this.setMainPanelWidth(i),this.setPositions(e==="left"?n:this.mainPanelDimensions.relativeLeft))},restorePositionData(){const e=De(`${Jt}_${this.currentNodePaneType}`).value;if(e){const t=parseFloat(e);this.setMainPanelWidth(t);const o=this.getInitialLeftPosition(t);return this.setPositions(o),!0}return!1},storePositionData(){De(`${Jt}_${this.currentNodePaneType}`).value=this.mainPanelDimensions.relativeWidth.toString()},onDragStart(){this.isDragging=!0,this.$emit("dragstart",{position:this.mainPanelDimensions.relativeLeft})},onDrag(e){const t=this.pxToRelativeWidth(e.x)-this.mainPanelDimensions.relativeWidth/2;this.setPositions(t)},onDragEnd(){setTimeout(()=>{this.isDragging=!1,this.$emit("dragend",{windowWidth:this.windowWidth,position:this.mainPanelDimensions.relativeLeft})},0),this.storePositionData()},setTotalWidth(){this.windowWidth=window.innerWidth},close(){this.$emit("close")}}}),br="_dataPanel_w56ig_5",Tr="_inputPanel_w56ig_14 _dataPanel_w56ig_5",Sr="_outputPanel_w56ig_22 _dataPanel_w56ig_5",Dr="_mainPanel_w56ig_30",Er="_draggable_w56ig_34",Cr="_mainPanelInner_w56ig_38",Ir="_dragging_w56ig_45",Pr="_dragButtonContainer_w56ig_58",Or="_visible_w56ig_74",Rr={dataPanel:br,inputPanel:Tr,outputPanel:Sr,mainPanel:Dr,draggable:Er,mainPanelInner:Cr,dragging:Ir,"double-width":"_double-width_w56ig_54",dragButtonContainer:Pr,visible:Or};function $r(e,t,o,n,i,s){const a=S("NDVFloatingNodes"),r=S("PanelDragButton"),l=S("n8n-resize-wrapper");return u(),T("div",null,[e.activeNode?(u(),P(a,{key:0,onSwitchSelectedNode:e.onSwitchSelectedNode,"root-node":e.activeNode,type:"input"},null,8,["onSwitchSelectedNode","root-node"])):C("",!0),e.hideInputAndOutput?C("",!0):(u(),T("div",{key:1,class:D(e.$style.inputPanel),style:se(e.inputPanelStyles)},[ae(e.$slots,"input")],6)),e.hideInputAndOutput?C("",!0):(u(),T("div",{key:2,class:D(e.$style.outputPanel),style:se(e.outputPanelStyles)},[ae(e.$slots,"output")],6)),g("div",{class:D(e.$style.mainPanel),style:se(e.mainPanelStyles)},[v(l,{isResizingEnabled:e.currentNodePaneType!=="unknown",width:e.relativeWidthToPx(e.mainPanelDimensions.relativeWidth),minWidth:e.MIN_PANEL_WIDTH,gridSize:20,onResize:e.onResizeDebounced,onResizestart:e.onResizeStart,onResizeend:e.onResizeEnd,supportedDirections:e.supportedResizeDirections},{default:y(()=>[g("div",{class:D(e.$style.dragButtonContainer)},[!e.hideInputAndOutput&&e.isDraggable?(u(),P(r,{key:0,class:D({[e.$style.draggable]:!0,[e.$style.visible]:e.isDragging}),canMoveLeft:e.canMoveLeft,canMoveRight:e.canMoveRight,onDragstart:e.onDragStart,onDrag:e.onDrag,onDragend:e.onDragEnd},null,8,["class","canMoveLeft","canMoveRight","onDragstart","onDrag","onDragend"])):C("",!0)],2),g("div",{class:D({[e.$style.mainPanelInner]:!0,[e.$style.dragging]:e.isDragging})},[ae(e.$slots,"main")],2)]),_:3},8,["isResizingEnabled","width","minWidth","onResize","onResizestart","onResizeend","supportedDirections"])],6)])}const Ar={$style:Rr},Mr=H(kr,[["render",$r],["__cssModules",Ar]]),_r={allowVulnerableTags:!1,enforceHtmlBoundary:!1,disallowedTagsMode:"discard",allowedTags:[...Xt.defaults.allowedTags,"style","img","title"],allowedAttributes:{...Xt.defaults.allowedAttributes,"*":["class","style"]},transformTags:{head:""}},Wr={name:"RunDataHtml",props:{inputHtml:{type:String}},computed:{sanitizedHtml(){return _n(this.inputHtml,_r)}}},Vr=["srcdoc"];function Br(e,t,o,n,i,s){return u(),T("iframe",{class:"__html-display",srcdoc:s.sanitizedHtml},null,8,Vr)}const bn=H(Wr,[["render",Br]]),Lr=Object.freeze(Object.defineProperty({__proto__:null,default:bn},Symbol.toStringTag,{value:"Module"})),Ur=x({name:"BinaryDataDisplayEmbed",components:{VueJsonPretty:Nn,RunDataHtml:bn},props:{binaryData:{type:Object,required:!0}},data(){return{isLoading:!0,embedSource:"",error:!1,data:""}},computed:{...q(Y)},async mounted(){const{id:e,data:t,fileName:o,fileType:n,mimeType:i}=this.binaryData,s=n==="json",a=n==="html";if(!e)s||a?this.data=Nt(atob(t)):this.embedSource="data:"+i+";base64,"+t;else try{const r=this.workflowsStore.getBinaryUrl(e,"view",o,i);if(s||a){const l=await fetch(r,{credentials:"include"});this.data=await(s?l.json():l.text())}else this.embedSource=r}catch{this.error=!0}this.isLoading=!1},methods:{embedClass(){const{fileType:e}=this.binaryData;return[e??"other"]}}}),xr={key:0},Fr={key:1},Hr={key:2},zr={key:0,controls:"",autoplay:""},Kr=["src","type"],jr={key:1,controls:"",autoplay:""},Yr=["src","type"],Gr=["src"];function qr(e,t,o,n,i,s){const a=S("vue-json-pretty"),r=S("run-data-html");return u(),T("span",null,[e.isLoading?(u(),T("div",xr,"Loading binary data...")):e.error?(u(),T("div",Fr,"Error loading binary data")):(u(),T("span",Hr,[e.binaryData.fileType==="video"?(u(),T("video",zr,[g("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Kr),I(" "+b(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="audio"?(u(),T("audio",jr,[g("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Yr),I(" "+b(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="json"?(u(),P(a,{key:2,data:e.data,deep:3,showLength:!0},null,8,["data"])):e.binaryData.fileType==="html"?(u(),P(r,{key:3,inputHtml:e.data},null,8,["inputHtml"])):(u(),T("embed",{key:4,src:e.embedSource,class:D(["binary-data",e.embedClass()])},null,10,Gr))]))])}const Jr=H(Ur,[["render",qr]]),Xr=x({name:"BinaryDataDisplay",mixins:[Oe],components:{BinaryDataDisplayEmbed:Jr},props:["displayData","windowVisible"],computed:{...q(Y),binaryData(){const e=this.getBinaryData(this.workflowRunData,this.displayData.node,this.displayData.runIndex,this.displayData.outputIndex);return e.length===0||this.displayData.index>=e.length||e[this.displayData.index][this.displayData.key]===void 0?null:e[this.displayData.index][this.displayData.key]},workflowRunData(){const e=this.workflowsStore.getWorkflowExecution;if(e===null)return null;const t=e.data;return t?t.resultData.runData:null}},methods:{closeWindow(){return this.$emit("close"),!1}}}),Qr={class:"binary-data-window-wrapper"},Zr={key:0};function el(e,t,o,n,i,s){var l;const a=S("n8n-button"),r=S("BinaryDataDisplayEmbed");return e.windowVisible?(u(),T("div",{key:0,class:D(["binary-data-window",(l=e.binaryData)==null?void 0:l.fileType])},[v(a,{onClick:ie(e.closeWindow,["stop"]),size:"small",class:"binary-data-window-back",title:e.$locale.baseText("binaryDataDisplay.backToOverviewPage"),icon:"arrow-left",label:e.$locale.baseText("binaryDataDisplay.backToList")},null,8,["onClick","title","label"]),g("div",Qr,[e.binaryData?(u(),P(r,{key:1,binaryData:e.binaryData},null,8,["binaryData"])):(u(),T("div",Zr,b(e.$locale.baseText("binaryDataDisplay.noDataFoundToDisplay")),1))])],2)):C("",!0)}const tl=H(Xr,[["render",el]]),ol=x({name:"NodeErrorView",mixins:[St],props:["error"],components:{VueJsonPretty:Nn},setup(){return{...He()}},computed:{...q(G,ee),displayCause(){return JSON.stringify(this.error.cause).length<on},parameters(){const e=this.ndvStore.activeNode;if(!e)return[];const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion);return t===null?[]:t.properties}},methods:{replacePlaceholders(e,t){const o=this.parameterDisplayName(e,!1),n=this.parameterDisplayName(e,!0);return t.replace(/%%PARAMETER%%/g,o).replace(/%%PARAMETER_FULL%%/g,n)},getErrorDescription(){var o;if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return It(this.error.description+this.$locale.baseText("pushConnection.executionError.openNode",{interpolate:{node:this.error.node.name}}));if(!((o=this.error.context)!=null&&o.descriptionTemplate))return It(this.error.description);const t=this.parameterDisplayName(this.error.context.parameter);return It(this.error.context.descriptionTemplate.replace(/%%PARAMETER%%/g,t))},getErrorMessage(){var n;const e=this.$locale.baseText("nodeErrorView.error")+": ";if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return this.$locale.baseText("nodeErrorView.errorSubNode",{interpolate:{node:this.error.node.name}});if(this.error.message===this.error.description)return e;if(!((n=this.error.context)!=null&&n.messageTemplate))return e+this.error.message;const o=this.parameterDisplayName(this.error.context.parameter);return e+this.error.context.messageTemplate.replace(/%%PARAMETER%%/g,o)},parameterDisplayName(e,t=!0){try{const o=this.parameterName(this.parameters,e.split("."));if(!o.length)throw new Error;return t?o.map(n=>n.displayName).join(" > "):o.pop().displayName}catch{return`Could not find parameter "${e}"`}},parameterName(e,t){let o=t.shift();if(o===void 0)return[];const n=o.match(/(.*)\[([\d])\]$/);n!==null&&n.length>0&&(o=n[1]);const i=e.find(s=>s.name===o);if(i===void 0)throw new Error(`Could not find parameter "${o}"`);return t.length===0?[i]:i.hasOwnProperty("options")?[i,...this.parameterName(i.options,t)]:i.hasOwnProperty("values")?[i,...this.parameterName(i.values,t)]:[i]},copyCause(){this.copyToClipboard(JSON.stringify(this.error.cause)),this.copySuccess()},copySuccess(){this.showMessage({title:this.$locale.baseText("nodeErrorView.showMessage.title"),type:"info"})}}}),nl={class:"error-header"},il=["textContent"],sl=["innerHTML"],al={class:"error-details__summary"},rl={class:"error-details__content"},ll={key:0},dl={key:1},ul={class:"clearfix box-card__title"},cl={key:2,class:"el-card box-card is-never-shadow el-card__body"},hl={class:"error-details__summary"},pl={key:0},gl={class:"error-details__summary"},fl={key:1},ml={class:"error-details__summary"},yl={key:3},wl={class:"clearfix box-card__title"},vl={key:4},Nl={class:"clearfix box-card__title"},kl=g("br",null,null,-1),bl={class:"box-card__subtitle"},Tl={key:0,class:"copy-button"},Sl={key:2},Dl={key:5},El={class:"clearfix box-card__title"};function Cl(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("el-card"),l=S("n8n-icon-button"),p=S("vue-json-pretty");return u(),T("div",null,[g("div",nl,[g("div",{class:"error-message",textContent:b(e.getErrorMessage())},null,8,il),e.error.description?(u(),T("div",{key:0,class:"error-description",innerHTML:e.getErrorDescription()},null,8,sl)):C("",!0)]),g("details",null,[g("summary",al,[v(a,{class:"error-details__icon",icon:"angle-right"}),I(" "+b(e.$locale.baseText("nodeErrorView.details")),1)]),g("div",rl,[e.error.context&&e.error.context.causeDetailed?(u(),T("div",ll,[v(r,{class:"box-card",shadow:"never"},{default:y(()=>[g("div",null,b(e.error.context.causeDetailed),1)]),_:1})])):C("",!0),e.error.timestamp?(u(),T("div",dl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",ul,[g("span",null,b(e.$locale.baseText("nodeErrorView.time")),1)])]),default:y(()=>[g("div",null,b(new Date(e.error.timestamp).toLocaleString()),1)]),_:1})])):C("",!0),e.error.context&&e.error.context.itemIndex!==void 0?(u(),T("div",cl,[g("span",hl,b(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+b(e.error.context.itemIndex)+" ",1),e.error.context.runIndex?(u(),T("span",pl,[I(" | "),g("span",gl,b(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+b(e.error.context.runIndex),1)])):C("",!0),e.error.context.parameter?(u(),T("span",fl,[I(" | "),g("span",ml,b(e.$locale.baseText("nodeErrorView.inParameter"))+":",1),I(" "+b(e.parameterDisplayName(e.error.context.parameter)),1)])):C("",!0)])):C("",!0),e.error.httpCode?(u(),T("div",yl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",wl,[g("span",null,b(e.$locale.baseText("nodeErrorView.httpCode")),1)])]),default:y(()=>[g("div",null,b(e.error.httpCode),1)]),_:1})])):C("",!0),e.error.cause?(u(),T("div",vl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",Nl,[g("span",null,b(e.$locale.baseText("nodeErrorView.cause")),1),kl,g("span",bl,b(e.$locale.baseText("nodeErrorView.dataBelowMayContain")),1)])]),default:y(()=>[g("div",null,[e.displayCause?(u(),T("div",Tl,[v(l,{onClick:e.copyCause,title:e.$locale.baseText("nodeErrorView.copyToClipboard"),icon:"copy"},null,8,["onClick","title"])])):C("",!0),e.displayCause?(u(),P(p,{key:1,data:e.error.cause,deep:3,showLength:!0,selectableType:"single",path:"error",class:"json-data"},null,8,["data"])):(u(),T("span",Sl,[v(a,{icon:"info-circle"}),I(b(e.$locale.baseText("nodeErrorView.theErrorCauseIsTooLargeToBeDisplayed")),1)]))])]),_:1})])):C("",!0),e.error.stack?(u(),T("div",Dl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",El,[g("span",null,b(e.$locale.baseText("nodeErrorView.stack")),1)])]),default:y(()=>[g("div",null,[g("pre",null,[g("code",null,b(e.error.stack),1)])])]),_:1})])):C("",!0)])])])}const Il=H(ol,[["render",Cl]]),Pl=Re(async()=>Ce(()=>import("./RunDataTable-690SZ7_1.js"),__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,34,35,36,37,38,39,40,41,42,43,44,45,46]))),Ol=Re(async()=>Ce(()=>import("./RunDataJson-FZZoF8ao.js"),__vite__mapDeps([47,2,3,4,5,6,7,8,1,9,10,11,12,13,14,38,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,48]))),Rl=Re(async()=>Ce(()=>import("./RunDataSchema-wjyR7MiY.js"),__vite__mapDeps([49,2,3,4,5,6,7,8,1,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,34,35,36,37,38,39,40,41,42,43,44,45,50]))),$l=Re(async()=>Ce(()=>Promise.resolve().then(()=>Lr),void 0)),Al=Re(async()=>Ce(()=>import("./RunDataSearch-0UjOZNT9.js"),__vite__mapDeps([51,2,3,4,5,6,7,8,1,9,10,11,12,13,14,52]))),Ml=x({name:"RunData",mixins:[Ie,pn,Oe,ze],components:{BinaryDataDisplay:tl,NodeErrorView:Il,CodeNodeEditor:Li,RunDataTable:Pl,RunDataJson:Ol,RunDataSchema:Rl,RunDataHtml:$l,RunDataSearch:Al},props:{nodeUi:{type:Object},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},tooMuchDataTitle:{type:String},noDataInBranchMessage:{type:String},isExecuting:{type:Boolean},executingMessage:{type:String},sessionId:{type:String},paneType:{type:String},overrideOutputs:{type:Array},mappingEnabled:{type:Boolean},distanceFromActive:{type:Number},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(){return{...He()}},data(){return{connectionType:$.Main,binaryDataPreviewActive:!1,dataSize:0,showData:!1,outputIndex:0,binaryDataDisplayVisible:!1,binaryDataDisplayData:null,MAX_DISPLAY_DATA_SIZE:on,MAX_DISPLAY_ITEMS_AUTO_ALL:Wn,currentPage:1,pageSize:10,pageSizes:[10,25,50,100],pinDataDiscoveryTooltipVisible:!1,isControlledPinDataTooltip:!1,search:""}},mounted(){this.init(),this.isPaneTypeInput||this.showPinDataDiscoveryTooltip(this.jsonData),this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:this.currentOutputIndex}),this.paneType==="output"&&(this.setDisplayMode(),this.activatePane())},beforeUnmount(){this.hidePinDataDiscoveryTooltip()},computed:{...q(G,ee,Y),activeNode(){return this.ndvStore.activeNode},dataPinningDocsUrl(){return Vn},dataEditingDocsUrl(){return Bn},displayMode(){return this.ndvStore.getPanelDisplayMode(this.paneType)},node(){return this.nodeUi||null},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isSchemaView(){return this.displayMode==="schema"},isTriggerNode(){return this.node===null?!1:this.nodeTypesStore.isTriggerNode(this.node.type)},canPinData(){if(this.node===null)return!1;const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=ge(e,t,this.nodeType);return!!!fe(o).find(s=>s!==$.Main)&&!this.isPaneTypeInput&&this.isPinDataNodeType&&!(this.binaryData&&this.binaryData.length>0)},buttons(){var o;const e=[{label:this.$locale.baseText("runData.table"),value:"table"},{label:this.$locale.baseText("runData.json"),value:"json"}];this.binaryData.length&&e.push({label:this.$locale.baseText("runData.binary"),value:"binary"});const t={label:this.$locale.baseText("runData.schema"),value:"schema"};return this.isPaneTypeInput&&!Qt(this.jsonData)?e.unshift(t):e.push(t),this.isPaneTypeOutput&&((o=this.activeNode)==null?void 0:o.type)===Zt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&e.unshift({label:"HTML",value:"html"}),e},hasNodeRun(){return!!(!this.isExecuting&&this.node&&(this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name)||this.hasPinData))},isArtificialRecoveredEventItem(){var e,t,o;return!!((o=(t=(e=this.rawInputData)==null?void 0:e[0])==null?void 0:t.json)!=null&&o.isArtificialRecoveredEventItem)},subworkflowExecutionError(){return this.workflowsStore.subWorkflowExecutionError},hasSubworkflowExecutionError(){return!!this.subworkflowExecutionError},hasRunError(){var e,t,o;return!!(this.node&&((o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])!=null&&o.error))},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},dataCount(){return this.getDataCount(this.runIndex,this.currentOutputIndex)},unfilteredDataCount(){return this.pinData?this.pinData.length:this.rawInputData.length},dataSizeInMB(){return(this.dataSize/1024/1e3).toLocaleString()},maxOutputIndex(){if(this.node===null||this.runIndex===void 0)return 0;const e=this.workflowRunData;if(e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<this.runIndex)return 0;if(e[this.node.name][this.runIndex]){const t=e[this.node.name][this.runIndex].data;if(t!=null&&t.main)return t.main.length-1}return 0},currentPageOffset(){return this.pageSize*(this.currentPage-1)},maxRunIndex(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length-1:0},rawInputData(){return this.getRawInputData(this.runIndex,this.currentOutputIndex,this.connectionType)},inputData(){const e=this.getPinDataOrLiveData(this.rawInputData);return this.getFilteredData(e)},inputDataPage(){const e=this.pageSize*(this.currentPage-1);return this.inputData.slice(e,e+this.pageSize)},jsonData(){return eo(this.inputData)},binaryData(){return this.node?this.getBinaryData(this.workflowRunData,this.node.name,this.runIndex,this.currentOutputIndex).filter(t=>!!(t&&Object.keys(t).length)):[]},currentOutputIndex(){var e;return(e=this.overrideOutputs)!=null&&e.length&&!this.overrideOutputs.includes(this.outputIndex)?this.overrideOutputs[0]:this.outputIndex},branches(){var o;const e=n=>n.charAt(0).toLocaleUpperCase()+n.slice(1),t=[];for(let n=0;n<=this.maxOutputIndex;n++){if(this.overrideOutputs&&!this.overrideOutputs.includes(n))continue;const i=this.getRawInputData(this.runIndex,n).length,s=this.getDataCount(this.runIndex,n),a=this.search?this.$locale.baseText("ndv.search.items",{adjustToNumber:i,interpolate:{matched:s,total:i}}):this.$locale.baseText("ndv.output.items",{adjustToNumber:s,interpolate:{count:s}});let r=this.getOutputName(n);if(`${r}`==`${n}`)r=`${this.$locale.baseText("ndv.output")} ${r}`;else{const l=Ln.includes((o=this.node)==null?void 0:o.type)?"":` ${this.$locale.baseText("ndv.output.branch")}`;r=e(`${this.getOutputName(n)}${l}`)}t.push({label:this.search&&s||i?`${r} (${a})`:r,value:n})}return t},editMode(){return this.isPaneTypeInput?{enabled:!1,value:""}:this.ndvStore.outputPanelEditMode},isPaneTypeInput(){return this.paneType==="input"},isPaneTypeOutput(){return this.paneType==="output"},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},showIOSearch(){return this.hasNodeRun&&!this.hasRunError},showIoSearchNoMatchContent(){return this.hasNodeRun&&!this.inputData.length&&this.search}},methods:{getResolvedNodeOutputs(){if(this.node&&this.nodeType){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name);if(t)return ve(e,t,this.nodeType)}return[]},onItemHover(e){if(e===null){this.$emit("itemHover",null);return}this.$emit("itemHover",{outputIndex:this.currentOutputIndex,itemIndex:e})},onClickDataPinningDocsLink(){var e;this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:(e=this.activeNode)==null?void 0:e.type,pane:"output",type:"data-pinning-docs"})},showPinDataDiscoveryTooltip(e){if(!this.isTriggerNode)return;const t=De(oo).value;e&&e.length>0&&!this.isReadOnlyRoute&&!t&&(this.pinDataDiscoveryComplete(),setTimeout(()=>{this.isControlledPinDataTooltip=!0,this.pinDataDiscoveryTooltipVisible=!0,we.emit("data-pinning-discovery",{isTooltipVisible:!0})},500))},hidePinDataDiscoveryTooltip(){this.pinDataDiscoveryTooltipVisible&&(this.isControlledPinDataTooltip=!1,this.pinDataDiscoveryTooltipVisible=!1,we.emit("data-pinning-discovery",{isTooltipVisible:!1}))},pinDataDiscoveryComplete(){De(oo).value="true",De(Wt).value="true"},enterEditMode({origin:e}){var n;const t=this.pinData?to(this.pinData):eo(this.rawInputData),o=t.length>0?t:Un;this.ndvStore.setOutputPanelEditModeEnabled(!0),this.ndvStore.setOutputPanelEditModeValue(JSON.stringify(o,null,2)),this.$telemetry.track("User opened ndv edit state",{node_type:(n=this.activeNode)==null?void 0:n.type,click_type:e==="editIconButton"?"button":"link",session_id:this.sessionId,run_index:this.runIndex,is_output_present:this.hasNodeRun||this.hasPinData,view:!this.hasNodeRun&&!this.hasPinData?"undefined":this.displayMode,is_data_pinned:this.hasPinData})},onClickCancelEdit(){this.ndvStore.setOutputPanelEditModeEnabled(!1),this.ndvStore.setOutputPanelEditModeValue(""),this.onExitEditMode({type:"cancel"})},onClickSaveEdit(){if(!this.node)return;const{value:e}=this.editMode;this.clearAllStickyNotifications();try{this.setPinData(this.node,to(e),"save-edit")}catch(t){console.error(t);return}this.ndvStore.setOutputPanelEditModeEnabled(!1),this.onExitEditMode({type:"save"})},onExitEditMode({type:e}){var t;this.$telemetry.track("User closed ndv edit state",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,view:this.displayMode,type:e})},async onTogglePinData({source:e}){if(this.node){if(e==="pin-icon-click"){const t={node_type:this.activeNode.type,session_id:this.sessionId,run_index:this.runIndex,view:!this.hasNodeRun&&!this.hasPinData?"none":this.displayMode};this.$externalHooks().run("runData.onTogglePinData",t),this.$telemetry.track("User clicked pin data icon",t)}if(this.updateNodeParameterIssues(this.node),this.hasPinData){this.unsetPinData(this.node,e);return}try{this.setPinData(this.node,this.rawInputData,"pin-icon-click")}catch(t){console.error(t);return}this.maxRunIndex>0&&this.showToast({title:this.$locale.baseText("ndv.pinData.pin.multipleRuns.title",{interpolate:{index:`${this.runIndex}`}}),message:this.$locale.baseText("ndv.pinData.pin.multipleRuns.description"),type:"success",duration:2e3}),this.hidePinDataDiscoveryTooltip(),this.pinDataDiscoveryComplete()}},switchToBinary(){this.onDisplayModeChange("binary")},onBranchChange(e){this.outputIndex=e,this.$telemetry.track("User changed ndv branch",{session_id:this.sessionId,branch_index:e,node_type:this.activeNode.type,node_type_input_selection:this.nodeType?this.nodeType.name:"",pane:this.paneType})},showTooMuchData(){this.showData=!0,this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,type:"showTooMuchData"})},toggleLinkRuns(){this.linkedRuns?this.unlinkRun():this.linkRun()},linkRun(){this.$emit("linkRun")},unlinkRun(){this.$emit("unlinkRun")},onCurrentPageChange(e){var t;this.currentPage=e,this.$telemetry.track("User changed ndv page",{node_type:(t=this.activeNode)==null?void 0:t.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onPageSizeChange(e){var o;this.pageSize=e;const t=Math.ceil(this.dataCount/this.pageSize);t<this.currentPage&&(this.currentPage=t),this.$telemetry.track("User changed ndv page size",{node_type:(o=this.activeNode)==null?void 0:o.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onDisplayModeChange(e){const t=this.displayMode;this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:e});const o=this.$refs.dataContainer;if(o){const n=o.children[0];n&&n.scrollTo(0,0)}this.closeBinaryDataDisplay(),this.$externalHooks().run("runData.displayModeChanged",{newValue:e,oldValue:t}),this.activeNode&&this.$telemetry.track("User changed ndv item view",{previous_view:t,new_view:e,node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType})},getRunLabel(e){let t=0;for(let i=0;i<=this.maxOutputIndex;i++)t+=this.getPinDataOrLiveData(this.getRawInputData(e-1,i)).length;const o=this.$locale.baseText("ndv.output.items",{adjustToNumber:t,interpolate:{count:t}}),n=t>0?` (${o})`:"";return e+this.$locale.baseText("ndv.output.of")+(this.maxRunIndex+1)+n},getRawInputData(e,t,o=$.Main){let n=[];return this.node&&(n=this.getNodeInputData(this.node,e,t,this.paneType,o)),n.length===0||!Array.isArray(n)?[]:n},getPinDataOrLiveData(e){return this.pinData&&!this.isProductionExecutionPreview?Array.isArray(this.pinData)?this.pinData.map(t=>({json:t})):[{json:this.pinData}]:e},getFilteredData(e){return this.search?(this.currentPage=1,e.filter(({json:t})=>xn(t,this.search))):e},getDataCount(e,t,o=$.Main){var s,a,r;if(!this.node)return 0;if((r=(a=(s=this.workflowRunData)==null?void 0:s[this.node.name])==null?void 0:a[e])!=null&&r.hasOwnProperty("error"))return 1;const n=this.getRawInputData(e,t,o),i=this.getPinDataOrLiveData(n);return this.getFilteredData(i).length},init(){this.outputIndex=0,this.refreshDataSize(),this.closeBinaryDataDisplay();let e=[];if(this.nodeType!==null&&this.node!==null){const t=this.getResolvedNodeOutputs();e=fe(t)}this.connectionType=e.length===0?$.Main:e[0],this.binaryData.length>0?this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"binary"}):this.displayMode==="binary"&&this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"table"})},closeBinaryDataDisplay(){this.binaryDataDisplayVisible=!1,this.binaryDataDisplayData=null},clearExecutionData(){this.workflowsStore.setWorkflowExecutionData(null),this.updateNodesExecutionIssues()},isViewable(e,t){const{fileType:o}=this.binaryData[e][t];return!!o&&["image","audio","video","text","json","pdf","html"].includes(o)},isDownloadable(e,t){const{mimeType:o,fileName:n}=this.binaryData[e][t];return!!(o&&n)},async downloadBinaryData(e,t){const{id:o,data:n,fileName:i,fileExtension:s,mimeType:a}=this.binaryData[e][t];if(o){const r=this.workflowsStore.getBinaryUrl(o,"download",i,a);At.saveAs(r,[i,s].join("."));return}else{const r="data:"+a+";base64,"+n,l=await fetch(r).then(async p=>p.blob());At.saveAs(l,i)}},async downloadJsonData(){const e=this.node.name.replace(/[^\w\d]/g,"_"),t=new Blob([JSON.stringify(this.rawInputData,null,2)],{type:"application/json"});At.saveAs(t,`${e}.json`)},displayBinaryData(e,t){this.binaryDataDisplayVisible=!0,this.binaryDataDisplayData={node:this.node.name,runIndex:this.runIndex,outputIndex:this.currentOutputIndex,index:e,key:t}},getOutputName(e){if(this.node===null)return e+1;const t=this.nodeType,o=this.getResolvedNodeOutputs(),n=o==null?void 0:o[e];return n&&Ps(n)?n==null?void 0:n.displayName:!(t!=null&&t.outputNames)||t.outputNames.length<=e?e+1:t.outputNames[e]},refreshDataSize(){this.showData=!1;const e=this.inputDataPage.map(t=>t.json);this.dataSize=JSON.stringify(e).length,this.dataSize<this.MAX_DISPLAY_DATA_SIZE&&(this.showData=!0)},onRunIndexChange(e){this.$emit("runChange",e)},enableNode(){if(this.node){const e={name:this.node.name,properties:{disabled:!this.node.disabled}};this.workflowsStore.updateNodeProperties(e)}},setDisplayMode(){if(!this.activeNode)return;this.activeNode.type===Zt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&this.ndvStore.setPanelDisplayMode({pane:"output",mode:"html"})},activatePane(){this.$emit("activatePane")},onSearchClear(){this.search="",document.dispatchEvent(new KeyboardEvent("keyup",{key:"/"}))}},watch:{node(){this.init()},hasNodeRun(){this.paneType==="output"&&this.setDisplayMode()},inputDataPage:{handler(e){this.paneType&&e&&this.ndvStore.setNDVPanelDataIsEmpty({panel:this.paneType,isEmpty:e.every(t=>Qt(t.json))})},immediate:!0,deep:!0},jsonData(e){this.refreshDataSize(),this.showPinDataDiscoveryTooltip(e)},binaryData(e,t){e.length&&!t.length&&this.displayMode!=="binary"?this.switchToBinary():!e.length&&this.displayMode==="binary"&&this.onDisplayModeChange("table")},currentOutputIndex(e){this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:e})},search(e){this.$emit("search",e)}}}),_l="_infoIcon_dosb5_5",Wl="_center_dosb5_9",Vl="_container_dosb5_23",Bl="_pinnedDataCallout_dosb5_32",Ll="_header_dosb5_40",Ul="_dataContainer_dosb5_54",xl="_dataDisplay_dosb5_63",Fl="_tabs_dosb5_75",Hl="_itemsCount_dosb5_82",zl="_runSelector_dosb5_90",Kl="_runSelectorWrapper_dosb5_99",jl="_pagination_dosb5_104",Yl="_pageSizeSelector_dosb5_114",Gl="_binaryIndex_dosb5_120",ql="_binaryRow_dosb5_137",Jl="_binaryCell_dosb5_142",Xl="_binaryHeader_dosb5_154",Ql="_binaryButtonContainer_dosb5_163",Zl="_binaryValue_dosb5_174",ed="_displayModes_dosb5_179",td="_tooltipContain_dosb5_185",od="_pinDataButton_dosb5_189",nd="_spinner_dosb5_193",id="_editMode_dosb5_204",sd="_editModeBody_dosb5_213",ad="_editModeFooter_dosb5_220",rd="_editModeFooterInfotip_dosb5_230",ld="_editModeActions_dosb5_236",dd="_stretchVertically_dosb5_243",ud="_uiBlocker_dosb5_247",cd={infoIcon:_l,center:Wl,container:Vl,pinnedDataCallout:Bl,header:Ll,dataContainer:Ul,"actions-group":"_actions-group_dosb5_59",dataDisplay:xl,tabs:Fl,itemsCount:Hl,runSelector:zl,runSelectorWrapper:Kl,pagination:jl,pageSizeSelector:Yl,binaryIndex:Gl,binaryRow:ql,binaryCell:Jl,binaryHeader:Xl,binaryButtonContainer:Ql,binaryValue:Zl,displayModes:ed,tooltipContain:td,pinDataButton:od,spinner:nd,editMode:id,editModeBody:sd,editModeFooter:ad,editModeFooterInfotip:rd,editModeActions:ld,stretchVertically:dd,uiBlocker:ud},hd={key:0,class:"ml-4xs"},pd={key:0},gd=["innerHTML"],fd=["data-test-id"],md={key:0},yd={key:1},wd={key:2},vd={key:3},Nd={key:4};function kd(e,t,o,n,i,s){const a=S("n8n-link"),r=S("n8n-callout"),l=S("BinaryDataDisplay"),p=S("n8n-radio-buttons"),h=S("n8n-icon-button"),d=S("n8n-text"),m=S("n8n-tooltip"),N=S("n8n-button"),k=S("n8n-option"),w=S("n8n-select"),c=S("run-data-search"),f=S("n8n-tabs"),E=S("n8n-spinner"),O=S("code-node-editor"),R=S("n8n-info-tip"),W=S("NodeErrorView"),V=S("i18n-t"),A=S("run-data-table"),L=S("run-data-json"),_=S("run-data-html"),te=S("run-data-schema"),Ke=S("el-pagination"),B=S("n8n-block-ui");return u(),T("div",{class:D(["run-data",e.$style.container]),onMouseover:t[14]||(t[14]=(...M)=>e.activatePane&&e.activatePane(...M))},[e.canPinData&&e.hasPinData&&!e.editMode.enabled&&!e.isProductionExecutionPreview?(u(),P(r,{key:0,theme:"secondary",icon:"thumbtack",class:D(e.$style.pinnedDataCallout)},{trailingContent:y(()=>[v(a,{to:e.dataPinningDocsUrl,size:"small",theme:"secondary",bold:"",underline:"",onClick:e.onClickDataPinningDocsLink},{default:y(()=>[I(b(e.$locale.baseText("runData.pindata.learnMore")),1)]),_:1},8,["to","onClick"])]),default:y(()=>[I(b(e.$locale.baseText("runData.pindata.thisDataIsPinned"))+" ",1),!e.isReadOnlyRoute&&!e.readOnlyEnv?(u(),T("span",hd,[v(a,{theme:"secondary",size:"small",underline:"",bold:"",onClick:t[0]||(t[0]=ie(M=>e.onTogglePinData({source:"banner-link"}),["stop"]))},{default:y(()=>[I(b(e.$locale.baseText("runData.pindata.unpin")),1)]),_:1})])):C("",!0)]),_:1},8,["class"])):C("",!0),v(l,{windowVisible:e.binaryDataDisplayVisible,displayData:e.binaryDataDisplayData,onClose:e.closeBinaryDataDisplay},null,8,["windowVisible","displayData","onClose"]),g("div",{class:D(e.$style.header)},[ae(e.$slots,"header",{},void 0,!0),z(g("div",{onClick:t[3]||(t[3]=ie(()=>{},["stop"])),class:D(e.$style.displayModes),"data-test-id":"run-data-pane-header"},[z(v(p,{modelValue:e.displayMode,options:e.buttons,"data-test-id":"ndv-run-data-display-mode","onUpdate:modelValue":e.onDisplayModeChange},null,8,["modelValue","options","onUpdate:modelValue"]),[[J,e.hasNodeRun&&(e.inputData.length||e.binaryData.length||e.search)&&!e.editMode.enabled]]),e.canPinData&&!e.isReadOnlyRoute&&!e.readOnlyEnv?z((u(),P(h,{key:0,title:e.$locale.baseText("runData.editOutput"),circle:!1,disabled:e.node.disabled,class:"ml-2xs",icon:"pencil-alt",type:"tertiary","data-test-id":"ndv-edit-pinned-data",onClick:t[1]||(t[1]=M=>e.enterEditMode({origin:"editIconButton"}))},null,8,["title","disabled"])),[[J,!e.editMode.enabled]]):C("",!0),e.canPinData&&e.rawInputData.length?z((u(),P(m,{key:1,placement:"bottom-end",visible:e.isControlledPinDataTooltip?e.isControlledPinDataTooltip&&e.pinDataDiscoveryTooltipVisible:void 0},Dt({default:y(()=>[v(h,{class:D(["ml-2xs",e.$style.pinDataButton]),type:"tertiary",active:e.hasPinData,icon:"thumbtack",disabled:e.editMode.enabled||e.rawInputData.length===0&&!e.hasPinData||e.isReadOnlyRoute||e.readOnlyEnv,onClick:t[2]||(t[2]=M=>e.onTogglePinData({source:"pin-icon-click"})),"data-test-id":"ndv-pin-data"},null,8,["class","active","disabled"])]),_:2},[e.isControlledPinDataTooltip?{name:"content",fn:y(()=>[g("div",{class:D(e.$style.tooltipContainer)},b(e.$locale.baseText("node.discovery.pinData.ndv")),3)]),key:"1"}:{name:"content",fn:y(()=>[g("div",{class:D(e.$style.tooltipContainer)},[g("strong",null,b(e.$locale.baseText("ndv.pinData.pin.title")),1),v(d,{size:"small",tag:"p"},{default:y(()=>[I(b(e.$locale.baseText("ndv.pinData.pin.description"))+" ",1),v(a,{to:e.dataPinningDocsUrl,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("ndv.pinData.pin.link")),1)]),_:1},8,["to"])]),_:1})],2)]),key:"0"}]),1032,["visible"])),[[J,!e.editMode.enabled]]):C("",!0),z(g("div",{class:D(e.$style.editModeActions)},[v(N,{type:"tertiary",label:e.$locale.baseText("runData.editor.cancel"),onClick:e.onClickCancelEdit},null,8,["label","onClick"]),v(N,{class:"ml-2xs",type:"primary",label:e.$locale.baseText("runData.editor.save"),onClick:e.onClickSaveEdit},null,8,["label","onClick"])],2),[[J,e.editMode.enabled]])],2),[[J,!e.hasRunError]])],2),e.maxRunIndex>0?z((u(),T("div",{key:1,class:D(e.$style.runSelector),"data-test-id":"run-selector"},[g("div",{class:D(e.$style.runSelectorWrapper)},[v(w,{size:"small",modelValue:e.runIndex,"onUpdate:modelValue":e.onRunIndexChange,onClick:t[4]||(t[4]=ie(()=>{},["stop"])),teleported:""},{prepend:y(()=>[I(b(e.$locale.baseText("ndv.output.run")),1)]),default:y(()=>[(u(!0),T(Z,null,de(e.maxRunIndex+1,M=>(u(),P(k,{label:e.getRunLabel(M),value:M-1,key:M},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"]),e.canLinkRuns?(u(),P(m,{key:0,placement:"right"},{content:y(()=>[I(b(e.$locale.baseText(e.linkedRuns?"runData.unlinking.hint":"runData.linking.hint")),1)]),default:y(()=>[v(h,{class:"linkRun",icon:e.linkedRuns?"unlink":"link",text:"",type:"tertiary",size:"small",onClick:e.toggleLinkRuns},null,8,["icon","onClick"])]),_:1})):C("",!0),ae(e.$slots,"run-info",{},void 0,!0)],2),e.showIOSearch?(u(),P(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[5]||(t[5]=M=>e.search=M),paneType:e.paneType,isAreaActive:e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","paneType","isAreaActive","onFocus"])):C("",!0)],2)),[[J,!e.editMode.enabled]]):C("",!0),ae(e.$slots,"before-data",{},void 0,!0),e.maxOutputIndex>0&&e.branches.length>1?(u(),T("div",{key:2,class:D(e.$style.tabs),"data-test-id":"branches"},[v(f,{modelValue:e.currentOutputIndex,options:e.branches,"onUpdate:modelValue":e.onBranchChange},null,8,["modelValue","options","onUpdate:modelValue"]),e.showIOSearch?(u(),P(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[6]||(t[6]=M=>e.search=M),paneType:e.paneType,isAreaActive:e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","paneType","isAreaActive","onFocus"])):C("",!0)],2)):e.hasNodeRun&&(e.dataCount>0&&e.maxRunIndex===0||e.search)&&!e.isArtificialRecoveredEventItem?z((u(),T("div",{key:3,class:D(e.$style.itemsCount),"data-test-id":"ndv-items-count"},[e.search?(u(),P(d,{key:0},{default:y(()=>[I(b(e.$locale.baseText("ndv.search.items",{adjustToNumber:e.unfilteredDataCount,interpolate:{matched:e.dataCount,total:e.unfilteredDataCount}})),1)]),_:1})):(u(),P(d,{key:1},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.items",{adjustToNumber:e.dataCount,interpolate:{count:e.dataCount}})),1)]),_:1})),e.showIOSearch?(u(),P(c,{key:2,modelValue:e.search,"onUpdate:modelValue":t[7]||(t[7]=M=>e.search=M),paneType:e.paneType,isAreaActive:e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","paneType","isAreaActive","onFocus"])):C("",!0)],2)),[[J,!e.editMode.enabled]]):C("",!0),g("div",{class:D(e.$style.dataContainer),ref:"dataContainer","data-test-id":"ndv-data-container"},[e.isExecuting?(u(),T("div",{key:0,class:D(e.$style.center),"data-test-id":"ndv-executing"},[g("div",{class:D(e.$style.spinner)},[v(E,{type:"ring"})],2),v(d,null,{default:y(()=>[I(b(e.executingMessage),1)]),_:1})],2)):e.editMode.enabled?(u(),T("div",{key:1,class:D(e.$style.editMode)},[g("div",{class:D([e.$style.editModeBody,"ignore-key-press"])},[v(O,{modelValue:e.editMode.value,language:"json","onUpdate:modelValue":t[8]||(t[8]=M=>e.ndvStore.setOutputPanelEditModeValue(M))},null,8,["modelValue"])],2),g("div",{class:D(e.$style.editModeFooter)},[v(R,{bold:!1,class:D(e.$style.editModeFooterInfotip)},{default:y(()=>[I(b(e.$locale.baseText("runData.editor.copyDataInfo"))+" ",1),v(a,{to:e.dataEditingDocsUrl,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("generic.learnMore")),1)]),_:1},8,["to"])]),_:1},8,["class"])],2)],2)):e.paneType==="output"&&e.hasSubworkflowExecutionError?(u(),T("div",{key:2,class:D(e.$style.stretchVertically)},[v(W,{error:e.subworkflowExecutionError,class:D(e.$style.errorDisplay)},null,8,["error","class"])],2)):e.hasNodeRun?e.paneType==="input"&&e.node.disabled?(u(),T("div",{key:4,class:D(e.$style.center)},[v(d,null,{default:y(()=>[I(b(e.$locale.baseText("ndv.input.disabled",{interpolate:{nodeName:e.node.name}}))+" ",1),v(a,{onClick:e.enableNode},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.disabled.cta")),1)]),_:1},8,["onClick"])]),_:1})],2)):e.hasNodeRun&&e.isArtificialRecoveredEventItem?(u(),T("div",{key:5,class:D(e.$style.center)},[ae(e.$slots,"recovered-artificial-output-data",{},void 0,!0)],2)):e.hasNodeRun&&e.hasRunError?(u(),T("div",{key:6,class:D(e.$style.stretchVertically)},[e.isPaneTypeInput?(u(),P(d,{key:0,class:D(e.$style.center),size:"large",tag:"p",bold:""},{default:y(()=>[I(b(e.$locale.baseText("nodeErrorView.inputPanel.previousNodeError.title",{interpolate:{nodeName:e.node.name}})),1)]),_:1},8,["class"])):e.$slots.content?ae(e.$slots,"content",{key:1},void 0,!0):(u(),P(W,{key:2,error:e.workflowRunData[e.node.name][e.runIndex].error,class:D(e.$style.dataDisplay)},null,8,["error","class"]))],2)):e.hasNodeRun&&(!e.unfilteredDataCount||e.search&&!e.dataCount)&&e.branches.length>1?(u(),T("div",{key:7,class:D(e.$style.center)},[e.search?(u(),T("div",pd,[v(d,{tag:"h3",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),v(d,null,{default:y(()=>[v(V,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:y(()=>[g("a",{href:"#",onClick:t[9]||(t[9]=(...M)=>e.onSearchClear&&e.onSearchClear(...M))},b(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})])):(u(),P(d,{key:1},{default:y(()=>[I(b(e.noDataInBranchMessage),1)]),_:1}))],2)):e.hasNodeRun&&!e.inputData.length&&!e.search?(u(),T("div",{key:8,class:D(e.$style.center)},[ae(e.$slots,"no-output-data",{},()=>[I("xxx")],!0)],2)):e.hasNodeRun&&!e.showData?(u(),T("div",{key:9,class:D(e.$style.center)},[v(d,{bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.tooMuchDataTitle),1)]),_:1}),v(d,{align:"center",tag:"div"},{default:y(()=>[g("span",{innerHTML:e.$locale.baseText("ndv.output.tooMuchData.message",{interpolate:{size:e.dataSizeInMB}})},null,8,gd)]),_:1}),v(N,{outline:"",label:e.$locale.baseText("ndv.output.tooMuchData.showDataAnyway"),onClick:e.showTooMuchData},null,8,["label","onClick"]),v(N,{size:"small",label:e.$locale.baseText("runData.downloadBinaryData"),onClick:t[10]||(t[10]=M=>e.downloadJsonData())},null,8,["label"])],2)):e.hasNodeRun&&e.$slots.content?ae(e.$slots,"content",{key:10},void 0,!0):e.hasNodeRun&&e.displayMode==="table"&&e.binaryData.length>0&&e.inputData.length===1&&Object.keys(e.jsonData[0]||{}).length===0?(u(),T("div",{key:11,class:D(e.$style.center)},[v(d,null,{default:y(()=>[I(b(e.$locale.baseText("runData.switchToBinary.info"))+" ",1),g("a",{onClick:t[11]||(t[11]=(...M)=>e.switchToBinary&&e.switchToBinary(...M))},b(e.$locale.baseText("runData.switchToBinary.binary")),1)]),_:1})],2)):e.showIoSearchNoMatchContent?(u(),T("div",{key:12,class:D(e.$style.center)},[v(d,{tag:"h3",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),v(d,null,{default:y(()=>[v(V,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:y(()=>[g("a",{href:"#",onClick:t[12]||(t[12]=(...M)=>e.onSearchClear&&e.onSearchClear(...M))},b(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})],2)):e.hasNodeRun&&e.displayMode==="table"?(u(),P(Se,{key:13},{default:y(()=>[v(A,{node:e.node,inputData:e.inputDataPage,mappingEnabled:e.mappingEnabled,distanceFromActive:e.distanceFromActive,runIndex:e.runIndex,pageOffset:e.currentPageOffset,totalRuns:e.maxRunIndex,hasDefaultHoverState:e.paneType==="input"&&!e.search,search:e.search,onMounted:t[13]||(t[13]=M=>e.$emit("tableMounted",M)),onActiveRowChanged:e.onItemHover,onDisplayModeChange:e.onDisplayModeChange},null,8,["node","inputData","mappingEnabled","distanceFromActive","runIndex","pageOffset","totalRuns","hasDefaultHoverState","search","onActiveRowChanged","onDisplayModeChange"])]),_:1})):e.hasNodeRun&&e.displayMode==="json"?(u(),P(Se,{key:14},{default:y(()=>[v(L,{paneType:e.paneType,editMode:e.editMode,sessioId:e.sessionId,node:e.node,inputData:e.inputDataPage,mappingEnabled:e.mappingEnabled,distanceFromActive:e.distanceFromActive,runIndex:e.runIndex,totalRuns:e.maxRunIndex,search:e.search},null,8,["paneType","editMode","sessioId","node","inputData","mappingEnabled","distanceFromActive","runIndex","totalRuns","search"])]),_:1})):e.hasNodeRun&&e.isPaneTypeOutput&&e.displayMode==="html"?(u(),P(Se,{key:15},{default:y(()=>[v(_,{inputHtml:e.inputDataPage[0].json.html},null,8,["inputHtml"])]),_:1})):e.hasNodeRun&&e.isSchemaView?(u(),P(Se,{key:16},{default:y(()=>[v(te,{data:e.jsonData,mappingEnabled:e.mappingEnabled,distanceFromActive:e.distanceFromActive,node:e.node,paneType:e.paneType,runIndex:e.runIndex,totalRuns:e.maxRunIndex,search:e.search},null,8,["data","mappingEnabled","distanceFromActive","node","paneType","runIndex","totalRuns","search"])]),_:1})):e.displayMode==="binary"&&e.binaryData.length===0?(u(),T("div",{key:17,class:D(e.$style.center)},[v(d,{align:"center",tag:"div"},{default:y(()=>[I(b(e.$locale.baseText("runData.noBinaryDataFound")),1)]),_:1})],2)):e.displayMode==="binary"?(u(),T("div",{key:18,class:D(e.$style.dataDisplay)},[(u(!0),T(Z,null,de(e.binaryData,(M,U)=>(u(),T("div",{key:U},[e.binaryData.length>1?(u(),T("div",{key:0,class:D(e.$style.binaryIndex)},[g("div",null,b(U+1),1)],2)):C("",!0),g("div",{class:D(e.$style.binaryRow)},[(u(!0),T(Z,null,de(M,(K,X)=>(u(),T("div",{class:D(e.$style.binaryCell),key:U+"_"+X},[g("div",{"data-test-id":"ndv-binary-data_"+U},[g("div",{class:D(e.$style.binaryHeader)},b(X),3),K.fileName?(u(),T("div",md,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.fileName"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.fileName),3)])):C("",!0),K.directory?(u(),T("div",yd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.directory"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.directory),3)])):C("",!0),K.fileExtension?(u(),T("div",wd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.fileExtension"))+":",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.fileExtension),3)])):C("",!0),K.mimeType?(u(),T("div",vd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.mimeType"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.mimeType),3)])):C("",!0),K.fileSize?(u(),T("div",Nd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.fileSize"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.fileSize),3)])):C("",!0),g("div",{class:D(e.$style.binaryButtonContainer)},[e.isViewable(U,X)?(u(),P(N,{key:0,size:"small",label:e.$locale.baseText("runData.showBinaryData"),"data-test-id":"ndv-view-binary-data",onClick:ce=>e.displayBinaryData(U,X)},null,8,["label","onClick"])):C("",!0),e.isDownloadable(U,X)?(u(),P(N,{key:1,size:"small",type:"secondary",label:e.$locale.baseText("runData.downloadBinaryData"),"data-test-id":"ndv-download-binary-data",onClick:ce=>e.downloadBinaryData(U,X)},null,8,["label","onClick"])):C("",!0)],2)],8,fd)],2))),128))],2)]))),128))],2)):C("",!0):(u(),T("div",{key:3,class:D(e.$style.center)},[ae(e.$slots,"node-not-run",{},void 0,!0)],2))],2),e.hasNodeRun&&!e.hasRunError&&e.binaryData.length===0&&e.dataCount>e.pageSize&&!e.isSchemaView&&!e.isArtificialRecoveredEventItem?z((u(),T("div",{key:4,class:D(e.$style.pagination),"data-test-id":"ndv-data-pagination"},[v(Ke,{background:"","hide-on-single-page":!0,"current-page":e.currentPage,"pager-count":5,"page-size":e.pageSize,layout:"prev, pager, next","onUpdate:currentPage":e.onCurrentPageChange,total:e.dataCount},null,8,["current-page","page-size","onUpdate:currentPage","total"]),g("div",{class:D(e.$style.pageSizeSelector)},[v(w,{size:"mini",modelValue:e.pageSize,"onUpdate:modelValue":e.onPageSizeChange,teleported:""},{prepend:y(()=>[I(b(e.$locale.baseText("ndv.output.pageSize")),1)]),default:y(()=>[(u(!0),T(Z,null,de(e.pageSizes,M=>(u(),P(k,{key:M,label:M,value:M},null,8,["label","value"]))),128)),v(k,{label:e.$locale.baseText("ndv.output.all"),value:e.dataCount},null,8,["label","value"])]),_:1},8,["modelValue","onUpdate:modelValue"])],2)],2)),[[J,!e.editMode.enabled]]):C("",!0),v(B,{show:e.blockUI,class:D(e.$style.uiBlocker)},null,8,["show","class"])],34)}const bd={$style:cd},Tn=H(Ml,[["render",kd],["__cssModules",bd],["__scopeId","data-v-0149f0a5"]]),Td=x({props:{taskData:{}},computed:{runTaskData(){return this.taskData},runMetadata(){return this.runTaskData?{executionTime:this.runTaskData.executionTime,startTime:new Date(this.runTaskData.startTime).toLocaleString()}:null}}}),Sd=g("br",null,null,-1);function Dd(e,t,o,n,i,s){const a=S("n8n-text"),r=S("n8n-info-tip");return e.runMetadata?(u(),P(r,{key:0,type:"tooltip",theme:"info-light",tooltipPlacement:"right"},{default:y(()=>[g("div",null,[v(a,{bold:!0,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("runData.startTime")+":"),1)]),_:1}),I(" "+b(e.runMetadata.startTime),1),Sd,v(a,{bold:!0,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("runData.executionTime")+":"),1)]),_:1}),I(" "+b(e.runMetadata.executionTime)+" "+b(e.$locale.baseText("runData.ms")),1)])]),_:1})):C("",!0)}const Ed=H(Td,[["render",Dd]]),_t={REGULAR:"regular",LOGS:"logs"},Cd=x({name:"OutputPanel",mixins:[ze],components:{RunData:Tn,RunInfo:Ed,RunDataAi:Os},data(){return{outputMode:"regular",outputTypes:[{label:this.$locale.baseText("ndv.output.outType.regular"),value:_t.REGULAR},{label:this.$locale.baseText("ndv.output.outType.logs"),value:_t.LOGS}]}},props:{runIndex:{type:Number,required:!0},isReadOnly:{type:Boolean},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},sessionId:{type:String},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},computed:{...q(G,ee,ue,Y),node(){return this.ndvStore.activeNode},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isTriggerNode(){return this.nodeTypesStore.isTriggerNode(this.node.type)},hasAiMetadata(){if(this.node){const e=this.workflowsStore.getWorkflowResultDataByNodeName(this.node.name);return!e||!Array.isArray(e)||e.length===0?!1:!!e[e.length-1].metadata}return!1},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){return!!(this.nodeType&&this.nodeType.group.includes("schedule"))},isNodeRunning(){return this.node&&this.workflowsStore.isNodeExecuting(this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){var t;if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return(t=e==null?void 0:e.resultData)!=null&&t.runData?e.resultData.runData:null},hasNodeRun(){return this.workflowsStore.subWorkflowExecutionError?!0:!!(this.node&&this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name))},runTaskData(){if(!this.node||this.workflowExecution===null)return null;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<=this.runIndex?null:e[this.node.name][this.runIndex]},runsCount(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length:0},staleData(){if(!this.node)return!1;const e=this.workflowsStore.getParametersLastUpdate(this.node.name);if(!e||!this.runTaskData)return!1;const t=this.runTaskData.startTime;return e>t},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},canPinData(){return this.isPinDataNodeType&&!this.isReadOnly}},methods:{insertTestData(){const e=this.$refs.runData;e&&(e.enterEditMode({origin:"insertTestDataLink"}),this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:this.node.type,pane:"output",type:"insert-test-data"}))},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},openSettings(){this.$emit("openSettings"),this.$telemetry.track("User clicked ndv link",{node_type:this.node.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"output",type:"settings"})},onRunIndexChange(e){this.$emit("runChange",e)},onUpdateOutputMode(e){e===_t.LOGS?gt.emit("setPositionByName","minLeft"):gt.emit("setPositionByName","initial")},activatePane(){this.$emit("activatePane")}}}),Id="_outputTypeSelect_1rlob_10",Pd="_titleSection_1rlob_15",Od="_title_1rlob_15",Rd="_noOutputData_1rlob_30",$d="_recoveredOutputData_1rlob_40",Ad={outputTypeSelect:Id,titleSection:Pd,title:Od,noOutputData:Rd,recoveredOutputData:$d},Md=["innerHTML"],_d=g("br",null,null,-1);function Wd(e,t,o,n,i,s){const a=S("n8n-radio-buttons"),r=S("RunInfo"),l=S("n8n-info-tip"),p=S("n8n-text"),h=S("run-data-ai"),d=S("RunData");return u(),P(d,{nodeUi:e.node,runIndex:e.runIndex,linkedRuns:e.linkedRuns,canLinkRuns:e.canLinkRuns,tooMuchDataTitle:e.$locale.baseText("ndv.output.tooMuchData.title"),noDataInBranchMessage:e.$locale.baseText("ndv.output.noOutputDataInBranch"),isExecuting:e.isNodeRunning,executingMessage:e.$locale.baseText("ndv.output.executing"),sessionId:e.sessionId,blockUI:e.blockUI,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isPaneActive,onActivatePane:e.activatePane,paneType:"output",onRunChange:e.onRunIndexChange,onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onTableMounted:t[3]||(t[3]=m=>e.$emit("tableMounted",m)),onItemHover:t[4]||(t[4]=m=>e.$emit("itemHover",m)),onSearch:t[5]||(t[5]=m=>e.$emit("search",m)),ref:"runData","data-output-type":e.outputMode},Dt({header:y(()=>[g("div",{class:D(e.$style.titleSection)},[e.hasAiMetadata?(u(),P(a,{key:0,options:e.outputTypes,modelValue:e.outputMode,"onUpdate:modelValue":[t[0]||(t[0]=m=>e.outputMode=m),e.onUpdateOutputMode]},null,8,["options","modelValue","onUpdate:modelValue"])):(u(),T("span",{key:1,class:D(e.$style.title)},b(e.$locale.baseText(e.outputPanelEditMode.enabled?"ndv.output.edit":"ndv.output")),3)),!e.hasPinData&&e.runsCount===1?z((u(),P(r,{key:2,taskData:e.runTaskData},null,8,["taskData"])),[[J,!e.outputPanelEditMode.enabled]]):C("",!0),e.hasNodeRun&&e.staleData?(u(),P(l,{key:3,theme:"warning",type:"tooltip",tooltipPlacement:"right"},{default:y(()=>[g("span",{innerHTML:e.$locale.baseText(e.hasPinData?"ndv.output.staleDataWarning.pinData":"ndv.output.staleDataWarning.regular")},null,8,Md)]),_:1})):C("",!0)],2)]),"node-not-run":y(()=>[e.workflowRunning&&!e.isTriggerNode?(u(),P(p,{key:0,"data-test-id":"ndv-output-waiting"},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.waitingToRun")),1)]),_:1})):C("",!0),e.workflowRunning?C("",!0):(u(),P(p,{key:1,"data-test-id":"ndv-output-run-node-hint"},{default:y(()=>[e.isSubNode?(u(),T(Z,{key:0},[I(b(e.$locale.baseText("ndv.output.runNodeHintSubNode")),1)],64)):(u(),T(Z,{key:1},[I(b(e.$locale.baseText("ndv.output.runNodeHint"))+" ",1),e.canPinData?(u(),T("span",{key:0,onClick:t[1]||(t[1]=(...m)=>e.insertTestData&&e.insertTestData(...m))},[_d,I(" "+b(e.$locale.baseText("generic.or"))+" ",1),v(p,{tag:"a",size:"medium",color:"primary"},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.insertTestData")),1)]),_:1})])):C("",!0)],64))]),_:1}))]),"no-output-data":y(()=>[v(p,{bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.noOutputData.title")),1)]),_:1}),v(p,null,{default:y(()=>[I(b(e.$locale.baseText("ndv.output.noOutputData.message"))+" ",1),g("a",{onClick:t[2]||(t[2]=(...m)=>e.openSettings&&e.openSettings(...m))},b(e.$locale.baseText("ndv.output.noOutputData.message.settings")),1),I(" "+b(e.$locale.baseText("ndv.output.noOutputData.message.settingsOption")),1)]),_:1})]),"recovered-artificial-output-data":y(()=>[g("div",{class:D(e.$style.recoveredOutputData)},[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),v(p,null,{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.outputMode==="logs"?{name:"content",fn:y(()=>[v(h,{node:e.node,"run-index":e.runIndex},null,8,["node","run-index"])]),key:"0"}:void 0,!e.hasPinData&&e.runsCount>1?{name:"run-info",fn:y(()=>[v(r,{taskData:e.runTaskData},null,8,["taskData"])]),key:"1"}:void 0]),1032,["nodeUi","runIndex","linkedRuns","canLinkRuns","tooMuchDataTitle","noDataInBranchMessage","isExecuting","executingMessage","sessionId","blockUI","isProductionExecutionPreview","isPaneActive","onActivatePane","onRunChange","onLinkRun","onUnlinkRun","data-output-type"])}const Vd={$style:Ad},Bd=H(Cd,[["render",Wd],["__cssModules",Vd]]),Ld={},Ud={width:"112",height:"80",viewBox:"0 0 112 80",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},xd=Ss('<mask id="mask0_489_46042" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="0" y="0" width="112" height="80"><rect width="112" height="80" fill="url(#paint0_linear_489_46042)"></rect></mask><g mask="url(#mask0_489_46042)"><rect x="-0.5" width="112" height="80" fill="url(#pattern0)" fill-opacity="0.6"></rect></g><defs><pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"><use xlink:href="#image0_489_46042" transform="scale(0.00357143 0.005)"></use></pattern><linearGradient id="paint0_linear_489_46042" x1="90.5" y1="40.4494" x2="112.5" y2="40.4494" gradientUnits="userSpaceOnUse"><stop></stop><stop offset="1" stop-color="white" stop-opacity="0"></stop></linearGradient><image id="image0_489_46042" width="280" height="200" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAADICAYAAAAzx/4XAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABhdSURBVHgB7d0JcFTVngbw/72d4IYa0Ie4IK2llgpodNwtB9AaxVILF7ZxynkgWupojaRwASXQGEBqEAI8LXfBpZQS9IFabjMFkXFfijCKyqjQqIiKShCUpdP3vvPdpXP7pjtk6dPdSX+/qlPpJX07UfrL/yz3XEOIPJNiswaZkbKBtkiluC0qRB1gCJW86ntmjzYM81YvWIhyhgFTwlCxGJGyBcJKhTQxhUrSpJraKSpcVgjDhTQqEyo5U+6prbVExmV6TnWT6ixbnuxmSZ262xCLVTUIUTsxYEoMKpdM4aKCZV5ZUmIMFMoljsGUkMk1c9RArjE39HBchcuYadVVdUKUYwyYEjEhVhstj8gqdbMi8HA8kpTBqmqJC5EGHOQtEeVlMkXSw6WB4UK6cQymBKB6UYMso4OPWYZMrWG4kGasYEpAmWGHB3Xj0ydVzRUizRgwJcAwjaFpD9gyVYjygAHTxTndo9Bium2WLBWiPGDAdHFlkWT4/KK6uVzrQnnCgOniDNuIBu/blr1aiPKEAdPF2Xba1DQeYfVCecOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2hhCXc7ll19eUVZWNto0zYFGJDLIamys8J+LRMrilpWst217WSKRqFu6dGlciDRhwHQho0aNilqWVavC4/I2vGyhCpqpDBrSISLUJYwcOfJWFS6vq5vHS9tURiKRcf3795c1a9a8JUQ5xAqmk0N3qLy8/O/q5iDpIMMwlu7evXuMqmYahCgHOMjbyalwWSE5CBdA18o7HlFOsIvUiY0YMaJWfWnLeEtr9FbdpQrVXXpDiDqIXaROavjw4aPVlwWiiapmBi9ZsqROiDqAXaTOa4popMZjtIUXlQ4GTCfkVS9R0SvqvQ9RuzFgOqe/Sn7k632oi+IYTCfjTUtvkTxJJBI9OG1N7cUKppMpKyurlDzK9/tR18KA6Xzy+oG3LCsqRO3EgOl8KiSPTNOMClE7MWCISJsyIUcsVlvRGJEVhm3Nq5k8fqEUr3wPuHKAl9qNFYwnFqtqMND9MMwF1TW16yfXzLl1Qqw2KkXGtu245Fe9ELUTAybAaPprHbXFmFsekfXV02oX3BX7r6KZSUkmk3WSR42NjQwYajcGTIBl2aubPWjL6EikfJWqalZU3zN7tBSYtyalTvJAVUt1XANDHcExmDTofmRdezhIdZ8GqaCZYog9d3fSWDYzVhWXwnhScrRFQ0sMw3hSiDqAFUyAZUi8Fd9W8O5TIpFYqr7ERa/44sWLFwpRBzBggiJm28YbCtR9QrfFsqwq0WuqEHUQz0UKwFR1MiIdOc8nns/u01VXXTXXNM1bJcdUeM174YUXxglRBzFgQlQ1goDp+GpZQxYmGxPzZsTu0DYL4534iC0uc9lNq1ddo1OEKAfYRQoYpyoYI1djG6r7ZEbKF+CYogm6Smo8ZjA265YcwHFwPCHKkZKrYPCB31cSUTEjlaYtUSNi9rVtqTTcqiUqOWKLzCtLql5XrCov07zDhg2LqYBo9y53akq6asmSJXOFKIe6ZMDEYvdGG6W80jKNioiYJ6vfUs38qDBxA0T7yYJqNqpq+qSqvH9YceG1xsZGBE1bNorihddIm04ZMMEqJILAMFWI2E5wYCwiKoUTV0E2Zlp1VZ0UEIImmUwOUjeHRiKRSnU76j9nlpU1WI2NdapieUuF0UIupCOdijZgUIXslkhFhq5MVPRWIQ3tOb4KlnrVJboiVrjFdxlNmjo7ZphmqutkW9bUaVPGx4QoDwq6ktfvyhimEVV/W/uiKyNuFVKRVC110SbEoJ2zNGywMZ1sSL2dtLdahlFvGtKgwqEe4aCmqqNqqnp9Ww6Y7/EWos5Ca8Bk6cpExa1CoipEdJVQ6Ko0uCFibbAMM94tIvWSkPieQgAho6aqpbUKNd5C1Bl0OGCaDaiaUpHelSlv+mZbcimuWr1t2RvUoGbcNiSOKkQ91pCDSiIuex7LccZbVLjUhR5vT2bm9r8MUZHYY8CgCqmQnRVZujKpKiTVnclTV0b0QlBFsz2ZZbzFCH0N3w4dIo3Riu/Z0+NERScVMM5Je1nWhiRlb21dGcGHWQWHWLJahVVDa7syOjlVkZn5Nw6Nt4S/yQg0LGJECJ+n2nGqdVPtO9XeUW2lagnZw4+R4bYdeE8GDRW9VMCURcoX2PhA5HhA1WvNujLFNtsSZBjetg12+mfYErtq+uTx86QpQFIvkab/ZOgTnqlajWpniBssQY2qrVJtumornMOK9BQ3jE5XrY9q3VXbodo61d5U7TPVtgeO4QcNQ4aKWipgsNmS+qvdnnNaAl2ZtAHVhmIOkZbYKmCM9HCJJ3bvGjtz2sT/FffDv7e4/+3wTegl7lJtt3f/JHHD5VzVjH333Ve6deuGZfjYHU62b99eZts2gmS+ajHVvlZtjGqjVNsnw4+DkxkfVW2OapuF1Qx1IoExmBY3W1LPFV9XRhcracUjpulUMKq8WP3Lr1uGPzx/Gk6CPFu1gaqdrNrB4lYjP6n2iWr/p9pG1W5X7Z9UM4499li59NJL5ZRTTnFC5ssvv5Tly5fL+++/L7t370alMkO1TaqdYqr36969uxx44IG42Bm2xpStW7fK77//fqAKpPHiVkYIpR+897Wl5WBh6FDBNQWMaSJAFhZgQLXYGNbO5AZzn4gkLWv+199+O23xgr/tpR7/V9VuUK1fhtdcLW43BhXOaart07NnT5kzZ44MGTLECQxABTN06FAZM2aM1NfXI817oyFcEEbnn3++DBgwwAmZbdu2yTvvvCNvvPGGbN68WRVU9s3ijt9sFbdqOki1fcUNEoTfL9I0rhOsbogKJhUw06qrcEZuTs7K7exmzpy49a7qe8feWzPxKXErh39TrVq1ngiLCjWv1qNHD+ybggpDGhoasMtcf/X8ieJ9sC+88EI599xzU+ECuH3MMcfIyJEjETCpxw8++GCpqqqSa665RtCl8g0fPlzuuusuWbRoEaoZHOhKcSumY8Ttgh0pbjWD6ul/xJ39+i3wq7CKoYLinrzpUlPNM9xwwQAtQuM/VeuJILjgggucdvTRRzsVyTfffCPLli2T9957D1VHauD3zDPPdLpFYfvtt5+cdtppTpD8+eefzmP9+vWTgQMHpoULoAq69tpr5e2333a6S8r54obLaaHDXqTaNar9TbUnVPtVguGC8SSDBQ3lHwOmueA0MwZdMRN01D777COnnnqq1NTUON2ZIHRr7rzzTidkfAcddJBEIpHmB1cfdARV37595YsvvnAeQ0X0l7/8JeMPc8IJJ8ghhxwin3/+ObZU6KUe6uUfPxqNyo4dO2TdunXGzp07D1UP/4dq34hbiWJ2Cq8x8J4MGSoEbjjVJLhQLhgwGNB1xkVQuYTDBc444ww5++yz5YADDkg9tv/++zthkgnCChUQIITQ3cLxM8FxjjrqKCkvb1oRjdCZMWOGzJs3zxnnufrqq3ENaTyFMZ1LxR2ANv3fif0kKhRWMOnCC+XQMMDrjJ+EuzC+vfbay+n2YEB2zZo1zmP+1HQme++9t1OV+LdRwQTHasJQ7SBg1MyTc//mm2+W66+/3jk+xoHw3GuvvSabNm3CQfp4zRmLsdWkO+sWKhRWMJkFF9JhdsYZL9m4cWPWF5x++ulOpeGHSksBg0BCFwdQoWTrHvmOOOKIVAWDMBoxYkTq2KhcevXq5by3Zz9xK5iI83uoAEL3yKlibNYylF8MmHTh6sWfoXEGWT/99NPUwGwYxkMwJY1qA10m3M80BgPoEmGGqbKy0hkMRmsJxn4wOIxQwXuEAwlhhuDx74obMs7vkFRjMIwVKhR2kVzBpf7BbhICZr1qW5LJZA/MGK1du9ZZOBeGLs5ll13mTEPj9mGHHeaPizSDQBg8eLAzZoNqpn///tISjPvMmjVLNmzYIIMGDWr2PN4Hx/Eg1RAyTsBgkDdVubCzRHnGgMkcLH4Fg9vbxK1iBm7evNlZhZspYODII4902h7fUH3QES4ImdbA2M+wYcOcGSNUMpkEwsw/uT01yEtUKKXeRco0c4SG2ZgrVLtRtb+KNxGDBXXvvvsuVtZKvmEMBqGUrdsVkgpIO5k0/HMK2FWifCvlCiZT5YJp6RGqjVXtEO++3+Vwzg/CepS6ujpnlW2RMkKNqGBYwTRVLvuLe8byveIurouKGzKYkUktcME09EsvveSvrC16lhAVTqlWMMHqxe9O3CbuuT7OdMzxxx/vnAmNLsknn3wiK1eudNah7Nq1ywmZVatWZRxwLQScsrBz507/LjIFJz2ygqGCK+Uukj8Iiq/YcW6keOFyww03yN133+2sUcHgKaqV5557TqZOnepMU3/77bfO1gvFEjDougWmzxEuu4WoCJRiwGSaLbpANWdxyVlnnSUPPfRQ2gswuDp27Fhn1ezEiROdr63xww8/yPr16+Wcc85ptugOA8aYkcIpAlg3Ex68xZQ0zrg++eSTpU+fPi0O7qKCCXTZEC47hKgIlOoYTDBk8MnFMlhnqewll1yS8QVYeYvl+Y8++qjMnDnTmTZuCVb94gzp8847T6qrq9OeQxg888wzcvHFF8tNN90kL7/8ctrzv/zyi0yYMEGuvPJKufHGG+Wrr75q8b3QbcNrPOgrdY4BIurySrmCQbj660XKvcdSS/gzwXPXXXedtAbGabBXjG3bznYLQVjP8v333zu3f/vtN6fLFYSw2LJli1Mpff3119hms8X3QsD8+uuv/l30lRAwzsw0l2pTIZXav7/wJUX8CuYP8SZc8IHvTBBgCKA//vjDuStuBfO7EBWBUvwDF5xd8cdgUttNrlu3TjqTRCIh8Xg8dVfczaawCTnX1VHBlXIFHewqob/iBAy6NnYnOusYAYOBZA+ql58leOUBNQvGVXdUKFxo58In1Pmrj5W6GP/o8IEDs0aYRtYFa3NwlrcH/SR/TwlWMFRwpV7B+PChxEhrI3bzf/7556WjsGudHzLZtnjoKExPYzr7448/9h/CANL/S9OpR9gvk0FDBVPKARP84KHEeEu89SNPPPFEh09oxJYNfsDoqmAwsPvqq6/6U9T42dHVQ1Cmn9+In4NbNVABlGLAhK/57DcsRomrlvzoo4/kvvvuS21RWawwIP3444/7dzG4i8vMImgwI8YTqKngSi1ggpdd9ZvlNVwxEbvxO4tO8MFdunRpq1ft5hsGonH6gjfrhSTEJWhxWYNguLCLRAVV6l0kS9JD5lVxr87oLFybPXu2rFixQnINXSd/gygERXtCDCdfPvvss/5d9JH+W7Ufpel3SS20S80gsZtEeVaqXaRgwwCJ5X3FwMsDqq3CN+JcICzz/+CDDySXcF6Rv8UlBmrb2hVbvXq1cyVIbxNyTK9jqTACxgo1VjBUUKVawQS7R37I+A19DlwhcR0++NiWAdce+uyzzySXgicvtqWCQWU1efJk5+cS9+fHz/uCuDNIflimmmFGbFYuVCilXMH4H0L/Q9no3cbXD1Wbr9pm7LPyyiuvSG1tbcFX+SKIHnzwQXn99df9hzCw+4i4ewYHQ5KDvFQUSn0Mxg+a4IcTAYM+CwZfZqm2BetYsDYGlcN3333XqoMfeuihqbUwuMJAEK4qgEuXADb0Dp9giX1ounfv7rwWx8HF2QAXV3vssceCXaoHxb3o/W7v5/ZD0g9PB8dfqFBatYN0F5TppMdwQ/g0iLv0/sxEIlGOcEFFc+KJJ2a91KsPwYFrUGNnPGy5cPjhh6eewxoZvB7PY9OqK664wgkVHwIFe9DgciWjRo2Sk046yTkDe/z48c64kKdO3IDBVQ8QLAlJr8KcKmbg4Iv+WQXVoFTA2PZbK+verBOiPCjVHe0QHn6I+GMwqOYS3vP+SZAIl9dU66Vme67fsmVL+YIFC+Tnn3+W6dOnOxdZywZVysiRI51qI3ypEYy/IHjuuOOO8DWNUq+96KKLnMua4Htx//777xesz/HOk8Ks0Qxxt2VISnq4sItERaPUr4sUnk0KngDp38bWB4vFvUb1v2/durUcm36j4sBMznHHHZf14AiOcHgEZbvWNaDK8a9XjbGXxYsXC05j8Dyh2iZp6hZlC5emlbxEBVDKAROsYvzxiuAVHYMnIP+k2jOq7VIVxLXbt2/f++mnn3bOMbrttttkwIABohO23sSWDN5sE6qVl6SpagmHS7ARFVSpn02daU1MIktDyDyl2gMqZLbhPKCnnnpKbr/9dmeLh/ZAcNxyyy3Su3dv6devnzz88MPBKiUF2zFg1zoPRpl/C/1smWaQRNhFogLjpWObPoTBv/jB7pIEvqK7hDUn+LTfotoBb775pnOdJAziBi5Av0c//vijzJ8/Xx544AHn/k8//SRTpkxxFt5hn97gda2xQXjghMmNkh4o4XDh+AsVDW7Zmnm62p+V8S8BEqwWMLD6d9UeVu1nDLouX77cuYxJa2FbTgQTAsZ7b6e7g5BZtGiRfPjhh2lnYKN6CWyCtUOyj70EqxeigmPAuIJdinDQBMPGb9jg5RPVPseLsGQfVUZrYYOoWbNmOVPP4p5cWe8dy8a1r1ER4Zh+qIQueWJK5vEWW9g1oiLDLlKTTFPXRuh5/3vQsO2ds7k2LkPiX4wNMLUcvg4SwgLbW2ItDS7g5p16gLDCiU4LVTtBtR5qILcPVuuiizRkyBBnvQwqG7zWg+s3ZQsXdo2oqDBg0vkBgg+tXymINL9YW3DTcKfL88gjj8iLL77oBAMWygXHUABjK9iKEwHj7aGLY8dVW6baN+IO3PZW7SpVDVXgTO4lS5Y44zp4XWBXvL7e+zJYqOgxYJoLhox4t4NB4y/CA2clNFb34vrVbYBuF1IG+898JE1ncmO7CKzK+xd1zB5r167N1IXtJu51nFi9UNFjwGQWDhlfsILBtDVOisSJRPuGno9I8038cUzMPmHnf8wEYd+ZleKGjR8MOJtyobhbX1aqdqB3LASQf0lY7PD9hzBYqBNgwGQXDBm/e+QP/vrXUkIFgg98T0m/UmQ3aQqi4DQ4ggELXbBvrn/1xeDMD74f4YNFfW94x8WxEt7rMO6zSTKfDsCQoaLDgGlZeLVveJUvQgZBgS5LRJoCxsxwnEzbRPiDyb5gFwxVzEbJvAgwKaxgqBNgwLROOBwQMqb31YcP/Z4CxsrS/IDwqx5T0isgW9L3rOGCOuoUGDB7FuyCBM9bagw8jsf8cMk2/tJSwPiCYzzB2apM+9bwrGkqegyY1guGCzQGHiuTpqom05VagwETDppgQISnws0Mr/cXAPK8Iyp6DJjWC6/2Dd72181ASwETrmQyVR/h7SLCxwhu88kxGCpqDJjWCa/ytaR5WIR3xAu/Pjzj01LA7Cmk2DWiToEB03Z+mJiB28GAEckcMMHbVuhxO/S6TCHlf1+msGLQUFFiwLSeX8X4ty1pHiit2TouU7cmU8BI6Lad5StR0WLAtE0wCMKDs209RkvPtTY8GDJU1Bgw7WNnuW+04TVEXR4DJrcYIkQB3HCKiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBdnGFI2gWbjIjZV4jyhAHTxdmGHU9/QKJClCcMmC6uLBmpDz1UOS5W2/qLaBN1AAOmi4vFquLiXuDNV7GfaY0WojxgwJQA27KeDN43DXOoEOUBA6YElNnmwtBDg6rvmT1OiDRjwJQAdJNssdOqGDHMKRNitVEh0ogBUyLKkkZMfQlOWVeUR2QFQ4Z0YsCUCGew15CpoYejCJlJNbWDhEiDtmz1SF2ACpOY+p8+pdkThixMNMrUme6sE1FOMGBK0KSaOXMNMW7N8vRSNe20LGkl62fE7qgXog5gwJSorJUMUQ4xYEoYxl7UP4AF6mZUiDRgwJBU31M7Wv1LQDUTFaIcYsBQSmx6bWVjo3W5mOZAww2bqBB1wD8AobUpv0xPqN8AAAAASUVORK5CYII="></image></defs>',3),Fd=[xd];function Hd(e,t){return u(),T("svg",Ud,Fd)}const zd=H(Ld,[["render",Hd]]),Kd=x({name:"InputPanel",mixins:[Pe],components:{RunData:Tn,NodeExecuteButton:Yt,WireMeUp:zd},props:{currentNodeName:{type:String},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},workflow:{},canLinkRuns:{type:Boolean},sessionId:{type:String},readOnly:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},data(){return{showDraggableHintWithDelay:!1,draggableHintShown:!1,inputMode:"debugging",mappedNode:null,inputModes:[{value:"mapping",label:this.$locale.baseText("ndv.input.mapping")},{value:"debugging",label:this.$locale.baseText("ndv.input.debugging")}]}},computed:{...q(G,ee,Y),focusedMappableInput(){return this.ndvStore.focusedMappableInput},isUserOnboarded(){return this.ndvStore.isMappingOnboarded},isMappingMode(){return this.isActiveNodeConfig&&this.inputMode==="mapping"},showDraggableHint(){const e=[vt,ot,Fn,Hn];return!this.currentNode||e.includes(this.currentNode.type)?!1:!!this.focusedMappableInput&&!this.isUserOnboarded},isActiveNodeConfig(){var o,n;let e=((o=this.activeNodeType)==null?void 0:o.inputs)??[],t=((n=this.activeNodeType)==null?void 0:n.outputs)??[];if(this.activeNode!==null&&this.currentWorkflow!==null){const i=this.currentWorkflow.getNode(this.activeNode.name);e=ge(this.currentWorkflow,i,this.activeNodeType),t=ve(this.currentWorkflow,i,this.activeNodeType)}else Array.isArray(e)||(e=[]),Array.isArray(t)||(t=[]);return!!(e.length===0||e.every(i=>this.filterOutConnectionType(i,$.Main))&&t.find(i=>this.filterOutConnectionType(i,$.Main)))},isMappingEnabled(){return this.readOnly?!1:this.isActiveNodeConfig?this.isMappingMode&&this.mappedNode!==null:!0},isExecutingPrevious(){if(!this.workflowRunning)return!1;const e=this.workflowsStore.executedNode,t=this.workflowsStore.executingNode;return this.activeNode&&e===this.activeNode.name&&!this.workflowsStore.isNodeExecuting(this.activeNode.name)?!0:t.length||e?!!this.parentNodes.find(o=>this.workflowsStore.isNodeExecuting(o.name)||o.name===e):!1},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.workflow},activeNode(){return this.ndvStore.activeNode},rootNode(){return this.currentWorkflow.getChildNodes(this.activeNode.name,"ALL_NON_MAIN")[0]},rootNodesParents(){return[...this.currentWorkflow.getParentNodes(this.rootNode,"main")].reverse()},currentNode(){return this.isActiveNodeConfig?this.mappedNode?this.workflowsStore.getNodeByName(this.mappedNode):this.activeNode:this.workflowsStore.getNodeByName(this.currentNodeName)},connectedCurrentNodeOutputs(){const e=this.parentNodes.find(({name:t})=>t===this.currentNodeName);if(e)return e.indicies},parentNodes(){if(!this.activeNode)return[];const e=this.workflow.getParentNodesByDepth(this.activeNode.name);return e.filter(({name:t},o)=>this.activeNode&&t!==this.activeNode.name&&e.findIndex(n=>n.name===t)===o)},currentNodeDepth(){const e=this.parentNodes.find(t=>this.currentNode&&t.name===this.currentNode.name);return e?e.depth:-1},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},isMultiInputNode(){return this.activeNodeType!==null&&this.activeNodeType.inputs.length>1}},methods:{filterOutConnectionType(e,t){return e?typeof e=="string"?e!==t:e.type!==t:!1},onInputModeChange(e){this.inputMode=e},onMappedNodeSelected(e){this.mappedNode=e,this.onRunIndexChange(0),this.onUnlinkRun()},getMultipleNodesText(e){var i;if(!e||!this.isMultiInputNode||!this.activeNode||((i=this.activeNodeType)==null?void 0:i.inputNames)===void 0)return"";const n=(this.currentWorkflow.connectionsByDestinationNode[this.activeNode.name].main||[]).reduce((s,a,r)=>a[0]&&a[0].node===e?[...s,r]:s,[]).map(s=>{var a,r;return(r=(a=this.activeNodeType)==null?void 0:a.inputNames)==null?void 0:r[s]});return n.length===0?"":`(${n.join(" & ")})`},onNodeExecute(){this.$emit("execute"),this.activeNode&&this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"executePrevious"})},onRunIndexChange(e){this.$emit("runChange",e)},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},onInputNodeChange(e){const t=this.parentNodes.findIndex(o=>o.name===e)+1;this.$emit("changeInputNode",e,t)},onConnectionHelpClick(){this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"not-connected-help"})},truncate(e){const t=e.substring(0,30);return t.length<e.length?`${t}...`:t},activatePane(){this.$emit("activatePane")}},watch:{inputMode:{handler(e){this.onRunIndexChange(-1),e==="mapping"&&(this.onUnlinkRun(),this.mappedNode=this.rootNodesParents[0])},immediate:!0},showDraggableHint(e,t){e&&!t?setTimeout(()=>{this.draggableHintShown||(this.showDraggableHintWithDelay=this.showDraggableHint,this.showDraggableHintWithDelay&&(this.draggableHintShown=!0,this.$telemetry.track("User viewed data mapping tooltip",{type:"unexecuted input pane"})))},1e3):e||(this.showDraggableHintWithDelay=!1)}}}),jd="_mappedNode_13qhk_5",Yd="_titleSection_13qhk_10",Gd="_inputModeTab_13qhk_19",qd="_noOutputData_13qhk_23",Jd="_recoveredOutputData_13qhk_33",Xd="_notConnected_13qhk_42",Qd="_title_13qhk_10",Zd={mappedNode:jd,titleSection:Yd,inputModeTab:Gd,noOutputData:qd,recoveredOutputData:Jd,notConnected:Xd,title:Qd},eu={key:0},tu={key:1},ou=["innerHTML"];function nu(e,t,o,n,i,s){const a=S("n8n-option"),r=S("n8n-select"),l=S("n8n-radio-buttons"),p=S("n8n-text"),h=S("NodeExecuteButton"),d=S("n8n-tooltip"),m=S("WireMeUp"),N=S("RunData");return u(),P(N,{nodeUi:e.currentNode,runIndex:e.runIndex,linkedRuns:e.linkedRuns,canLinkRuns:!e.mappedNode&&e.canLinkRuns,tooMuchDataTitle:e.$locale.baseText("ndv.input.tooMuchData.title"),noDataInBranchMessage:e.$locale.baseText("ndv.input.noOutputDataInBranch"),isExecuting:e.isExecutingPrevious,executingMessage:e.$locale.baseText("ndv.input.executingPrevious"),sessionId:e.sessionId,overrideOutputs:e.connectedCurrentNodeOutputs,mappingEnabled:e.isMappingEnabled,distanceFromActive:e.currentNodeDepth,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isPaneActive,onActivatePane:e.activatePane,paneType:"input",onItemHover:t[2]||(t[2]=k=>e.$emit("itemHover",k)),onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onRunChange:e.onRunIndexChange,onTableMounted:t[3]||(t[3]=k=>e.$emit("tableMounted",k)),onSearch:t[4]||(t[4]=k=>e.$emit("search",k)),"data-test-id":"ndv-input-panel"},Dt({header:y(()=>[g("div",{class:D(e.$style.titleSection)},[e.parentNodes.length?(u(),P(r,{key:0,teleported:"",size:"small",modelValue:e.currentNodeName,"onUpdate:modelValue":e.onInputNodeChange,"no-data-text":e.$locale.baseText("ndv.input.noNodesFound"),placeholder:e.$locale.baseText("ndv.input.parentNodes"),filterable:"","data-test-id":"ndv-input-select"},{prepend:y(()=>[g("span",{class:D(e.$style.title)},b(e.$locale.baseText("ndv.input")),3)]),default:y(()=>[(u(!0),T(Z,null,de(e.parentNodes,k=>(u(),P(a,{value:k.name,key:k.name,class:"node-option",label:`${e.truncate(k.name)} ${e.getMultipleNodesText(k.name)}`,"data-test-id":"ndv-input-option"},{default:y(()=>[g("span",null,b(e.truncate(k.name))+" ",1),e.getMultipleNodesText(k.name)?(u(),T("span",eu,b(e.getMultipleNodesText(k.name)),1)):(u(),T("span",tu,b(e.$locale.baseText("ndv.input.nodeDistance",{adjustToNumber:k.depth})),1))]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","no-data-text","placeholder"])):(u(),T("span",{key:1,class:D(e.$style.title)},b(e.$locale.baseText("ndv.input")),3)),e.isActiveNodeConfig&&!e.readOnly?(u(),P(l,{key:2,options:e.inputModes,modelValue:e.inputMode,"onUpdate:modelValue":e.onInputModeChange},null,8,["options","modelValue","onUpdate:modelValue"])):C("",!0)],2)]),"node-not-run":y(()=>[e.isActiveNodeConfig&&e.rootNode||e.parentNodes.length?(u(),T("div",{key:0,class:D(e.$style.noOutputData)},[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.noOutputData.title")),1)]),_:1}),e.readOnly?C("",!0):(u(),P(d,{key:0,visible:e.showDraggableHint&&e.showDraggableHintWithDelay},{content:y(()=>[g("div",{innerHTML:e.$locale.baseText("dataMapping.dragFromPreviousHint",{interpolate:{name:e.focusedMappableInput}})},null,8,ou)]),default:y(()=>[v(h,{type:"secondary",transparent:!0,nodeName:e.isActiveNodeConfig?e.rootNode:e.currentNodeName,label:e.$locale.baseText("ndv.input.noOutputData.executePrevious"),onExecute:e.onNodeExecute,telemetrySource:"inputs","data-test-id":"execute-previous-node"},null,8,["nodeName","label","onExecute"])]),_:1},8,["visible"])),e.readOnly?C("",!0):(u(),P(p,{key:1,tag:"div",size:"small"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.noOutputData.hint")),1)]),_:1}))],2)):(u(),T("div",{key:1,class:D(e.$style.notConnected)},[g("div",null,[v(m)]),v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.notConnected.title")),1)]),_:1}),v(p,{tag:"div"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.notConnected.message"))+" ",1),g("a",{href:"https://docs.n8n.io/workflows/connections/",target:"_blank",onClick:t[1]||(t[1]=(...k)=>e.onConnectionHelpClick&&e.onConnectionHelpClick(...k))},b(e.$locale.baseText("ndv.input.notConnected.learnMore")),1)]),_:1})],2))]),"no-output-data":y(()=>[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.noOutputData")),1)]),_:1})]),"recovered-artificial-output-data":y(()=>[g("div",{class:D(e.$style.recoveredOutputData)},[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),v(p,null,{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.isMappingMode?{name:"before-data",fn:y(()=>[(u(),P(yn("style"),null,{default:y(()=>[I("button.linkRun { display: none }")]),_:1})),g("div",{class:D(e.$style.mappedNode)},[v(r,{modelValue:e.mappedNode,"onUpdate:modelValue":e.onMappedNodeSelected,size:"small",onClick:t[0]||(t[0]=ie(()=>{},["stop"])),teleported:""},{prepend:y(()=>[I(b(e.$locale.baseText("ndv.input.previousNode")),1)]),default:y(()=>[(u(!0),T(Z,null,de(e.rootNodesParents,k=>(u(),P(a,{key:k,label:k,value:k},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])],2)]),key:"0"}:void 0]),1032,["nodeUi","runIndex","linkedRuns","canLinkRuns","tooMuchDataTitle","noDataInBranchMessage","isExecuting","executingMessage","sessionId","overrideOutputs","mappingEnabled","distanceFromActive","isProductionExecutionPreview","isPaneActive","onActivatePane","onLinkRun","onUnlinkRun","onRunChange"])}const iu={$style:Zd},su=H(Kd,[["render",nu],["__cssModules",iu],["__scopeId","data-v-216c34ad"]]),au=x({name:"TriggerPanel",mixins:[Pe,St],components:{NodeExecuteButton:Yt,CopyInput:Ui,NodeIcon:Tt},data:()=>({executionsHelpEventBus:nn()}),props:{nodeName:{type:String},sessionId:{type:String}},computed:{...q(G,ee,ue,Y),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},serviceName(){return this.nodeType?pt(this.nodeType):""},isWebhookNode(){return!!(this.node&&this.node.type===Le)},webhookHttpMethod(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.getWebhookExpressionValue(this.nodeType.webhooks[0],"httpMethod")},webhookTestUrl(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.getWebhookUrl(this.nodeType.webhooks[0],this.node,"test")},isWebhookBasedNode(){var e,t;return!!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)},isPollingNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return!!this.node&&!this.node.disabled&&this.isWebhookBasedNode&&e&&(!t||t===this.nodeName)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isActivelyPolling(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&this.isPollingNode&&this.nodeName===e},isWorkflowActive(){return this.workflowsStore.isWorkflowActive},listeningTitle(){var e;return((e=this.nodeType)==null?void 0:e.name)===Ue?this.$locale.baseText("ndv.trigger.webhookNode.formTrigger.listening"):this.$locale.baseText("ndv.trigger.webhookNode.listening")},listeningHint(){var e;return((e=this.nodeType)==null?void 0:e.name)===Ue?this.$locale.baseText("ndv.trigger.webhookBasedNode.formTrigger.serviceHint"):this.$locale.baseText("ndv.trigger.webhookBasedNode.serviceHint",{interpolate:{service:this.serviceName}})},header(){var t;const e=this.nodeType?pt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingEvent"):(t=this.nodeType)!=null&&t.triggerPanel&&typeof this.nodeType.triggerPanel.header=="string"?this.nodeType.triggerPanel.header:this.isWebhookBasedNode?this.$locale.baseText("ndv.trigger.webhookBasedNode.action",{interpolate:{name:e}}):""},subheader(){const e=this.nodeType?pt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingHint",{interpolate:{name:e}}):""},executionsHelp(){var e,t;if(((t=(e=this.nodeType)==null?void 0:e.triggerPanel)==null?void 0:t.executionsHelp)!==void 0){if(typeof this.nodeType.triggerPanel.executionsHelp=="string")return this.nodeType.triggerPanel.executionsHelp;if(!this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.inactive)return this.nodeType.triggerPanel.executionsHelp.inactive;if(this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.active)return this.nodeType.triggerPanel.executionsHelp.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):""},activationHint(){var e,t;if(this.isActivelyPolling)return"";if((t=(e=this.nodeType)==null?void 0:e.triggerPanel)!=null&&t.activationHint){if(typeof this.nodeType.triggerPanel.activationHint=="string")return this.nodeType.triggerPanel.activationHint;if(!this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.inactive=="string")return this.nodeType.triggerPanel.activationHint.inactive;if(this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.active=="string")return this.nodeType.triggerPanel.activationHint.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):""}},methods:{expandExecutionHelp(){this.$refs.help&&this.executionsHelpEventBus.emit("expand")},onLinkClick(e){var o;if(!e.target)return;const t=e.target;t.localName==="a"&&(o=t.dataset)!=null&&o.key&&(e.stopPropagation(),e.preventDefault(),t.dataset.key==="activate"?this.$emit("activate"):t.dataset.key==="executions"?(this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-executions-log"}),this.ndvStore.activeNodeName=null,this.$router.push({name:j.EXECUTIONS})):t.dataset.key==="settings"&&this.uiStore.openModal(zn))},onTestLinkCopied(){this.$telemetry.track("User copied webhook URL",{pane:"inputs",type:"test url"})},onNodeExecute(){this.$emit("execute")}}}),ru="_container_2vg29_5",lu="_header_2vg29_22",du="_action_2vg29_29",uu="_shake_2vg29_33",cu="_accordion_2vg29_54",hu={container:ru,header:lu,action:du,shake:uu,accordion:cu},pu={key:"empty"},gu={key:"listening"},fu={key:0},mu={key:1},yu={key:"default"},wu={key:0,class:"mb-xl"},vu=["textContent"],Nu=["innerHTML"];function ku(e,t,o,n,i,s){const a=S("NodeIcon"),r=S("n8n-pulse"),l=S("n8n-text"),p=S("CopyInput"),h=S("NodeExecuteButton"),d=S("n8n-spinner"),m=S("n8n-heading"),N=S("n8n-link"),k=S("n8n-info-accordion");return u(),T("div",{class:D(e.$style.container)},[v(Ds,{name:"fade",mode:"out-in"},{default:y(()=>[e.hasIssues?(u(),T("div",pu)):e.isListeningForEvents?(u(),T("div",gu,[v(r,null,{default:y(()=>[v(a,{nodeType:e.nodeType,size:40},null,8,["nodeType"])]),_:1}),e.isWebhookNode?(u(),T("div",fu,[v(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:y(()=>[I(b(e.$locale.baseText("ndv.trigger.webhookNode.listening")),1)]),_:1}),g("div",{class:D([e.$style.shake,"mb-xs"])},[v(l,null,{default:y(()=>[I(b(e.$locale.baseText("ndv.trigger.webhookNode.requestHint",{interpolate:{type:this.webhookHttpMethod}})),1)]),_:1})],2),v(p,{value:e.webhookTestUrl,toastTitle:e.$locale.baseText("ndv.trigger.copiedTestUrl"),class:"mb-2xl",size:"medium",collapse:!0,"copy-button-text":e.$locale.baseText("generic.clickToCopy"),onCopy:e.onTestLinkCopied},null,8,["value","toastTitle","copy-button-text","onCopy"]),v(h,{"data-test-id":"trigger-execute-button",nodeName:e.nodeName,onExecute:e.onNodeExecute,size:"medium",telemetrySource:"inputs"},null,8,["nodeName","onExecute"])])):(u(),T("div",mu,[v(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:y(()=>[I(b(e.listeningTitle),1)]),_:1}),g("div",{class:D([e.$style.shake,"mb-xs"])},[v(l,{tag:"div"},{default:y(()=>[I(b(e.listeningHint),1)]),_:1})],2),v(h,{"data-test-id":"trigger-execute-button",nodeName:e.nodeName,onExecute:e.onNodeExecute,size:"medium",telemetrySource:"inputs"},null,8,["nodeName","onExecute"])]))])):(u(),T("div",yu,[e.isActivelyPolling?(u(),T("div",wu,[v(d,{type:"ring"})])):C("",!0),g("div",{class:D(e.$style.action)},[g("div",{class:D(e.$style.header)},[e.header?(u(),P(m,{key:0,tag:"h1",bold:""},{default:y(()=>[I(b(e.header),1)]),_:1})):C("",!0),e.subheader?(u(),P(l,{key:1},{default:y(()=>[g("span",{textContent:b(e.subheader)},null,8,vu)]),_:1})):C("",!0)],2),v(h,{"data-test-id":"trigger-execute-button",nodeName:e.nodeName,onExecute:e.onNodeExecute,size:"medium",telemetrySource:"inputs"},null,8,["nodeName","onExecute"])],2),e.activationHint?(u(),P(l,{key:1,size:"small",onClick:e.onLinkClick},{default:y(()=>[g("span",{innerHTML:e.activationHint},null,8,Nu),I("  ")]),_:1},8,["onClick"])):C("",!0),e.activationHint&&e.executionsHelp?(u(),P(N,{key:2,size:"small",onClick:e.expandExecutionHelp},{default:y(()=>[I(b(e.$locale.baseText("ndv.trigger.moreInfo")),1)]),_:1},8,["onClick"])):C("",!0),e.executionsHelp?(u(),P(k,{key:3,ref:"help",class:D(e.$style.accordion),title:e.$locale.baseText("ndv.trigger.executionsHint.question"),description:e.executionsHelp,eventBus:e.executionsHelpEventBus,"onClick:body":e.onLinkClick},null,8,["class","title","description","eventBus","onClick:body"])):C("",!0)]))]),_:1})],2)}const bu={$style:hu},Tu=H(au,[["render",ku],["__cssModules",bu],["__scopeId","data-v-d1ba9417"]]),Su=x({name:"NodeDetailsView",mixins:[Ie,Oe,Pe,Ho,ze],components:{NodeSettings:Va,InputPanel:su,OutputPanel:Bd,NDVDraggablePanels:Mr,TriggerPanel:Tu},props:{readOnly:{type:Boolean},renaming:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1}},setup(e){var t,o;return{...Qo(),...xt(),...(o=(t=Ho).setup)==null?void 0:o.call(t,e)}},data(){return{settingsEventBus:nn(),redrawRequired:!1,runInputIndex:-1,runOutputIndex:-1,isLinkingEnabled:!0,selectedInput:void 0,triggerWaitingWarningEnabled:!1,isDragging:!1,mainPanelPosition:0,pinDataDiscoveryTooltipVisible:!1,avgInputRowHeight:0,avgOutputRowHeight:0,isInputPaneActive:!1,isOutputPaneActive:!1,isPairedItemHoveringEnabled:!0}},mounted(){we.on("data-pinning-discovery",this.setIsTooltipVisible)},beforeUnmount(){we.off("data-pinning-discovery",this.setIsTooltipVisible)},computed:{...q(G,ee,ue,Y,sn),sessionId(){return this.ndvStore.sessionId},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},showTriggerWaitingWarning(){return this.triggerWaitingWarningEnabled&&!!this.activeNodeType&&!this.activeNodeType.group.includes("trigger")&&this.workflowRunning&&this.workflowsStore.executionWaitingForWebhook},activeNode(){return this.ndvStore.activeNode},inputNodeName(){return this.selectedInput||this.parentNode},inputNode(){return this.inputNodeName?this.workflowsStore.getNodeByName(this.inputNodeName):null},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},showTriggerPanel(){var n,i,s,a;const e=!!((i=(n=this.activeNodeType)==null?void 0:n.webhooks)!=null&&i.length),t=(s=this.activeNodeType)==null?void 0:s.polling,o=!!((a=this.activeNodeType)!=null&&a.triggerPanel);return!this.readOnly&&this.isTriggerNode&&(e||t||o)},workflow(){return this.getCurrentWorkflow()},hasOutputConnection(){var t,o;if(!this.activeNode)return!1;const e=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);return(((o=(t=Object.values(e))==null?void 0:t[0])==null?void 0:o[0])??[]).length>0},parentNodes(){return this.activeNode?this.workflow.getParentNodesByDepth(this.activeNode.name,1).map(({name:e})=>e)||[]:[]},parentNode(){var t;const e=this.workflowsStore.getPinData;for(const o of this.parentNodes)if(e[o]||(t=this.workflowRunData)!=null&&t[o])return o;return this.parentNodes[0]},isExecutableTriggerNode(){return this.activeNodeType?Kn.includes(this.activeNodeType.name):!1},isTriggerNode(){return!!this.activeNodeType&&(this.activeNodeType.group.includes("trigger")||this.activeNodeType.name===vt)},isActiveStickyNode(){return!!this.ndvStore.activeNode&&this.ndvStore.activeNode.type===re},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},maxOutputRun(){if(this.activeNode===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.activeNode.name)?0:e[this.activeNode.name].length?e[this.activeNode.name].length-1:0},outputRun(){return this.runOutputIndex===-1?this.maxOutputRun:Math.min(this.runOutputIndex,this.maxOutputRun)},maxInputRun(){if(this.inputNode===null||this.activeNode===null)return 0;const e=this.workflow.getNode(this.activeNode.name),t=ve(this.workflow,e,this.activeNodeType);let o=this.inputNode;const n=this.workflowRunData;return t.some(i=>i!==$.Main)&&(o=this.activeNode),!o||!n||!n.hasOwnProperty(o.name)?0:n[o.name].length?n[o.name].length-1:0},inputRun(){return this.isLinkingEnabled&&this.maxOutputRun===this.maxInputRun?this.outputRun:this.runInputIndex===-1?this.maxInputRun:Math.min(this.runInputIndex,this.maxInputRun)},canLinkRuns(){return this.maxOutputRun>0&&this.maxOutputRun===this.maxInputRun},linked(){return this.isLinkingEnabled&&this.canLinkRuns},inputPanelMargin(){return this.isTriggerNode?0:80},featureRequestUrl(){return this.activeNodeType?`${jn}${this.activeNodeType.name}`:""},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isWorkflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isExecutionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},blockUi(){return this.isWorkflowRunning||this.isExecutionWaitingForWebhook},foreignCredentials(){const e=(this.activeNode||{}).credentials,t=this.workflowsStore.usedCredentials,o=[];return e&&this.settingsStore.isEnterpriseFeatureEnabled(an.Sharing)&&Object.values(e).forEach(n=>{n.id&&t[n.id]&&!t[n.id].currentUserHasAccess&&o.push(n.id)}),o},hasForeignCredential(){return this.foreignCredentials.length>0}},watch:{activeNode(e,t){e&&e.name!==(t==null?void 0:t.name)&&!this.isActiveStickyNode&&(this.runInputIndex=-1,this.runOutputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=void 0,this.triggerWaitingWarningEnabled=!1,this.avgOutputRowHeight=0,this.avgInputRowHeight=0,setTimeout(()=>this.ndvStore.setNDVSessionId(),0),this.$externalHooks().run("dataDisplay.nodeTypeChanged",{nodeSubtitle:this.getNodeSubtitle(e,this.activeNodeType,this.getCurrentWorkflow())}),setTimeout(()=>{if(this.activeNode){const o=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);this.$telemetry.track("User opened node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,is_editable:!this.hasForeignCredential,parameters_pane_position:this.mainPanelPosition,input_first_connector_runs:this.maxInputRun,output_first_connector_runs:this.maxOutputRun,selected_view_inputs:this.isTriggerNode?"trigger":this.ndvStore.inputPanelDisplayMode,selected_view_outputs:this.ndvStore.outputPanelDisplayMode,input_connectors:this.parentNodes.length,output_connectors:o&&o.main&&o.main.length,input_displayed_run_index:this.inputRun,output_displayed_run_index:this.outputRun,data_pinning_tooltip_presented:this.pinDataDiscoveryTooltipVisible,input_displayed_row_height_avg:this.avgInputRowHeight,output_displayed_row_height_avg:this.avgOutputRowHeight})}},2e3)),window.top&&!this.isActiveStickyNode&&window.top.postMessage(JSON.stringify({command:e?"openNDV":"closeNDV"}),"*")},maxOutputRun(){this.runOutputIndex=-1},maxInputRun(){this.runInputIndex=-1},inputNodeName(e){setTimeout(()=>{this.ndvStore.setInputNodeName(e)},0)},inputRun(){setTimeout(()=>{this.ndvStore.setInputRunIndex(this.inputRun)},0)}},methods:{setIsTooltipVisible({isTooltipVisible:e}){this.pinDataDiscoveryTooltipVisible=e},onKeyDown(e){if(e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.readOnly)return;this.$emit("saveKeyboardShortcut",e)}},onInputItemHover(e){if(e===null||!this.inputNodeName||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.inputNodeName,runIndex:this.inputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onOutputItemHover(e){if(e===null||!this.activeNode||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.activeNode.name,runIndex:this.outputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onInputTableMounted(e){this.avgInputRowHeight=e.avgRowHeight},onOutputTableMounted(e){this.avgOutputRowHeight=e.avgRowHeight},onWorkflowActivate(){this.ndvStore.activeNodeName=null,setTimeout(()=>{this.activateCurrentWorkflow("ndv")},1e3)},onFeatureRequestClick(){window.open(this.featureRequestUrl,"_blank"),this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:$.Main,type:"i-wish-this-node-would"})},onPanelsInit(e){this.mainPanelPosition=e.position},onDragStart(e){this.isDragging=!0,this.mainPanelPosition=e.position},onDragEnd(e){this.isDragging=!1,this.$telemetry.track("User moved parameters pane",{window_width:e.windowWidth,start_position:this.mainPanelPosition,end_position:e.position,node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.mainPanelPosition=e.position},onLinkRunToInput(){this.runOutputIndex=this.runInputIndex,this.isLinkingEnabled=!0,this.trackLinking("input")},onLinkRunToOutput(){this.isLinkingEnabled=!0,this.trackLinking("output")},onUnlinkRun(e){this.runInputIndex=this.runOutputIndex,this.isLinkingEnabled=!1,this.trackLinking(e)},trackLinking(e){this.$telemetry.track("User changed ndv run linking",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,linked:this.linked,pane:e})},onNodeExecute(){setTimeout(()=>{!this.activeNode||!this.workflowRunning||(this.triggerWaitingWarningEnabled=!0)},1e3)},openSettings(){this.settingsEventBus.emit("openSettings")},valueChanged(e){this.$emit("valueChanged",e)},nodeTypeSelected(e){this.$emit("nodeTypeSelected",e)},async onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},async close(){var e,t;if(!this.isDragging){if(typeof((e=this.activeNodeType)==null?void 0:e.outputs)=="string"||typeof((t=this.activeNodeType)==null?void 0:t.inputs)=="string"||this.redrawRequired){const o=this.activeNode.name;setTimeout(()=>{this.$emit("redrawNode",o)},1)}if(this.outputPanelEditMode.enabled){if(await this.confirm("",this.$locale.baseText("ndv.pinData.beforeClosing.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.cancel")})===We){const{value:n}=this.outputPanelEditMode;if(this.activeNode)try{this.setPinData(this.activeNode,Nt(n),"on-ndv-close-modal")}catch(i){console.error(i)}}this.ndvStore.setOutputPanelEditModeEnabled(!1)}await this.$externalHooks().run("dataDisplay.nodeEditingFinished"),this.$telemetry.track("User closed node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.triggerWaitingWarningEnabled=!1,this.ndvStore.activeNodeName=null,this.ndvStore.resetNDVSessionId()}},onRunOutputIndexChange(e){this.runOutputIndex=e,this.trackRunChange(e,"output")},onRunInputIndexChange(e){this.runInputIndex=e,this.linked&&(this.runOutputIndex=e),this.trackRunChange(e,"input")},trackRunChange(e,t){this.$telemetry.track("User changed ndv run dropdown",{session_id:this.sessionId,run_index:e,node_type:this.activeNodeType?this.activeNodeType.name:"",pane:t})},onInputNodeChange(e,t){this.runInputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=e,this.$telemetry.track("User changed ndv input dropdown",{node_type:this.activeNode?this.activeNode.type:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId,selection_value:t,input_node_type:this.inputNode?this.inputNode.type:""})},onStopExecution(){this.$emit("stopExecution")},activateInputPane(){this.isInputPaneActive=!0,this.isOutputPaneActive=!1},activateOutputPane(){this.isInputPaneActive=!1,this.isOutputPaneActive=!0},onSearch(e){this.isPairedItemHoveringEnabled=!e}}}),Du="_modalBackground_17uio_5",Eu="_triggerWarning_17uio_10",Cu="_backToCanvas_17uio_14",Iu="_featureRequest_17uio_35",Pu={modalBackground:Du,triggerWarning:Eu,backToCanvas:Cu,featureRequest:Iu};function Ou(e,t,o,n,i,s){const a=S("n8n-icon"),r=S("n8n-text"),l=S("n8n-tooltip"),p=S("TriggerPanel"),h=S("InputPanel"),d=S("OutputPanel"),m=S("NodeSettings"),N=S("font-awesome-icon"),k=S("NDVDraggablePanels"),w=S("el-dialog");return u(),P(w,{modelValue:(!!e.activeNode||e.renaming)&&!e.isActiveStickyNode,"before-close":e.close,"show-close":!1,class:"data-display-wrapper ndv-wrapper","overlay-class":"data-display-overlay",width:"auto","append-to-body":"","data-test-id":"ndv","data-has-output-connection":e.hasOutputConnection},{default:y(()=>{var c;return[v(l,{placement:"bottom-start",visible:e.showTriggerWaitingWarning,disabled:!e.showTriggerWaitingWarning},{content:y(()=>[g("div",{class:D(e.$style.triggerWarning)},b(e.$locale.baseText("ndv.backToCanvas.waitingForTriggerWarning")),3)]),default:y(()=>[g("div",{class:D(e.$style.backToCanvas),onClick:t[0]||(t[0]=(...f)=>e.close&&e.close(...f)),"data-test-id":"back-to-canvas"},[v(a,{icon:"arrow-left",color:"text-xlight",size:"medium"}),v(r,{color:"text-xlight",size:"medium",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("ndv.backToCanvas")),1)]),_:1})],2)]),_:1},8,["visible","disabled"]),e.activeNode?(u(),T("div",{key:0,class:"data-display",ref:"container",onKeydownCapture:t[6]||(t[6]=(...f)=>e.onKeyDown&&e.onKeyDown(...f)),tabindex:"0"},[g("div",{onClick:t[1]||(t[1]=(...f)=>e.close&&e.close(...f)),class:D(e.$style.modalBackground)},null,2),(u(),P(k,{isTriggerNode:e.isTriggerNode,hideInputAndOutput:e.activeNodeType===null,position:e.isTriggerNode&&!e.showTriggerPanel?0:void 0,isDraggable:!e.isTriggerNode,hasDoubleWidth:((c=e.activeNodeType)==null?void 0:c.parameterPane)==="wide",nodeType:e.activeNodeType,key:e.activeNode.name,onSwitchSelectedNode:e.onSwitchSelectedNode,onClose:e.close,onInit:e.onPanelsInit,onDragstart:e.onDragStart,onDragend:e.onDragEnd},Dt({output:y(()=>[v(d,{"data-test-id":"output-panel",canLinkRuns:e.canLinkRuns,runIndex:e.outputRun,linkedRuns:e.linked,sessionId:e.sessionId,isReadOnly:e.readOnly||e.hasForeignCredential,blockUI:e.blockUi&&e.isTriggerNode&&!e.isExecutableTriggerNode,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isOutputPaneActive,onActivatePane:e.activateOutputPane,onLinkRun:e.onLinkRunToOutput,onUnlinkRun:t[3]||(t[3]=()=>e.onUnlinkRun("output")),onRunChange:e.onRunOutputIndexChange,onOpenSettings:e.openSettings,onTableMounted:e.onOutputTableMounted,onItemHover:e.onOutputItemHover,onSearch:e.onSearch},null,8,["canLinkRuns","runIndex","linkedRuns","sessionId","isReadOnly","blockUI","isProductionExecutionPreview","isPaneActive","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onTableMounted","onItemHover","onSearch"])]),main:y(()=>[v(m,{eventBus:e.settingsEventBus,dragging:e.isDragging,sessionId:e.sessionId,nodeType:e.activeNodeType,foreignCredentials:e.foreignCredentials,readOnly:e.readOnly,blockUI:e.blockUi&&e.showTriggerPanel,executable:!e.readOnly,onValueChanged:e.valueChanged,onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution,onRedrawRequired:t[4]||(t[4]=f=>e.redrawRequired=!0),onActivate:e.onWorkflowActivate},null,8,["eventBus","dragging","sessionId","nodeType","foreignCredentials","readOnly","blockUI","executable","onValueChanged","onExecute","onStopExecution","onActivate"]),e.featureRequestUrl?(u(),T("a",{key:0,onClick:t[5]||(t[5]=(...f)=>e.onFeatureRequestClick&&e.onFeatureRequestClick(...f)),class:D(e.$style.featureRequest),target:"_blank"},[v(N,{icon:"lightbulb"}),I(" "+b(e.$locale.baseText("ndv.featureRequest")),1)],2)):C("",!0)]),_:2},[e.showTriggerPanel||!e.isTriggerNode?{name:"input",fn:y(()=>[e.showTriggerPanel?(u(),P(p,{key:0,nodeName:e.activeNode.name,sessionId:e.sessionId,onExecute:e.onNodeExecute,onActivate:e.onWorkflowActivate},null,8,["nodeName","sessionId","onExecute","onActivate"])):e.isTriggerNode?C("",!0):(u(),P(h,{key:1,workflow:e.workflow,canLinkRuns:e.canLinkRuns,runIndex:e.inputRun,linkedRuns:e.linked,currentNodeName:e.inputNodeName,sessionId:e.sessionId,readOnly:e.readOnly||e.hasForeignCredential,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isInputPaneActive,onActivatePane:e.activateInputPane,onLinkRun:e.onLinkRunToInput,onUnlinkRun:t[2]||(t[2]=()=>e.onUnlinkRun("input")),onRunChange:e.onRunInputIndexChange,onOpenSettings:e.openSettings,onChangeInputNode:e.onInputNodeChange,onExecute:e.onNodeExecute,onTableMounted:e.onInputTableMounted,onItemHover:e.onInputItemHover,onSearch:e.onSearch},null,8,["workflow","canLinkRuns","runIndex","linkedRuns","currentNodeName","sessionId","readOnly","isProductionExecutionPreview","isPaneActive","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onChangeInputNode","onExecute","onTableMounted","onItemHover","onSearch"]))]),key:"0"}:void 0]),1032,["isTriggerNode","hideInputAndOutput","position","isDraggable","hasDoubleWidth","nodeType","onSwitchSelectedNode","onClose","onInit","onDragstart","onDragend"]))],544)):C("",!0)]}),_:1},8,["modelValue","before-close","data-has-output-connection"])}const Ru={$style:Pu},$u=H(Su,[["render",Ou],["__cssModules",Ru]]),Au=x({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=it(),{position:n,isOpen:i,actions:s,target:a}=o,r=F();Ht(i,()=>{var h,d;i?(h=r.value)==null||h.open():(d=r.value)==null||d.close()},{flush:"post"});function l(h){const d=h;o._dispatchAction(d),t("action",d,o.targetNodes.value)}function p(h){h||o.close()}return(h,d)=>be(i)?(u(),P(wn,{key:0,to:"body"},[g("div",{class:D(h.$style.contextMenu),style:se({left:`${be(n)[0]}px`,top:`${be(n)[1]}px`})},[v(be(Yn),{ref_key:"dropdown",ref:r,items:be(s),placement:"bottom-start","data-test-id":"context-menu",hideArrow:be(a).source!=="node-button",onSelect:l,onVisibleChange:p},{activator:y(()=>[g("div",{class:D(h.$style.activator)},null,2)]),_:1},8,["items","hideArrow"])],6)])):C("",!0)}}),Mu="_contextMenu_2nizv_5",_u="_activator_2nizv_9",Wu={contextMenu:Mu,activator:_u},Vu={$style:Wu},Bu=H(Au,[["__cssModules",Vu]]),Lu=(e,t)=>{const o=Xn.includes(e);return{type:"N8nAddInput",options:{width:24,height:72,color:t,multiple:o}}},Uu=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),Sn=x({mixins:[kn],mounted(){if(this.data!==null)try{this.__addNode(this.data)}catch{}},data(){return{inputs:[],outputs:[]}},computed:{...q(G,ue,Kt,Y,bt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""}},props:{name:{type:String},instance:{type:Object},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean}},methods:{__addEndpointTestingData(e,t,o){if(window!=null&&window.Cypress&&"canvas"in e.endpoint){const n=e.endpoint.canvas;this.instance.setAttribute(n,"data-endpoint-name",this.data.name),this.instance.setAttribute(n,"data-input-index",o.toString()),this.instance.setAttribute(n,"data-endpoint-type",t)}},__addInputEndpoints(e,t){const o={},n={},i=this.workflowsStore.getCurrentWorkflow(),s=ge(i,this.data,t)||[];this.inputs=s;const a=[...s];a.sort((r,l)=>typeof r=="string"?1:typeof l=="string"||r.required&&!l.required?-1:!r.required&&l.required?1:0),a.forEach((r,l)=>{var A,L;let p;typeof r=="string"?p={type:r}:p=r;const h=p.type,d=h===$.Main?$.Main:"other";o.hasOwnProperty(d)?o[d]++:o[d]=0,n.hasOwnProperty(h)?n[h]++:n[h]=0;const m=o[d],N=n[h],k=s.filter(_=>{const te=typeof _=="string"?_:_.type;return h===$.Main?te===$.Main:te!==$.Main}),w=k.filter(_=>_!==$.Main),c=w.filter(_=>typeof _!="string"&&_.required),f=w.filter(_=>typeof _!="string"&&!_.required),E=this.getSpacerIndexes(c.length,f.length),O=Do(h,"input",k.length,E)[m],R=mt(h),W={uuid:Bt(this.nodeId,h,N),anchor:O,maxConnections:p.maxConnections??-1,endpoint:"Rectangle",paintStyle:Rt(t,"--color-foreground-xdark",h),hoverPaintStyle:Rt(t,"--color-primary",h),scope:xi(R),source:h!==$.Main,target:!this.isReadOnly&&s.length>1,parameters:{connection:"target",nodeId:this.nodeId,type:h,index:N},enabled:!this.isReadOnly,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...this.__getInputConnectionStyle(h,t)},V=(A=this.instance)==null?void 0:A.addEndpoint(this.$refs[this.data.name],W);this.__addEndpointTestingData(V,"input",N),(p.displayName||(L=t.inputNames)!=null&&L[l])&&V.addOverlay(Fi(p.displayName||t.inputNames[l],h,p.required)),Array.isArray(V)||(V.__meta={nodeName:e.name,nodeId:this.nodeId,index:N,totalEndpoints:k.length,nodeType:e.type})}),a.length===0&&this.instance.manage(this.$refs[this.data.name])},getSpacerIndexes(e,t,o=Gn,n=qn){const i=[];if(e>0&&t>0){if(o)i.push(e);else if(e+t<n)for(let s=e;s<n-t;s++)i.push(s)}else if(e>0&&e<n&&t===0)for(let s=0;s<n-e;s++)i.push(s+e);else if(e===0&&t>0&&t<n)for(let s=0;s<n-t;s++)i.push(s);return i},__addOutputEndpoints(e,t){const o={},n={},i=this.workflowsStore.getCurrentWorkflow();this.outputs=ve(i,this.data,t)||[];let s=0;const a=[];this.outputs.forEach((l,p)=>{var d;let h;typeof l=="string"?h={type:l}:h=l,(d=t.outputNames)!=null&&d[p]&&(h.displayName=t.outputNames[p]),h.displayName&&(s=h.displayName.length>s?h.displayName.length:s),a.push(h)});const r=s<4?"short":"medium";this.outputs.forEach((l,p)=>{const h=a[p],d=h.type,m=d===$.Main?$.Main:"other";o.hasOwnProperty(m)?o[m]++:o[m]=0,n.hasOwnProperty(d)?n[d]++:n[d]=0;const N=o[m],k=n[d],w=this.outputs.filter(R=>{const W=typeof R=="string"?R:R.type;return d===$.Main?W===$.Main:W!==$.Main}),c=Do(d,"output",w.length)[N],f=mt(d),E={uuid:yt(this.nodeId,d,k),anchor:c,maxConnections:-1,endpoint:{type:"Dot",options:{radius:t&&w.length>2?7:9}},hoverPaintStyle:qe(t,"--color-primary"),scope:f,source:!0,target:d!==$.Main,enabled:!this.isReadOnly,parameters:{connection:"source",nodeId:this.nodeId,type:d,index:k},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...this.__getOutputConnectionStyle(d,h,t)},O=this.instance.addEndpoint(this.$refs[this.data.name],E);if(this.__addEndpointTestingData(O,"output",k),h.displayName){const R=Hi(h.displayName,d,h==null?void 0:h.category);O.addOverlay(R)}if(Array.isArray(O)||(O.__meta={nodeName:e.name,nodeId:this.nodeId,index:k,totalEndpoints:w.length,endpointLabelLength:r}),!this.isReadOnly&&d===$.Main){const R={uuid:yt(this.nodeId,d,k),anchor:c,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:O,showOutputLabel:this.outputs.length===1,size:this.outputs.length>=3?"small":"medium",endpointLabelLength:r,hoverMessage:this.$locale.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!this.isReadOnly,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:this.nodeId,type:d,index:k,category:h==null?void 0:h.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};h!=null&&h.category&&(R.cssClass=`${R.cssClass} ${h==null?void 0:h.category}`);const W=this.instance.addEndpoint(this.$refs[this.data.name],R);this.__addEndpointTestingData(W,"plus",k),Array.isArray(W)||(W.__meta={nodeName:e.name,nodeId:this.nodeId,index:k,nodeType:e.type,totalEndpoints:w.length})}})},__addNode(e){const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion)??this.nodeTypesStore.getNodeType(Jn);this.__addInputEndpoints(e,t),this.__addOutputEndpoints(e,t)},__getEndpointColor(e){return`--node-type-${e}-color`},__getInputConnectionStyle(e,t){return e===$.Main?{paintStyle:Rt(t,this.__getEndpointColor($.Main),e)}:Object.values($).includes(e)?(n=>({endpoint:Lu(n,this.__getEndpointColor(n))}))(e):{}},__getOutputConnectionStyle(e,t,o){const n="output",i=s=>({endpoint:Uu(),paintStyle:qe(o,this.__getEndpointColor(s)),hoverPaintStyle:qe(o,this.__getEndpointColor(s))});return e===$.Main?t.category==="error"?{paintStyle:{...qe(o,this.__getEndpointColor($.Main)),fill:"var(--node-error-output-color)"},cssClass:`dot-${n}-endpoint`}:{paintStyle:qe(o,this.__getEndpointColor($.Main)),cssClass:`dot-${n}-endpoint`}:Object.values($).includes(e)?i(e):{}},touchEnd(e){this.isTouchDevice&&this.uiStore.isActionActive("dragActive")&&this.uiStore.removeActiveAction("dragActive")},mouseLeftClick(e){const t=e.path||e.composedPath&&e.composedPath();for(let o=0;o<t.length;o++)if(t[o].className&&typeof t[o].className=="string"&&t[o].className.includes("no-select-on-click"))return;this.isTouchDevice||(this.uiStore.isActionActive("dragActive")?this.uiStore.removeActiveAction("dragActive"):(this.isCtrlKeyPressed(e)||this.$emit("deselectAllNodes"),this.uiStore.isNodeSelected(this.data.name)?this.$emit("deselectNode",this.name):this.$emit("nodeSelected",this.name)))}}}),xu=x({name:"Node",setup(){return{contextMenu:it()}},mixins:[Ie,Sn,Oe,Pe,ze,Ft],components:{TitledList:zi,FontAwesomeIcon:Rs,NodeIcon:Tt},props:{isProductionExecutionPreview:{type:Boolean,default:!1}},computed:{...q(G,ee,ue,Y),showPinnedDataInfo(){return this.hasPinData&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?Jo.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(){var e;return this.workflowsStore.getWorkflowResultDataByNodeName(((e=this.data)==null?void 0:e.name)||"")||[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error","failed"].includes(this.nodeExecutionStatus)?!0:this.hasPinData?!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?pt(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.workflowsStore.isNodeExecuting(this.data.name)},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(){return this.data.type===ot},isConfigNode(){var e;return this.nodeTypesStore.isConfigNode(this.getCurrentWorkflow(),this.data,((e=this.data)==null?void 0:e.type)??"")},isConfigurableNode(){var e;return this.nodeTypesStore.isConfigurableNode(this.getCurrentWorkflow(),this.data,((e=this.data)==null?void 0:e.type)??"")},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode(((e=this.data)==null?void 0:e.type)||"")},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=>e.type===this.data.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(n=>n!==$.Main);o.length&&o.forEach(n=>{e[`node-wrapper--connection-type-${n}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=this.workflowsStore.getCurrentWorkflow(),o=ge(t,this.node,this.nodeType)||[],i=fe(o).filter(l=>l!==$.Main);if(i.length){o.filter(p=>typeof p!="string"&&p.required);let l=0;e["--configurable-node-input-count"]=i.length+l}const s=ve(t,this.node,this.nodeType)||[],r=fe(s).filter(l=>l===$.Main);e["--node-main-output-count"]=r.length}return e},nodeClass(){return{"node-box":!0,disabled:this.data.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,n;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(i=>{i!=null&&i.error&&e.push(`${i.error.message}${i.error.description?` (${i.error.description})`:""}`)}),((n=this.data)==null?void 0:n.issues)!==void 0&&e.push(...Qn(this.data.issues,this.data)),e},nodeDisabledIcon(){return this.data.disabled===!1?"pause":"play"},position(){return this.node?this.node.position:[0,0]},showDisabledLinethrough(){return!this.isConfigurableNode&&!!(this.data.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){return this.$locale.shortNodeType(this.data.type)},nodeTitle(){return this.data.name==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):this.data.name},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=me(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===Zn?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,n,i;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),this.data.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues?((i=(n=(o=this.nodeRunData)==null?void 0:o[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-canvas-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=>e.name===this.data.name)!==void 0},shiftOutputCount(){return!!(this.nodeType&&this.outputs.length>2)},shouldShowTriggerTooltip(){return!!this.node&&this.isTriggerNode&&!this.isPollingTypeNode&&!this.hasPinData&&!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)}},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(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}},created(){De(Wt).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{this.$emit("run",{name:this.data&&this.data.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isModalActive||e===0||(De(Wt).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){try{const e=this.getNodeSubtitle(this.data,this.nodeType,this.getCurrentWorkflow())||"";this.nodeSubtitle=e.includes(ei)?"":e}catch{}},disableNode(){this.data!==null&&(this.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new Ki(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(){this.$emit("runWorkflow",this.data.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},onClick(e){this.callDebounced("onClickDebounced",{debounceTime:50,trailing:!0},e)},onClickDebounced(e){e.detail>=2?this.setNodeActive():this.mouseLeftClick(e)},setNodeActive(){this.ndvStore.activeNodeName=this.data?this.data.name:"",this.pinDataDiscoveryTooltipVisible=!1},touchStart(){this.isTouchDevice===!0&&!this.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})}}}),Dn=e=>(fn("data-v-cd47e477"),e=e(),mn(),e),Fu=["id","data-name"],Hu={class:"select-background"},zu={key:0,class:"trigger-icon"},Ku=["innerHTML"],ju={key:0,class:"node-issues","data-test-id":"node-issues"},Yu={key:1,class:"waiting"},Gu=["textContent"],qu={key:2,class:"node-pin-data-icon"},Ju={key:0,class:"items-count"},Xu={key:3},Qu={key:4,class:"data-count"},Zu={key:0,class:"items-count"},ec=["title"],tc={class:"node-trigger-tooltip__wrapper"},oc=["textContent"],nc=Dn(()=>g("span",null,null,-1)),ic=Dn(()=>g("span",null,null,-1)),sc={key:0,class:"node-options no-select-on-click"},ac={class:"node-description"},rc=["title"],lc={"data-test-id":"canvas-node-box-title"},dc={key:0},uc=["title"];function cc(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("n8n-tooltip"),l=S("titled-list"),p=S("NodeIcon"),h=S("n8n-icon-button"),d=zt("touch");return u(),T("div",{class:D(e.nodeWrapperClass),style:se(e.nodeWrapperStyles),id:e.nodeId,"data-test-id":"canvas-node",ref:e.data.name,"data-name":e.data.name,onContextmenu:t[2]||(t[2]=m=>e.openContextMenu(m,"node-right-click"))},[z(g("div",Hu,null,512),[[J,e.isSelected]]),g("div",{class:D({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.isTouchDevice,"menu-open":e.isContextMenuOpen})},[z((u(),T("div",{class:D(e.nodeClass),style:se(e.nodeStyle),onClick:t[0]||(t[0]=ie((...m)=>e.onClick&&e.onClick(...m),["left"]))},[e.isTriggerNode?(u(),T("i",zu,[v(r,{placement:"bottom"},{content:y(()=>[g("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,Ku)]),default:y(()=>[v(a,{icon:"bolt",size:"lg"})]),_:1})])):C("",!0),e.data.disabled?C("",!0):(u(),T("div",{key:1,class:D({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues?(u(),T("div",ju,[v(r,{"show-after":500,placement:"bottom"},{content:y(()=>[v(l,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:y(()=>[v(a,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(u(),T("div",Yu,[v(r,{placement:"bottom"},{content:y(()=>[g("div",{textContent:b(e.waiting)},null,8,Gu)]),default:y(()=>[v(a,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(u(),T("span",qu,[v(a,{icon:"thumbtack"}),e.workflowDataItems>1?(u(),T("span",Ju,b(e.workflowDataItems),1)):C("",!0)])):e.nodeExecutionStatus==="unknown"?(u(),T("span",Xu)):e.workflowDataItems?(u(),T("span",Qu,[v(a,{icon:"check"}),e.workflowDataItems>1?(u(),T("span",Zu,b(e.workflowDataItems),1)):C("",!0)])):C("",!0)],2)),g("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[v(a,{icon:"sync-alt",spin:""})],8,ec),g("div",tc,[v(r,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:y(()=>[g("div",{textContent:b(e.getTriggerNodeTooltip)},null,8,oc)]),default:y(()=>[nc]),_:1},8,["visible"]),e.isTriggerNode?(u(),P(r,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:y(()=>[I(b(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:y(()=>[ic]),_:1},8,["visible"])):C("",!0)]),v(p,{class:"node-icon",nodeType:e.nodeType,size:40,shrink:!1,colorDefault:e.iconColorDefault,disabled:this.data.disabled},null,8,["nodeType","colorDefault","disabled"])],6)),[[d,e.touchStart,"start"],[d,e.touchEnd,"end"]]),e.isReadOnly?C("",!0):z((u(),T("div",sc,[v(h,{"data-test-id":"execute-node-button",type:"tertiary",text:"",icon:"play",disabled:e.workflowRunning||e.isConfigNode,title:e.$locale.baseText("node.executeNode"),onClick:e.executeNode},null,8,["disabled","title","onClick"]),v(h,{"data-test-id":"overflow-node-button",type:"tertiary",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=m=>e.openContextMenu(m,"node-button"))})],512)),[[J,!e.hideActions]]),e.showDisabledLinethrough?(u(),T("div",{key:1,class:D({"disabled-linethrough":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):C("",!0)],2),g("div",ac,[g("div",{class:"node-name",title:e.nodeTitle},[g("p",lc,b(e.nodeTitle),1),e.data.disabled?(u(),T("p",dc,"("+b(e.$locale.baseText("node.disabled"))+")",1)):C("",!0)],8,rc),e.nodeSubtitle!==void 0?(u(),T("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},b(e.nodeSubtitle),9,uc)):C("",!0)])],46,Fu)}const hc=H(xu,[["render",cc],["__scopeId","data-v-cd47e477"]]),pc=x({name:"Sticky",mixins:[Ie,Sn,Oe,Pe],setup(){const e=F(),t=F(!1),o=i=>{t.value=i},n=it(i=>{var s;i==="change_color"&&(o(!0),(s=e.value)==null||s.click())});return{colorPopoverTrigger:e,contextMenu:n,forceActions:t,setForceActions:o}},props:{nodeViewScale:{type:Number},gridSize:{type:Number}},computed:{...q(G,ee,ue,Y),defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&Pt(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.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&&at(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&at(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")}},data(){return{isResizing:!1,isTouchActive:!1}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...this.node.parameters,color:e}}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e,t){if(e){const o=this.name===rn,n=e.querySelector('img[alt="n8n quickstart video"'),i=o&&n?"welcome_video":o&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:i})}},onInputChange(e){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:n}){this.node&&((o!==0||n!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(n||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:Pt(e.content)?e.content:this.node.parameters.content,height:at(e.height)?e.height:this.node.parameters.height,width:at(e.width)?e.width:this.node.parameters.width,color:Pt(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.isTouchDevice===!0&&!this.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},onContextMenu(e){this.node&&this.contextMenu.open(e,{source:"node-right-click",node:this.node})}}}),gc=["id","data-name"],fc={class:"select-sticky-background"},mc=["title"],yc=["title"],wc={class:"content"},vc=["onClick"];function Nc(e,t,o,n,i,s){const a=S("n8n-sticky"),r=S("font-awesome-icon"),l=S("n8n-popover"),p=zt("touch");return u(),T("div",{class:"sticky-wrapper",id:e.nodeId,ref:e.data.name,style:se(e.stickyPosition),"data-name":e.data.name,"data-test-id":"sticky"},[g("div",{class:D({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.isTouchDevice}),style:se(e.stickySize)},[z(g("div",fc,null,512),[[J,e.isSelected]]),z((u(),T("div",{class:"sticky-box",onClick:t[0]||(t[0]=ie((...h)=>e.mouseLeftClick&&e.mouseLeftClick(...h),["left"])),onContextmenu:t[1]||(t[1]=(...h)=>e.onContextMenu&&e.onContextMenu(...h))},[v(a,{modelValue:e.node.parameters.content,height:e.node.parameters.height,width:e.node.parameters.width,scale:e.nodeViewScale,backgroundColor:e.node.parameters.color,id:e.node.id,readOnly:e.isReadOnly,defaultText:e.defaultText,editMode:e.isActive&&!e.isReadOnly,gridSize:e.gridSize,onEdit:e.onEdit,onResizestart:e.onResizeStart,onResize:e.onResize,onResizeend:e.onResizeEnd,onMarkdownClick:e.onMarkdownClick,"onUpdate:modelValue":e.onInputChange},null,8,["modelValue","height","width","scale","backgroundColor","id","readOnly","defaultText","editMode","gridSize","onEdit","onResizestart","onResize","onResizeend","onMarkdownClick","onUpdate:modelValue"])],32)),[[p,e.touchStart,"start"],[p,e.touchEnd,"end"]]),z(g("div",{class:D({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[z((u(),T("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.deleteNode")},[v(r,{icon:"trash"})],8,mc)),[[p,e.deleteNode,"tap"]]),v(l,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:y(()=>[g("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[v(r,{icon:"palette"})],8,yc)]),default:y(()=>[g("div",wc,[(u(!0),T(Z,null,de(Array.from({length:7}),(h,d)=>{var m,N;return u(),T("div",{class:D(["color",`sticky-color-${d+1}`]),"data-test-id":"color",key:d,onClick:k=>e.changeColor(d+1),style:se({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${d+1})`,"box-shadow":d===0&&((m=e.node)==null?void 0:m.parameters.color)===""||d+1===((N=e.node)==null?void 0:N.parameters.color)?`0 0 0 1px var(--color-sticky-background-${d+1})`:"none"})},null,14,vc)}),128))])]),_:1},8,["onShow","onHide"])],2),[[J,e.showActions]])],6)],12,gc)}const kc=H(pc,[["render",Nc],["__scopeId","data-v-911250ba"]]),bc=60,Tc=30,Sc=30,Dc=15,Ec=-20,jo=-200,Cc=-5;function Ic(e,t){let o=0,n=0;for(;o<e.length&&n<t.length;){const i=e.charAt(o).toLowerCase(),s=t.charAt(n).toLowerCase();i===s&&o++,++n}return e.length!==0&&t.length!==0&&o===e.length}function Pc(e,t){return En(e,t,0,0,null,[],256,0,0,5)}function En(e,t,o,n,i,s,a,r,l,p){let h=0;if(++l>=p)return{matched:!1,outScore:h};if(o===e.length||n===t.length)return{matched:!1,outScore:h};let d=!1,m=[],N=0,k=!0;for(;o<e.length&&n<t.length;){if(e[o].toLowerCase()===t[n].toLowerCase()){if(r>=a)return{matched:!1,outScore:h};k&&i&&(s=[...i],k=!1);const c=[],f=En(e,t,o,n+1,s,c,a,r,l,p),E=f.outScore;f.matched&&((!d||E>N)&&(m=[...c],N=E),d=!0),s[r++]=n,++o}++n}const w=o===e.length;if(w){h=100;let c=Ec*s[0];c=c<jo?jo:c,h+=c;const f=t.length-r;h+=Cc*f;for(let E=0;E<r;E++){const O=s[E];if(E>0){const R=s[E-1];O===R+1&&(h+=bc)}if(O>0){const R=t[O-1],W=t[O];R!==R.toUpperCase()&&W!==W.toLowerCase()&&(h+=Sc),(R==="_"||R===" ")&&(h+=Tc)}else h+=Dc}return d&&(!w||N>h)?(s=[...m],h=N,{matched:!0,outScore:h}):w?{matched:!0,outScore:h}:{matched:!1,outScore:h}}return{matched:!1,outScore:h}}function Oc(e,t){if(e.hasOwnProperty(t))return e[t];const o=t.split(".");let n=e,i=0;for(;n&&i<o.length;){const s=o[i];n=n[s],i++}return n}function Rc(e,t,o){const n=t.reduce((i,s)=>{let a=[];o.forEach(({key:l,weight:p})=>{const h=Oc(s,l);Array.isArray(h)?a=a.concat(h.map(d=>({value:d,weight:p}))):typeof h=="string"&&a.push({value:h,weight:p})});const r=a.reduce((l,{value:p,weight:h})=>{if(!Ic(e,p))return l;const d=Pc(e,p);d.outScore*=h;const{matched:m,outScore:N}=d;return!l&&m||m&&l&&N>l.outScore?d:l},null);return r&&i.push({score:r.outScore,item:s}),i},[]);return n.sort((i,s)=>s.score-i.score),n}function tt(e,t,o="node"){var i,s,a;const n={uuid:pe(),key:e.name,subcategory:t??((a=(s=(i=e.codex)==null?void 0:i.subcategories)==null?void 0:s[le])==null?void 0:a[0])??nt,properties:{...e},type:o};return n}function $c(e){const t=[le,Lt];return e.reduce((o,n)=>{let i=[nt];return t.forEach(s=>{var a,r,l,p;(r=(a=n.codex)==null?void 0:a.categories)!=null&&r.includes(s)&&(i=((p=(l=n.codex)==null?void 0:l.subcategories)==null?void 0:p[s])??[])}),i.forEach(s=>{o[s]||(o[s]=[]),o[s].push(tt(n,s))}),o},{})}function Ac(e){return e.sort((t,o)=>{var s,a,r,l;if(t.type!=="node"||o.type!=="node")return-1;const n=((a=(s=t.properties)==null?void 0:s.displayName)==null?void 0:a.toLowerCase())||t.key,i=((l=(r=o.properties)==null?void 0:r.displayName)==null?void 0:l.toLowerCase())||o.key;return n.localeCompare(i,void 0,{sensitivity:"base"})})}function Yo(e,t){const o=e.toLowerCase().replace("trigger","").trimEnd();return(Rc(o,t,[{key:"properties.displayName",weight:1.3},{key:"properties.codex.alias",weight:1}])||[]).map(({item:i})=>i)}const wt=kt(ti.NODE_CREATOR,()=>{const e=F(xe),t=F([]),o=F({}),n=F(!1),i=F(""),s=Q(()=>Object.values(t.value).map(d=>tt(d)));function a(d){t.value=d}function r(d){o.value=d}function l(d){n.value=d}function p(d){e.value=d}function h(d){i.value=d}return{openSource:i,selectedView:e,showScrim:n,mergedNodes:t,actions:o,setShowScrim:l,setSelectedView:p,setOpenSource:h,setActions:r,setMergeNodes:a,allNodeCreatorNodes:s}}),Mc=["textContent"],_c=x({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=wt(),n=Q(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(i,s)=>{const a=S("font-awesome-icon"),r=S("n8n-tooltip");return u(),T("div",{class:D(i.$style.canvasAddButton),style:se(n.value),ref:"container","data-test-id":"canvas-add-button"},[v(r,{placement:"top",visible:i.showTooltip,disabled:be(o).showScrim,"popper-class":i.$style.tooltip,"show-after":700},{content:y(()=>[I(b(i.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:y(()=>[g("button",{class:D(i.$style.button),onClick:s[0]||(s[0]=l=>i.$emit("click")),"data-test-id":"canvas-plus-button"},[v(a,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),g("p",{class:D(i.$style.label),textContent:b(i.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,Mc)],6)}}}),Wc="_canvasAddButton_mfxxv_5",Vc="_button_mfxxv_17",Bc="_label_mfxxv_38",Lc={canvasAddButton:Wc,button:Vc,label:Bc},Uc={$style:Lc},xc=H(_c,[["__cssModules",Uc]]),Fc="data-keyboard-nav-id",Go=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","Tab"],Hc=kt("nodeCreatorKeyboardNavigation",()=>{const e=F([]),t=F(null),o=F({});function n(c){return c==null?void 0:c.getAttribute("data-keyboard-nav-type")}function i(c){return(c==null?void 0:c.getAttribute(Fc))||void 0}async function s(){return new Promise(c=>{k(),setTimeout(()=>{e.value=Array.from(document.querySelectorAll("[data-keyboard-nav-type]")).map(f=>new WeakRef(f)),c()},0)})}function a(c,f){Object.values(o.value).filter(R=>R.keyboardKeys.includes(c)).forEach(R=>{if(!t.value)return;(R.condition===void 0||R.condition(n(f)||"",t.value))&&t.value&&R.handler(t.value,c)})}async function r(c){var V,A,L;const f=c.key;if(!Go.includes(f))return;c.preventDefault(),c.stopPropagation(),await s();const E=e.value.findIndex(_=>i(_==null?void 0:_.deref())===t.value),O=(V=e.value[E])==null?void 0:V.deref(),R=f==="ArrowDown",W=f==="ArrowUp";if(O){if(R){const _=E<e.value.length-1?E+1:0;p((A=e.value[_])==null?void 0:A.deref())}if(W){const _=E>0?E-1:e.value.length-1;p((L=e.value[_])==null?void 0:L.deref())}a(f,O)}}function l(c){t.value=c}function p(c){const f=i(c);f&&(l(f),c!=null&&c.scrollIntoView&&(c==null||c.scrollIntoView({block:"center"})))}async function h(c){var f;await s(),p((f=e.value[c])==null?void 0:f.deref())}function d(){document.addEventListener("keydown",r,{capture:!0})}function m(){k(),document.removeEventListener("keydown",r,{capture:!0})}function N(c,f){f.keyboardKeys.forEach(E=>{if(Go.includes(E))o.value={...o.value,[c]:f};else throw new Error(`Key ${E} is not supported`)})}function k(){e.value=[]}function w(){return e.value.findIndex(c=>i(c==null?void 0:c.deref())===t.value)}return{activeItemId:t,attachKeydownEvent:d,refreshSelectableItems:s,detachKeydownEvent:m,registerKeyHook:N,getActiveItemIndex:w,setActiveItemId:l,setActiveItemIndex:h}});function qo(e,t){return e.filter(o=>{var n,i,s;return(s=(i=(n=o.codex)==null?void 0:n.subcategories)==null?void 0:i[Lt])==null?void 0:s.includes(t)}).map(o=>({key:o.name,type:"node",properties:{group:[],name:o.name,displayName:o.displayName,title:o.displayName,description:o.description,icon:o.icon}})).sort((o,n)=>o.properties.displayName.localeCompare(n.properties.displayName))}function vh(e){const t=Ee(),o=G(),n=qo(o.allLatestNodeTypes,ni),i=qo(o.allLatestNodeTypes,ii);return{value:et,title:t.baseText("nodeCreator.aiPanel.aiNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),info:t.baseText("nodeCreator.aiPanel.infoBox"),items:[...n,...i,{key:Ut,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.aiOtherNodesDescription")}}]}}function zc(e){const t=Ee();function o(n){return{connectionType:n,iconProps:{color:`var(--node-type-${n}-color)`},panelClass:`nodes-list-panel-${n}`}}return{value:Ut,title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),items:[{key:no,type:"subcategory",properties:{title:no,icon:"file-import",...o($.AiDocument)}},{key:io,type:"subcategory",properties:{title:io,icon:"language",...o($.AiLanguageModel)}},{key:so,type:"subcategory",properties:{title:so,icon:"brain",...o($.AiMemory)}},{key:ao,type:"subcategory",properties:{title:ao,icon:"list",...o($.AiOutputParser)}},{key:ro,type:"subcategory",properties:{title:ro,icon:"search",...o($.AiRetriever)}},{key:lo,type:"subcategory",properties:{title:lo,icon:"grip-lines-vertical",...o($.AiTextSplitter)}},{key:uo,type:"subcategory",properties:{title:uo,icon:"tools",...o($.AiTool)}},{key:co,type:"subcategory",properties:{title:co,icon:"vector-square",...o($.AiEmbedding)}},{key:ho,type:"subcategory",properties:{title:ho,icon:"project-diagram",...o($.AiVectorStore)}},{key:po,type:"subcategory",properties:{title:po,icon:"code"}}]}}function Nh(e){const t=Ee();return{value:xe,title:t.baseText("nodeCreator.triggerHelperPanel.selectATrigger"),subtitle:t.baseText("nodeCreator.triggerHelperPanel.selectATriggerDescription"),items:[{key:nt,type:"subcategory",properties:{forceIncludeNodes:[Le,oi],title:"App Trigger Nodes",icon:"satellite-dish"}},{key:go,type:"node",category:[le],properties:{group:[],name:go,displayName:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDescription"),icon:"fa:clock"}},{key:Le,type:"node",category:[le],properties:{group:[],name:Le,displayName:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDescription"),iconData:{type:"file",icon:"webhook",fileBuffer:"/static/webhook-icon.svg"}}},{key:Ue,type:"node",category:[le],properties:{group:[],name:Ue,displayName:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDescription"),iconData:{type:"file",icon:"form",fileBuffer:"/static/form-grey.svg"}}},{key:ot,type:"node",category:[le],properties:{group:[],name:ot,displayName:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDescription"),icon:"fa:mouse-pointer"}},{key:fo,type:"node",category:[le],properties:{group:[],name:fo,displayName:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDescription"),icon:"fa:sign-out-alt"}},{type:"subcategory",key:mo,category:le,properties:{title:mo,icon:"folder-open"}}]}}function kh(e){const t=Ee(),o={value:Vt,title:t.baseText("nodeCreator.triggerHelperPanel.whatHappensNext"),items:[{key:nt,type:"subcategory",properties:{title:"App Regular Nodes",icon:"globe"}},{type:"subcategory",key:yo,category:le,properties:{title:yo,icon:"pen"}},{type:"subcategory",key:wo,category:le,properties:{title:wo,icon:"toolbox"}},{type:"subcategory",key:vo,category:le,properties:{title:vo,icon:"code-branch"}},{type:"subcategory",key:No,category:le,properties:{title:No,icon:"file-alt"}}]};return(e??[]).some(i=>{var s,a;return(a=(s=i.codex)==null?void 0:s.categories)==null?void 0:a.includes(Lt)})&&o.items.push({key:et,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.langchainAiNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.nodesForAi")}}),o.items.push({key:xe,type:"view",properties:{title:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTrigger"),icon:"bolt",description:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTriggerDescription")}}),o}const Kc=kt("nodeCreatorViewStacks",()=>{const e=wt(),{getActiveItemIndex:t}=Hc(),o=F([]),n=Q(()=>{const w=o.value[o.value.length-1];if(!(w!=null&&w.baselineItems))return w.items?h(w.items):[];if(w.search&&a.value){const c=a.value.length>0?a.value:w.baselineItems;return h(Yo(w.search||"",c))}return h(w.baselineItems)}),i=Q(()=>{const w=o.value[o.value.length-1];return w?{...w,items:n.value,hasSearch:(w.baselineItems||[]).length>8||(w==null?void 0:w.hasSearch)}:{}}),s=Q(()=>i.value.mode||xe),a=Q(()=>{const w=o.value[o.value.length-1];return w!=null&&w.searchItems?w.searchItems.map(c=>tt(c,w.subcategory)):[]}),r=Q(()=>{const w=o.value[o.value.length-1];if(!(w!=null&&w.search))return[];const c=e.mergedNodes.map(E=>tt(E));return h(Yo(w.search||"",c)).filter(E=>!n.value.find(O=>O.key===E.key))});async function l(w,c,f){var W;const E=Ee();let O,R;c===!0?(O=G().visibleNodeTypesByInputConnectionTypeNames,R={properties:{title:E.baseText("nodeCreator.aiPanel.aiNodes"),icon:"robot"}}):(O=G().visibleNodeTypesByOutputConnectionTypeNames,R=zc().items.find(V=>V.properties.connectionType===w)),await vn(),d({title:R==null?void 0:R.properties.title,rootView:Ut,mode:"nodes",items:e.allNodeCreatorNodes,nodeIcon:{iconType:"icon",icon:R==null?void 0:R.properties.icon,color:(W=R==null?void 0:R.properties.iconProps)==null?void 0:W.color},panelClass:R==null?void 0:R.properties.panelClass,baseFilter:V=>{var L;if(V.key===si)return!1;const A=O[w].includes(V.key);return A&&((L=f==null?void 0:f.nodes)!=null&&L.length)?f.nodes.includes(V.key):A},itemsMapper(V){return{...V,subcategory:w}},preventBack:!0})}function p(){const w=o.value[o.value.length-1];if(!w||!i.value.uuid)return;let c=(w==null?void 0:w.items)??$c(e.mergedNodes)[(w==null?void 0:w.subcategory)??nt]??[];if((w.forceIncludeNodes??[]).length>0){const f=e.mergedNodes.filter(E=>{var O;return(O=w.forceIncludeNodes)==null?void 0:O.includes(E.name)}).map(E=>tt(E,w.subcategory));c.push(...f)}w.baseFilter&&(c=c.filter(w.baseFilter)),w.itemsMapper&&(c=c.map(w.itemsMapper)),w.items||Ac(c),N({baselineItems:c})}function h(w){return w.map(c=>({...c,uuid:`${c.key}-${pe()}`}))}function d(w){i.value.uuid&&N({activeIndex:t()});const c=pe();o.value.push({...w,uuid:c,transitionDirection:"in",activeIndex:0}),p()}function m(){i.value.uuid&&(o.value.pop(),N({transitionDirection:"out"}))}function N(w){const c=o.value[o.value.length-1],f=o.value.findIndex(E=>E.uuid===c.uuid);c&&Object.keys(w).forEach(E=>{const O=E;o.value[f]={...o.value[f],[E]:w[O]}})}function k(){o.value=[]}return{viewStacks:o,activeViewStack:i,activeViewStackMode:s,globalSearchItemsDiff:r,gotoCompatibleConnectionView:l,resetViewStacks:k,updateCurrentViewStack:N,pushViewStack:d,popViewStack:m}}),jc=Re(async()=>Ce(()=>import("./NodeCreation-OxTpBRfP.js").then(e=>e.N),__vite__mapDeps([53,2,3,4,5,6,7,8,1,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,54]))),Yc=Re(async()=>Ce(()=>import("./CanvasControls-kb3__O2G.js"),__vite__mapDeps([55,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,36,37,38,39,40,41,42,43,44,45,56]))),Gc=x({name:"NodeView",mixins:[St,Ie,pn,Ms,Pe,ft,Ft,Oe,ze],components:{NodeDetailsView:$u,Node:hc,Sticky:kc,CanvasAddButton:xc,KeyboardShortcutTooltip:ji,NodeCreation:jc,CanvasControls:Yc,ContextMenu:Bu},setup(e){var i,s;const t=Ee(),o=it(),n=un();return{locale:t,contextMenu:o,dataSchema:n,..._s(),...Yi(),...ai(),...He(),...xt(),...Ws(),...Is(),...(s=(i=ft).setup)==null?void 0:s.call(i,e)}},errorCaptured:(e,t,o)=>{console.error("errorCaptured"),console.error(e)},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=lt(e),n=!this.uiStore.nodeViewInitialized;let i=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Ye)&&t.name!==j.NEW_WORKFLOW&&e.params.action!=="workflowSave";const s=e.name===j.TEMPLATE_IMPORT;if(o===Ge.WORKFLOW||s){if(i||n||s){if(this.startLoading(),n){const a=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=a}await Promise.all([this.loadCredentials(),this.initView()]),this.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===Ge.EXECUTIONS&&(i=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),i&&(this.uiStore.nodeViewInitialized=!1))},activeNode(){this.createNodeActive=!1},containsTrigger(e){e===!1&&this.canvasStore.setRecenteredCanvasAddButtonPosition(this.getNodeViewOffsetPosition)},nodeViewScale(e){const t=this.$refs.nodeView;t&&(t.style.transform=`scale(${e})`)}},async beforeRouteLeave(e,t,o){if(lt(e)===Ge.EXECUTIONS||t.name===j.TEMPLATE_IMPORT||lt(e)===Ge.WORKFLOW&&t.name===j.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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});n===We?(this.workflowsStore.setWorkflowId(Ye),await this.saveCurrentWorkflow({},!1)&&await this.settingsStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===j.NEW_WORKFLOW?await this.$router.replace({name:j.WORKFLOW,params:{name:this.currentWorkflow}},()=>{this.$router.push(e)}):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):n===ri&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Ye),this.resetWorkspace(),this.uiStore.stateIsDirty=!1,o())}else this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o()},computed:{...q(Kt,Xi,tn,wt,G,ee,di,sn,Ji,ue,Y,li,wt,qi,cn,bt,Gi,As,$s),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===j.DEMO},showCanvasAddButton(){return this.loadingService===null&&!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!==re)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===re)},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 Qi(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(){return this.$route.params.name||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===vt||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!!this.nodes.find(e=>e.type===ui&&e.disabled!==!0)},isExecutionDisabled(){return!this.containsTrigger||this.allTriggersDisabled},getNodeViewOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},nodeViewScale(){return this.canvasStore.nodeViewScale},instance(){return this.canvasStore.jsPlumbInstance}},data(){return{GRID_SIZE:Be,STICKY_NODE_TYPE:re,createNodeActive:!1,lastClickPosition:[450,450],ctrlKeyPressed:!1,moveCanvasKeyPressed:!1,stopExecutionInProgress:!1,blankRedirect:!1,credentialsUpdated:!1,pullConnActiveNodeName:null,pullConnActive:!1,dropPrevented:!1,connectionDragScope:{type:null,connection:null},renamingActive:!1,showStickyButton:!1,isExecutionPreview:!1,showTriggerMissingTooltip:!1,workflowData:null,activeConnection:null,isProductionExecutionPreview:!1,enterTimer:void 0,exitTimer:void 0,readOnlyNotification:null,suspendRecordingDetachedConnections:!1,NODE_CREATOR_OPEN_SOURCES:he,eventsAttached:!1,unloadTimeout:void 0}},methods:{editAllowedCheck(){var e;if(!((e=this.readOnlyNotification)!=null&&e.visible))return 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}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),n={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",n),this.$externalHooks().run("nodeView.onRunNode",n),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(ci)},async onRunWorkflow(){this.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Ot(e,this.getNodeTypes()).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)===Zi).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 i;const o=this.instance.getManagedElement(t.id),n=this.instance.getEndpoints(o);Object.keys(((i=t==null?void 0:t.issues)==null?void 0:i.input)??{}).forEach(s=>{n.filter(r=>r._defaultType.scope===s).forEach(r=>{const l=r==null?void 0:r.endpoint;l&&l.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst");this.registerCustomAction({key:"showNodeCreator",action:()=>this.showTriggerCreator(he.NO_TRIGGER_EXECUTION_TOOLTIP)});const 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.updateNodesExecutionIssues()},async onSaveKeyboardShortcut(e){let t=await this.saveCurrentWorkflow();t&&(await this.settingsStore.fetchPromptsData(),this.$route.name===j.EXECUTION_DEBUG&&await this.$router.replace({name:j.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"}))},showTriggerCreator(e){this.createNodeActive||(this.nodeCreatorStore.setSelectedView(xe),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0}))},async openExecution(e){var o,n;this.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(i){this.showError(i,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(Ye),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:t.workflowData.id,ownedBy:t.workflowData.ownedBy}),t.workflowData.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWith:t.workflowData.sharedWith}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.addNodes(Te(t.workflowData.nodes),Te(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&&((n=(o=t.data)==null?void 0:o.resultData)!=null&&n.error)){let i=!1;if(t.data.resultData.runData){const s=t.data.resultData.runData;e:for(const a of Object.keys(s))for(const r of s[a])if(r.error){i=!0;break e}}!i&&t.data.resultData.error.stack&&(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.stopLoading()},async importWorkflowExact(e){if(!e.workflow.nodes||!e.workflow.connections)throw new Error("Invalid workflow object");this.resetWorkspace(),e.workflow.nodes=es(e.workflow.nodes),await this.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.startLoading(),this.setLoadingText(this.$locale.baseText("nodeView.loadingTemplate")),this.resetWorkspace(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=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(o){this.showError(o,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:j.NEW_WORKFLOW});return}this.blankRedirect=!0,await this.$router.replace({name:j.NEW_WORKFLOW,query:{templateId:e}}),await this.addNodes(t.workflow.nodes,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name)||{},await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!0,this.$externalHooks().run("template.open",{templateId:e,templateName:t.name,workflow:t.workflow}),this.stopLoading()},async openWorkflow(e){this.startLoading();const t=this.workflowsStore.activeWorkflowExecution;this.resetWorkspace(),this.workflowsStore.addWorkflow(e),this.workflowsStore.setActive(e.active||!1),this.workflowsStore.setWorkflowId(e.id),this.workflowsStore.setWorkflowName({newName:e.name,setStateDirty:!1}),this.workflowsStore.setWorkflowSettings(e.settings||{}),this.workflowsStore.setWorkflowPinData(e.pinData||{}),this.workflowsStore.setWorkflowVersionId(e.versionId),e.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:e.id,ownedBy:e.ownedBy}),e.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWith:e.sharedWith}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials);const o=e.tags||[],n=o.map(i=>i.id);this.workflowsStore.setWorkflowTagIds(n||[]),this.tagsStore.upsertTags(o),await this.addNodes(e.nodes,e.connections),this.credentialsUpdated||(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.workflowsStore.activeWorkflowExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.workflowsStore.activeWorkflowExecution=t,this.stopLoading(),this.collaborationStore.notifyWorkflowOpened(e.id)},touchTap(e){this.isTouchDevice&&this.mouseDown(e)},mouseDown(e){this.lastClickPosition=this.getMousePositionWithinNodeView(e),e instanceof MouseEvent&&e.button===1&&(this.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.mouseDownMoveWorkflow(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.mouseUpMoveWorkflow(e)},keyUp(e){e.key===this.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){if(this.contextMenu.close(),e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.isReadOnlyRoute||this.readOnlyEnv)return;this.callDebounced("onSaveKeyboardShortcut",{debounceTime:1e3},e);return}const t=e.path||e.composedPath&&e.composedPath();for(const n of t)if(n.className&&typeof n.className=="string"&&n.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"){this.createNodeActive=!1,this.activeNode&&(this.$externalHooks().run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const o=this.uiStore.getSelectedNodes.map(n=>n&&this.workflowsStore.getNodeByName(n.name)).filter(n=>!!n);if(e.key==="d"&&!this.isCtrlKeyPressed(e))this.callDebounced("toggleActivationNodes",{debounceTime:350},o);else if(e.key==="d"&&this.isCtrlKeyPressed(e))o.length>0&&(e.preventDefault(),this.duplicateNodes(o));else if(e.key==="p"&&!this.isCtrlKeyPressed(e))o.length>0&&(e.preventDefault(),this.togglePinNodes(o,"keyboard-shortcut"));else if(e.key==="Delete"||e.key==="Backspace")e.stopPropagation(),e.preventDefault(),this.callDebounced("deleteNodes",{debounceTime:500},o);else if(e.key==="Tab")this.onToggleNodeCreator({source:he.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&this.isCtrlKeyPressed(e)&&!this.isReadOnlyRoute&&!this.readOnlyEnv)this.onRunWorkflow();else if(e.key==="S"&&e.shiftKey&&!this.isReadOnlyRoute&&!this.readOnlyEnv)this.onAddNodes({nodes:[{type:re}],connections:[]});else if(e.key===this.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&!this.isReadOnlyRoute&&!this.readOnlyEnv){const n=this.lastSelectedNode;n!==null&&n.type!==re&&this.callDebounced("renameNodePrompt",{debounceTime:1500},n.name)}else if(e.key==="a"&&this.isCtrlKeyPressed(e))e.stopPropagation(),e.preventDefault(),this.callDebounced("selectAllNodes",{debounceTime:1e3});else if(e.key==="c"&&this.isCtrlKeyPressed(e))this.callDebounced("copyNodes",{debounceTime:1e3},o);else if(e.key==="x"&&this.isCtrlKeyPressed(e))e.stopPropagation(),e.preventDefault(),this.callDebounced("cutNodes",{debounceTime:1e3},o);else if(e.key==="n"&&this.isCtrlKeyPressed(e)&&e.altKey){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.name===j.NEW_WORKFLOW?oe.emit("newWorkflow"):this.$router.push({name:j.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"){const n=this.lastSelectedNode;if(n!==null){if(n.type===re&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=n.name}}else if(e.key==="ArrowRight"&&e.shiftKey)e.stopPropagation(),e.preventDefault(),this.callDebounced("selectDownstreamNodes",{debounceTime:1e3});else if(e.key==="ArrowRight"){const n=this.lastSelectedNode;if(n===null)return;const i=this.workflowsStore.outgoingConnectionsByNodeName(n.name);if(i.main===void 0||i.main.length===0)return;this.callDebounced("nodeSelectedByName",{debounceTime:100},i.main[0][0].node,!1,!0)}else if(e.key==="ArrowLeft"&&e.shiftKey)e.stopPropagation(),e.preventDefault(),this.callDebounced("selectUpstreamNodes",{debounceTime:1e3});else if(e.key==="ArrowLeft"){const n=this.lastSelectedNode;if(n===null)return;const i=this.getCurrentWorkflow();if(!i.connectionsByDestinationNode.hasOwnProperty(n.name))return;const s=i.connectionsByDestinationNode[n.name];if(s.main===void 0||s.main.length===0)return;this.callDebounced("nodeSelectedByName",{debounceTime:100},s.main[0][0].node,!1,!0)}else if(["ArrowUp","ArrowDown"].includes(e.key)){const n=this.lastSelectedNode;if(n===null)return;const i=this.getCurrentWorkflow();if(!i.connectionsByDestinationNode.hasOwnProperty(n.name))return;const s=i.connectionsByDestinationNode[n.name];if(!Array.isArray(s.main)||!s.main.length)return;const a=s.main[0][0].node,r=this.workflowsStore.outgoingConnectionsByNodeName(a);if(!Array.isArray(r.main)||!r.main.length)return;let l,p=e.key==="ArrowUp"?-99999999:99999999,h=null;for(const d of r.main)for(const m of d)m.node!==n.name&&(l=this.workflowsStore.getNodeByName(m.node),l&&(e.key==="ArrowUp"?l.position[1]<=n.position[1]&&l.position[1]>p&&(h=l.name,p=l.position[1]):l.position[1]>=n.position[1]&&l.position[1]<p&&(h=l.name,p=l.position[1])));h!==null&&this.callDebounced("nodeSelectedByName",{debounceTime:100},h,!1,!0)}},toggleActivationNodes(e){this.editAllowedCheck()&&this.disableNodes(e,!0)},togglePinNodes(e,t){if(!this.editAllowedCheck())return;this.historyStore.startRecordingUndo();const o=e.some(n=>!this.workflowsStore.pinDataByNodeName(n.name));for(const n of e)if(o){const i=this.dataSchema.getInputDataWithPinned(n);i.length!==0&&this.setPinData(n,i,t)}else this.unsetPinData(n,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.getCurrentWorkflow(),o=this.getConnectedNodes("upstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},selectDownstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.getCurrentWorkflow(),o=this.getConnectedNodes("downstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const n=this.workflowsStore.nodesByName[e],i=this.getCurrentWorkflow(),s=this.getConnectedNodes("downstream",i,e);for(const a of s){const r=this.workflowsStore.nodesByName[a],l=r.position;if(r.position[0]<n.position[0])continue;const p={name:a,properties:{position:[r.position[0]+t,r.position[1]]}};this.workflowsStore.updateNodeProperties(p),this.onNodeMoved(r),(o&&l[0]!==p.properties.position[0]||l[1]!==p.properties.position[1])&&this.historyStore.pushCommandToUndo(new dn(a,l,p.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 n={meta:{instanceId:this.rootStore.instanceId},...o};this.removeForeignCredentialsFromWorkflow(n,this.credentialsStore.allCredentials);const i=JSON.stringify(n,null,2);this.copyToClipboard(i),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(s=>s.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.workflowsStore.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 n={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},i={data:n,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(i),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(n),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.getWorkflowDataToSave().then(t=>{const o={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Ot(t,this.getNodeTypes()).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 receivedCopyPasteData(e){if(this.readOnlyEnv)return;if(lt(this.$route)===Ge.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.receivedCopyPasteData.message",{interpolate:{plainTextData:e}}),this.$locale.baseText("nodeView.confirmMessage.receivedCopyPasteData.headline"),{type:"warning",confirmButtonText:this.$locale.baseText("nodeView.confirmMessage.receivedCopyPasteData.confirmButtonText"),cancelButtonText:this.$locale.baseText("nodeView.confirmMessage.receivedCopyPasteData.cancelButtonText"),dangerouslyUseHTMLString:!0})!==We||(o=await this.getWorkflowDataFromUrl(e),o===void 0))return}else try{if(o=JSON.parse(e),!this.editAllowedCheck())return}catch{return}return this.importWorkflowData(o,"paste",!1)}},async getWorkflowDataFromUrl(e){let t;this.startLoading();try{t=await this.workflowsStore.getWorkflowFromUrl(e)}catch(o){this.stopLoading(),this.showError(o,this.$locale.baseText("nodeView.showError.getWorkflowDataFromUrl.title"));return}return this.stopLoading(),t},async importWorkflowData(e,t,o=!0){if(!(!e.hasOwnProperty("nodes")||!e.hasOwnProperty("connections")))try{const n={};e.nodes&&e.nodes.forEach(l=>{if(l.webhookId&&hi.includes(l.type)&&Object.values(this.getCurrentWorkflow().nodes).some(h=>h.webhookId===l.webhookId)&&(l.webhookId=pe()),l.id){const p=pe();n[p]=l.id,l.id=p}else l.id=pe()}),this.removeUnknownCredentials(e);const i=this.rootStore.instanceId,s=JSON.stringify(Ot(e,this.getNodeTypes(),{nodeIdMap:n,sourceInstanceId:e.meta&&e.meta.instanceId!==i?e.meta.instanceId:""}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:s}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:s}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:s}),this.deselectAllNodes(),this.updateNodePositions(e,ke(this.nodes,this.lastClickPosition));const a=await this.addNodesToWorkflow(e);setTimeout(()=>{a.nodes.forEach(l=>{this.nodeSelectedByName(l.name)})});const r=this.settingsStore.areTagsEnabled;if(o&&r&&Array.isArray(e.tags)){const l=await this.tagsStore.fetchAll(),p=new Set(l.map(k=>k.name)),h=e.tags,d=h.filter(k=>!p.has(k.name)),m=[];for(const k of d){const w=this.tagsStore.create(k.name).then(c=>(l.push(c),c));m.push(w)}await Promise.all(m);const N=h.reduce((k,w)=>{const c=l.find(f=>f.name===w.name);return c&&k.push(c.id),k},[]);this.workflowsStore.addWorkflowTagIds(N)}}catch(n){this.showError(n,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,n]of Object.entries(t.credentials))n.id!==null&&(this.credentialsStore.getCredentialById(n.id)||delete t.credentials[o])}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=Nt(e.dataTransfer.getData(pi));if(t){const o=this.getMousePositionWithinNodeView(e),n=[o[0]-Je/2+Be,o[1]-Je/2];await this.onAddNodes(t,!0,n),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 n=this.workflowsStore.getNodeByName(e);n&&(this.nodeSelected(n),this.uiStore.lastSelectedNode=n.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.lastSelectedConnection=null,this.canvasStore.newNodeInsertPosition=null,t&&(this.ndvStore.activeNodeName=n.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 s,a,r,l;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const n={id:pe(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},i=(s=e.credentials)==null?void 0:s.map(p=>this.credentialsStore.getUsableCredentialByType(p.name)).flat();if(i&&i.length===1){const p=i[0],h=this.credentialsStore.getCredentialById(p.id),d={id:h.id,name:h.name},m={[p.type]:d};await this.loadNodesProperties([n].map(w=>({name:w.type,version:w.typeVersion})));const N=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),k=Ve((N==null?void 0:N.properties)||[],{},!0,!1,n);if(e.credentials){const w=e.credentials.find(f=>f.name===p.type);if((a=w==null?void 0:w.displayOptions)!=null&&a.hide)return n;const c=(r=w==null?void 0:w.displayOptions)==null?void 0:r.show;if(!c)return n.credentials=m,n;if(Object.keys(c).length===1&&c.authentication){n.credentials=m;let f={};for(const E of Object.keys(c)){if(k&&!k[E]){f={},n.credentials=void 0;break}const O=(l=c[E])==null?void 0:l[0];O&&typeof O=="string"&&(f[E]=O),n.parameters={...n.parameters,...f}}}}}return n},async injectNode(e,t={},o=!0,n=!1,i=!1){var p,h;const s=this.nodeTypesStore.getNodeType(e);if(s===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(s.maxNodes!==void 0&&this.getNodeTypeCount(e)>=s.maxNodes){this.showMaxNodeTypeError(s);return}const a=await this.getNewNodeWithDefaultCredential(s,{name:t.name}),r=this.lastSelectedNode;if(t.position)a.position=ke(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(r){const d=this.canvasStore.lastSelectedConnection;if(d){const[m]=ts(d);m<=os&&this.pushDownstreamNodes(r.name,$t,n)}if(this.canvasStore.newNodeInsertPosition)a.position=ke(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+Be,this.canvasStore.newNodeInsertPosition[1]-Je/2]),this.canvasStore.newNodeInsertPosition=null;else{let m=0;const N=this.getCurrentWorkflow();if(d){const f=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(f){const E=[[-100,100],[-140,0,140],[-240,-100,100,240]],O=ve(N,r,f),W=fe(O).filter(V=>V===$.Main);if(W.length>1){const V=E[W.length-2],A=d.__meta?d.__meta.sourceOutputIndex:0;m=V[A]}}}let k=[];try{k=ve(N,a,s)}catch{}const w=fe(k),c=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(w.length>0&&w.every(f=>f!==$.Main)){const f=N.getNode(r.name),E=ge(N,f,c),R=(fe(E)||[]).filter(W=>W!==$.Main).findIndex(W=>k[0]===W);a.position=ke(this.nodes,[r.position[0]+Je/(Math.max(((p=c==null?void 0:c.inputs)==null?void 0:p.length)??1),1)*R,r.position[1]+$t],[100,0])}else{const f=ge(N,r,c),E=fe(f);let O=$t;E.find(R=>R!==$.Main)&&(O+=150),a.position=ke(this.nodes,[r.position[0]+O,r.position[1]+m],[100,0])}}}else{const d=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;a.position=ke(this.nodes,d)}const l=this.locale.localizeNodeName(a.name,a.type);if(a.name=this.uniqueNodeName(l),(h=s.webhooks)!=null&&h.length&&(a.webhookId=pe()),await this.addNodes([a],void 0,n),this.workflowsStore.setNodePristine(a.name,!0),this.uiStore.stateIsDirty=!0,e===re)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.$externalHooks().run("nodeView.addNodeButton",{nodeTypeName:e}),ns().trackAddedTrigger(e);const d={node_type:e,node_version:a.typeVersion,is_auto_add:i,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};r&&(d.input_node_type=r.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",d)}return n&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(a.name,o&&e!==re)})),a},getConnection(e,t,o,n,i){const s=this.workflowsStore.outgoingConnectionsByNodeName(e)[i];if(s){const a=s[t];if(a)return a.find(r=>r.node===o&&r.index===n)}},connectTwoNodes(e,t,o,n,i){this.uiStore.stateIsDirty=!0;const s=this.workflowsStore.getNodeByName(e),a=this.workflowsStore.getNodeByName(o);if(s&&a&&!this.checkNodeConnectionAllowed(s,a,i)||this.getConnection(e,t,o,n,i))return;const r=[{node:e,type:i,index:t},{node:o,type:i,index:n}];this.__addConnection(r)},async addNode(e,t={},o=!0,n=!1,i=!1){var m;if(!this.editAllowedCheck())return;const s=this.lastSelectedNode,a=this.uiStore.lastSelectedNodeOutputIndex,r=this.uiStore.lastSelectedNodeEndpointUuid,l=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const p=await this.injectNode(e,t,o,n,i);if(!p)return;const h=a||0,d=r||"";if(r&&!i){const N=this.instance.getEndpoint(r);if(N&&this.checkNodeConnectionAllowed(s,p,N.scope)){const k=N.scope,w=this.instance.getManagedElement(p.id),f=this.instance.getEndpoints(w).find(E=>E.scope===k&&N.parameters.connection!==E.parameters.connection);(m=this.instance)==null||m.connect({uuids:[d,(f==null?void 0:f.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(s&&!i){if(await this.$nextTick(),l!=null&&l.__meta){this.__deleteJSPlumbConnection(l,n);const N=l.__meta.targetNodeName,k=l.__meta.targetOutputIndex;this.connectTwoNodes(p.name,0,N,k,$.Main)}this.connectTwoNodes(s.name,h,p.name,0,$.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const n=this.getCurrentWorkflow(),i=n.getNode(e);if(!i)return{nodes:[]};const s=this.nodeTypesStore.getNodeType(i==null?void 0:i.type,i.typeVersion);if(s){const r=ge(n,i,s).filter(l=>!(typeof l=="string"||l.type!==t||!l.filter));r.length&&(o=r[0].filter)}return o},insertNodeAfterSelected(e){var s,a,r;const t=e.outputType??$.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((a=(s=e.connection)==null?void 0:s.target.jtk)==null?void 0:a.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&(this.canvasStore.lastSelectedConnection=e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const n=((r=e.connection)==null?void 0:r.endpoints[0].parameters.connection)==="source";t!==$.Main&&Object.values($).includes(t)&&Kc().gotoCompatibleConnectionView(t,n,this.getNodeCreatorFilter(o.name,t)).catch(l=>{})},onEventConnectionAbort(e){try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.pullConnActiveNodeName){const t=this.workflowsStore.getNodeById(e.parameters.nodeId);if(t){const o=t.name,n=e.parameters.index;this.connectTwoNodes(o,n,this.pullConnActiveNodeName,0,$.Main),this.pullConnActiveNodeName=null,this.dropPrevented=!0}return}this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:he.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type})}catch(t){console.error(t)}},checkNodeConnectionAllowed(e,t,o){var i;const n=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((i=n==null?void 0:n.inputs)!=null&&i.length){const s=this.getCurrentWorkflow(),a=s.getNode(t.name);let r=[];n&&(r=ge(s,a,n));for(const l of r||[])if(!(typeof l=="string"||l.type!==o||!l.filter)&&l.filter.nodes.length&&!l.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 n=this.workflowsStore.getNodeById(t.nodeId),i=this.workflowsStore.getNodeById(o.nodeId),s=(n==null?void 0:n.name)||"",a=(i==null?void 0:i.name)||"";return n&&i&&!this.checkNodeConnectionAllowed(n,i,o.type)?!1:this.getConnection(s,t.index,a,o.index,t.type)?(this.dropPrevented=!0,this.pullConnActiveNodeName=null,!1):!0}catch(t){return console.error(t),!0}},onEventConnection(e){var t,o;try{if(e.sourceEndpoint.parameters.connection==="target"){const l=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=l}const n=e.sourceEndpoint.parameters,i=e.targetEndpoint.parameters,s=(t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name,a=(o=this.workflowsStore.getNodeById(i.nodeId))==null?void 0:o.name;s&&a&&(e.connection.__meta={sourceNodeName:s,sourceOutputIndex:n.index,targetNodeName:a,targetOutputIndex:i.index}),Xe(e.connection),is(e.targetEndpoint);const r=[{node:s,type:n.type,index:n.index},{node:a,type:i.type,index:i.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:r}),this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new ss(r)),!this.isReadOnlyRoute&&!this.readOnlyEnv){as(e.sourceEndpoint),rs(e.connection,()=>{this.activeConnection=null,this.__deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:n.index,connection:e.connection,eventSource:he.NODE_CONNECTION_ACTION})}),setTimeout(()=>{ls(e.source,e.target,"canvas"in e.connection.connector?e.connection.connector.canvas:void 0)},0);const l=us(e.connection,ds);n.type!==$.Main&&(e.connection.setPaintStyle(cs(e.connection,e.sourceEndpoint.parameters.category)),l==null||l.setVisible(!1))}this.dropPrevented=!1,this.updateNodesInputIssues(),this.resetEndpointsErrors()}catch(n){console.error(n)}},onDragMove(){var e;(e=this.instance)==null||e.connections.forEach(t=>{Eo(t),Co(t),Object.values(t.overlays).forEach(o=>{var n;o.canvas&&((n=this.instance)==null||n.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)&&Io(this.activeConnection),this.enterTimer=void 0,e&&(hs(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)&&(Io(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Po(e.connection);const n=e.connection.parameters,i=e.originalEndpoint.parameters,s=[{node:((t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name)||"",type:n.type,index:n.index},{node:((o=this.workflowsStore.getNodeById(i.nodeId))==null?void 0:o.name)||"",type:i.type,index:i.index}];this.__removeConnection(s,!1)}catch(n){console.error(n)}},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){try{if(e.sourceEndpoint.parameters.connection==="target"){const o=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=o}const t=Oo(e);if(Po(e.targetEndpoint),ps(e.sourceEndpoint,e.connection),e.connection.removeOverlays(),this.__removeConnectionByConnectionInfo(e,!1,!1),this.pullConnActiveNodeName){this.historyStore.startRecordingUndo();const n=this.workflowsStore.getNodeById(e.connection.parameters.nodeId).name,i=e.connection.parameters.index;t&&this.historyStore.pushCommandToUndo(new dt(t)),this.connectTwoNodes(n,i,this.pullConnActiveNodeName,0,$.Main),this.pullConnActiveNodeName=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&t){const o=new dt(t,this);this.historyStore.pushCommandToUndo(o)}this.updateNodesInputIssues()}catch(t){console.error(t)}},onConnectionDrag(e){var t;(t=e.overlays["midpoint-arrow"])==null||t.setVisible(!1);try{this.pullConnActiveNodeName=null,this.pullConnActive=!0,this.canvasStore.newNodeInsertPosition=null,Xe(e);const o=[...document.querySelectorAll(".node-wrapper")],n=s=>{if(!e)return;const a=document.querySelector(".jtk-endpoint.jtk-drag-hover");if(a){const p=a.jtk.endpoint;Ro(e,p);return}const r=24;o.find(p=>{var c;const{top:h,left:d,right:m,bottom:N}=p.getBoundingClientRect(),[k,w]=Fe(s);if(h<=w&&N>=w&&d-r<=k&&m>=k){const f=p.dataset.name,E=this.workflowsStore.getNodeByName(f);if(E){const O=this.nodeTypesStore.getNodeType(E.type,E.typeVersion),R=this.getCurrentWorkflow(),W=R.getNode(f),V=ge(R,W,O);if(O&&V.length===1){this.pullConnActiveNodeName=E.name;const A=this.getInputEndpointUUID(f,e.parameters.type,0);if(A){const L=(c=this.instance)==null?void 0:c.getEndpoint(A);return Ro(e,L),!0}}}}return!1})||(gs(e),this.pullConnActiveNodeName=null)},i=s=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(s),fs(e),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",i),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",n),window.addEventListener("touchmove",n),window.addEventListener("mouseup",i),window.addEventListener("touchend",n),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(e){var t;Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>Object.values(o)).filter(o=>o.endpoint.type==="N8nPlus").forEach(o=>setTimeout(()=>o.instance.revalidate(o.element),0))},onPlusEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:he.PLUS_ENDPOINT,outputType:e.scope,endpointUuid:e.uuid})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:he.ADD_INPUT_ENDPOINT,nodeCreatorView:et,outputType:e.scope,endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(ut,this.onEventConnectionAbort),this.instance.bind(ko,this.onInterceptBeforeDrop),this.instance.bind(bo,this.onEventConnection),this.instance.bind(Vo,this.onDragMove),this.instance.bind(Bo,this.onConnectionMouseOver),this.instance.bind(Lo,this.onConnectionMouseOut),this.instance.bind(To,this.onConnectionMoved),this.instance.bind(Uo,this.onEndpointMouseOver),this.instance.bind(xo,this.onEndpointMouseOut),this.instance.bind(rt,this.onConnectionDetached),this.instance.bind(ct,this.onConnectionDrag),this.instance.bind([ct,ut,rt],this.onConnectionDragAbortDetached),this.instance.bind($o,this.onPlusEndpointClick),this.instance.bind(Ao,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(ut,this.onEventConnectionAbort),this.instance.unbind(ko,this.onInterceptBeforeDrop),this.instance.unbind(bo,this.onEventConnection),this.instance.unbind(Vo,this.onDragMove),this.instance.unbind(Bo,this.onConnectionMouseOver),this.instance.unbind(Lo,this.onConnectionMouseOut),this.instance.unbind(To,this.onConnectionMoved),this.instance.unbind(Uo,this.onEndpointMouseOver),this.instance.unbind(xo,this.onEndpointMouseOut),this.instance.unbind(rt,this.onConnectionDetached),this.instance.unbind(ct,this.onConnectionDrag),this.instance.unbind(ct,this.onConnectionDragAbortDetached),this.instance.unbind(ut,this.onConnectionDragAbortDetached),this.instance.unbind(rt,this.onConnectionDragAbortDetached),this.instance.unbind($o,this.onPlusEndpointClick),this.instance.unbind(Ao,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(e=!0){if(this.instance){const t=this.instance.getManagedElements();for(const o of Object.values(t)){const n=o.endpoints;for(const i of n||[]){const s=i==null?void 0:i.endpoint;s&&s.type===ms&&s.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*gi.SECOND),e.returnValue=!0,!0;this.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},async newWorkflow(){this.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),await this.tryToAddWelcomeSticky(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.workflowsStore.activeWorkflowExecution=null,this.stopLoading()},async tryToAddWelcomeSticky(){this.canvasStore.zoomToFit()},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===j.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o)}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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(n===We)await this.saveCurrentWorkflow()&&await this.settingsStore.fetchPromptsData();else if(n===fi)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name),o!==null){let n;try{n=await this.workflowsStore.fetchWorkflow(o)}catch(i){this.showError(i,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:j.NEW_WORKFLOW})}n&&(this.titleSet(n.name,"IDLE"),await this.openWorkflow(n),await this.checkAndInitDebugMode(),(e=n.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${n.meta.onboardingId}`,{workflow_id:n.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}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)},getOutputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?yt(n.id,t,o):null},getInputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Bt(n.id,t,o):null},__addConnection(e){var i;const t=this.getOutputEndpointUUID(e[0].node,e[0].type,e[0].index),o=this.getInputEndpointUUID(e[1].node,e[1].type,e[1].index);if(!t||!o)return;const n=[t,o];(i=this.instance)==null||i.connect({uuids:n,detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinData)})},__removeConnection(e,t=!1){var o,n;if(t){const i=this.workflowsStore.getNodeByName(e[0].node),s=this.workflowsStore.getNodeByName(e[1].node);if(!i||!s)return;const a=this.nodeTypesStore.getNodeType(i.type,i.typeVersion),r=((o=a==null?void 0:a.outputs)==null?void 0:o[e[0].index])||$.Main,l=typeof r=="string"?r:r.name,p=mt(l);((n=this.instance)==null?void 0:n.getConnections({scope:p,source:i.id,target:s.id})).forEach(d=>{d.__meta?d.__meta.sourceOutputIndex===e[0].index&&d.__meta.targetOutputIndex===e[1].index&&this.__deleteJSPlumbConnection(d):this.__deleteJSPlumbConnection(d)})}this.workflowsStore.removeConnection({connection:e})},__deleteJSPlumbConnection(e,t=!1){var o,n,i;if(e.removeOverlays(),this.pullConnActiveNodeName=null,(o=this.instance)==null||o.deleteConnection(e),t&&e.__meta){const s=[{index:(n=e.__meta)==null?void 0:n.sourceOutputIndex,node:e.__meta.sourceNodeName,type:$.Main},{index:(i=e.__meta)==null?void 0:i.targetOutputIndex,node:e.__meta.targetNodeName,type:$.Main}],a=new dt(s,this);this.historyStore.pushCommandToUndo(a)}},__removeConnectionByConnectionInfo(e,t=!1,o=!1){const n=Oo(e);n&&(t?this.__deleteJSPlumbConnection(e.connection,o):o&&this.historyStore.pushCommandToUndo(new dt(n)),this.workflowsStore.removeConnection({connection:n}))},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=Te(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getJSPlumbConnection(e,t,o,n,i){var c,f;const s=this.workflowsStore.getNodeByName(e),a=this.workflowsStore.getNodeByName(o);if(!s||!a)return;const r=s.id,l=a.id,p=yt(r,i,t),h=Bt(l,i,n),d=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),m=((c=d==null?void 0:d.outputs)==null?void 0:c[t])||$.Main,N=typeof m=="string"?m:m.name,k=mt(N);return((f=this.instance)==null?void 0:f.getConnections({scope:k,source:r,target:l})).find(E=>{const O=E.getUuids();return O[0]===p&&O[1]===h})},getJSPlumbEndpoints(e){var i;const t=this.workflowsStore.getNodeByName(e),o=this.instance.getManagedElement(t==null?void 0:t.id);return(i=this.instance)==null?void 0:i.getEndpoints(o)},getPlusEndpoint(e,t){return this.getJSPlumbEndpoints(e).find(n=>{var i;return n.endpoint.type==="N8nPlus"&&((i=n==null?void 0:n.__meta)==null?void 0:i.index)===t})},getIncomingOutgoingConnections(e){var o,n;const t=this.workflowsStore.getNodeByName(e);if(t){const i=(o=this.instance)==null?void 0:o.getConnections({source:t.id});return{incoming:(n=this.instance)==null?void 0:n.getConnections({target:t.id}),outgoing:i}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(n=>{Co(n),Eo(n)})},onNodeRun({name:e,data:t,waiting:o}){var d;const n=this.workflowsStore.getPinData;if(n!=null&&n[e])return;const i=e,s=this.workflowsStore.getNodeByName(i),a=s!==null?s.id:"";if(t===null||t.length===0||o){((d=this.instance)==null?void 0:d.getConnections({source:a})).forEach(k=>{Xe(k)}),this.getJSPlumbEndpoints(i).forEach(k=>{k.endpoint.type==="N8nPlus"&&k.endpoint.clearSuccessOutput()});return}const r=this.workflowsStore.outgoingConnectionsByNodeName(i),l=Object.keys(r)[0],p=r[l],h=ys(t,p||[],l??$.Main);Object.keys(h).forEach(m=>{Object.keys(h[m]).forEach(N=>{Object.keys(h[m][N]).forEach(k=>{if(N){const c=this.getJSPlumbConnection(i,parseInt(m,10),N,parseInt(k,10),l);if(c){const f=h[m][N][k];f.isArtificialRecoveredEventItem?ws(c):!(f!=null&&f.total)&&!f.isArtificialRecoveredEventItem?Xe(c):Mo(c,f)}}const w=this.getPlusEndpoint(i,parseInt(m,10));if(w!=null&&w.endpoint){const c=h[m][mi][0];c&&c.total>0?w.endpoint.setSuccessOutput(vs(c)):w.endpoint.clearSuccessOutput()}})})})},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const n=this.workflowsStore.getNodeByName(e);if(!n)return;t&&o&&this.historyStore.startRecordingUndo();const i=[];if(i.includes(n.type)){let d=!1;for(const m of this.nodes)if(m.name!==n.name&&i.includes(m.type)){d=!0;break}if(!d)return}n.type===re?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:n.name===rn}):(this.$externalHooks().run("node.deleteNode",{node:n}),this.$telemetry.track("User deleted node",{node_type:n.type,workflow_id:this.workflowsStore.workflowId}));let s=!1;const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),r=this.getCurrentWorkflow(),l=r.getNode(n.name);let p=[],h=[];if(a&&(p=ge(r,l,a),h=ve(r,l,a)),h.length===1&&p.length===1){const{incoming:d,outgoing:m}=this.getIncomingOutgoingConnections(n.name);if(d.length===1&&m.length===1){const N=d[0],k=m[0];if(N.__meta&&k.__meta){s=!0;const w=N.__meta.sourceNodeName,c=N.__meta.sourceOutputIndex,f=k.__meta.targetNodeName,E=k.__meta.targetOutputIndex;setTimeout(()=>{var O;this.connectTwoNodes(w,c,f,E,$.Main),s&&((O=this.instance)==null||O.setSuspendDrawing(!1,!0),s=!1)},100)}}}vn(()=>{var d,m,N;(d=this.instance)==null||d.setSuspendDrawing(!0),(((m=this.instance)==null?void 0:m.endpointsByElement[n.id])||[]).flat().forEach(k=>{var w;return(w=this.instance)==null?void 0:w.deleteEndpoint(k)}),this.workflowsStore.removeAllNodeConnection(n),this.workflowsStore.removeNode(n),this.workflowsStore.clearNodeExecutionData(n.name),s||(N=this.instance)==null||N.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(n),t&&this.historyStore.pushCommandToUndo(new ks(n))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},s?100:0)},async onSwitchSelectedNode(e){this.nodeSelectedByName(e,!0,!0)},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});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const n=await t;if((n==null?void 0:n.action)!==We)return;await this.renameNode(e,n.value,!0)}catch{}},async renameNode(e,t,o=!1){if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const i=(this.activeNode&&this.activeNode.name)===e;i&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const s=this.getCurrentWorkflow(!0);s.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new hn(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.addNodes(Object.values(s.nodes),s.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),i&&(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}))},matchCredentials(e){e.credentials&&Object.entries(e.credentials).forEach(([t,o])=>{const n=this.credentialsStore.getCredentialsByType(t);if(typeof o=="string"&&(o={id:null,name:o},this.credentialsUpdated=!0),o.id){const s=o.id.toString(),a=n.find(r=>r.id===s);if(a){(a.name!==o.name||typeof o.id=="number")&&(e.credentials[t]={id:a.id,name:a.name},this.credentialsUpdated=!0);return}}e.credentials[t]=o;const i=n.filter(s=>s.name===o.name);i.length===1&&(e.credentials[t].id=i[0].id,this.credentialsUpdated=!0)})},async addNodes(e,t,o=!1){var i,s;if(!(e!=null&&e.length))return;await this.loadNodesProperties(e.map(a=>({name:a.type,version:a.typeVersion})));let n;if(e.forEach(a=>{if(a.id||(a.id=pe()),n=this.nodeTypesStore.getNodeType(a.type,a.typeVersion),a.hasOwnProperty("disabled")||(a.disabled=!1),a.hasOwnProperty("parameters")||(a.parameters={}),n!==null){let r=null;try{r=Ve(n.properties,a.parameters,!0,!1,a)}catch(l){console.error(this.$locale.baseText("nodeView.thereWasAProblemLoadingTheNodeParametersOfNode")+`: "${a.name}"`),console.error(l)}a.parameters=r!==null?r:{},a.type===Le&&a.parameters.path===""&&(a.parameters.path=a.webhookId)}this.matchCredentials(a),this.workflowsStore.addNode(a),o&&this.historyStore.pushCommandToUndo(new Ns(a))}),await this.$nextTick(),(i=this.instance)==null||i.setSuspendDrawing(!0),t!==void 0){let a;for(const r of Object.keys(t))for(const l of Object.keys(t[r]))for(let p=0;p<t[r][l].length;p++){const h=t[r][l][p];h&&h.forEach(d=>{a=[{node:r,type:l,index:p},{node:d.node,type:d.type,index:d.index}],this.__addConnection(a)})}}this.refreshNodeIssues(),(s=this.instance)==null||s.setSuspendDrawing(!1,!0)},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const n=this.getNodeTypesMaxCount();let i,s;const a=[];await this.loadNodesProperties(e.nodes.map(c=>({name:c.type,version:c.typeVersion}))),e.nodes.forEach(c=>{if(n[c.type]!==void 0)if(n[c.type].exist>=n[c.type].max){t[c.name]=n[c.type].nodeNames[0];return}else n[c.type].exist+=1;i=c.name;const f=this.locale.localizeNodeName(c.name,c.type);s=this.uniqueNodeName(f,o),o.push(s),t[i]=s,a.push(c)});const r={},l=e.connections,p=a.map(c=>c.name);let h,d,m,N,k;for(h of Object.keys(l)){if(!p.includes(h))continue;const c={};for(d of Object.keys(l[h]))for(c[d]=[],m=0;m<l[h][d].length;m++){const f=[];if(l[h][d][m])for(N=0;N<l[h][d][m].length;N++)k=l[h][d][m][N],p.includes(k.node)&&f.push(k);c[d].push(f)}r[h]=c}const w=this.getWorkflow(a,r);for(i in t)i!==t[i]&&w.renameNode(i,t[i]);if(e.pinData){let c=!0;for(const f of Object.keys(e.pinData)){if(!c){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const E=w.nodes[t[f]];try{this.setPinData(E,e.pinData[f],"add-nodes"),c=!0}catch(O){c=!1,console.error(O)}}}return this.historyStore.startRecordingUndo(),await this.addNodes(Object.values(w.nodes),w.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(w.nodes),connections:w.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const n=[];for(const d of e){o=this.getNodeDataToSave(d),n.push(d.name),t.nodes.push(o);const m=this.workflowsStore.pinDataByNodeName(d.name);if(m&&(t.pinData[d.name]=m),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(an.Sharing)){const N=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([k,w])=>{var c;return w.id&&(!N[w.id]||((c=N[w.id])==null?void 0:c.currentUserHasAccess))}))}}let i,s,a,r,l,p,h;return t.nodes.forEach(d=>{if(s=this.workflowsStore.outgoingConnectionsByNodeName(d.name),Object.keys(s).length!==0){h={};for(a of Object.keys(s))for(l=0;l<s[a].length;l++){for(i=[],r=0;r<s[a][l].length;r++)p=s[a][l][r],n.indexOf(p.node)!==-1&&i.push(p);i.length&&(h.hasOwnProperty(a)||(h[a]=[]),h[a][l]=i)}Object.keys(h).length&&(t.connections[d.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.credentialsUpdated=!1},async loadActiveWorkflows(){await this.workflowsStore.fetchActiveWorkflows()},async loadNodeTypes(){await this.nodeTypesStore.getNodeTypes()},async loadCredentialTypes(){await this.credentialsStore.fetchCredentialTypes(!0)},async loadCredentials(){await this.credentialsStore.fetchAllCredentials()},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async loadNodesProperties(e){const t=this.nodeTypesStore.allNodeTypes,o=[];t.forEach(n=>{const i=Array.isArray(n.version)?n.version:[n.version];e.find(s=>s.name===n.name&&i.includes(s.version))&&!n.hasOwnProperty("properties")&&o.push({name:n.name,version:Array.isArray(n.version)?n.version.slice(-1)[0]:n.version})}),o.length>0&&(this.startLoading(),await this.nodeTypesStore.getNodesInformation(o),this.stopLoading())},async onPostMessageReceived(e){var t;if((t=e==null?void 0:e.data)!=null&&t.includes('"command"'))try{const o=JSON.parse(e.data);if(o&&o.command==="openWorkflow")try{await this.importWorkflowExact(o),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(o&&o.command==="openExecution")try{this.isProductionExecutionPreview=o.executionMode!=="manual",await this.openExecution(o.executionId),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(o==null?void 0:o.command)==="setActiveExecution"&&(this.workflowsStore.activeWorkflowExecution=o.execution)}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")},addPinDataConnections(e){Object.keys(e).forEach(t=>{var i;const o=this.workflowsStore.getNodeByName(t);if(!o)return;((i=this.instance)==null?void 0:i.getConnections({source:o.id})).forEach(s=>{Mo(s,{total:e[t].length,iterations:0})})})},removePinDataConnections(e){Object.keys(e).forEach(t=>{var i;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=(i=this.instance)==null?void 0:i.getConnections({source:o.id});this.instance.setSuspendDrawing(!0),n.forEach(Xe),this.instance.setSuspendDrawing(!1,!0)})},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?Vt:xe),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let n;switch(this.nodeCreatorStore.selectedView){case et:n="ai";break;case Vt:n="regular";break;default:n="regular"}t&&this.nodeCreatorStore.setOpenSource(e),this.$externalHooks().run("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,n){let i=n;for(const{type:a,isAutoAdd:r,name:l,openDetail:p,position:h}of e){await this.addNode(a,{position:h??i,dragAndDrop:o,name:l},p??!1,!0,r);const d=this.nodes[this.nodes.length-1];i=[d.position[0]+Je*2+Be,d.position[1]]}const s=this.nodes.length-e.length;for(const{from:a,to:r}of t){const l=this.nodes[s+a.nodeIndex],p=this.nodes[s+r.nodeIndex];this.connectTwoNodes(l.name,a.outputIndex??0,p.name,r.inputIndex??0,$.Main)}},async saveCurrentWorkflowExternal(e){await this.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 n;o&&((n=this.instance)==null||n.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=pe(),await this.addNodes([e]))},onRevertAddConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__removeConnection(e,!0),this.suspendRecordingDetachedConnections=!1},async onRevertRemoveConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__addConnection(e),this.suspendRecordingDetachedConnections=!1},async onRevertNameChange({currentName:e,newName:t}){await this.renameNode(t,e)},onRevertEnableToggle({nodeName:e,isDisabled:t}){const o=this.workflowsStore.getNodeByName(e);o&&this.disableNodes([o])},onPageShow(e){e.persisted&&this.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&[j.NEW_WORKFLOW,j.TEMPLATE_IMPORT].includes(this.$route.name)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:j.WORKFLOWS})})},async checkAndInitDebugMode(){this.$route.name===j.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:he.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:re}],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);try{if(await Promise.all([this.loadCredentials(),this.loadVariables(),this.tagsStore.fetchAll()]),e!==null&&!this.uiStore.stateIsDirty){const t=await this.workflowsStore.fetchWorkflow(e);t&&(this.titleSet(t.name,"IDLE"),await this.openWorkflow(t))}}catch(t){console.error(t)}},async mounted(){var t;this.resetWorkspace(),this.canvasStore.initInstance(this.$refs.nodeView),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.startLoading();const e=[this.loadActiveWorkflows(),this.loadCredentials(),this.loadCredentialTypes(),this.loadVariables(),this.loadSecrets()];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(Cs(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.stopLoading(),setTimeout(()=>{this.usersStore.showPersonalizationSurvey(),this.addPinDataConnections(this.workflowsStore.getPinData||{})},0)}),this.$externalHooks().run("nodeView.mount").catch(o=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&yi(this.currentUser)<=wi){const o=await this.uiStore.getNextOnboardingPrompt(),n=o.toast_sequence_number===1?vi:1e3;o.title&&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(Ni)}})},n)}_o.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:({connectiontype:o,node:n})=>{this.onToggleNodeCreator({source:he.NOTICE_ERROR_MESSAGE,createNodeActive:!0,nodeCreatorView:et}),this.ndvStore.activeNodeName=null;const i=this.workflowsStore.getNodeByName(n);o&&i&&this.insertNodeAfterSelected({index:0,endpointUuid:`${i.id}-input${o}0`,eventSource:he.NOTICE_ERROR_MESSAGE,outputType:o,sourceId:i.id})}}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(he.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),oe.on("newWorkflow",this.newWorkflow),oe.on("importWorkflowData",this.onImportWorkflowDataEvent),oe.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),oe.on("openChat",this.onOpenChat),ne.on("nodeMove",this.onMoveNode),ne.on("revertAddNode",this.onRevertAddNode),ne.on("revertRemoveNode",this.onRevertRemoveNode),ne.on("revertAddConnection",this.onRevertAddConnection),ne.on("revertRemoveConnection",this.onRevertRemoveConnection),ne.on("revertRenameNode",this.onRevertNameChange),ne.on("enableNodeToggle",this.onRevertEnableToggle),we.on("pin-data",this.addPinDataConnections),we.on("unpin-data",this.removePinDataConnections),oe.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),oe.off("newWorkflow",this.newWorkflow),oe.off("importWorkflowData",this.onImportWorkflowDataEvent),oe.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),oe.off("openChat",this.onOpenChat),ne.off("nodeMove",this.onMoveNode),ne.off("revertAddNode",this.onRevertAddNode),ne.off("revertRemoveNode",this.onRevertRemoveNode),ne.off("revertAddConnection",this.onRevertAddConnection),ne.off("revertRemoveConnection",this.onRevertRemoveConnection),ne.off("revertRenameNode",this.onRevertNameChange),ne.off("enableNodeToggle",this.onRevertEnableToggle),we.off("pin-data",this.addPinDataConnections),we.off("unpin-data",this.removePinDataConnections),oe.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect()},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.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,window.removeEventListener("message",this.onPostMessageReceived),oe.off("newWorkflow",this.newWorkflow),oe.off("importWorkflowData",this.onImportWorkflowDataEvent),oe.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Ye),_o.off("pull",this.onSourceControlPull)}}),qc="_content_8gnvh_5",Jc="_shake_8gnvh_13",Xc={content:qc,shake:Jc},Qc=["textContent"],Zc={key:0,class:"workflow-execute-wrapper"};function eh(e,t,o,n,i,s){const a=S("canvas-add-button"),r=S("node"),l=S("sticky"),p=S("node-details-view"),h=S("NodeCreation"),d=S("CanvasControls"),m=S("ContextMenu"),N=S("n8n-button"),k=S("keyboard-shortcut-tooltip"),w=S("n8n-icon-button"),c=zt("touch");return u(),T("div",{class:D(e.$style.content)},[g("div",{class:"node-view-root do-not-select",id:"node-view-root","data-test-id":"node-view-root",onDragover:t[12]||(t[12]=(...f)=>e.onDragOver&&e.onDragOver(...f)),onDrop:t[13]||(t[13]=(...f)=>e.onDrop&&e.onDrop(...f))},[z((u(),T("div",{class:D(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[2]||(t[2]=(...f)=>e.mouseDown&&e.mouseDown(...f)),onTouchend:t[3]||(t[3]=(...f)=>e.mouseUp&&e.mouseUp(...f)),onTouchmove:t[4]||(t[4]=(...f)=>e.mouseMoveNodeWorkflow&&e.mouseMoveNodeWorkflow(...f)),onMousedown:t[5]||(t[5]=(...f)=>e.mouseDown&&e.mouseDown(...f)),onMouseup:t[6]||(t[6]=(...f)=>e.mouseUp&&e.mouseUp(...f)),onContextmenu:t[7]||(t[7]=(...f)=>e.contextMenu.open&&e.contextMenu.open(...f)),onWheel:t[8]||(t[8]=(...f)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...f))},[g("div",{id:"node-view-background",class:"node-view-background",style:se(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),g("div",{id:"node-view",class:"node-view",style:se(e.workflowStyle),ref:"nodeView","data-test-id":"node-view"},[z(v(a,{style:se(e.canvasAddButtonStyle),onClick:t[0]||(t[0]=f=>e.showTriggerCreator(e.NODE_CREATOR_OPEN_SOURCES.TRIGGER_PLACEHOLDER_BUTTON)),showTooltip:!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,ref:"canvasAddButton","onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition,"data-test-id":"canvas-add-button"},null,8,["style","showTooltip","position","onHook:mounted"]),[[J,e.showCanvasAddButton]]),(u(!0),T(Z,null,de(e.nodesToRender,f=>(u(),P(r,{onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRunWorkflow:e.onRunNode,onMoved:e.onNodeMoved,onRun:e.onNodeRun,key:`${f.id}_node`,name:f.name,isReadOnly:e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,isActive:!!e.activeNode&&e.activeNode.name===f.name,hideActions:e.pullConnActive,isProductionExecutionPreview:e.isProductionExecutionPreview},{"custom-tooltip":y(()=>[g("span",{textContent:b(e.$locale.baseText("nodeView.placeholderNode.addTriggerNodeBeforeExecuting"))},null,8,Qc)]),_:2},1032,["onDeselectAllNodes","onDeselectNode","onNodeSelected","onRunWorkflow","onMoved","onRun","name","isReadOnly","instance","isActive","hideActions","isProductionExecutionPreview"]))),128)),(u(!0),T(Z,null,de(e.stickiesToRender,f=>(u(),P(l,{onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRemoveNode:t[1]||(t[1]=E=>e.removeNode(E,!0)),key:`${f.id}_sticky`,name:f.name,isReadOnly:e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,isActive:!!e.activeNode&&e.activeNode.name===f.name,nodeViewScale:e.nodeViewScale,gridSize:e.GRID_SIZE,hideActions:e.pullConnActive},null,8,["onDeselectAllNodes","onDeselectNode","onNodeSelected","name","isReadOnly","instance","isActive","nodeViewScale","gridSize","hideActions"]))),128))],4)],34)),[[c,e.touchTap,"tap"]]),v(p,{readOnly:e.isReadOnlyRoute||e.readOnlyEnv,renaming:e.renamingActive,isProductionExecutionPreview:e.isProductionExecutionPreview,onRedrawNode:e.redrawNode,onSwitchSelectedNode:e.onSwitchSelectedNode,onValueChanged:e.valueChanged,onStopExecution:e.stopExecution,onSaveKeyboardShortcut:e.onSaveKeyboardShortcut},null,8,["readOnly","renaming","isProductionExecutionPreview","onRedrawNode","onSwitchSelectedNode","onValueChanged","onStopExecution","onSaveKeyboardShortcut"]),(u(),P(Se,null,{default:y(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(u(),P(h,{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"])):C("",!0)]),_:1})),(u(),P(Se,null,{default:y(()=>[v(d)]),_:1})),(u(),P(Se,null,{default:y(()=>[v(m,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(u(),T("div",Zc,[g("span",{onMouseenter:t[9]||(t[9]=f=>e.showTriggerMissingToltip(!0)),onMouseleave:t[10]||(t[10]=f=>e.showTriggerMissingToltip(!1)),onClick:t[11]||(t[11]=(...f)=>e.onRunContainerClick&&e.onRunContainerClick(...f))},[v(k,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:y(()=>[v(N,{onClick:ie(e.onRunWorkflow,["stop"]),loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"play-circle",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button"},null,8,["onClick","loading","label","disabled"])]),_:1},8,["label"])],32),e.containsChatNodes?(u(),P(N,{key:0,onClick:ie(e.onOpenChat,["stop"]),label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button"},null,8,["onClick"])):C("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(u(),P(w,{key:1,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,onClick:ie(e.stopExecution,["stop"]),"data-test-id":"stop-execution-button"},null,8,["title","loading","onClick"])):C("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(u(),P(w,{key:2,class:"stop-execution",icon:"stop",size:"large",title:e.$locale.baseText("nodeView.stopWaitingForWebhookCall"),type:"secondary",onClick:ie(e.stopWaitingForWebhook,["stop"]),"data-test-id":"stop-execution-waiting-for-webhook-button"},null,8,["title","onClick"])):C("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(u(),P(w,{key:3,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large",onClick:ie(e.clearExecutionData,["stop"]),"data-test-id":"clear-execution-data-button"},null,8,["title","onClick"])):C("",!0)])):C("",!0)],32)],2)}const th={$style:Xc},oh=H(Gc,[["render",eh],["__cssModules",th],["__scopeId","data-v-90cc5b8d"]]),bh=Object.freeze(Object.defineProperty({__proto__:null,default:oh},Symbol.toStringTag,{value:"Module"}));export{vh as A,za as D,bh as N,kh as R,Nh as T,Kt as a,Kc as b,Hc as c,zc as d,ze as p,Ac as s,tt as t,wt as u};
2
- //# sourceMappingURL=NodeView-CdR2fi_x.js.map
1
+ import{l as ue,O as Y,Q as G,dT as vt,S as re,as as Ee,dU as Jo,dV as Xo,dC as Qo,u as He,ac as ee,c$ as fe,N as $,dW as In,dX as Pn,dY as st,dZ as On,d_ as Rn,d$ as Nt,_ as H,e0 as $n,e1 as An,bg as Zo,aL as en,e2 as Gt,cT as Ue,b8 as ot,a3 as Le,aa as We,R as tn,d7 as qt,K as ge,e3 as Mn,e4 as _e,T as Te,a8 as Ve,e5 as gt,d3 as De,e6 as Jt,e7 as _n,e8 as Xt,e9 as on,ai as It,ea as Wn,eb as Vn,ec as Bn,cP as Qt,b5 as Zt,ax as eo,ed as Ln,ab as ve,ee as we,ef as to,eg as Un,eh as xn,ei as oo,ej as Wt,d0 as Ce,ek as Fn,el as Hn,s as nn,d5 as pt,B as j,d1 as zn,t as sn,em as Kn,en as jn,z as an,eo as Yn,ep as Gn,eq as qn,er as Jn,es as Xn,cR as Qn,et as Zn,G as ei,eu as Pt,W as at,ev as rn,ew as le,ex as nt,cX as Lt,D as ti,ey as xe,ez as et,eA as Ut,eB as no,eC as io,eD as so,eE as ao,eF as ro,eG as lo,eH as uo,eI as co,eJ as ho,eK as po,eL as oi,b9 as go,eM as fo,eN as mo,eO as Vt,eP as yo,eQ as wo,eR as vo,eS as No,cZ as ni,cY as ii,c_ as si,cQ as ai,a4 as Ye,dB as Ge,eT as ri,p as li,v as di,cW as ui,eU as he,cV as ci,cS as Ot,df as oe,eV as hi,eW as pi,dR as gi,eX as fi,U as mi,cJ as yi,cK as wi,cL as vi,bu as Ni}from"./n8n-NE7NqrvB.js";import{m as q,d as kt}from"./pinia-IhuTtYiV.js";import{_ as ko,$ as bo,a0 as To,a1 as rt}from"./@jsplumb/core-MKwKlGip.js";import{j as Fe,k as bt,b as ln,l as ki,P as So,m as ke,n as bi,o as Ti,p as Si,q as Di,r as Ei,t as Ci,v as Ii,x as Pi,C as Oi,y as Ri,z as $i,A as Ai,G as Be,M as dn,D as Mi,B as _i,E as un,F as Wi,N as Tt,H as Ie,I as St,w as Pe,f as ft,a as xt,J as Oe,K as Vi,L as Bi,O as cn,R as hn,d as Ft,g as pn,Q as Li,U as Ui,V as Do,W as mt,X as Bt,Y as Rt,Z as xi,_ as Fi,$ as yt,a0 as qe,a1 as Hi,a2 as zi,a3 as Ki,a4 as ji,a5 as Yi,a6 as lt,a7 as Gi,a8 as qi,a9 as Ji,u as Xi,aa as Qi,ab as Zi,ac as es,ad as Je,ae as ts,af as os,ag as $t,ah as ns,ai as Xe,aj as is,ak as ss,al as as,am as rs,an as ls,ao as ds,ap as us,aq as cs,ar as Eo,as as Co,at as Io,au as hs,av as Po,aw as Oo,ax as ps,ay as dt,az as Ro,aA as gs,aB as fs,aC as $o,aD as Ao,aE as ms,aF as ys,aG as ws,aH as Mo,aI as vs,aJ as Ns,s as _o,aK as ne,aL as ks}from"./index-sMRiWGJS.js";import{G as x,r as F,e as Q,d as Ht,b as gn,ag as S,l as u,m as T,p as g,T as v,I as D,O as y,S as I,R as b,M as P,Q as C,a8 as Wo,a2 as ie,F as Z,a7 as de,aw as fn,ax as mn,K as bs,V as z,U as J,P as yn,H as ae,a5 as wn,J as se,y as Ts,aD as Re,a9 as Dt,aF as Se,aL as Ss,W as Ds,u as be,aq as zt,n as vn}from"./vendor-2CfOYFi2.js";import{n as Es,f as ut,g as Vo,a as Bo,E as Lo,b as Uo,d as xo,h as ct,i as Cs}from"./@jsplumb/browser-ui-QL7QI0sV.js";import{v as pe}from"./uuid-McvpxQtQ.js";import{u as Is}from"./useExecutionDebugging-vYjc-e7j.js";import{g as me,s as Ae,x as Fo,y as Ps}from"./lodash-es-s_m9YyW7.js";import{F as At}from"./file-saver-_vO_MOS2.js";import{V as Nn}from"./vue-json-pretty-HTL9TWGq.js";import Os from"./RunDataAi-ueFTZBht.js";import{w as Ho}from"./workflowActivate-FonyQsS3.js";import{F as Rs}from"./@fortawesome/vue-fontawesome-GVmvJ_gj.js";import{a as $s,u as As}from"./collaboration.store-lUjjktP5.js";const kn=x({data(){return{isTouchDevice:"ontouchstart"in window||navigator.msMaxTouchPoints,isMacOs:/(ipad|iphone|ipod|mac)/i.test(navigator.platform)}},computed:{controlKeyCode(){return this.isMacOs?"Meta":"Control"}},methods:{isCtrlKeyPressed(e){return this.isTouchDevice===!0&&e instanceof MouseEvent?!0:this.isMacOs?e.metaKey:e.ctrlKey}}}),Ms=x({mixins:[kn],data(){return{moveLastPosition:[0,0]}},computed:{...q(ue)},methods:{moveWorkflow(e){const t=this.uiStore.nodeViewOffsetPosition,[o,n]=Fe(e),i=t[0]+(o-this.moveLastPosition[0]),s=t[1]+(n-this.moveLastPosition[1]);this.uiStore.nodeViewOffsetPosition=[i,s],this.moveLastPosition[0]=o,this.moveLastPosition[1]=n},mouseDownMoveWorkflow(e,t){if(!this.isCtrlKeyPressed(e)&&!t||this.uiStore.isActionActive("dragActive"))return;e.button!==1&&(this.uiStore.nodeViewMoveInProgress=!0);const[o,n]=Fe(e);this.moveLastPosition[0]=o,this.moveLastPosition[1]=n,this.$el.addEventListener("mousemove",this.mouseMoveNodeWorkflow)},mouseUpMoveWorkflow(e){this.uiStore.nodeViewMoveInProgress&&(this.$el.removeEventListener("mousemove",this.mouseMoveNodeWorkflow),this.uiStore.nodeViewMoveInProgress=!1)},mouseMoveNodeWorkflow(e){if(!(e.target&&!e.target.id.includes("node-view"))&&!this.uiStore.isActionActive("dragActive")){if(e.buttons===4&&(this.uiStore.nodeViewMoveInProgress=!0),e.buttons===0){this.mouseUp(e);return}this.moveWorkflow(e)}}}}),Kt=kt("canvas",()=>{const e=Y(),t=G(),o=ue(),n=bt(),i=ln(),s=F(),a=F(!1),r=F(null),l=F(null),p=Q(()=>e.allNodes),h=Q(()=>p.value.filter(B=>B.type===vt||t.isTriggerNode(B.type))),d=F(!1),m=F(1),N=F([1,1]),k=Q(()=>i.preferences.branchReadOnly);Ht(k,B=>{s.value&&(s.value.elementsDraggable=!B)});const w=B=>{const M=ki(m.value,B??[0,0]);M[0]-=So/2,M[1]-=So/2,N.value=ke(p.value,M)},c=()=>(w(),{id:pe(),...Mi,position:N.value}),f=()=>h.value.length>0?p.value:[c(),...p.value],E=B=>{const M=d.value?0:o.sidebarMenuCollapsed?bi:Ti,U=B[0]-M,K=d.value?B[1]:B[1]-o.bannersHeight-o.headerHeight;return[U,K]},O=(B,M)=>{var U;m.value=B,(U=s.value)==null||U.setZoom(B),o.nodeViewOffsetPosition=M},R=()=>{const{scale:B,offset:M}=Si({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E([window.innerWidth/2,window.innerHeight/2])});O(B,M)},W=()=>{const{scale:B,offset:M}=Di({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E([window.innerWidth/2,window.innerHeight/2])});O(B,M)},V=()=>{const{scale:B,offset:M}=Ei({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E([window.innerWidth/2,window.innerHeight/2])});O(B,M)},A=()=>{const B=f();if(!B.length)return;const{zoomLevel:M,offset:U}=Ci(B,!d.value);O(M,U)},L=(B,M,U=!1)=>{const K=o.nodeViewOffsetPosition,X=K[0]-(U?M:B),ce=K[1]-(U?B:M);o.nodeViewOffsetPosition=[X,ce]},_=B=>{B.preventDefault();const{deltaX:M,deltaY:U}=Ii(B);if(B.ctrlKey||B.metaKey){const K=_i(U),{scale:X,offset:ce}=Pi(K)({scale:m.value,offset:o.nodeViewOffsetPosition,origin:E(Fe(B))});O(X,ce);return}L(M,U,B.shiftKey)};function te(B){var M;s.value&&(s.value.destroy(),s.value.reset(),s.value=void 0),s.value=Es({container:B,connector:Oi,resizeObserver:!1,endpoint:{type:"Dot",options:{radius:5}},paintStyle:Ri,hoverPaintStyle:$i,connectionOverlays:Ai,elementsDraggable:!k.value,dragOptions:{cursor:"pointer",grid:{w:Be,h:Be},start:U=>{var ye;const X=U.drag.getDragElement().getAttribute("data-name");if(!X)return;a.value=!0;const ce=o.isNodeSelected(X);return U.e&&!ce&&((ye=s.value)==null||ye.clearDragSelection(),o.resetSelectedNodes()),o.addActiveAction("dragActive"),!0},stop:U=>{const X=U.drag.getDragElement().getAttribute("data-name");if(!X)return;const ce=e.getNodeByName(X);if(a.value=!1,o.isActionActive("dragActive")&&ce){const ye=o.getSelectedNodes.slice();ye.map($e=>$e.name).includes(ce.name)||ye.push(ce),ye.length>1&&n.startRecordingUndo();let je;ye.forEach($e=>{const Et=document.getElementById($e.id);if(Et===null)return;je=[parseInt(Et.style.left.slice(0,-2),10),parseInt(Et.style.top.slice(0,-2),10)];const Cn={name:$e.name,properties:{position:je}},Ct=$e.position;(Ct[0]!==je[0]||Ct[1]!==je[1])&&(n.pushCommandToUndo(new dn($e.name,Ct,je)),e.updateNodeProperties(Cn))}),ye.length>1&&n.stopRecordingUndo(),o.isActionActive("dragActive")&&o.removeActiveAction("dragActive")}},filter:".node-description, .node-description .node-name, .node-description .node-subtitle"}}),(M=s.value)==null||M.setDragConstrainFunction(U=>o.isReadOnlyView?null:U)}const Ke=Q(()=>s.value);return{isDemo:d,nodeViewScale:m,canvasAddButtonPosition:N,lastSelectedConnection:r,newNodeInsertPosition:l,jsPlumbInstance:Ke,setRecenteredCanvasAddButtonPosition:w,getNodesWithPlaceholderNode:f,canvasPositionFromPagePosition:E,setZoomLevel:O,resetZoom:R,zoomIn:W,zoomOut:V,zoomToFit:A,wheelScroll:_,initInstance:te}}),Mt=F([0,0]),Qe=F(!1),Ze=F({source:"canvas"}),ht=F([]),zo=F(()=>{}),it=(e=()=>{})=>{const t=ue(),o=G(),n=Y(),i=ln(),{getInputDataWithPinned:s}=un(),a=Ee(),r=Q(()=>i.preferences.branchReadOnly||t.isReadOnlyView),l=Q(()=>{if(!Qe.value)return[];const c=t.selectedNodes.map(E=>n.getNodeByName(E.name)),f=Ze.value;return f.source==="canvas"?c:f.source==="node-right-click"?c.some(O=>O.name===f.node.name)?c:[f.node]:[f.node]}),p=c=>{const f=n.allNodes.filter(E=>E.type===c.name);return c.maxNodes===void 0||f.length<c.maxNodes},h=c=>{const f=o.getNodeType(c.type,c.typeVersion);return!f||Jo.includes(f.name)?!1:p(f)},d=c=>{const f=o.getNodeType(c.type,c.typeVersion),E=s(c);return!f||E.length===0?!1:f.outputs.length===1&&!Xo.includes(c.type)},m=c=>!!n.pinDataByNodeName(c.name),N=()=>{Ze.value={source:"canvas"},Qe.value=!1,ht.value=[],Mt.value=[0,0]},k=(c,f={source:"canvas"})=>{if(c.stopPropagation(),Qe.value&&f.source===Ze.value.source){N();return}c.preventDefault(),zo.value=e,Ze.value=f,Mt.value=Fe(c),Qe.value=!0;const E=l.value,O=E.every(V=>V.type===re),R={adjustToNumber:E.length,interpolate:{subject:O?a.baseText("contextMenu.sticky",{adjustToNumber:E.length}):a.baseText("contextMenu.node",{adjustToNumber:E.length})}},W=[{id:"select_all",divided:!0,label:a.baseText("contextMenu.selectAll"),shortcut:{metaKey:!0,keys:["A"]},disabled:E.length===n.allNodes.length},{id:"deselect_all",label:a.baseText("contextMenu.deselectAll"),disabled:E.length===0}];if(E.length===0)ht.value=[{id:"add_node",shortcut:{keys:["Tab"]},label:a.baseText("contextMenu.addNode"),disabled:r.value},{id:"add_sticky",shortcut:{shiftKey:!0,keys:["s"]},label:a.baseText("contextMenu.addSticky"),disabled:r.value},...W];else{const V=[!O&&{id:"toggle_activation",label:E.every(A=>A.disabled)?a.baseText("contextMenu.activate",R):a.baseText("contextMenu.deactivate",R),shortcut:{keys:["D"]},disabled:r.value},!O&&{id:"toggle_pin",label:E.every(A=>m(A))?a.baseText("contextMenu.unpin",R):a.baseText("contextMenu.pin",R),shortcut:{keys:["p"]},disabled:r.value||!E.every(d)},{id:"copy",label:a.baseText("contextMenu.copy",R),shortcut:{metaKey:!0,keys:["C"]}},{id:"duplicate",label:a.baseText("contextMenu.duplicate",R),shortcut:{metaKey:!0,keys:["D"]},disabled:r.value||!E.every(h)},...W,{id:"delete",divided:!0,label:a.baseText("contextMenu.delete",R),shortcut:{keys:["Del"]},disabled:r.value}].filter(Boolean);if(E.length===1){const A=O?[{id:"open",label:a.baseText("contextMenu.editSticky"),shortcut:{keys:["↵"]},disabled:r.value},{id:"change_color",label:a.baseText("contextMenu.changeColor"),disabled:r.value}]:[{id:"open",label:a.baseText("contextMenu.open"),shortcut:{keys:["↵"]}},{id:"execute",label:a.baseText("contextMenu.execute"),disabled:r.value},{id:"rename",label:a.baseText("contextMenu.rename"),shortcut:{keys:["F2"]},disabled:r.value}];V.unshift(...A)}ht.value=V}},w=c=>{zo.value(c,l.value)};return Ht(()=>t.nodeViewOffsetPosition,()=>{N()}),{isOpen:Qe,position:Mt,target:Ze,actions:ht,targetNodes:l,open:k,close:N,_dispatchAction:w}};function _s(){const e=F(!1),t=F(document.createElement("span")),{isTouchDevice:o,isCtrlKeyPressed:n}=Qo(),i=ue(),s=Kt(),a=Y(),{isOpen:r}=it();function l(A){Object.assign(t.value.style,A)}function p(A){const[L,_]=E(A);t.value=Object.assign(t.value,{x:L,y:_}),l({left:t.value.x+"px",top:t.value.y+"px",visibility:"visible"}),e.value=!0}function h(A){const L=m(A);l({left:L.x+"px",top:L.y+"px",width:L.width+"px",height:L.height+"px"})}function d(){t.value.x=0,t.value.y=0,l({visibility:"hidden",left:"0px",top:"0px",width:"0px",height:"0px"}),e.value=!1}function m(A){const[L,_]=E(A);return{x:Math.min(L,t.value.x),y:Math.min(_,t.value.y),width:Math.abs(L-t.value.x),height:Math.abs(_-t.value.y)}}function N(A){const L=[],_=m(A);return a.allNodes.forEach(te=>{te.position[0]<_.x||te.position[0]>_.x+_.width||te.position[1]<_.y||te.position[1]>_.y+_.height||L.push(te)}),L}function k(){t.value.id="select-box",l({margin:"0px auto",border:"2px dotted #FF0000",position:"absolute",zIndex:"100",visibility:"hidden"}),t.value.addEventListener("mouseup",c),document.querySelector("#node-view").appendChild(t.value)}function w(A){if(A.buttons===0){c(A);return}h(A)}function c(A){if(A.button===2||r.value)return;if(!e.value){o&&A.target instanceof HTMLElement&&A.target&&A.target.id.includes("node-view")&&W();return}document.removeEventListener("mousemove",w),W();const L=N(A);L.forEach(_=>{R(_)}),L.length===1&&(i.lastSelectedNode=L[0].name),d()}function f(A,L){n(A)||L||A.button===2||i.isActionActive("dragActive")||(p(A),document.addEventListener("mousemove",w))}function E(A){const L=Fe(A),[_,te]=s.canvasPositionFromPagePosition(L),Ke=s.nodeViewScale,B=i.nodeViewOffsetPosition;return Wi(_,te,Ke,B)}function O(A){i.removeNodeFromSelection(A),V.value.removeFromDragSelection(V.value.getManagedElement(A==null?void 0:A.id))}function R(A){i.addSelectedNode(A),V.value.addToDragSelection(V.value.getManagedElement(A==null?void 0:A.id))}function W(){V.value.clearDragSelection(),i.resetSelectedNodes(),i.lastSelectedNode=null,i.lastSelectedNodeOutputIndex=null,s.lastSelectedConnection=null,s.newNodeInsertPosition=null}const V=Q(()=>s.jsPlumbInstance);return gn(()=>{k()}),{selectActive:e,getMousePositionWithinNodeView:E,mouseUpMouseSelect:c,mouseDownMouseSelect:f,nodeDeselected:O,nodeSelected:R,deselectAllNodes:W}}function Ws(){function e(){return G().allNodeTypes.reduce((o,n)=>{if(typeof n.defaults.name!="string")throw new Error("Expected node name default to be a string");return/\d$/.test(n.defaults.name)&&o.push(n.defaults.name),o},[])}function t(o,n=[]){var h,d;const{canvasNames:i}=Y();if(!i.has(o)&&!n.includes(o))return o;const a=e().find(m=>o.startsWith(m));if(a){let m="",N=1;const k=o.split(a).pop(),w=k==null?void 0:k[k.length-1];for(w&&Number.isInteger(Number(w))&&(N=parseInt(w,10),o=o.slice(0,-1)),m=o;i.has(m)||n.includes(m);)m=o+N++;return m}if(/^\d+-?\d*$/.test(o)){let m="",N=1;const k=o.match(/(?<base>\d+)-?(?<suffix>\d*)/);if(!(k!=null&&k.groups))throw new Error("Failed to find match for unique name");for(((h=k==null?void 0:k.groups)==null?void 0:h.suffix)!==""&&(N=parseInt(k.groups.suffix,10)),m=k.groups.base;i.has(m)||n.includes(m);)m=k.groups.base+"-"+N++;return m}let r="",l=1;const p=o.match(/(?<base>.*\D+)(?<suffix>\d*)/);if(!(p!=null&&p.groups))throw new Error("Failed to find match for unique name");for(((d=p==null?void 0:p.groups)==null?void 0:d.suffix)!==""&&(l=parseInt(p.groups.suffix,10)),r=p.groups.base;i.has(r)||n.includes(r);)r=p.groups.base+l++;return r}return{uniqueNodeName:t}}const ze=x({setup(){return{...He()}},computed:{...q(Y,ee),pinData(){return this.node?this.workflowsStore.pinDataByNodeName(this.node.name):void 0},hasPinData(){return!!this.node&&typeof this.pinData<"u"},isSubNode(){if(!this.nodeType.outputs||typeof this.nodeType.outputs=="string")return!1;const e=fe(this.nodeType.outputs);return e?e.filter(t=>t!==$.Main).length>0:!1},isPinDataNodeType(){return!!this.node&&!this.isSubNode&&!this.isMultipleOutputsNodeType&&!Xo.includes(this.node.type)},isMultipleOutputsNodeType(){var e;return((e=this.nodeType)==null?void 0:e.outputs.length)>1}},methods:{isValidPinDataJSON(e){try{return JSON.parse(e),!0}catch(t){const o=this.$locale.baseText("runData.editOutputInvalid"),n=new RegExp(/JSON\.parse:|of the JSON data/,"g"),i=t.message.replace(n,"").trim(),s=/at position (\d+)/,a=t.message.match(s);if(t.message=i.charAt(0).toUpperCase()+i.slice(1),t.message=t.message.replace("Unexpected token ' in JSON",this.$locale.baseText("runData.editOutputInvalid.singleQuote")),a){const r=parseInt(a[1],10),l=(e.slice(0,r).match(/\n/g)||[]).length;t.message=t.message.replace(s,this.$locale.baseText("runData.editOutputInvalid.atPosition",{interpolate:{position:`${r}`}})),t.message=`${this.$locale.baseText("runData.editOutputInvalid.onLine",{interpolate:{line:`${l+1}`}})} ${t.message}`}return this.showError(t,o),!1}},isValidPinDataSize(e,t){typeof e=="object"&&(e=JSON.stringify(e));const{pinData:o,...n}=this.workflowsStore.getCurrentWorkflow(),i=In(n,{replaceCircularRefs:!0}),s={...o,[t]:e},a=this.workflowsStore.getPinDataSize(s);return a>Pn?(this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title")),!1):st(i)+a>On-Rn?(this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLargeWorkflow.description")),this.$locale.baseText("ndv.pinData.error.tooLargeWorkflow.title")),!1):!0},setPinData(e,t,o){if(typeof t=="string"){if(!this.isValidPinDataJSON(t))throw this.onDataPinningError({errorType:"invalid-json",source:o}),new Error("Invalid JSON");t=Nt(t)}if(!this.isValidPinDataSize(t,e.name))throw this.onDataPinningError({errorType:"data-too-large",source:o}),new Error("Data too large");this.onDataPinningSuccess({source:o}),this.workflowsStore.pinData({node:e,data:t})},unsetPinData(e,t){this.onDataUnpinning({source:t}),this.workflowsStore.unpinData({node:e})},onDataPinningSuccess({source:e}){var o;const t={pinning_source:e,node_type:(o=this.activeNode)==null?void 0:o.type,session_id:this.sessionId,data_size:st(this.pinData),view:this.displayMode,run_index:this.runIndex};this.$externalHooks().run("runData.onDataPinningSuccess",t),this.$telemetry.track("Ndv data pinning success",t)},onDataPinningError({errorType:e,source:t}){var o;this.$telemetry.track("Ndv data pinning failure",{pinning_source:t,node_type:(o=this.activeNode)==null?void 0:o.type,session_id:this.sessionId,data_size:st(this.pinData),view:this.displayMode,run_index:this.runIndex,error_type:e})},onDataUnpinning({source:e}){var t;this.$telemetry.track("User unpinned ndv data",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,source:e,data_size:st(this.pinData)})}}}),Vs=x({name:"NodeTitle",components:{NodeIcon:Tt},props:{modelValue:{type:String,default:""},nodeType:{},readOnly:{type:Boolean,default:!1}},data(){return{editName:!1,newName:""}},computed:{editable(){return!this.readOnly&&window===window.parent}},methods:{async onEdit(){this.newName=this.modelValue,this.editName=!0,await this.$nextTick();const e=this.$refs.input;e&&e.focus()},onRename(){this.newName.trim()!==""&&this.$emit("update:modelValue",this.newName.trim()),this.editName=!1}}}),Bs="_container_15oh7_5",Ls="_title_15oh7_15",Us="_hoverable_15oh7_23",xs="_editIcon_15oh7_26",Fs="_iconWrapper_15oh7_30",Hs="_editIconContainer_15oh7_43",zs="_editButtons_15oh7_49",Ks="_editContainer_15oh7_57",js={container:Bs,title:Ls,hoverable:Us,editIcon:xs,iconWrapper:Fs,editIconContainer:Hs,editButtons:zs,editContainer:Ks};function Ys(e,t,o,n,i,s){const a=S("NodeIcon"),r=S("n8n-text"),l=S("n8n-input"),p=S("n8n-button"),h=S("font-awesome-icon"),d=S("n8n-popover");return u(),T("span",{class:D(e.$style.container),"data-test-id":"node-title-container",onClick:t[5]||(t[5]=(...m)=>e.onEdit&&e.onEdit(...m))},[g("span",{class:D(e.$style.iconWrapper)},[v(a,{nodeType:e.nodeType,size:18},null,8,["nodeType"])],2),v(d,{placement:"right",width:"200",visible:e.editName,disabled:!e.editable},{reference:y(()=>[g("div",{class:D({[e.$style.title]:!0,[e.$style.hoverable]:e.editable})},[I(b(e.modelValue)+" ",1),g("div",{class:D(e.$style.editIconContainer)},[e.editable?(u(),P(h,{key:0,class:D(e.$style.editIcon),icon:"pencil-alt"},null,8,["class"])):C("",!0)],2)],2)]),default:y(()=>[g("div",{class:D(e.$style.editContainer),onKeydown:[t[2]||(t[2]=Wo((...m)=>e.onRename&&e.onRename(...m),["enter"])),t[3]||(t[3]=ie(()=>{},["stop"])),t[4]||(t[4]=Wo(m=>e.editName=!1,["esc"]))]},[v(r,{bold:!0,color:"text-base",tag:"div"},{default:y(()=>[I(b(e.$locale.baseText("ndv.title.renameNode")),1)]),_:1}),v(l,{ref:"input",size:"small",modelValue:e.newName,"onUpdate:modelValue":t[0]||(t[0]=m=>e.newName=m),"data-test-id":"node-rename-input"},null,8,["modelValue"]),g("div",{class:D(e.$style.editButtons)},[v(p,{type:"secondary",size:"small",onClick:t[1]||(t[1]=m=>e.editName=!1),label:e.$locale.baseText("ndv.title.cancel")},null,8,["label"]),v(p,{type:"primary",size:"small",onClick:e.onRename,label:e.$locale.baseText("ndv.title.rename")},null,8,["onClick","label"])],2)],34)]),_:1},8,["visible","disabled"])],2)}const Gs={$style:js},qs=H(Vs,[["render",Ys],["__cssModules",Gs]]),Js=x({name:"NodeSettingsTabs",mixins:[Ie],props:{modelValue:{type:String,default:""},nodeType:{},sessionId:{type:String}},computed:{...q(ee,Y),activeNode(){return this.ndvStore.activeNode},documentationUrl(){var n,i,s,a;const e=this.nodeType;if(!e)return"";if(e.documentationUrl&&e.documentationUrl.startsWith("http"))return e.documentationUrl;const t="?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign="+e.name,o=(a=(s=(i=(n=e.codex)==null?void 0:n.resources)==null?void 0:i.primaryDocumentation)==null?void 0:s[0])==null?void 0:a.url;return o?o+t:this.isCommunityNode?`${$n}${e.name.split(".")[0]}`:An+t},isCommunityNode(){const e=this.nodeType;return e?Zo(e.name):!1},packageName(){return this.nodeType.name.split(".")[0]},options(){const e=[{label:this.$locale.baseText("nodeSettings.parameters"),value:"params"}];this.documentationUrl&&e.push({label:this.$locale.baseText("nodeSettings.docs"),value:"docs",href:this.documentationUrl}),this.isCommunityNode&&e.push({icon:"cube",value:"communityNode",align:"right",tooltip:this.$locale.baseText("generic.communityNode.tooltip",{interpolate:{docUrl:en,packageName:this.packageName}})});const t=!this.isCommunityNode;return e.push({icon:"cog",value:"settings",align:t?"right":void 0}),e}},methods:{onTabSelect(e){e==="docs"&&this.nodeType&&(this.$externalHooks().run("dataDisplay.onDocumentationUrlClick",{nodeType:this.nodeType,documentationUrl:this.documentationUrl}),this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:$.Main,type:"docs"})),e==="settings"&&this.nodeType&&this.$telemetry.track("User viewed node settings",{node_type:this.nodeType.name,workflow_id:this.workflowsStore.workflowId}),(e==="settings"||e==="params")&&this.$emit("update:modelValue",e)},onTooltipClick(e,t){e==="communityNode"&&t.target.localName==="a"&&this.$telemetry.track("user clicked cnr docs link",{source:"node details view"})}}});function Xs(e,t,o,n,i,s){const a=S("n8n-tabs");return u(),P(a,{options:e.options,modelValue:e.modelValue,"onUpdate:modelValue":e.onTabSelect,onTooltipClick:e.onTooltipClick},null,8,["options","modelValue","onUpdate:modelValue","onTooltipClick"])}const Qs=H(Js,[["render",Xs]]),Zs=x({name:"NodeWebhooks",mixins:[St,Pe],props:["node","nodeType"],setup(){return{...He()}},data(){return{isMinimized:this.nodeType&&!Gt.includes(this.nodeType.name),showUrlFor:"test"}},computed:{webhooksNode(){return this.nodeType===null||this.nodeType.webhooks===void 0?[]:this.nodeType.webhooks.filter(e=>e.restartWebhook!==!0)},baseText(){switch(this.nodeType.name){case Ue:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls.formTrigger"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls.formTrigger"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls.formTrigger"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls.formTrigger"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title.formTrigger"),copyMessage:this.$locale.baseText("nodeWebhooks.showMessage.message.formTrigger")};default:return{toggleTitle:this.$locale.baseText("nodeWebhooks.webhookUrls"),clickToDisplay:this.$locale.baseText("nodeWebhooks.clickToDisplayWebhookUrls"),clickToHide:this.$locale.baseText("nodeWebhooks.clickToHideWebhookUrls"),clickToCopy:this.$locale.baseText("nodeWebhooks.clickToCopyWebhookUrls"),testUrl:this.$locale.baseText("nodeWebhooks.testUrl"),productionUrl:this.$locale.baseText("nodeWebhooks.productionUrl"),copyTitle:this.$locale.baseText("nodeWebhooks.showMessage.title"),copyMessage:void 0}}}},methods:{copyWebhookUrl(e){const t=this.getWebhookUrlDisplay(e);this.copyToClipboard(t),this.showMessage({title:this.baseText.copyTitle,message:this.baseText.copyMessage,type:"success"}),this.$telemetry.track("User copied webhook URL",{pane:"parameters",type:`${this.showUrlFor} url`})},getWebhookUrlDisplay(e){return this.node?this.getWebhookUrl(e,this.node,this.showUrlFor):""}},watch:{node(){this.isMinimized=!Gt.includes(this.nodeType.name)}}}),jt=e=>(fn("data-v-59e2355b"),e=e(),mn(),e),ea={key:0,class:"webhooks"},ta=["title"],oa={key:0,class:"node-webhooks"},na={class:"url-selection"},ia={key:0,class:"webhook-wrapper"},sa={class:"http-field"},aa={class:"http-method"},ra=jt(()=>g("br",null,null,-1)),la={class:"url-field"},da=["onClick"],ua=jt(()=>g("br",null,null,-1)),ca={key:1,class:"webhook-wrapper"},ha={class:"url-field-full-width"},pa=["onClick"],ga=jt(()=>g("br",null,null,-1));function fa(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("n8n-radio-buttons"),l=S("el-col"),p=S("el-row"),h=S("n8n-tooltip"),d=S("el-collapse-transition");return e.webhooksNode.length?(u(),T("div",ea,[g("div",{class:D(["clickable headline",{expanded:!e.isMinimized}]),onClick:t[0]||(t[0]=m=>e.isMinimized=!e.isMinimized),title:e.isMinimized?e.baseText.clickToDisplay:e.baseText.clickToHide},[v(a,{icon:"angle-down",class:"minimize-button minimize-icon"}),I(" "+b(e.baseText.toggleTitle),1)],10,ta),v(d,null,{default:y(()=>[e.isMinimized?C("",!0):(u(),T("div",oa,[g("div",na,[v(p,null,{default:y(()=>[v(l,{span:24},{default:y(()=>[v(r,{modelValue:e.showUrlFor,"onUpdate:modelValue":t[1]||(t[1]=m=>e.showUrlFor=m),options:[{label:e.baseText.testUrl,value:"test"},{label:e.baseText.productionUrl,value:"production"}]},null,8,["modelValue","options"])]),_:1})]),_:1})]),(u(!0),T(Z,null,de(e.webhooksNode.filter(m=>!m.ndvHideUrl),(m,N)=>(u(),P(h,{key:N,class:"item",content:e.baseText.clickToCopy,placement:"left"},{default:y(()=>[m.ndvHideMethod?(u(),T("div",ca,[g("div",ha,[g("div",{class:"webhook-url left-ellipsis clickable",onClick:k=>e.copyWebhookUrl(m)},[I(b(e.getWebhookUrlDisplay(m)),1),ga],8,pa)])])):(u(),T("div",ia,[g("div",sa,[g("div",aa,[I(b(e.getWebhookExpressionValue(m,"httpMethod")),1),ra])]),g("div",la,[g("div",{class:"webhook-url left-ellipsis clickable",onClick:k=>e.copyWebhookUrl(m)},[I(b(e.getWebhookUrlDisplay(m)),1),ua],8,da)])]))]),_:2},1032,["content"]))),128))]))]),_:1})])):C("",!0)}const ma=H(Zs,[["render",fa],["__scopeId","data-v-59e2355b"]]),ya=x({inheritAttrs:!1,mixins:[ft,ze],props:{nodeName:{type:String},disabled:{type:Boolean,default:!1},label:{type:String},type:{type:String},size:{type:String},transparent:{type:Boolean,default:!1},telemetrySource:{type:String}},setup(e){var t,o;return{...He(),...xt(),...(o=(t=ft).setup)==null?void 0:o.call(t,e)}},computed:{...q(G,ee,Y),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},nodeRunning(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&(this.workflowsStore.isNodeExecuting(this.node.name)||e===this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isTriggerNode(){return this.node?this.nodeTypesStore.isTriggerNode(this.node.type):!1},isManualTriggerNode(){return!!(this.nodeType&&this.nodeType.name===ot)},isFormTriggerNode(){return!!(this.nodeType&&this.nodeType.name===Ue)},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){var e;return!!((e=this.nodeType)!=null&&e.group.includes("schedule"))},isWebhookNode(){return!!(this.nodeType&&this.nodeType.name===Le)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return this.node&&!this.node.disabled&&this.isTriggerNode&&e&&(!t||t===this.nodeName)},isListeningForWorkflowEvents(){return this.nodeRunning&&this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},disabledHint(){if(this.isListeningForEvents)return"";if(this.isTriggerNode&&this.node.disabled)return this.$locale.baseText("ndv.execute.nodeIsDisabled");if(this.isTriggerNode&&this.hasIssues){const e=this.ndvStore.activeNode;return e&&e.name!==this.nodeName?this.$locale.baseText("ndv.execute.fixPrevious"):this.$locale.baseText("ndv.execute.requiredFieldsMissing")}return this.workflowRunning&&!this.nodeRunning?this.$locale.baseText("ndv.execute.workflowAlreadyRunning"):""},buttonLabel(){var e;return this.isListeningForEvents||this.isListeningForWorkflowEvents?this.$locale.baseText("ndv.execute.stopListening"):this.label?this.label:this.isWebhookNode?this.$locale.baseText("ndv.execute.listenForTestEvent"):this.isFormTriggerNode?this.$locale.baseText("ndv.execute.testStep"):this.isPollingTypeNode||(e=this.nodeType)!=null&&e.mockManualExecution?this.$locale.baseText("ndv.execute.fetchEvent"):this.isTriggerNode&&!this.isScheduleTrigger&&!this.isManualTriggerNode&&!this.isFormTriggerNode?this.$locale.baseText("ndv.execute.listenForEvent"):this.$locale.baseText("ndv.execute.executeNode")}},methods:{async stopWaitingForWebhook(){try{await this.workflowsStore.removeTestWebhook(this.workflowsStore.workflowId)}catch(e){this.showError(e,this.$locale.baseText("ndv.execute.stopWaitingForWebhook.error"));return}},async onClick(){if(this.isListeningForEvents)await this.stopWaitingForWebhook();else if(this.isListeningForWorkflowEvents)this.$emit("stopExecution");else{let e=!1;if(this.hasPinData&&(e=await this.confirm(this.$locale.baseText("ndv.pinData.unpinAndExecute.description"),this.$locale.baseText("ndv.pinData.unpinAndExecute.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.unpinAndExecute.cancel")})===We,e&&this.node&&this.unsetPinData(this.node,"unpin-and-execute-modal")),!this.hasPinData||e){const t={node_type:this.nodeType?this.nodeType.name:null,workflow_id:this.workflowsStore.workflowId,source:this.telemetrySource,session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",t),await this.$externalHooks().run("nodeExecuteButton.onClick",t),await this.runWorkflow({destinationNode:this.nodeName,source:"RunData.ExecuteNodeButton"}),this.$emit("execute")}}}}});function wa(e,t,o,n,i,s){const a=S("n8n-button"),r=S("n8n-tooltip");return u(),T("div",null,[v(r,{placement:"bottom",disabled:!e.disabledHint},{content:y(()=>[g("div",null,b(e.disabledHint),1)]),default:y(()=>[g("div",null,[v(a,bs(e.$attrs,{loading:e.nodeRunning&&!e.isListeningForEvents&&!e.isListeningForWorkflowEvents,disabled:e.disabled||!!e.disabledHint,label:e.buttonLabel,type:e.type,size:e.size,icon:e.isFormTriggerNode&&"flask",transparentBackground:e.transparent,onClick:e.onClick}),null,16,["loading","disabled","label","type","size","icon","transparentBackground","onClick"])])]),_:1},8,["disabled"])])}const Yt=H(ya,[["render",wa]]),va=x({name:"NodeSettings",mixins:[Ie,Oe],components:{NodeTitle:qs,NodeCredentials:Vi,ParameterInputList:Bi,NodeSettingsTabs:Qs,NodeWebhooks:ma,NodeExecuteButton:Yt},computed:{...q(bt,G,ee,ue,tn,Y,cn),isCurlImportModalOpen(){return this.uiStore.isModalOpen(qt)},isReadOnly(){return this.readOnly||this.hasForeignCredential},isExecutable(){if(this.nodeType&&this.node){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=ge(e,t,this.nodeType);if(!fe(o).includes($.Main)&&!this.isTriggerNode)return!1}return this.executable||this.hasForeignCredential},nodeTypeName(){if(this.nodeType){const e=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${e}.displayName`,fallback:this.nodeType.name})}return""},nodeTypeVersions(){return this.node?this.nodeTypesStore.getNodeVersions(this.node.type):[]},latestVersion(){return Math.max(...this.nodeTypeVersions)},isLatestNodeVersion(){var e;return this.latestVersion===((e=this.node)==null?void 0:e.typeVersion)},nodeVersionTag(){return!this.nodeType||this.nodeType.hidden?this.$locale.baseText("nodeSettings.deprecated"):this.isLatestNodeVersion?this.$locale.baseText("nodeSettings.latest"):this.$locale.baseText("nodeSettings.latestVersion",{interpolate:{version:this.latestVersion.toString()}})},nodeTypeDescription(){var e;if((e=this.nodeType)!=null&&e.description){const t=this.$locale.shortNodeType(this.nodeType.name);return this.$locale.headerText({key:`headers.${t}.description`,fallback:this.nodeType.description})}else return this.$locale.baseText("nodeSettings.noDescriptionFound")},headerStyle(){return this.node?{"background-color":this.node.color}:{}},node(){return this.ndvStore.activeNode},parametersSetting(){return this.parameters.filter(e=>e.isNodeSetting)},parametersNoneSetting(){return this.parameters.filter(e=>!e.isNodeSetting)},parameters(){return this.nodeType===null?[]:this.nodeType.properties},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isCommunityNode(){var e;return Zo((e=this.node)==null?void 0:e.type)},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode((e=this.node)==null?void 0:e.type)},workflowOwnerName(){return this.workflowsEEStore.getWorkflowOwnerName(`${this.workflowsStore.workflowId}`)},hasForeignCredential(){return this.foreignCredentials.length>0},usedCredentials(){return Object.values(this.workflowsStore.usedCredentials).filter(e=>{var t;return Object.values(((t=this.node)==null?void 0:t.credentials)||[]).find(o=>o.id===e.id)})},credentialOwnerName(){const e=this.usedCredentials?Object.values(this.usedCredentials).find(t=>t.id===this.foreignCredentials[0]):void 0;return this.credentialsStore.getCredentialOwnerName(e)}},props:{eventBus:{type:Object},dragging:{type:Boolean},sessionId:{type:String},nodeType:{type:Object},readOnly:{type:Boolean,default:!1},foreignCredentials:{type:Array,default:()=>[]},blockUI:{type:Boolean,default:!1},executable:{type:Boolean,default:!0}},data(){return{nodeValid:!0,nodeColor:null,openPanel:"params",nodeValues:{color:"#ff0000",alwaysOutputData:!1,executeOnce:!1,notesInFlow:!1,onError:"stopWorkflow",retryOnFail:!1,maxTries:3,waitBetweenTries:1e3,notes:"",parameters:{}},nodeValuesInitialized:!1,nodeSettings:[],COMMUNITY_NODES_INSTALLATION_DOCS_URL:en,CUSTOM_NODES_DOCS_URL:Mn,MAIN_NODE_PANEL_WIDTH:_e,hiddenIssuesInputs:[]}},watch:{node(e,t){this.setNodeValues()},isCurlImportModalOpen(e,t){if(e===!1){let o=this.uiStore.getHttpNodeParameters||"";if(!o)return;try{o=JSON.parse(o),this.valueChanged({node:this.node.name,name:"parameters",value:o}),this.uiStore.setHttpNodeParameters({name:qt,parameters:""})}catch{}}}},methods:{populateHiddenIssuesSet(){!this.node||!this.workflowsStore.isNodePristine(this.node.name)||(this.hiddenIssuesInputs.push("credentials"),this.parametersNoneSetting.forEach(e=>{this.hiddenIssuesInputs.push(e.name)}),this.workflowsStore.setNodePristine(this.node.name,!1))},populateSettings(){this.isExecutable&&!this.isTriggerNode&&this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.alwaysOutputData.displayName"),name:"alwaysOutputData",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.alwaysOutputData.description")},{displayName:this.$locale.baseText("nodeSettings.executeOnce.displayName"),name:"executeOnce",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.executeOnce.description")},{displayName:this.$locale.baseText("nodeSettings.retryOnFail.displayName"),name:"retryOnFail",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.retryOnFail.description")},{displayName:this.$locale.baseText("nodeSettings.maxTries.displayName"),name:"maxTries",type:"number",typeOptions:{minValue:2,maxValue:5},default:3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.maxTries.description")},{displayName:this.$locale.baseText("nodeSettings.waitBetweenTries.displayName"),name:"waitBetweenTries",type:"number",typeOptions:{minValue:0,maxValue:5e3},default:1e3,displayOptions:{show:{retryOnFail:[!0]}},noDataExpression:!0,description:this.$locale.baseText("nodeSettings.waitBetweenTries.description")},{displayName:this.$locale.baseText("nodeSettings.onError.displayName"),name:"onError",type:"options",options:[{name:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.displayName"),value:"stopWorkflow",description:this.$locale.baseText("nodeSettings.onError.options.stopWorkflow.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.displayName"),value:"continueRegularOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueRegularOutput.description")},{name:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.displayName"),value:"continueErrorOutput",description:this.$locale.baseText("nodeSettings.onError.options.continueErrorOutput.description")}],default:"stopWorkflow",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.onError.description")}),this.nodeSettings.push({displayName:this.$locale.baseText("nodeSettings.notes.displayName"),name:"notes",type:"string",typeOptions:{rows:5},default:"",noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notes.description")},{displayName:this.$locale.baseText("nodeSettings.notesInFlow.displayName"),name:"notesInFlow",type:"boolean",default:!1,noDataExpression:!0,description:this.$locale.baseText("nodeSettings.notesInFlow.description")})},onParameterBlur(e){this.hiddenIssuesInputs=this.hiddenIssuesInputs.filter(t=>t!==e)},onWorkflowActivate(){this.hiddenIssuesInputs=[],this.$emit("activate")},onNodeExecute(){this.hiddenIssuesInputs=[],this.$emit("execute")},setValue(e,t){const o=e.split(".");let n=o.pop(),i=!1;if(n!==void 0&&n.includes("[")){const s=n.match(/(.*)\[(\d+)\]$/);s&&(o.push(s[1]),n=s[2],i=!0)}if(o.length===0)if(t===null){const{[n]:s,...a}=this.nodeValues;this.nodeValues=a}else this.nodeValues={...this.nodeValues,[n]:t};else if(t===null){let s=me(this.nodeValues,o.join("."));const{[n]:a,...r}=s;if(s=r,i&&s.length===0){n=o.pop(),s=me(this.nodeValues,o.join("."));const{[n]:l,...p}=s;s=p}}else typeof t=="object"?Ae(me(this.nodeValues,o.join(".")),n,Te(t)):Ae(me(this.nodeValues,o.join(".")),n,t);this.nodeValues={...this.nodeValues}},credentialSelected(e){this.workflowsStore.updateNodeProperties(e);const t=this.workflowsStore.getNodeByName(e.name);t&&this.updateNodeCredentialIssues(t),this.$externalHooks().run("nodeSettings.credentialSelected",{updateInformation:e})},nameChanged(e){this.node&&this.historyStore.pushCommandToUndo(new hn(this.node.name,e)),this.valueChanged({value:e,name:"name"})},valueChanged(e){var i;let t;e.hasOwnProperty("value")?t=e.value:t=me(this.nodeValues,e.name);const o=e.node||((i=this.node)==null?void 0:i.name),n=this.workflowsStore.getNodeByName(o);if(n!==null)if(e.name==="onError"&&this.$emit("redrawRequired"),e.name==="name"){const s={value:t,oldValue:o,name:e.name};this.$emit("valueChanged",s)}else if(e.name==="parameters"){const s=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!s)return;let a=Ve(s.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Te(a);for(const l of Object.keys(e.value)){t=e.value[l];const p=l.split(".").slice(1).join("."),h=p.match(/(.*)\[(\d+)\]$/);if(e[l]===void 0&&h!==null){const d=h[1],m=h[2],N=me(a,d);Array.isArray(N)&&(N.splice(parseInt(m,10),1),Ae(a,d,N))}else t===void 0?Fo(a,p):Ae(a,p,t);this.$externalHooks().run("nodeSettings.valueChanged",{parameterPath:p,newValue:t,parameters:this.parameters,oldNodeParameters:r})}a=Ve(s.properties,a,!0,!1,n);for(const l of Object.keys(a))a&&a[l]!==null&&a[l]!==void 0&&this.setValue(`parameters.${l}`,a[l]);if(a){const l={name:n.name,value:a};this.workflowsStore.setNodeParameters(l),this.updateNodeParameterIssuesByName(n.name),this.updateNodeCredentialIssuesByName(n.name)}}else if(e.name.startsWith("parameters.")){const s=this.nodeTypesStore.getNodeType(n.type,n.typeVersion);if(!s)return;let a=Ve(s.properties,n.parameters,!1,!1,n);const r=Object.assign({},a);a=Te(a);const l=e.name.split(".").slice(1).join("."),p=l.match(/(.*)\[(\d+)\]$/);if(e.value===void 0&&p!==null){const d=p[1],m=p[2],N=me(a,d);Array.isArray(N)&&(N.splice(parseInt(m,10),1),Ae(a,d,N))}else t===void 0?Fo(a,l):Ae(a,l,t);a=Ve(s.properties,a,!0,!1,n);for(const d of Object.keys(a))a&&a[d]!==null&&a[d]!==void 0&&this.setValue(`parameters.${d}`,a[d]);const h={name:n.name,value:a};this.workflowsStore.setNodeParameters(h),this.$externalHooks().run("nodeSettings.valueChanged",{parameterPath:l,newValue:t,parameters:this.parameters,oldNodeParameters:r}),this.updateNodeParameterIssuesByName(n.name),this.updateNodeCredentialIssuesByName(n.name),this.$telemetry.trackNodeParametersValuesChange(s.name,e)}else{this.nodeValues={...this.nodeValues,[e.name]:t};const s={name:n.name,key:e.name,value:t};this.workflowsStore.setNodeValue(s)}},setNodeValues(){if(!this.node){this.nodeValuesInitialized=!0;return}if(this.nodeType!==null){this.nodeValid=!0;const e=[];this.node.color&&(e.push("color"),this.nodeValues={...this.nodeValues,color:this.node.color}),this.node.notes&&(e.push("notes"),this.nodeValues={...this.nodeValues,notes:this.node.notes}),this.node.alwaysOutputData&&(e.push("alwaysOutputData"),this.nodeValues={...this.nodeValues,alwaysOutputData:this.node.alwaysOutputData}),this.node.executeOnce&&(e.push("executeOnce"),this.nodeValues={...this.nodeValues,executeOnce:this.node.executeOnce}),this.node.continueOnFail&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:"continueRegularOutput"}),this.node.onError&&(e.push("onError"),this.nodeValues={...this.nodeValues,onError:this.node.onError}),this.node.notesInFlow&&(e.push("notesInFlow"),this.nodeValues={...this.nodeValues,notesInFlow:this.node.notesInFlow}),this.node.retryOnFail&&(e.push("retryOnFail"),this.nodeValues={...this.nodeValues,retryOnFail:this.node.retryOnFail}),this.node.maxTries&&(e.push("maxTries"),this.nodeValues={...this.nodeValues,maxTries:this.node.maxTries}),this.node.waitBetweenTries&&(e.push("waitBetweenTries"),this.nodeValues={...this.nodeValues,waitBetweenTries:this.node.waitBetweenTries});for(const t of this.nodeSettings)e.includes(t.name)||(this.nodeValues={...this.nodeValues,[t.name]:t.default});this.nodeValues={...this.nodeValues,parameters:Te(this.node.parameters)}}else this.nodeValid=!1;this.nodeValuesInitialized=!0},onMissingNodeTextClick(e){e.target.localName==="a"&&this.$telemetry.track("user clicked cnr browse button",{source:"cnr missing node modal"})},onMissingNodeLearnMoreLinkClick(){var e,t;this.$telemetry.track("user clicked cnr docs link",{source:"missing node modal source",package_name:(e=this.node)==null?void 0:e.type.split(".")[0],node_type:(t=this.node)==null?void 0:t.type})},onStopExecution(){this.$emit("stopExecution")},openSettings(){this.openPanel="settings"}},mounted(){var e;this.populateHiddenIssuesSet(),this.populateSettings(),this.setNodeValues(),(e=this.eventBus)==null||e.on("openSettings",this.openSettings),this.updateNodeParameterIssues(this.node,this.nodeType)},beforeUnmount(){var e;(e=this.eventBus)==null||e.off("openSettings",this.openSettings)}}),Na="_header_1uxvz_5",ka="_warningIcon_1uxvz_9",ba="_descriptionContainer_1uxvz_14",Ta={header:Na,warningIcon:ka,descriptionContainer:ba},Sa={class:"header-side-menu"},Da={key:1},Ea={key:0,class:"node-is-not-valid"},Ca={class:"missingNodeTitleContainer mt-s mb-xs"},Ia={class:"mb-l"},Pa=["href"],Oa=["href","textContent"],Ra={key:1,class:"node-parameters-wrapper","data-test-id":"node-parameters"},$a={key:1,class:"no-parameters"},Aa={key:2,class:"parameter-item parameter-notice","data-test-id":"node-parameters-http-notice"},Ma={class:"node-version","data-test-id":"node-version"};function _a(e,t,o,n,i,s){var E;const a=S("NodeTitle"),r=S("NodeExecuteButton"),l=S("NodeSettingsTabs"),p=S("font-awesome-icon"),h=S("n8n-text"),d=S("i18n-t"),m=S("n8n-link"),N=S("n8n-notice"),k=S("node-webhooks"),w=S("node-credentials"),c=S("parameter-input-list"),f=S("n8n-block-ui");return u(),T("div",{class:D({"node-settings":!0,dragging:e.dragging}),onKeydown:t[1]||(t[1]=ie(()=>{},["stop"]))},[g("div",{class:D(e.$style.header)},[g("div",Sa,[e.node?(u(),P(a,{key:0,class:"node-name",modelValue:e.node.name,nodeType:e.nodeType,readOnly:e.isReadOnly,"onUpdate:modelValue":e.nameChanged},null,8,["modelValue","nodeType","readOnly","onUpdate:modelValue"])):C("",!0),e.isExecutable?(u(),T("div",Da,[!e.blockUI&&e.node&&e.nodeValid?(u(),P(r,{key:0,"data-test-id":"node-execute-button",nodeName:e.node.name,disabled:e.outputPanelEditMode.enabled&&!e.isTriggerNode,size:"small",telemetrySource:"parameters",onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution},null,8,["nodeName","disabled","onExecute","onStopExecution"])):C("",!0)])):C("",!0)]),e.node&&e.nodeValid?(u(),P(l,{key:0,modelValue:e.openPanel,"onUpdate:modelValue":t[0]||(t[0]=O=>e.openPanel=O),nodeType:e.nodeType,sessionId:e.sessionId},null,8,["modelValue","nodeType","sessionId"])):C("",!0)],2),e.node&&!e.nodeValid?(u(),T("div",Ea,[g("p",{class:D(e.$style.warningIcon)},[v(p,{icon:"exclamation-triangle"})],2),g("div",Ca,[v(h,{size:"large",color:"text-dark",bold:""},{default:y(()=>[I(b(e.$locale.baseText("nodeSettings.communityNodeUnknown.title")),1)]),_:1})]),e.isCommunityNode?(u(),T("div",{key:0,class:D(e.$style.descriptionContainer)},[g("div",Ia,[v(d,{keypath:"nodeSettings.communityNodeUnknown.description",tag:"span",onClick:e.onMissingNodeTextClick},{action:y(()=>[g("a",{href:`https://www.npmjs.com/package/${e.node.type.split(".")[0]}`,target:"_blank"},b(e.node.type.split(".")[0]),9,Pa)]),_:1},8,["onClick"])]),v(m,{to:e.COMMUNITY_NODES_INSTALLATION_DOCS_URL,onClick:e.onMissingNodeLearnMoreLinkClick},{default:y(()=>[I(b(e.$locale.baseText("nodeSettings.communityNodeUnknown.installLink.text")),1)]),_:1},8,["to","onClick"])],2)):(u(),P(d,{key:1,keypath:"nodeSettings.nodeTypeUnknown.description",tag:"span"},{action:y(()=>[g("a",{href:e.CUSTOM_NODES_DOCS_URL,target:"_blank",textContent:b(e.$locale.baseText("nodeSettings.nodeTypeUnknown.description.customNode"))},null,8,Oa)]),_:1}))])):C("",!0),e.node&&e.nodeValid?(u(),T("div",Ra,[e.hasForeignCredential?(u(),P(N,{key:0,content:e.$locale.baseText("nodeSettings.hasForeignCredential",{interpolate:{owner:e.credentialOwnerName}})},null,8,["content"])):C("",!0),z(g("div",null,[v(k,{node:e.node,nodeType:e.nodeType},null,8,["node","nodeType"]),e.nodeValuesInitialized?(u(),P(c,{key:0,parameters:e.parametersNoneSetting,hideDelete:!0,nodeValues:e.nodeValues,isReadOnly:e.isReadOnly,hiddenIssuesInputs:e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onActivate:e.onWorkflowActivate,onParameterBlur:e.onParameterBlur},{default:y(()=>[v(w,{node:e.node,readonly:e.isReadOnly,showAll:!0,onCredentialSelected:e.credentialSelected,onValueChanged:e.valueChanged,onBlur:e.onParameterBlur,"hide-issues":e.hiddenIssuesInputs.includes("credentials")},null,8,["node","readonly","onCredentialSelected","onValueChanged","onBlur","hide-issues"])]),_:1},8,["parameters","nodeValues","isReadOnly","hiddenIssuesInputs","onValueChanged","onActivate","onParameterBlur"])):C("",!0),e.parametersNoneSetting.length===0?(u(),T("div",$a,[v(h,null,{default:y(()=>[I(b(e.$locale.baseText("nodeSettings.thisNodeDoesNotHaveAnyParameters")),1)]),_:1})])):C("",!0),e.isCustomApiCallSelected(e.nodeValues)?(u(),T("div",Aa,[v(N,{content:e.$locale.baseText("nodeSettings.useTheHttpRequestNode",{interpolate:{nodeTypeDisplayName:e.nodeType.displayName}})},null,8,["content"])])):C("",!0)],512),[[J,e.openPanel==="params"]]),z(g("div",null,[v(c,{parameters:e.parametersSetting,nodeValues:e.nodeValues,isReadOnly:e.isReadOnly,hiddenIssuesInputs:e.hiddenIssuesInputs,path:"parameters",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","nodeValues","isReadOnly","hiddenIssuesInputs","onValueChanged","onParameterBlur"]),v(c,{parameters:e.nodeSettings,hideDelete:!0,nodeValues:e.nodeValues,isReadOnly:e.isReadOnly,hiddenIssuesInputs:e.hiddenIssuesInputs,path:"",onValueChanged:e.valueChanged,onParameterBlur:e.onParameterBlur},null,8,["parameters","nodeValues","isReadOnly","hiddenIssuesInputs","onValueChanged","onParameterBlur"]),g("div",Ma,[I(b(e.$locale.baseText("nodeSettings.nodeVersion",{interpolate:{node:(E=e.nodeType)==null?void 0:E.displayName,version:e.node.typeVersion.toString()}}))+" ",1),g("span",null,"("+b(e.nodeVersionTag)+")",1)])],512),[[J,e.openPanel==="settings"]])])):C("",!0),v(f,{show:e.blockUI},null,8,["show"])],34)}const Wa={$style:Ta},Va=H(va,[["render",_a],["__cssModules",Wa],["__scopeId","data-v-7be9a1a3"]]),Ba=x({name:"draggable",props:{disabled:{type:Boolean},type:{type:String},data:{type:String},tag:{type:String,default:"div"},targetDataKey:{type:String}},data(){const e={x:-100,y:-100};return{isDragging:!1,draggablePosition:e,draggingEl:null,draggableStyle:{transform:`translate(${e.x}px, ${e.y}px)`},animationFrameId:0}},computed:{...q(ee),canDrop(){return this.ndvStore.canDraggableDrop},stickyPosition(){return this.ndvStore.draggableStickyPos}},methods:{setDraggableStyle(){this.draggableStyle={transform:`translate(${this.draggablePosition.x}px, ${this.draggablePosition.y}px)`}},onDragStart(e){var o,n,i;if(this.disabled||(this.draggingEl=e.target,this.targetDataKey&&((o=this.draggingEl.dataset)==null?void 0:o.target)!==this.targetDataKey&&(this.draggingEl=this.draggingEl.closest(`[data-target="${this.targetDataKey}"]`)),this.targetDataKey&&((i=(n=this.draggingEl)==null?void 0:n.dataset)==null?void 0:i.target)!==this.targetDataKey))return;e.preventDefault(),e.stopPropagation(),this.isDragging=!1,this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),window.addEventListener("mousemove",this.onDrag),window.addEventListener("mouseup",this.onDragEnd);const t=document.activeElement;t&&t.blur()},onDrag(e){if(e.preventDefault(),e.stopPropagation(),!this.disabled){if(!this.isDragging){this.isDragging=!0;const t=this.targetDataKey&&this.draggingEl?this.draggingEl.dataset.value:this.data||"";this.ndvStore.draggableStartDragging({type:this.type,data:t||""}),this.$emit("dragstart",this.draggingEl),document.body.style.cursor="grabbing"}this.animationFrameId=window.requestAnimationFrame(()=>{this.canDrop&&this.stickyPosition?this.draggablePosition={x:this.stickyPosition[0],y:this.stickyPosition[1]}:this.draggablePosition={x:e.pageX,y:e.pageY},this.setDraggableStyle(),this.$emit("drag",this.draggablePosition)})}},onDragEnd(){this.disabled||(document.body.style.cursor="unset",window.removeEventListener("mousemove",this.onDrag),window.removeEventListener("mouseup",this.onDragEnd),window.cancelAnimationFrame(this.animationFrameId),setTimeout(()=>{this.$emit("dragend",this.draggingEl),this.isDragging=!1,this.draggingEl=null,this.ndvStore.draggableStopDragging()},0))}}}),La="_dragging_bt5wj_5",Ua="_draggable_bt5wj_10",xa={dragging:La,draggable:Ua,"draggable-data-transfer":"_draggable-data-transfer_bt5wj_17"};function Fa(e,t,o,n,i,s){return u(),P(yn(e.tag),{class:D({[e.$style.dragging]:e.isDragging}),onMousedown:e.onDragStart,ref:"wrapper"},{default:y(()=>[ae(e.$slots,"default",{isDragging:e.isDragging}),(u(),P(wn,{to:"body"},[z(g("div",{ref:"draggable",class:D(e.$style.draggable),style:se(e.draggableStyle)},[ae(e.$slots,"preview",{canDrop:e.canDrop,el:e.draggingEl})],6),[[J,e.isDragging]])]))]),_:3},40,["class","onMousedown"])}const Ha={$style:xa},za=H(Ba,[["render",Fa],["__cssModules",Ha]]),Ka=x({components:{Draggable:za},props:{canMoveRight:{type:Boolean},canMoveLeft:{type:Boolean}},methods:{onDrag(e){this.$emit("drag",e)},onDragStart(){this.$emit("dragstart")},onDragEnd(){this.$emit("dragend")}}}),ja="_dragContainer_4rvyw_5",Ya="_dragButton_4rvyw_9",Ga="_leftArrow_4rvyw_23 _arrow_4rvyw_32",qa="_rightArrow_4rvyw_24 _arrow_4rvyw_32",Ja="_visible_4rvyw_28",Xa="_arrow_4rvyw_32",Qa="_grid_4rvyw_50",Za={dragContainer:ja,dragButton:Ya,leftArrow:Ga,rightArrow:qa,visible:Ja,arrow:Xa,grid:Qa},er=g("div",null,[g("div"),g("div"),g("div"),g("div"),g("div")],-1),tr=g("div",null,[g("div"),g("div"),g("div"),g("div"),g("div")],-1),or=[er,tr];function nr(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("Draggable");return u(),P(r,{type:"panel-resize",onDrag:e.onDrag,onDragstart:e.onDragStart,onDragend:e.onDragEnd,class:D(e.$style.dragContainer)},{default:y(({isDragging:l})=>[g("div",{class:D({[e.$style.dragButton]:!0})},[e.canMoveLeft?(u(),T("span",{key:0,class:D({[e.$style.leftArrow]:!0,[e.$style.visible]:l})},[v(a,{icon:"arrow-left"})],2)):C("",!0),e.canMoveRight?(u(),T("span",{key:1,class:D({[e.$style.rightArrow]:!0,[e.$style.visible]:l})},[v(a,{icon:"arrow-right"})],2)):C("",!0),g("div",{class:D(e.$style.grid)},or,2)],2)]),_:1},8,["onDrag","onDragstart","onDragend","class"])}const ir={$style:Za},sr=H(Ka,[["render",nr],["__cssModules",ir]]),ar=["onClick","data-node-name","data-node-placement"],rr=x({__name:"NDVFloatingNodes",props:{rootNode:{},type:{}},emits:["switchSelectedNode"],setup(e,{expose:t,emit:o}){const n=e,i=Y(),s=G(),a=i.getCurrentWorkflow();function r(N){const k=h.value[N][0];k&&o("switchSelectedNode",k.node.name)}function l(N){if(N.shiftKey&&N.altKey&&(N.ctrlKey||N.metaKey)){const w={ArrowUp:"outputSub",ArrowRight:"outputMain",ArrowDown:"inputSub",ArrowLeft:"inputMain"}[N.key]||null;w&&r(w)}}function p(N){return N.map(k=>{const w=i.getNodeByName(k);if(w){const c=s.getNodeType(w.type);if(c)return{node:w,nodeType:c}}return null}).filter(k=>k!==null)}const h=Q(()=>{const N=n.rootNode.name;return{outputSub:p(a.getChildNodes(N,"ALL_NON_MAIN")),outputMain:p(a.getChildNodes(N,"main",1)),inputSub:p(a.getParentNodes(N,"ALL_NON_MAIN")),inputMain:p(a.getParentNodes(N,"main",1))}}),d=["outputSub","outputMain","inputSub","inputMain"],m={outputSub:"bottom",outputMain:"left",inputSub:"top",inputMain:"right"};return gn(()=>{document.addEventListener("keydown",l,!0)}),Ts(()=>{document.removeEventListener("keydown",l,!0)}),t({moveNodeDirection:r}),(N,k)=>{const w=S("n8n-tooltip");return u(),T("aside",{class:D(N.$style.floatingNodes)},[(u(),T(Z,null,de(d,c=>g("ul",{class:D([N.$style.nodesList,N.$style[c]]),key:c},[(u(!0),T(Z,null,de(h.value[c],({node:f,nodeType:E})=>(u(),T(Z,null,[f&&E?(u(),P(w,{placement:m[c],teleported:!1,key:f.name,offset:60},{content:y(()=>[I(b(f.name),1)]),default:y(()=>[g("li",{class:D(N.$style.connectedNode),onClick:O=>N.$emit("switchSelectedNode",f.name),"data-test-id":"floating-node","data-node-name":f.name,"data-node-placement":c},[v(Tt,{nodeType:E,nodeName:f.name,"tooltip-position":m[c],size:35,circle:""},null,8,["nodeType","nodeName","tooltip-position"])],10,ar)]),_:2},1032,["placement"])):C("",!0)],64))),256))],2)),64))],2)}}}),lr="_floatingNodes_htxl9_5",dr="_nodesList_htxl9_19",ur="_inputSub_htxl9_33",cr="_outputSub_htxl9_33",hr="_outputMain_htxl9_44",pr="_inputMain_htxl9_44",gr="_connectedNode_htxl9_67",fr={floatingNodes:lr,nodesList:dr,inputSub:ur,outputSub:cr,outputMain:hr,inputMain:pr,connectedNode:gr},mr={$style:fr},yr=H(rr,[["__cssModules",mr]]),Ne=24,Ko=80,Me=280,wr=320,vr=420,Nr={regular:_e,dragless:_e,unknown:_e,inputless:_e,wide:_e*2},kr=x({name:"NDVDraggablePanels",mixins:[Ft],components:{PanelDragButton:sr,NDVFloatingNodes:yr},props:{isDraggable:{type:Boolean},hideInputAndOutput:{type:Boolean},position:{type:Number},nodeType:{type:Object,default:()=>({})}},data(){return{windowWidth:1,isDragging:!1,MIN_PANEL_WIDTH:Me,initialized:!1}},mounted(){this.setTotalWidth(),this.mainPanelDimensions.relativeLeft===1&&this.mainPanelDimensions.relativeRight===1&&(this.setMainPanelWidth(),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)),this.restorePositionData()),window.addEventListener("resize",this.setTotalWidth),this.$emit("init",{position:this.mainPanelDimensions.relativeLeft}),setTimeout(()=>{this.initialized=!0},0),gt.on("setPositionByName",this.setPositionByName)},beforeUnmount(){window.removeEventListener("resize",this.setTotalWidth),gt.off("setPositionByName",this.setPositionByName)},computed:{...q(ee),mainPanelDimensions(){return this.ndvStore.getMainPanelDimensions(this.currentNodePaneType)},activeNode(){return this.ndvStore.activeNode},supportedResizeDirections(){const e=["right"];return this.isDraggable&&e.push("left"),e},currentNodePaneType(){return this.hasInputSlot?this.isDraggable?this.nodeType===null?"unknown":me(this,"nodeType.parameterPane")||"regular":"dragless":"inputless"},hasInputSlot(){return this.$slots.input!==void 0},inputPanelMargin(){return this.pxToRelativeWidth(Ko)},minWindowWidth(){return 2*(Ne+Ko)+Me},minimumLeftPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.hasInputSlot?this.pxToRelativeWidth(Ne+20)+this.inputPanelMargin:this.pxToRelativeWidth(Ne)},maximumRightPosition(){return this.windowWidth<this.minWindowWidth?this.pxToRelativeWidth(1):this.pxToRelativeWidth(Ne+20)+this.inputPanelMargin},canMoveLeft(){return this.mainPanelDimensions.relativeLeft>this.minimumLeftPosition},canMoveRight(){return this.mainPanelDimensions.relativeRight>this.maximumRightPosition},mainPanelStyles(){return{left:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeLeft)}px`,right:`${this.relativeWidthToPx(this.mainPanelDimensions.relativeRight)}px`}},inputPanelStyles(){return{right:`${this.relativeWidthToPx(this.calculatedPositions.inputPanelRelativeRight)}px`}},outputPanelStyles(){return{left:`${this.relativeWidthToPx(this.calculatedPositions.outputPanelRelativeLeft)}px`,transform:`translateX(-${this.relativeWidthToPx(this.outputPanelRelativeTranslate)}px)`}},calculatedPositions(){const e=this.$slots.input!==void 0,t=this.mainPanelDimensions.relativeLeft+this.mainPanelDimensions.relativeWidth;return{inputPanelRelativeRight:e?1-t+this.mainPanelDimensions.relativeWidth:1-this.pxToRelativeWidth(Ne),outputPanelRelativeLeft:t}},outputPanelRelativeTranslate(){const e=1-this.pxToRelativeWidth(Me+Ne),t=this.calculatedPositions.outputPanelRelativeLeft-e;return t>0?t:0},hasDoubleWidth(){return me(this,"nodeType.parameterPane")==="wide"},fixedPanelWidth(){const e=this.hasDoubleWidth?2:1;return this.windowWidth>1700?vr*e:wr*e},isBelowMinWidthMainPanel(){const e=this.pxToRelativeWidth(Me);return this.mainPanelDimensions.relativeWidth<e}},watch:{windowWidth(e){const t=this.pxToRelativeWidth(Me);this.isBelowMinWidthMainPanel&&this.setMainPanelWidth(t);const o=this.minimumLeftPosition>this.mainPanelDimensions.relativeLeft,n=this.maximumRightPosition>this.mainPanelDimensions.relativeRight;e>this.minWindowWidth&&o&&n&&(this.setMainPanelWidth(t),this.setPositions(this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth))),this.setPositions(this.mainPanelDimensions.relativeLeft)}},methods:{onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},getInitialLeftPosition(e){return this.currentNodePaneType==="dragless"?this.pxToRelativeWidth(Ne+1+this.fixedPanelWidth):this.hasInputSlot?.5-e/2:this.minimumLeftPosition},setMainPanelWidth(e){const t=e||this.pxToRelativeWidth(Nr[this.currentNodePaneType]);this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeWidth:t}})},setPositions(e){const t=e||1-this.calculatedPositions.inputPanelRelativeRight,o=1-t-this.mainPanelDimensions.relativeWidth,n=this.maximumRightPosition>o,i=this.minimumLeftPosition>t,s=this.currentNodePaneType==="inputless";if(i){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:this.minimumLeftPosition,relativeRight:1-this.mainPanelDimensions.relativeWidth-this.minimumLeftPosition}});return}if(n){this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:1-this.mainPanelDimensions.relativeWidth-this.maximumRightPosition,relativeRight:this.maximumRightPosition}});return}this.ndvStore.setMainPanelDimensions({panelType:this.currentNodePaneType,dimensions:{relativeLeft:s?this.minimumLeftPosition:t,relativeRight:o}})},setPositionByName(e){const t={minLeft:this.minimumLeftPosition,maxRight:this.maximumRightPosition,initial:this.getInitialLeftPosition(this.mainPanelDimensions.relativeWidth)};this.setPositions(t[e])},pxToRelativeWidth(e){return e/this.windowWidth},relativeWidthToPx(e){return e*this.windowWidth},onResizeStart(){this.setTotalWidth()},onResizeEnd(){this.storePositionData()},onResizeDebounced(e){this.initialized&&this.callDebounced("onResize",{debounceTime:10,trailing:!0},e)},onResize({direction:e,x:t,width:o}){const n=this.pxToRelativeWidth(t),i=this.pxToRelativeWidth(o);e==="left"&&n<=this.minimumLeftPosition||e==="right"&&1-n<=this.maximumRightPosition||o<=Me||(this.setMainPanelWidth(i),this.setPositions(e==="left"?n:this.mainPanelDimensions.relativeLeft))},restorePositionData(){const e=De(`${Jt}_${this.currentNodePaneType}`).value;if(e){const t=parseFloat(e);this.setMainPanelWidth(t);const o=this.getInitialLeftPosition(t);return this.setPositions(o),!0}return!1},storePositionData(){De(`${Jt}_${this.currentNodePaneType}`).value=this.mainPanelDimensions.relativeWidth.toString()},onDragStart(){this.isDragging=!0,this.$emit("dragstart",{position:this.mainPanelDimensions.relativeLeft})},onDrag(e){const t=this.pxToRelativeWidth(e.x)-this.mainPanelDimensions.relativeWidth/2;this.setPositions(t)},onDragEnd(){setTimeout(()=>{this.isDragging=!1,this.$emit("dragend",{windowWidth:this.windowWidth,position:this.mainPanelDimensions.relativeLeft})},0),this.storePositionData()},setTotalWidth(){this.windowWidth=window.innerWidth},close(){this.$emit("close")}}}),br="_dataPanel_w56ig_5",Tr="_inputPanel_w56ig_14 _dataPanel_w56ig_5",Sr="_outputPanel_w56ig_22 _dataPanel_w56ig_5",Dr="_mainPanel_w56ig_30",Er="_draggable_w56ig_34",Cr="_mainPanelInner_w56ig_38",Ir="_dragging_w56ig_45",Pr="_dragButtonContainer_w56ig_58",Or="_visible_w56ig_74",Rr={dataPanel:br,inputPanel:Tr,outputPanel:Sr,mainPanel:Dr,draggable:Er,mainPanelInner:Cr,dragging:Ir,"double-width":"_double-width_w56ig_54",dragButtonContainer:Pr,visible:Or};function $r(e,t,o,n,i,s){const a=S("NDVFloatingNodes"),r=S("PanelDragButton"),l=S("n8n-resize-wrapper");return u(),T("div",null,[e.activeNode?(u(),P(a,{key:0,onSwitchSelectedNode:e.onSwitchSelectedNode,"root-node":e.activeNode,type:"input"},null,8,["onSwitchSelectedNode","root-node"])):C("",!0),e.hideInputAndOutput?C("",!0):(u(),T("div",{key:1,class:D(e.$style.inputPanel),style:se(e.inputPanelStyles)},[ae(e.$slots,"input")],6)),e.hideInputAndOutput?C("",!0):(u(),T("div",{key:2,class:D(e.$style.outputPanel),style:se(e.outputPanelStyles)},[ae(e.$slots,"output")],6)),g("div",{class:D(e.$style.mainPanel),style:se(e.mainPanelStyles)},[v(l,{isResizingEnabled:e.currentNodePaneType!=="unknown",width:e.relativeWidthToPx(e.mainPanelDimensions.relativeWidth),minWidth:e.MIN_PANEL_WIDTH,gridSize:20,onResize:e.onResizeDebounced,onResizestart:e.onResizeStart,onResizeend:e.onResizeEnd,supportedDirections:e.supportedResizeDirections},{default:y(()=>[g("div",{class:D(e.$style.dragButtonContainer)},[!e.hideInputAndOutput&&e.isDraggable?(u(),P(r,{key:0,class:D({[e.$style.draggable]:!0,[e.$style.visible]:e.isDragging}),canMoveLeft:e.canMoveLeft,canMoveRight:e.canMoveRight,onDragstart:e.onDragStart,onDrag:e.onDrag,onDragend:e.onDragEnd},null,8,["class","canMoveLeft","canMoveRight","onDragstart","onDrag","onDragend"])):C("",!0)],2),g("div",{class:D({[e.$style.mainPanelInner]:!0,[e.$style.dragging]:e.isDragging})},[ae(e.$slots,"main")],2)]),_:3},8,["isResizingEnabled","width","minWidth","onResize","onResizestart","onResizeend","supportedDirections"])],6)])}const Ar={$style:Rr},Mr=H(kr,[["render",$r],["__cssModules",Ar]]),_r={allowVulnerableTags:!1,enforceHtmlBoundary:!1,disallowedTagsMode:"discard",allowedTags:[...Xt.defaults.allowedTags,"style","img","title"],allowedAttributes:{...Xt.defaults.allowedAttributes,"*":["class","style"]},transformTags:{head:""}},Wr={name:"RunDataHtml",props:{inputHtml:{type:String}},computed:{sanitizedHtml(){return _n(this.inputHtml,_r)}}},Vr=["srcdoc"];function Br(e,t,o,n,i,s){return u(),T("iframe",{class:"__html-display",srcdoc:s.sanitizedHtml},null,8,Vr)}const bn=H(Wr,[["render",Br]]),Lr=Object.freeze(Object.defineProperty({__proto__:null,default:bn},Symbol.toStringTag,{value:"Module"})),Ur=x({name:"BinaryDataDisplayEmbed",components:{VueJsonPretty:Nn,RunDataHtml:bn},props:{binaryData:{type:Object,required:!0}},data(){return{isLoading:!0,embedSource:"",error:!1,data:""}},computed:{...q(Y)},async mounted(){const{id:e,data:t,fileName:o,fileType:n,mimeType:i}=this.binaryData,s=n==="json",a=n==="html";if(!e)s||a?this.data=Nt(atob(t)):this.embedSource="data:"+i+";base64,"+t;else try{const r=this.workflowsStore.getBinaryUrl(e,"view",o,i);if(s||a){const l=await fetch(r,{credentials:"include"});this.data=await(s?l.json():l.text())}else this.embedSource=r}catch{this.error=!0}this.isLoading=!1},methods:{embedClass(){const{fileType:e}=this.binaryData;return[e??"other"]}}}),xr={key:0},Fr={key:1},Hr={key:2},zr={key:0,controls:"",autoplay:""},Kr=["src","type"],jr={key:1,controls:"",autoplay:""},Yr=["src","type"],Gr=["src"];function qr(e,t,o,n,i,s){const a=S("vue-json-pretty"),r=S("run-data-html");return u(),T("span",null,[e.isLoading?(u(),T("div",xr,"Loading binary data...")):e.error?(u(),T("div",Fr,"Error loading binary data")):(u(),T("span",Hr,[e.binaryData.fileType==="video"?(u(),T("video",zr,[g("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Kr),I(" "+b(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="audio"?(u(),T("audio",jr,[g("source",{src:e.embedSource,type:e.binaryData.mimeType},null,8,Yr),I(" "+b(e.$locale.baseText("binaryDataDisplay.yourBrowserDoesNotSupport")),1)])):e.binaryData.fileType==="json"?(u(),P(a,{key:2,data:e.data,deep:3,showLength:!0},null,8,["data"])):e.binaryData.fileType==="html"?(u(),P(r,{key:3,inputHtml:e.data},null,8,["inputHtml"])):(u(),T("embed",{key:4,src:e.embedSource,class:D(["binary-data",e.embedClass()])},null,10,Gr))]))])}const Jr=H(Ur,[["render",qr]]),Xr=x({name:"BinaryDataDisplay",mixins:[Oe],components:{BinaryDataDisplayEmbed:Jr},props:["displayData","windowVisible"],computed:{...q(Y),binaryData(){const e=this.getBinaryData(this.workflowRunData,this.displayData.node,this.displayData.runIndex,this.displayData.outputIndex);return e.length===0||this.displayData.index>=e.length||e[this.displayData.index][this.displayData.key]===void 0?null:e[this.displayData.index][this.displayData.key]},workflowRunData(){const e=this.workflowsStore.getWorkflowExecution;if(e===null)return null;const t=e.data;return t?t.resultData.runData:null}},methods:{closeWindow(){return this.$emit("close"),!1}}}),Qr={class:"binary-data-window-wrapper"},Zr={key:0};function el(e,t,o,n,i,s){var l;const a=S("n8n-button"),r=S("BinaryDataDisplayEmbed");return e.windowVisible?(u(),T("div",{key:0,class:D(["binary-data-window",(l=e.binaryData)==null?void 0:l.fileType])},[v(a,{onClick:ie(e.closeWindow,["stop"]),size:"small",class:"binary-data-window-back",title:e.$locale.baseText("binaryDataDisplay.backToOverviewPage"),icon:"arrow-left",label:e.$locale.baseText("binaryDataDisplay.backToList")},null,8,["onClick","title","label"]),g("div",Qr,[e.binaryData?(u(),P(r,{key:1,binaryData:e.binaryData},null,8,["binaryData"])):(u(),T("div",Zr,b(e.$locale.baseText("binaryDataDisplay.noDataFoundToDisplay")),1))])],2)):C("",!0)}const tl=H(Xr,[["render",el]]),ol=x({name:"NodeErrorView",mixins:[St],props:["error"],components:{VueJsonPretty:Nn},setup(){return{...He()}},computed:{...q(G,ee),displayCause(){return JSON.stringify(this.error.cause).length<on},parameters(){const e=this.ndvStore.activeNode;if(!e)return[];const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion);return t===null?[]:t.properties}},methods:{replacePlaceholders(e,t){const o=this.parameterDisplayName(e,!1),n=this.parameterDisplayName(e,!0);return t.replace(/%%PARAMETER%%/g,o).replace(/%%PARAMETER_FULL%%/g,n)},getErrorDescription(){var o;if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return It(this.error.description+this.$locale.baseText("pushConnection.executionError.openNode",{interpolate:{node:this.error.node.name}}));if(!((o=this.error.context)!=null&&o.descriptionTemplate))return It(this.error.description);const t=this.parameterDisplayName(this.error.context.parameter);return It(this.error.context.descriptionTemplate.replace(/%%PARAMETER%%/g,t))},getErrorMessage(){var n;const e=this.$locale.baseText("nodeErrorView.error")+": ";if(this.error.name==="NodeOperationError"&&this.error.functionality==="configuration-node")return this.$locale.baseText("nodeErrorView.errorSubNode",{interpolate:{node:this.error.node.name}});if(this.error.message===this.error.description)return e;if(!((n=this.error.context)!=null&&n.messageTemplate))return e+this.error.message;const o=this.parameterDisplayName(this.error.context.parameter);return e+this.error.context.messageTemplate.replace(/%%PARAMETER%%/g,o)},parameterDisplayName(e,t=!0){try{const o=this.parameterName(this.parameters,e.split("."));if(!o.length)throw new Error;return t?o.map(n=>n.displayName).join(" > "):o.pop().displayName}catch{return`Could not find parameter "${e}"`}},parameterName(e,t){let o=t.shift();if(o===void 0)return[];const n=o.match(/(.*)\[([\d])\]$/);n!==null&&n.length>0&&(o=n[1]);const i=e.find(s=>s.name===o);if(i===void 0)throw new Error(`Could not find parameter "${o}"`);return t.length===0?[i]:i.hasOwnProperty("options")?[i,...this.parameterName(i.options,t)]:i.hasOwnProperty("values")?[i,...this.parameterName(i.values,t)]:[i]},copyCause(){this.copyToClipboard(JSON.stringify(this.error.cause)),this.copySuccess()},copySuccess(){this.showMessage({title:this.$locale.baseText("nodeErrorView.showMessage.title"),type:"info"})}}}),nl={class:"error-header"},il=["textContent"],sl=["innerHTML"],al={class:"error-details__summary"},rl={class:"error-details__content"},ll={key:0},dl={key:1},ul={class:"clearfix box-card__title"},cl={key:2,class:"el-card box-card is-never-shadow el-card__body"},hl={class:"error-details__summary"},pl={key:0},gl={class:"error-details__summary"},fl={key:1},ml={class:"error-details__summary"},yl={key:3},wl={class:"clearfix box-card__title"},vl={key:4},Nl={class:"clearfix box-card__title"},kl=g("br",null,null,-1),bl={class:"box-card__subtitle"},Tl={key:0,class:"copy-button"},Sl={key:2},Dl={key:5},El={class:"clearfix box-card__title"};function Cl(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("el-card"),l=S("n8n-icon-button"),p=S("vue-json-pretty");return u(),T("div",null,[g("div",nl,[g("div",{class:"error-message",textContent:b(e.getErrorMessage())},null,8,il),e.error.description?(u(),T("div",{key:0,class:"error-description",innerHTML:e.getErrorDescription()},null,8,sl)):C("",!0)]),g("details",null,[g("summary",al,[v(a,{class:"error-details__icon",icon:"angle-right"}),I(" "+b(e.$locale.baseText("nodeErrorView.details")),1)]),g("div",rl,[e.error.context&&e.error.context.causeDetailed?(u(),T("div",ll,[v(r,{class:"box-card",shadow:"never"},{default:y(()=>[g("div",null,b(e.error.context.causeDetailed),1)]),_:1})])):C("",!0),e.error.timestamp?(u(),T("div",dl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",ul,[g("span",null,b(e.$locale.baseText("nodeErrorView.time")),1)])]),default:y(()=>[g("div",null,b(new Date(e.error.timestamp).toLocaleString()),1)]),_:1})])):C("",!0),e.error.context&&e.error.context.itemIndex!==void 0?(u(),T("div",cl,[g("span",hl,b(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+b(e.error.context.itemIndex)+" ",1),e.error.context.runIndex?(u(),T("span",pl,[I(" | "),g("span",gl,b(e.$locale.baseText("nodeErrorView.itemIndex"))+":",1),I(" "+b(e.error.context.runIndex),1)])):C("",!0),e.error.context.parameter?(u(),T("span",fl,[I(" | "),g("span",ml,b(e.$locale.baseText("nodeErrorView.inParameter"))+":",1),I(" "+b(e.parameterDisplayName(e.error.context.parameter)),1)])):C("",!0)])):C("",!0),e.error.httpCode?(u(),T("div",yl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",wl,[g("span",null,b(e.$locale.baseText("nodeErrorView.httpCode")),1)])]),default:y(()=>[g("div",null,b(e.error.httpCode),1)]),_:1})])):C("",!0),e.error.cause?(u(),T("div",vl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",Nl,[g("span",null,b(e.$locale.baseText("nodeErrorView.cause")),1),kl,g("span",bl,b(e.$locale.baseText("nodeErrorView.dataBelowMayContain")),1)])]),default:y(()=>[g("div",null,[e.displayCause?(u(),T("div",Tl,[v(l,{onClick:e.copyCause,title:e.$locale.baseText("nodeErrorView.copyToClipboard"),icon:"copy"},null,8,["onClick","title"])])):C("",!0),e.displayCause?(u(),P(p,{key:1,data:e.error.cause,deep:3,showLength:!0,selectableType:"single",path:"error",class:"json-data"},null,8,["data"])):(u(),T("span",Sl,[v(a,{icon:"info-circle"}),I(b(e.$locale.baseText("nodeErrorView.theErrorCauseIsTooLargeToBeDisplayed")),1)]))])]),_:1})])):C("",!0),e.error.stack?(u(),T("div",Dl,[v(r,{class:"box-card",shadow:"never"},{header:y(()=>[g("div",El,[g("span",null,b(e.$locale.baseText("nodeErrorView.stack")),1)])]),default:y(()=>[g("div",null,[g("pre",null,[g("code",null,b(e.error.stack),1)])])]),_:1})])):C("",!0)])])])}const Il=H(ol,[["render",Cl]]),Pl=Re(async()=>Ce(()=>import("./RunDataTable-Qas85Wnj.js"),__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,34,35,36,37,38,39,40,41,42,43,44,45,46]))),Ol=Re(async()=>Ce(()=>import("./RunDataJson-VFzb6R4m.js"),__vite__mapDeps([47,2,3,4,5,6,7,8,1,9,10,11,12,13,14,38,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42,43,44,45,48]))),Rl=Re(async()=>Ce(()=>import("./RunDataSchema-BB0j0bVA.js"),__vite__mapDeps([49,2,3,4,5,6,7,8,1,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,34,35,36,37,38,39,40,41,42,43,44,45,50]))),$l=Re(async()=>Ce(()=>Promise.resolve().then(()=>Lr),void 0)),Al=Re(async()=>Ce(()=>import("./RunDataSearch-0UjOZNT9.js"),__vite__mapDeps([51,2,3,4,5,6,7,8,1,9,10,11,12,13,14,52]))),Ml=x({name:"RunData",mixins:[Ie,pn,Oe,ze],components:{BinaryDataDisplay:tl,NodeErrorView:Il,CodeNodeEditor:Li,RunDataTable:Pl,RunDataJson:Ol,RunDataSchema:Rl,RunDataHtml:$l,RunDataSearch:Al},props:{nodeUi:{type:Object},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},tooMuchDataTitle:{type:String},noDataInBranchMessage:{type:String},isExecuting:{type:Boolean},executingMessage:{type:String},sessionId:{type:String},paneType:{type:String},overrideOutputs:{type:Array},mappingEnabled:{type:Boolean},distanceFromActive:{type:Number},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},setup(){return{...He()}},data(){return{connectionType:$.Main,binaryDataPreviewActive:!1,dataSize:0,showData:!1,outputIndex:0,binaryDataDisplayVisible:!1,binaryDataDisplayData:null,MAX_DISPLAY_DATA_SIZE:on,MAX_DISPLAY_ITEMS_AUTO_ALL:Wn,currentPage:1,pageSize:10,pageSizes:[10,25,50,100],pinDataDiscoveryTooltipVisible:!1,isControlledPinDataTooltip:!1,search:""}},mounted(){this.init(),this.isPaneTypeInput||this.showPinDataDiscoveryTooltip(this.jsonData),this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:this.currentOutputIndex}),this.paneType==="output"&&(this.setDisplayMode(),this.activatePane())},beforeUnmount(){this.hidePinDataDiscoveryTooltip()},computed:{...q(G,ee,Y),activeNode(){return this.ndvStore.activeNode},dataPinningDocsUrl(){return Vn},dataEditingDocsUrl(){return Bn},displayMode(){return this.ndvStore.getPanelDisplayMode(this.paneType)},node(){return this.nodeUi||null},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isSchemaView(){return this.displayMode==="schema"},isTriggerNode(){return this.node===null?!1:this.nodeTypesStore.isTriggerNode(this.node.type)},canPinData(){if(this.node===null)return!1;const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name),o=ge(e,t,this.nodeType);return!!!fe(o).find(s=>s!==$.Main)&&!this.isPaneTypeInput&&this.isPinDataNodeType&&!(this.binaryData&&this.binaryData.length>0)},buttons(){var o;const e=[{label:this.$locale.baseText("runData.table"),value:"table"},{label:this.$locale.baseText("runData.json"),value:"json"}];this.binaryData.length&&e.push({label:this.$locale.baseText("runData.binary"),value:"binary"});const t={label:this.$locale.baseText("runData.schema"),value:"schema"};return this.isPaneTypeInput&&!Qt(this.jsonData)?e.unshift(t):e.push(t),this.isPaneTypeOutput&&((o=this.activeNode)==null?void 0:o.type)===Zt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&e.unshift({label:"HTML",value:"html"}),e},hasNodeRun(){return!!(!this.isExecuting&&this.node&&(this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name)||this.hasPinData))},isArtificialRecoveredEventItem(){var e,t,o;return!!((o=(t=(e=this.rawInputData)==null?void 0:e[0])==null?void 0:t.json)!=null&&o.isArtificialRecoveredEventItem)},subworkflowExecutionError(){return this.workflowsStore.subWorkflowExecutionError},hasSubworkflowExecutionError(){return!!this.subworkflowExecutionError},hasRunError(){var e,t,o;return!!(this.node&&((o=(t=(e=this.workflowRunData)==null?void 0:e[this.node.name])==null?void 0:t[this.runIndex])!=null&&o.error))},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},dataCount(){return this.getDataCount(this.runIndex,this.currentOutputIndex)},unfilteredDataCount(){return this.pinData?this.pinData.length:this.rawInputData.length},dataSizeInMB(){return(this.dataSize/1024/1e3).toLocaleString()},maxOutputIndex(){if(this.node===null||this.runIndex===void 0)return 0;const e=this.workflowRunData;if(e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<this.runIndex)return 0;if(e[this.node.name][this.runIndex]){const t=e[this.node.name][this.runIndex].data;if(t!=null&&t.main)return t.main.length-1}return 0},currentPageOffset(){return this.pageSize*(this.currentPage-1)},maxRunIndex(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length-1:0},rawInputData(){return this.getRawInputData(this.runIndex,this.currentOutputIndex,this.connectionType)},inputData(){const e=this.getPinDataOrLiveData(this.rawInputData);return this.getFilteredData(e)},inputDataPage(){const e=this.pageSize*(this.currentPage-1);return this.inputData.slice(e,e+this.pageSize)},jsonData(){return eo(this.inputData)},binaryData(){return this.node?this.getBinaryData(this.workflowRunData,this.node.name,this.runIndex,this.currentOutputIndex).filter(t=>!!(t&&Object.keys(t).length)):[]},currentOutputIndex(){var e;return(e=this.overrideOutputs)!=null&&e.length&&!this.overrideOutputs.includes(this.outputIndex)?this.overrideOutputs[0]:this.outputIndex},branches(){var o;const e=n=>n.charAt(0).toLocaleUpperCase()+n.slice(1),t=[];for(let n=0;n<=this.maxOutputIndex;n++){if(this.overrideOutputs&&!this.overrideOutputs.includes(n))continue;const i=this.getRawInputData(this.runIndex,n).length,s=this.getDataCount(this.runIndex,n),a=this.search?this.$locale.baseText("ndv.search.items",{adjustToNumber:i,interpolate:{matched:s,total:i}}):this.$locale.baseText("ndv.output.items",{adjustToNumber:s,interpolate:{count:s}});let r=this.getOutputName(n);if(`${r}`==`${n}`)r=`${this.$locale.baseText("ndv.output")} ${r}`;else{const l=Ln.includes((o=this.node)==null?void 0:o.type)?"":` ${this.$locale.baseText("ndv.output.branch")}`;r=e(`${this.getOutputName(n)}${l}`)}t.push({label:this.search&&s||i?`${r} (${a})`:r,value:n})}return t},editMode(){return this.isPaneTypeInput?{enabled:!1,value:""}:this.ndvStore.outputPanelEditMode},isPaneTypeInput(){return this.paneType==="input"},isPaneTypeOutput(){return this.paneType==="output"},readOnlyEnv(){return this.sourceControlStore.preferences.branchReadOnly},showIOSearch(){return this.hasNodeRun&&!this.hasRunError},showIoSearchNoMatchContent(){return this.hasNodeRun&&!this.inputData.length&&this.search}},methods:{getResolvedNodeOutputs(){if(this.node&&this.nodeType){const e=this.workflowsStore.getCurrentWorkflow(),t=e.getNode(this.node.name);if(t)return ve(e,t,this.nodeType)}return[]},onItemHover(e){if(e===null){this.$emit("itemHover",null);return}this.$emit("itemHover",{outputIndex:this.currentOutputIndex,itemIndex:e})},onClickDataPinningDocsLink(){var e;this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:(e=this.activeNode)==null?void 0:e.type,pane:"output",type:"data-pinning-docs"})},showPinDataDiscoveryTooltip(e){if(!this.isTriggerNode)return;const t=De(oo).value;e&&e.length>0&&!this.isReadOnlyRoute&&!t&&(this.pinDataDiscoveryComplete(),setTimeout(()=>{this.isControlledPinDataTooltip=!0,this.pinDataDiscoveryTooltipVisible=!0,we.emit("data-pinning-discovery",{isTooltipVisible:!0})},500))},hidePinDataDiscoveryTooltip(){this.pinDataDiscoveryTooltipVisible&&(this.isControlledPinDataTooltip=!1,this.pinDataDiscoveryTooltipVisible=!1,we.emit("data-pinning-discovery",{isTooltipVisible:!1}))},pinDataDiscoveryComplete(){De(oo).value="true",De(Wt).value="true"},enterEditMode({origin:e}){var n;const t=this.pinData?to(this.pinData):eo(this.rawInputData),o=t.length>0?t:Un;this.ndvStore.setOutputPanelEditModeEnabled(!0),this.ndvStore.setOutputPanelEditModeValue(JSON.stringify(o,null,2)),this.$telemetry.track("User opened ndv edit state",{node_type:(n=this.activeNode)==null?void 0:n.type,click_type:e==="editIconButton"?"button":"link",session_id:this.sessionId,run_index:this.runIndex,is_output_present:this.hasNodeRun||this.hasPinData,view:!this.hasNodeRun&&!this.hasPinData?"undefined":this.displayMode,is_data_pinned:this.hasPinData})},onClickCancelEdit(){this.ndvStore.setOutputPanelEditModeEnabled(!1),this.ndvStore.setOutputPanelEditModeValue(""),this.onExitEditMode({type:"cancel"})},onClickSaveEdit(){if(!this.node)return;const{value:e}=this.editMode;this.clearAllStickyNotifications();try{this.setPinData(this.node,to(e),"save-edit")}catch(t){console.error(t);return}this.ndvStore.setOutputPanelEditModeEnabled(!1),this.onExitEditMode({type:"save"})},onExitEditMode({type:e}){var t;this.$telemetry.track("User closed ndv edit state",{node_type:(t=this.activeNode)==null?void 0:t.type,session_id:this.sessionId,run_index:this.runIndex,view:this.displayMode,type:e})},async onTogglePinData({source:e}){if(this.node){if(e==="pin-icon-click"){const t={node_type:this.activeNode.type,session_id:this.sessionId,run_index:this.runIndex,view:!this.hasNodeRun&&!this.hasPinData?"none":this.displayMode};this.$externalHooks().run("runData.onTogglePinData",t),this.$telemetry.track("User clicked pin data icon",t)}if(this.updateNodeParameterIssues(this.node),this.hasPinData){this.unsetPinData(this.node,e);return}try{this.setPinData(this.node,this.rawInputData,"pin-icon-click")}catch(t){console.error(t);return}this.maxRunIndex>0&&this.showToast({title:this.$locale.baseText("ndv.pinData.pin.multipleRuns.title",{interpolate:{index:`${this.runIndex}`}}),message:this.$locale.baseText("ndv.pinData.pin.multipleRuns.description"),type:"success",duration:2e3}),this.hidePinDataDiscoveryTooltip(),this.pinDataDiscoveryComplete()}},switchToBinary(){this.onDisplayModeChange("binary")},onBranchChange(e){this.outputIndex=e,this.$telemetry.track("User changed ndv branch",{session_id:this.sessionId,branch_index:e,node_type:this.activeNode.type,node_type_input_selection:this.nodeType?this.nodeType.name:"",pane:this.paneType})},showTooMuchData(){this.showData=!0,this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,type:"showTooMuchData"})},toggleLinkRuns(){this.linkedRuns?this.unlinkRun():this.linkRun()},linkRun(){this.$emit("linkRun")},unlinkRun(){this.$emit("unlinkRun")},onCurrentPageChange(e){var t;this.currentPage=e,this.$telemetry.track("User changed ndv page",{node_type:(t=this.activeNode)==null?void 0:t.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onPageSizeChange(e){var o;this.pageSize=e;const t=Math.ceil(this.dataCount/this.pageSize);t<this.currentPage&&(this.currentPage=t),this.$telemetry.track("User changed ndv page size",{node_type:(o=this.activeNode)==null?void 0:o.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType,page_selected:this.currentPage,page_size:this.pageSize,items_total:this.dataCount})},onDisplayModeChange(e){const t=this.displayMode;this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:e});const o=this.$refs.dataContainer;if(o){const n=o.children[0];n&&n.scrollTo(0,0)}this.closeBinaryDataDisplay(),this.$externalHooks().run("runData.displayModeChanged",{newValue:e,oldValue:t}),this.activeNode&&this.$telemetry.track("User changed ndv item view",{previous_view:t,new_view:e,node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:this.paneType})},getRunLabel(e){let t=0;for(let i=0;i<=this.maxOutputIndex;i++)t+=this.getPinDataOrLiveData(this.getRawInputData(e-1,i)).length;const o=this.$locale.baseText("ndv.output.items",{adjustToNumber:t,interpolate:{count:t}}),n=t>0?` (${o})`:"";return e+this.$locale.baseText("ndv.output.of")+(this.maxRunIndex+1)+n},getRawInputData(e,t,o=$.Main){let n=[];return this.node&&(n=this.getNodeInputData(this.node,e,t,this.paneType,o)),n.length===0||!Array.isArray(n)?[]:n},getPinDataOrLiveData(e){return this.pinData&&!this.isProductionExecutionPreview?Array.isArray(this.pinData)?this.pinData.map(t=>({json:t})):[{json:this.pinData}]:e},getFilteredData(e){return this.search?(this.currentPage=1,e.filter(({json:t})=>xn(t,this.search))):e},getDataCount(e,t,o=$.Main){var s,a,r;if(!this.node)return 0;if((r=(a=(s=this.workflowRunData)==null?void 0:s[this.node.name])==null?void 0:a[e])!=null&&r.hasOwnProperty("error"))return 1;const n=this.getRawInputData(e,t,o),i=this.getPinDataOrLiveData(n);return this.getFilteredData(i).length},init(){this.outputIndex=0,this.refreshDataSize(),this.closeBinaryDataDisplay();let e=[];if(this.nodeType!==null&&this.node!==null){const t=this.getResolvedNodeOutputs();e=fe(t)}this.connectionType=e.length===0?$.Main:e[0],this.binaryData.length>0?this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"binary"}):this.displayMode==="binary"&&this.ndvStore.setPanelDisplayMode({pane:this.paneType,mode:"table"})},closeBinaryDataDisplay(){this.binaryDataDisplayVisible=!1,this.binaryDataDisplayData=null},clearExecutionData(){this.workflowsStore.setWorkflowExecutionData(null),this.updateNodesExecutionIssues()},isViewable(e,t){const{fileType:o}=this.binaryData[e][t];return!!o&&["image","audio","video","text","json","pdf","html"].includes(o)},isDownloadable(e,t){const{mimeType:o,fileName:n}=this.binaryData[e][t];return!!(o&&n)},async downloadBinaryData(e,t){const{id:o,data:n,fileName:i,fileExtension:s,mimeType:a}=this.binaryData[e][t];if(o){const r=this.workflowsStore.getBinaryUrl(o,"download",i,a);At.saveAs(r,[i,s].join("."));return}else{const r="data:"+a+";base64,"+n,l=await fetch(r).then(async p=>p.blob());At.saveAs(l,i)}},async downloadJsonData(){const e=this.node.name.replace(/[^\w\d]/g,"_"),t=new Blob([JSON.stringify(this.rawInputData,null,2)],{type:"application/json"});At.saveAs(t,`${e}.json`)},displayBinaryData(e,t){this.binaryDataDisplayVisible=!0,this.binaryDataDisplayData={node:this.node.name,runIndex:this.runIndex,outputIndex:this.currentOutputIndex,index:e,key:t}},getOutputName(e){if(this.node===null)return e+1;const t=this.nodeType,o=this.getResolvedNodeOutputs(),n=o==null?void 0:o[e];return n&&Ps(n)?n==null?void 0:n.displayName:!(t!=null&&t.outputNames)||t.outputNames.length<=e?e+1:t.outputNames[e]},refreshDataSize(){this.showData=!1;const e=this.inputDataPage.map(t=>t.json);this.dataSize=JSON.stringify(e).length,this.dataSize<this.MAX_DISPLAY_DATA_SIZE&&(this.showData=!0)},onRunIndexChange(e){this.$emit("runChange",e)},enableNode(){if(this.node){const e={name:this.node.name,properties:{disabled:!this.node.disabled}};this.workflowsStore.updateNodeProperties(e)}},setDisplayMode(){if(!this.activeNode)return;this.activeNode.type===Zt&&this.activeNode.parameters.operation==="generateHtmlTemplate"&&this.ndvStore.setPanelDisplayMode({pane:"output",mode:"html"})},activatePane(){this.$emit("activatePane")},onSearchClear(){this.search="",document.dispatchEvent(new KeyboardEvent("keyup",{key:"/"}))}},watch:{node(){this.init()},hasNodeRun(){this.paneType==="output"&&this.setDisplayMode()},inputDataPage:{handler(e){this.paneType&&e&&this.ndvStore.setNDVPanelDataIsEmpty({panel:this.paneType,isEmpty:e.every(t=>Qt(t.json))})},immediate:!0,deep:!0},jsonData(e){this.refreshDataSize(),this.showPinDataDiscoveryTooltip(e)},binaryData(e,t){e.length&&!t.length&&this.displayMode!=="binary"?this.switchToBinary():!e.length&&this.displayMode==="binary"&&this.onDisplayModeChange("table")},currentOutputIndex(e){this.ndvStore.setNDVBranchIndex({pane:this.paneType,branchIndex:e})},search(e){this.$emit("search",e)}}}),_l="_infoIcon_dosb5_5",Wl="_center_dosb5_9",Vl="_container_dosb5_23",Bl="_pinnedDataCallout_dosb5_32",Ll="_header_dosb5_40",Ul="_dataContainer_dosb5_54",xl="_dataDisplay_dosb5_63",Fl="_tabs_dosb5_75",Hl="_itemsCount_dosb5_82",zl="_runSelector_dosb5_90",Kl="_runSelectorWrapper_dosb5_99",jl="_pagination_dosb5_104",Yl="_pageSizeSelector_dosb5_114",Gl="_binaryIndex_dosb5_120",ql="_binaryRow_dosb5_137",Jl="_binaryCell_dosb5_142",Xl="_binaryHeader_dosb5_154",Ql="_binaryButtonContainer_dosb5_163",Zl="_binaryValue_dosb5_174",ed="_displayModes_dosb5_179",td="_tooltipContain_dosb5_185",od="_pinDataButton_dosb5_189",nd="_spinner_dosb5_193",id="_editMode_dosb5_204",sd="_editModeBody_dosb5_213",ad="_editModeFooter_dosb5_220",rd="_editModeFooterInfotip_dosb5_230",ld="_editModeActions_dosb5_236",dd="_stretchVertically_dosb5_243",ud="_uiBlocker_dosb5_247",cd={infoIcon:_l,center:Wl,container:Vl,pinnedDataCallout:Bl,header:Ll,dataContainer:Ul,"actions-group":"_actions-group_dosb5_59",dataDisplay:xl,tabs:Fl,itemsCount:Hl,runSelector:zl,runSelectorWrapper:Kl,pagination:jl,pageSizeSelector:Yl,binaryIndex:Gl,binaryRow:ql,binaryCell:Jl,binaryHeader:Xl,binaryButtonContainer:Ql,binaryValue:Zl,displayModes:ed,tooltipContain:td,pinDataButton:od,spinner:nd,editMode:id,editModeBody:sd,editModeFooter:ad,editModeFooterInfotip:rd,editModeActions:ld,stretchVertically:dd,uiBlocker:ud},hd={key:0,class:"ml-4xs"},pd={key:0},gd=["innerHTML"],fd=["data-test-id"],md={key:0},yd={key:1},wd={key:2},vd={key:3},Nd={key:4};function kd(e,t,o,n,i,s){const a=S("n8n-link"),r=S("n8n-callout"),l=S("BinaryDataDisplay"),p=S("n8n-radio-buttons"),h=S("n8n-icon-button"),d=S("n8n-text"),m=S("n8n-tooltip"),N=S("n8n-button"),k=S("n8n-option"),w=S("n8n-select"),c=S("run-data-search"),f=S("n8n-tabs"),E=S("n8n-spinner"),O=S("code-node-editor"),R=S("n8n-info-tip"),W=S("NodeErrorView"),V=S("i18n-t"),A=S("run-data-table"),L=S("run-data-json"),_=S("run-data-html"),te=S("run-data-schema"),Ke=S("el-pagination"),B=S("n8n-block-ui");return u(),T("div",{class:D(["run-data",e.$style.container]),onMouseover:t[14]||(t[14]=(...M)=>e.activatePane&&e.activatePane(...M))},[e.canPinData&&e.hasPinData&&!e.editMode.enabled&&!e.isProductionExecutionPreview?(u(),P(r,{key:0,theme:"secondary",icon:"thumbtack",class:D(e.$style.pinnedDataCallout)},{trailingContent:y(()=>[v(a,{to:e.dataPinningDocsUrl,size:"small",theme:"secondary",bold:"",underline:"",onClick:e.onClickDataPinningDocsLink},{default:y(()=>[I(b(e.$locale.baseText("runData.pindata.learnMore")),1)]),_:1},8,["to","onClick"])]),default:y(()=>[I(b(e.$locale.baseText("runData.pindata.thisDataIsPinned"))+" ",1),!e.isReadOnlyRoute&&!e.readOnlyEnv?(u(),T("span",hd,[v(a,{theme:"secondary",size:"small",underline:"",bold:"",onClick:t[0]||(t[0]=ie(M=>e.onTogglePinData({source:"banner-link"}),["stop"]))},{default:y(()=>[I(b(e.$locale.baseText("runData.pindata.unpin")),1)]),_:1})])):C("",!0)]),_:1},8,["class"])):C("",!0),v(l,{windowVisible:e.binaryDataDisplayVisible,displayData:e.binaryDataDisplayData,onClose:e.closeBinaryDataDisplay},null,8,["windowVisible","displayData","onClose"]),g("div",{class:D(e.$style.header)},[ae(e.$slots,"header",{},void 0,!0),z(g("div",{onClick:t[3]||(t[3]=ie(()=>{},["stop"])),class:D(e.$style.displayModes),"data-test-id":"run-data-pane-header"},[z(v(p,{modelValue:e.displayMode,options:e.buttons,"data-test-id":"ndv-run-data-display-mode","onUpdate:modelValue":e.onDisplayModeChange},null,8,["modelValue","options","onUpdate:modelValue"]),[[J,e.hasNodeRun&&(e.inputData.length||e.binaryData.length||e.search)&&!e.editMode.enabled]]),e.canPinData&&!e.isReadOnlyRoute&&!e.readOnlyEnv?z((u(),P(h,{key:0,title:e.$locale.baseText("runData.editOutput"),circle:!1,disabled:e.node.disabled,class:"ml-2xs",icon:"pencil-alt",type:"tertiary","data-test-id":"ndv-edit-pinned-data",onClick:t[1]||(t[1]=M=>e.enterEditMode({origin:"editIconButton"}))},null,8,["title","disabled"])),[[J,!e.editMode.enabled]]):C("",!0),e.canPinData&&e.rawInputData.length?z((u(),P(m,{key:1,placement:"bottom-end",visible:e.isControlledPinDataTooltip?e.isControlledPinDataTooltip&&e.pinDataDiscoveryTooltipVisible:void 0},Dt({default:y(()=>[v(h,{class:D(["ml-2xs",e.$style.pinDataButton]),type:"tertiary",active:e.hasPinData,icon:"thumbtack",disabled:e.editMode.enabled||e.rawInputData.length===0&&!e.hasPinData||e.isReadOnlyRoute||e.readOnlyEnv,onClick:t[2]||(t[2]=M=>e.onTogglePinData({source:"pin-icon-click"})),"data-test-id":"ndv-pin-data"},null,8,["class","active","disabled"])]),_:2},[e.isControlledPinDataTooltip?{name:"content",fn:y(()=>[g("div",{class:D(e.$style.tooltipContainer)},b(e.$locale.baseText("node.discovery.pinData.ndv")),3)]),key:"1"}:{name:"content",fn:y(()=>[g("div",{class:D(e.$style.tooltipContainer)},[g("strong",null,b(e.$locale.baseText("ndv.pinData.pin.title")),1),v(d,{size:"small",tag:"p"},{default:y(()=>[I(b(e.$locale.baseText("ndv.pinData.pin.description"))+" ",1),v(a,{to:e.dataPinningDocsUrl,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("ndv.pinData.pin.link")),1)]),_:1},8,["to"])]),_:1})],2)]),key:"0"}]),1032,["visible"])),[[J,!e.editMode.enabled]]):C("",!0),z(g("div",{class:D(e.$style.editModeActions)},[v(N,{type:"tertiary",label:e.$locale.baseText("runData.editor.cancel"),onClick:e.onClickCancelEdit},null,8,["label","onClick"]),v(N,{class:"ml-2xs",type:"primary",label:e.$locale.baseText("runData.editor.save"),onClick:e.onClickSaveEdit},null,8,["label","onClick"])],2),[[J,e.editMode.enabled]])],2),[[J,!e.hasRunError]])],2),e.maxRunIndex>0?z((u(),T("div",{key:1,class:D(e.$style.runSelector),"data-test-id":"run-selector"},[g("div",{class:D(e.$style.runSelectorWrapper)},[v(w,{size:"small",modelValue:e.runIndex,"onUpdate:modelValue":e.onRunIndexChange,onClick:t[4]||(t[4]=ie(()=>{},["stop"])),teleported:""},{prepend:y(()=>[I(b(e.$locale.baseText("ndv.output.run")),1)]),default:y(()=>[(u(!0),T(Z,null,de(e.maxRunIndex+1,M=>(u(),P(k,{label:e.getRunLabel(M),value:M-1,key:M},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"]),e.canLinkRuns?(u(),P(m,{key:0,placement:"right"},{content:y(()=>[I(b(e.$locale.baseText(e.linkedRuns?"runData.unlinking.hint":"runData.linking.hint")),1)]),default:y(()=>[v(h,{class:"linkRun",icon:e.linkedRuns?"unlink":"link",text:"",type:"tertiary",size:"small",onClick:e.toggleLinkRuns},null,8,["icon","onClick"])]),_:1})):C("",!0),ae(e.$slots,"run-info",{},void 0,!0)],2),e.showIOSearch?(u(),P(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[5]||(t[5]=M=>e.search=M),paneType:e.paneType,isAreaActive:e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","paneType","isAreaActive","onFocus"])):C("",!0)],2)),[[J,!e.editMode.enabled]]):C("",!0),ae(e.$slots,"before-data",{},void 0,!0),e.maxOutputIndex>0&&e.branches.length>1?(u(),T("div",{key:2,class:D(e.$style.tabs),"data-test-id":"branches"},[v(f,{modelValue:e.currentOutputIndex,options:e.branches,"onUpdate:modelValue":e.onBranchChange},null,8,["modelValue","options","onUpdate:modelValue"]),e.showIOSearch?(u(),P(c,{key:0,modelValue:e.search,"onUpdate:modelValue":t[6]||(t[6]=M=>e.search=M),paneType:e.paneType,isAreaActive:e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","paneType","isAreaActive","onFocus"])):C("",!0)],2)):e.hasNodeRun&&(e.dataCount>0&&e.maxRunIndex===0||e.search)&&!e.isArtificialRecoveredEventItem?z((u(),T("div",{key:3,class:D(e.$style.itemsCount),"data-test-id":"ndv-items-count"},[e.search?(u(),P(d,{key:0},{default:y(()=>[I(b(e.$locale.baseText("ndv.search.items",{adjustToNumber:e.unfilteredDataCount,interpolate:{matched:e.dataCount,total:e.unfilteredDataCount}})),1)]),_:1})):(u(),P(d,{key:1},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.items",{adjustToNumber:e.dataCount,interpolate:{count:e.dataCount}})),1)]),_:1})),e.showIOSearch?(u(),P(c,{key:2,modelValue:e.search,"onUpdate:modelValue":t[7]||(t[7]=M=>e.search=M),paneType:e.paneType,isAreaActive:e.isPaneActive,onFocus:e.activatePane},null,8,["modelValue","paneType","isAreaActive","onFocus"])):C("",!0)],2)),[[J,!e.editMode.enabled]]):C("",!0),g("div",{class:D(e.$style.dataContainer),ref:"dataContainer","data-test-id":"ndv-data-container"},[e.isExecuting?(u(),T("div",{key:0,class:D(e.$style.center),"data-test-id":"ndv-executing"},[g("div",{class:D(e.$style.spinner)},[v(E,{type:"ring"})],2),v(d,null,{default:y(()=>[I(b(e.executingMessage),1)]),_:1})],2)):e.editMode.enabled?(u(),T("div",{key:1,class:D(e.$style.editMode)},[g("div",{class:D([e.$style.editModeBody,"ignore-key-press"])},[v(O,{modelValue:e.editMode.value,language:"json","onUpdate:modelValue":t[8]||(t[8]=M=>e.ndvStore.setOutputPanelEditModeValue(M))},null,8,["modelValue"])],2),g("div",{class:D(e.$style.editModeFooter)},[v(R,{bold:!1,class:D(e.$style.editModeFooterInfotip)},{default:y(()=>[I(b(e.$locale.baseText("runData.editor.copyDataInfo"))+" ",1),v(a,{to:e.dataEditingDocsUrl,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("generic.learnMore")),1)]),_:1},8,["to"])]),_:1},8,["class"])],2)],2)):e.paneType==="output"&&e.hasSubworkflowExecutionError?(u(),T("div",{key:2,class:D(e.$style.stretchVertically)},[v(W,{error:e.subworkflowExecutionError,class:D(e.$style.errorDisplay)},null,8,["error","class"])],2)):e.hasNodeRun?e.paneType==="input"&&e.node.disabled?(u(),T("div",{key:4,class:D(e.$style.center)},[v(d,null,{default:y(()=>[I(b(e.$locale.baseText("ndv.input.disabled",{interpolate:{nodeName:e.node.name}}))+" ",1),v(a,{onClick:e.enableNode},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.disabled.cta")),1)]),_:1},8,["onClick"])]),_:1})],2)):e.hasNodeRun&&e.isArtificialRecoveredEventItem?(u(),T("div",{key:5,class:D(e.$style.center)},[ae(e.$slots,"recovered-artificial-output-data",{},void 0,!0)],2)):e.hasNodeRun&&e.hasRunError?(u(),T("div",{key:6,class:D(e.$style.stretchVertically)},[e.isPaneTypeInput?(u(),P(d,{key:0,class:D(e.$style.center),size:"large",tag:"p",bold:""},{default:y(()=>[I(b(e.$locale.baseText("nodeErrorView.inputPanel.previousNodeError.title",{interpolate:{nodeName:e.node.name}})),1)]),_:1},8,["class"])):e.$slots.content?ae(e.$slots,"content",{key:1},void 0,!0):(u(),P(W,{key:2,error:e.workflowRunData[e.node.name][e.runIndex].error,class:D(e.$style.dataDisplay)},null,8,["error","class"]))],2)):e.hasNodeRun&&(!e.unfilteredDataCount||e.search&&!e.dataCount)&&e.branches.length>1?(u(),T("div",{key:7,class:D(e.$style.center)},[e.search?(u(),T("div",pd,[v(d,{tag:"h3",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),v(d,null,{default:y(()=>[v(V,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:y(()=>[g("a",{href:"#",onClick:t[9]||(t[9]=(...M)=>e.onSearchClear&&e.onSearchClear(...M))},b(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})])):(u(),P(d,{key:1},{default:y(()=>[I(b(e.noDataInBranchMessage),1)]),_:1}))],2)):e.hasNodeRun&&!e.inputData.length&&!e.search?(u(),T("div",{key:8,class:D(e.$style.center)},[ae(e.$slots,"no-output-data",{},()=>[I("xxx")],!0)],2)):e.hasNodeRun&&!e.showData?(u(),T("div",{key:9,class:D(e.$style.center)},[v(d,{bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.tooMuchDataTitle),1)]),_:1}),v(d,{align:"center",tag:"div"},{default:y(()=>[g("span",{innerHTML:e.$locale.baseText("ndv.output.tooMuchData.message",{interpolate:{size:e.dataSizeInMB}})},null,8,gd)]),_:1}),v(N,{outline:"",label:e.$locale.baseText("ndv.output.tooMuchData.showDataAnyway"),onClick:e.showTooMuchData},null,8,["label","onClick"]),v(N,{size:"small",label:e.$locale.baseText("runData.downloadBinaryData"),onClick:t[10]||(t[10]=M=>e.downloadJsonData())},null,8,["label"])],2)):e.hasNodeRun&&e.$slots.content?ae(e.$slots,"content",{key:10},void 0,!0):e.hasNodeRun&&e.displayMode==="table"&&e.binaryData.length>0&&e.inputData.length===1&&Object.keys(e.jsonData[0]||{}).length===0?(u(),T("div",{key:11,class:D(e.$style.center)},[v(d,null,{default:y(()=>[I(b(e.$locale.baseText("runData.switchToBinary.info"))+" ",1),g("a",{onClick:t[11]||(t[11]=(...M)=>e.switchToBinary&&e.switchToBinary(...M))},b(e.$locale.baseText("runData.switchToBinary.binary")),1)]),_:1})],2)):e.showIoSearchNoMatchContent?(u(),T("div",{key:12,class:D(e.$style.center)},[v(d,{tag:"h3",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.search.noMatch.title")),1)]),_:1}),v(d,null,{default:y(()=>[v(V,{keypath:"ndv.search.noMatch.description",tag:"span"},{link:y(()=>[g("a",{href:"#",onClick:t[12]||(t[12]=(...M)=>e.onSearchClear&&e.onSearchClear(...M))},b(e.$locale.baseText("ndv.search.noMatch.description.link")),1)]),_:1})]),_:1})],2)):e.hasNodeRun&&e.displayMode==="table"?(u(),P(Se,{key:13},{default:y(()=>[v(A,{node:e.node,inputData:e.inputDataPage,mappingEnabled:e.mappingEnabled,distanceFromActive:e.distanceFromActive,runIndex:e.runIndex,pageOffset:e.currentPageOffset,totalRuns:e.maxRunIndex,hasDefaultHoverState:e.paneType==="input"&&!e.search,search:e.search,onMounted:t[13]||(t[13]=M=>e.$emit("tableMounted",M)),onActiveRowChanged:e.onItemHover,onDisplayModeChange:e.onDisplayModeChange},null,8,["node","inputData","mappingEnabled","distanceFromActive","runIndex","pageOffset","totalRuns","hasDefaultHoverState","search","onActiveRowChanged","onDisplayModeChange"])]),_:1})):e.hasNodeRun&&e.displayMode==="json"?(u(),P(Se,{key:14},{default:y(()=>[v(L,{paneType:e.paneType,editMode:e.editMode,sessioId:e.sessionId,node:e.node,inputData:e.inputDataPage,mappingEnabled:e.mappingEnabled,distanceFromActive:e.distanceFromActive,runIndex:e.runIndex,totalRuns:e.maxRunIndex,search:e.search},null,8,["paneType","editMode","sessioId","node","inputData","mappingEnabled","distanceFromActive","runIndex","totalRuns","search"])]),_:1})):e.hasNodeRun&&e.isPaneTypeOutput&&e.displayMode==="html"?(u(),P(Se,{key:15},{default:y(()=>[v(_,{inputHtml:e.inputDataPage[0].json.html},null,8,["inputHtml"])]),_:1})):e.hasNodeRun&&e.isSchemaView?(u(),P(Se,{key:16},{default:y(()=>[v(te,{data:e.jsonData,mappingEnabled:e.mappingEnabled,distanceFromActive:e.distanceFromActive,node:e.node,paneType:e.paneType,runIndex:e.runIndex,totalRuns:e.maxRunIndex,search:e.search},null,8,["data","mappingEnabled","distanceFromActive","node","paneType","runIndex","totalRuns","search"])]),_:1})):e.displayMode==="binary"&&e.binaryData.length===0?(u(),T("div",{key:17,class:D(e.$style.center)},[v(d,{align:"center",tag:"div"},{default:y(()=>[I(b(e.$locale.baseText("runData.noBinaryDataFound")),1)]),_:1})],2)):e.displayMode==="binary"?(u(),T("div",{key:18,class:D(e.$style.dataDisplay)},[(u(!0),T(Z,null,de(e.binaryData,(M,U)=>(u(),T("div",{key:U},[e.binaryData.length>1?(u(),T("div",{key:0,class:D(e.$style.binaryIndex)},[g("div",null,b(U+1),1)],2)):C("",!0),g("div",{class:D(e.$style.binaryRow)},[(u(!0),T(Z,null,de(M,(K,X)=>(u(),T("div",{class:D(e.$style.binaryCell),key:U+"_"+X},[g("div",{"data-test-id":"ndv-binary-data_"+U},[g("div",{class:D(e.$style.binaryHeader)},b(X),3),K.fileName?(u(),T("div",md,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.fileName"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.fileName),3)])):C("",!0),K.directory?(u(),T("div",yd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.directory"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.directory),3)])):C("",!0),K.fileExtension?(u(),T("div",wd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.fileExtension"))+":",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.fileExtension),3)])):C("",!0),K.mimeType?(u(),T("div",vd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.mimeType"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.mimeType),3)])):C("",!0),K.fileSize?(u(),T("div",Nd,[g("div",null,[v(d,{size:"small",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("runData.fileSize"))+": ",1)]),_:1})]),g("div",{class:D(e.$style.binaryValue)},b(K.fileSize),3)])):C("",!0),g("div",{class:D(e.$style.binaryButtonContainer)},[e.isViewable(U,X)?(u(),P(N,{key:0,size:"small",label:e.$locale.baseText("runData.showBinaryData"),"data-test-id":"ndv-view-binary-data",onClick:ce=>e.displayBinaryData(U,X)},null,8,["label","onClick"])):C("",!0),e.isDownloadable(U,X)?(u(),P(N,{key:1,size:"small",type:"secondary",label:e.$locale.baseText("runData.downloadBinaryData"),"data-test-id":"ndv-download-binary-data",onClick:ce=>e.downloadBinaryData(U,X)},null,8,["label","onClick"])):C("",!0)],2)],8,fd)],2))),128))],2)]))),128))],2)):C("",!0):(u(),T("div",{key:3,class:D(e.$style.center)},[ae(e.$slots,"node-not-run",{},void 0,!0)],2))],2),e.hasNodeRun&&!e.hasRunError&&e.binaryData.length===0&&e.dataCount>e.pageSize&&!e.isSchemaView&&!e.isArtificialRecoveredEventItem?z((u(),T("div",{key:4,class:D(e.$style.pagination),"data-test-id":"ndv-data-pagination"},[v(Ke,{background:"","hide-on-single-page":!0,"current-page":e.currentPage,"pager-count":5,"page-size":e.pageSize,layout:"prev, pager, next","onUpdate:currentPage":e.onCurrentPageChange,total:e.dataCount},null,8,["current-page","page-size","onUpdate:currentPage","total"]),g("div",{class:D(e.$style.pageSizeSelector)},[v(w,{size:"mini",modelValue:e.pageSize,"onUpdate:modelValue":e.onPageSizeChange,teleported:""},{prepend:y(()=>[I(b(e.$locale.baseText("ndv.output.pageSize")),1)]),default:y(()=>[(u(!0),T(Z,null,de(e.pageSizes,M=>(u(),P(k,{key:M,label:M,value:M},null,8,["label","value"]))),128)),v(k,{label:e.$locale.baseText("ndv.output.all"),value:e.dataCount},null,8,["label","value"])]),_:1},8,["modelValue","onUpdate:modelValue"])],2)],2)),[[J,!e.editMode.enabled]]):C("",!0),v(B,{show:e.blockUI,class:D(e.$style.uiBlocker)},null,8,["show","class"])],34)}const bd={$style:cd},Tn=H(Ml,[["render",kd],["__cssModules",bd],["__scopeId","data-v-0149f0a5"]]),Td=x({props:{taskData:{}},computed:{runTaskData(){return this.taskData},runMetadata(){return this.runTaskData?{executionTime:this.runTaskData.executionTime,startTime:new Date(this.runTaskData.startTime).toLocaleString()}:null}}}),Sd=g("br",null,null,-1);function Dd(e,t,o,n,i,s){const a=S("n8n-text"),r=S("n8n-info-tip");return e.runMetadata?(u(),P(r,{key:0,type:"tooltip",theme:"info-light",tooltipPlacement:"right"},{default:y(()=>[g("div",null,[v(a,{bold:!0,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("runData.startTime")+":"),1)]),_:1}),I(" "+b(e.runMetadata.startTime),1),Sd,v(a,{bold:!0,size:"small"},{default:y(()=>[I(b(e.$locale.baseText("runData.executionTime")+":"),1)]),_:1}),I(" "+b(e.runMetadata.executionTime)+" "+b(e.$locale.baseText("runData.ms")),1)])]),_:1})):C("",!0)}const Ed=H(Td,[["render",Dd]]),_t={REGULAR:"regular",LOGS:"logs"},Cd=x({name:"OutputPanel",mixins:[ze],components:{RunData:Tn,RunInfo:Ed,RunDataAi:Os},data(){return{outputMode:"regular",outputTypes:[{label:this.$locale.baseText("ndv.output.outType.regular"),value:_t.REGULAR},{label:this.$locale.baseText("ndv.output.outType.logs"),value:_t.LOGS}]}},props:{runIndex:{type:Number,required:!0},isReadOnly:{type:Boolean},linkedRuns:{type:Boolean},canLinkRuns:{type:Boolean},sessionId:{type:String},blockUI:{type:Boolean,default:!1},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},computed:{...q(G,ee,ue,Y),node(){return this.ndvStore.activeNode},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},isTriggerNode(){return this.nodeTypesStore.isTriggerNode(this.node.type)},hasAiMetadata(){if(this.node){const e=this.workflowsStore.getWorkflowResultDataByNodeName(this.node.name);return!e||!Array.isArray(e)||e.length===0?!1:!!e[e.length-1].metadata}return!1},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isScheduleTrigger(){return!!(this.nodeType&&this.nodeType.group.includes("schedule"))},isNodeRunning(){return this.node&&this.workflowsStore.isNodeExecuting(this.node.name)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){var t;if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return(t=e==null?void 0:e.resultData)!=null&&t.runData?e.resultData.runData:null},hasNodeRun(){return this.workflowsStore.subWorkflowExecutionError?!0:!!(this.node&&this.workflowRunData&&this.workflowRunData.hasOwnProperty(this.node.name))},runTaskData(){if(!this.node||this.workflowExecution===null)return null;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)||e[this.node.name].length<=this.runIndex?null:e[this.node.name][this.runIndex]},runsCount(){if(this.node===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.node.name)?0:e[this.node.name].length?e[this.node.name].length:0},staleData(){if(!this.node)return!1;const e=this.workflowsStore.getParametersLastUpdate(this.node.name);if(!e||!this.runTaskData)return!1;const t=this.runTaskData.startTime;return e>t},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},canPinData(){return this.isPinDataNodeType&&!this.isReadOnly}},methods:{insertTestData(){const e=this.$refs.runData;e&&(e.enterEditMode({origin:"insertTestDataLink"}),this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,node_type:this.node.type,pane:"output",type:"insert-test-data"}))},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},openSettings(){this.$emit("openSettings"),this.$telemetry.track("User clicked ndv link",{node_type:this.node.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"output",type:"settings"})},onRunIndexChange(e){this.$emit("runChange",e)},onUpdateOutputMode(e){e===_t.LOGS?gt.emit("setPositionByName","minLeft"):gt.emit("setPositionByName","initial")},activatePane(){this.$emit("activatePane")}}}),Id="_outputTypeSelect_1rlob_10",Pd="_titleSection_1rlob_15",Od="_title_1rlob_15",Rd="_noOutputData_1rlob_30",$d="_recoveredOutputData_1rlob_40",Ad={outputTypeSelect:Id,titleSection:Pd,title:Od,noOutputData:Rd,recoveredOutputData:$d},Md=["innerHTML"],_d=g("br",null,null,-1);function Wd(e,t,o,n,i,s){const a=S("n8n-radio-buttons"),r=S("RunInfo"),l=S("n8n-info-tip"),p=S("n8n-text"),h=S("run-data-ai"),d=S("RunData");return u(),P(d,{nodeUi:e.node,runIndex:e.runIndex,linkedRuns:e.linkedRuns,canLinkRuns:e.canLinkRuns,tooMuchDataTitle:e.$locale.baseText("ndv.output.tooMuchData.title"),noDataInBranchMessage:e.$locale.baseText("ndv.output.noOutputDataInBranch"),isExecuting:e.isNodeRunning,executingMessage:e.$locale.baseText("ndv.output.executing"),sessionId:e.sessionId,blockUI:e.blockUI,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isPaneActive,onActivatePane:e.activatePane,paneType:"output",onRunChange:e.onRunIndexChange,onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onTableMounted:t[3]||(t[3]=m=>e.$emit("tableMounted",m)),onItemHover:t[4]||(t[4]=m=>e.$emit("itemHover",m)),onSearch:t[5]||(t[5]=m=>e.$emit("search",m)),ref:"runData","data-output-type":e.outputMode},Dt({header:y(()=>[g("div",{class:D(e.$style.titleSection)},[e.hasAiMetadata?(u(),P(a,{key:0,options:e.outputTypes,modelValue:e.outputMode,"onUpdate:modelValue":[t[0]||(t[0]=m=>e.outputMode=m),e.onUpdateOutputMode]},null,8,["options","modelValue","onUpdate:modelValue"])):(u(),T("span",{key:1,class:D(e.$style.title)},b(e.$locale.baseText(e.outputPanelEditMode.enabled?"ndv.output.edit":"ndv.output")),3)),!e.hasPinData&&e.runsCount===1?z((u(),P(r,{key:2,taskData:e.runTaskData},null,8,["taskData"])),[[J,!e.outputPanelEditMode.enabled]]):C("",!0),e.hasNodeRun&&e.staleData?(u(),P(l,{key:3,theme:"warning",type:"tooltip",tooltipPlacement:"right"},{default:y(()=>[g("span",{innerHTML:e.$locale.baseText(e.hasPinData?"ndv.output.staleDataWarning.pinData":"ndv.output.staleDataWarning.regular")},null,8,Md)]),_:1})):C("",!0)],2)]),"node-not-run":y(()=>[e.workflowRunning&&!e.isTriggerNode?(u(),P(p,{key:0,"data-test-id":"ndv-output-waiting"},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.waitingToRun")),1)]),_:1})):C("",!0),e.workflowRunning?C("",!0):(u(),P(p,{key:1,"data-test-id":"ndv-output-run-node-hint"},{default:y(()=>[e.isSubNode?(u(),T(Z,{key:0},[I(b(e.$locale.baseText("ndv.output.runNodeHintSubNode")),1)],64)):(u(),T(Z,{key:1},[I(b(e.$locale.baseText("ndv.output.runNodeHint"))+" ",1),e.canPinData?(u(),T("span",{key:0,onClick:t[1]||(t[1]=(...m)=>e.insertTestData&&e.insertTestData(...m))},[_d,I(" "+b(e.$locale.baseText("generic.or"))+" ",1),v(p,{tag:"a",size:"medium",color:"primary"},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.insertTestData")),1)]),_:1})])):C("",!0)],64))]),_:1}))]),"no-output-data":y(()=>[v(p,{bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.output.noOutputData.title")),1)]),_:1}),v(p,null,{default:y(()=>[I(b(e.$locale.baseText("ndv.output.noOutputData.message"))+" ",1),g("a",{onClick:t[2]||(t[2]=(...m)=>e.openSettings&&e.openSettings(...m))},b(e.$locale.baseText("ndv.output.noOutputData.message.settings")),1),I(" "+b(e.$locale.baseText("ndv.output.noOutputData.message.settingsOption")),1)]),_:1})]),"recovered-artificial-output-data":y(()=>[g("div",{class:D(e.$style.recoveredOutputData)},[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),v(p,null,{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.outputMode==="logs"?{name:"content",fn:y(()=>[v(h,{node:e.node,"run-index":e.runIndex},null,8,["node","run-index"])]),key:"0"}:void 0,!e.hasPinData&&e.runsCount>1?{name:"run-info",fn:y(()=>[v(r,{taskData:e.runTaskData},null,8,["taskData"])]),key:"1"}:void 0]),1032,["nodeUi","runIndex","linkedRuns","canLinkRuns","tooMuchDataTitle","noDataInBranchMessage","isExecuting","executingMessage","sessionId","blockUI","isProductionExecutionPreview","isPaneActive","onActivatePane","onRunChange","onLinkRun","onUnlinkRun","data-output-type"])}const Vd={$style:Ad},Bd=H(Cd,[["render",Wd],["__cssModules",Vd]]),Ld={},Ud={width:"112",height:"80",viewBox:"0 0 112 80",fill:"none",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},xd=Ss('<mask id="mask0_489_46042" style="mask-type:alpha;" maskUnits="userSpaceOnUse" x="0" y="0" width="112" height="80"><rect width="112" height="80" fill="url(#paint0_linear_489_46042)"></rect></mask><g mask="url(#mask0_489_46042)"><rect x="-0.5" width="112" height="80" fill="url(#pattern0)" fill-opacity="0.6"></rect></g><defs><pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1"><use xlink:href="#image0_489_46042" transform="scale(0.00357143 0.005)"></use></pattern><linearGradient id="paint0_linear_489_46042" x1="90.5" y1="40.4494" x2="112.5" y2="40.4494" gradientUnits="userSpaceOnUse"><stop></stop><stop offset="1" stop-color="white" stop-opacity="0"></stop></linearGradient><image id="image0_489_46042" width="280" height="200" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAADICAYAAAAzx/4XAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABhdSURBVHgB7d0JcFTVngbw/72d4IYa0Ie4IK2llgpodNwtB9AaxVILF7ZxynkgWupojaRwASXQGEBqEAI8LXfBpZQS9IFabjMFkXFfijCKyqjQqIiKShCUpdP3vvPdpXP7pjtk6dPdSX+/qlPpJX07UfrL/yz3XEOIPJNiswaZkbKBtkiluC0qRB1gCJW86ntmjzYM81YvWIhyhgFTwlCxGJGyBcJKhTQxhUrSpJraKSpcVgjDhTQqEyo5U+6prbVExmV6TnWT6ixbnuxmSZ262xCLVTUIUTsxYEoMKpdM4aKCZV5ZUmIMFMoljsGUkMk1c9RArjE39HBchcuYadVVdUKUYwyYEjEhVhstj8gqdbMi8HA8kpTBqmqJC5EGHOQtEeVlMkXSw6WB4UK6cQymBKB6UYMso4OPWYZMrWG4kGasYEpAmWGHB3Xj0ydVzRUizRgwJcAwjaFpD9gyVYjygAHTxTndo9Bium2WLBWiPGDAdHFlkWT4/KK6uVzrQnnCgOniDNuIBu/blr1aiPKEAdPF2Xba1DQeYfVCecOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBEpA0Dhoi0YcAQkTYMGCLShgFDRNowYIhIGwYMEWnDgCEibRgwRKQNA4aItGHAEJE2DBgi0oYBQ0TaMGCISBsGDBFpw4AhIm0YMESkDQOGiLRhwBCRNgwYItKGAUNE2hhCXc7ll19eUVZWNto0zYFGJDLIamys8J+LRMrilpWst217WSKRqFu6dGlciDRhwHQho0aNilqWVavC4/I2vGyhCpqpDBrSISLUJYwcOfJWFS6vq5vHS9tURiKRcf3795c1a9a8JUQ5xAqmk0N3qLy8/O/q5iDpIMMwlu7evXuMqmYahCgHOMjbyalwWSE5CBdA18o7HlFOsIvUiY0YMaJWfWnLeEtr9FbdpQrVXXpDiDqIXaROavjw4aPVlwWiiapmBi9ZsqROiDqAXaTOa4popMZjtIUXlQ4GTCfkVS9R0SvqvQ9RuzFgOqe/Sn7k632oi+IYTCfjTUtvkTxJJBI9OG1N7cUKppMpKyurlDzK9/tR18KA6Xzy+oG3LCsqRO3EgOl8KiSPTNOMClE7MWCISJsyIUcsVlvRGJEVhm3Nq5k8fqEUr3wPuHKAl9qNFYwnFqtqMND9MMwF1TW16yfXzLl1Qqw2KkXGtu245Fe9ELUTAybAaPprHbXFmFsekfXV02oX3BX7r6KZSUkmk3WSR42NjQwYajcGTIBl2aubPWjL6EikfJWqalZU3zN7tBSYtyalTvJAVUt1XANDHcExmDTofmRdezhIdZ8GqaCZYog9d3fSWDYzVhWXwnhScrRFQ0sMw3hSiDqAFUyAZUi8Fd9W8O5TIpFYqr7ERa/44sWLFwpRBzBggiJm28YbCtR9QrfFsqwq0WuqEHUQz0UKwFR1MiIdOc8nns/u01VXXTXXNM1bJcdUeM174YUXxglRBzFgQlQ1goDp+GpZQxYmGxPzZsTu0DYL4534iC0uc9lNq1ddo1OEKAfYRQoYpyoYI1djG6r7ZEbKF+CYogm6Smo8ZjA265YcwHFwPCHKkZKrYPCB31cSUTEjlaYtUSNi9rVtqTTcqiUqOWKLzCtLql5XrCov07zDhg2LqYBo9y53akq6asmSJXOFKIe6ZMDEYvdGG6W80jKNioiYJ6vfUs38qDBxA0T7yYJqNqpq+qSqvH9YceG1xsZGBE1bNorihddIm04ZMMEqJILAMFWI2E5wYCwiKoUTV0E2Zlp1VZ0UEIImmUwOUjeHRiKRSnU76j9nlpU1WI2NdapieUuF0UIupCOdijZgUIXslkhFhq5MVPRWIQ3tOb4KlnrVJboiVrjFdxlNmjo7ZphmqutkW9bUaVPGx4QoDwq6ktfvyhimEVV/W/uiKyNuFVKRVC110SbEoJ2zNGywMZ1sSL2dtLdahlFvGtKgwqEe4aCmqqNqqnp9Ww6Y7/EWos5Ca8Bk6cpExa1CoipEdJVQ6Ko0uCFibbAMM94tIvWSkPieQgAho6aqpbUKNd5C1Bl0OGCaDaiaUpHelSlv+mZbcimuWr1t2RvUoGbcNiSOKkQ91pCDSiIuex7LccZbVLjUhR5vT2bm9r8MUZHYY8CgCqmQnRVZujKpKiTVnclTV0b0QlBFsz2ZZbzFCH0N3w4dIo3Riu/Z0+NERScVMM5Je1nWhiRlb21dGcGHWQWHWLJahVVDa7syOjlVkZn5Nw6Nt4S/yQg0LGJECJ+n2nGqdVPtO9XeUW2lagnZw4+R4bYdeE8GDRW9VMCURcoX2PhA5HhA1WvNujLFNtsSZBjetg12+mfYErtq+uTx86QpQFIvkab/ZOgTnqlajWpniBssQY2qrVJtumornMOK9BQ3jE5XrY9q3VXbodo61d5U7TPVtgeO4QcNQ4aKWipgsNmS+qvdnnNaAl2ZtAHVhmIOkZbYKmCM9HCJJ3bvGjtz2sT/FffDv7e4/+3wTegl7lJtt3f/JHHD5VzVjH333Ve6deuGZfjYHU62b99eZts2gmS+ajHVvlZtjGqjVNsnw4+DkxkfVW2OapuF1Qx1IoExmBY3W1LPFV9XRhcracUjpulUMKq8WP3Lr1uGPzx/Gk6CPFu1gaqdrNrB4lYjP6n2iWr/p9pG1W5X7Z9UM4499li59NJL5ZRTTnFC5ssvv5Tly5fL+++/L7t370alMkO1TaqdYqr36969uxx44IG42Bm2xpStW7fK77//fqAKpPHiVkYIpR+897Wl5WBh6FDBNQWMaSJAFhZgQLXYGNbO5AZzn4gkLWv+199+O23xgr/tpR7/V9VuUK1fhtdcLW43BhXOaart07NnT5kzZ44MGTLECQxABTN06FAZM2aM1NfXI817oyFcEEbnn3++DBgwwAmZbdu2yTvvvCNvvPGGbN68WRVU9s3ijt9sFbdqOki1fcUNEoTfL9I0rhOsbogKJhUw06qrcEZuTs7K7exmzpy49a7qe8feWzPxKXErh39TrVq1ngiLCjWv1qNHD+ybggpDGhoasMtcf/X8ieJ9sC+88EI599xzU+ECuH3MMcfIyJEjETCpxw8++GCpqqqSa665RtCl8g0fPlzuuusuWbRoEaoZHOhKcSumY8Ttgh0pbjWD6ul/xJ39+i3wq7CKoYLinrzpUlPNM9xwwQAtQuM/VeuJILjgggucdvTRRzsVyTfffCPLli2T9957D1VHauD3zDPPdLpFYfvtt5+cdtppTpD8+eefzmP9+vWTgQMHpoULoAq69tpr5e2333a6S8r54obLaaHDXqTaNar9TbUnVPtVguGC8SSDBQ3lHwOmueA0MwZdMRN01D777COnnnqq1NTUON2ZIHRr7rzzTidkfAcddJBEIpHmB1cfdARV37595YsvvnAeQ0X0l7/8JeMPc8IJJ8ghhxwin3/+ObZU6KUe6uUfPxqNyo4dO2TdunXGzp07D1UP/4dq34hbiWJ2Cq8x8J4MGSoEbjjVJLhQLhgwGNB1xkVQuYTDBc444ww5++yz5YADDkg9tv/++zthkgnCChUQIITQ3cLxM8FxjjrqKCkvb1oRjdCZMWOGzJs3zxnnufrqq3ENaTyFMZ1LxR2ANv3fif0kKhRWMOnCC+XQMMDrjJ+EuzC+vfbay+n2YEB2zZo1zmP+1HQme++9t1OV+LdRwQTHasJQ7SBg1MyTc//mm2+W66+/3jk+xoHw3GuvvSabNm3CQfp4zRmLsdWkO+sWKhRWMJkFF9JhdsYZL9m4cWPWF5x++ulOpeGHSksBg0BCFwdQoWTrHvmOOOKIVAWDMBoxYkTq2KhcevXq5by3Zz9xK5iI83uoAEL3yKlibNYylF8MmHTh6sWfoXEGWT/99NPUwGwYxkMwJY1qA10m3M80BgPoEmGGqbKy0hkMRmsJxn4wOIxQwXuEAwlhhuDx74obMs7vkFRjMIwVKhR2kVzBpf7BbhICZr1qW5LJZA/MGK1du9ZZOBeGLs5ll13mTEPj9mGHHeaPizSDQBg8eLAzZoNqpn///tISjPvMmjVLNmzYIIMGDWr2PN4Hx/Eg1RAyTsBgkDdVubCzRHnGgMkcLH4Fg9vbxK1iBm7evNlZhZspYODII4902h7fUH3QES4ImdbA2M+wYcOcGSNUMpkEwsw/uT01yEtUKKXeRco0c4SG2ZgrVLtRtb+KNxGDBXXvvvsuVtZKvmEMBqGUrdsVkgpIO5k0/HMK2FWifCvlCiZT5YJp6RGqjVXtEO++3+Vwzg/CepS6ujpnlW2RMkKNqGBYwTRVLvuLe8byveIurouKGzKYkUktcME09EsvveSvrC16lhAVTqlWMMHqxe9O3CbuuT7OdMzxxx/vnAmNLsknn3wiK1eudNah7Nq1ywmZVatWZRxwLQScsrBz507/LjIFJz2ygqGCK+Uukj8Iiq/YcW6keOFyww03yN133+2sUcHgKaqV5557TqZOnepMU3/77bfO1gvFEjDougWmzxEuu4WoCJRiwGSaLbpANWdxyVlnnSUPPfRQ2gswuDp27Fhn1ezEiROdr63xww8/yPr16+Wcc85ptugOA8aYkcIpAlg3Ex68xZQ0zrg++eSTpU+fPi0O7qKCCXTZEC47hKgIlOoYTDBk8MnFMlhnqewll1yS8QVYeYvl+Y8++qjMnDnTmTZuCVb94gzp8847T6qrq9OeQxg888wzcvHFF8tNN90kL7/8ctrzv/zyi0yYMEGuvPJKufHGG+Wrr75q8b3QbcNrPOgrdY4BIurySrmCQbj660XKvcdSS/gzwXPXXXedtAbGabBXjG3bznYLQVjP8v333zu3f/vtN6fLFYSw2LJli1Mpff3119hms8X3QsD8+uuv/l30lRAwzsw0l2pTIZXav7/wJUX8CuYP8SZc8IHvTBBgCKA//vjDuStuBfO7EBWBUvwDF5xd8cdgUttNrlu3TjqTRCIh8Xg8dVfczaawCTnX1VHBlXIFHewqob/iBAy6NnYnOusYAYOBZA+ql58leOUBNQvGVXdUKFxo58In1Pmrj5W6GP/o8IEDs0aYRtYFa3NwlrcH/SR/TwlWMFRwpV7B+PChxEhrI3bzf/7556WjsGudHzLZtnjoKExPYzr7448/9h/CANL/S9OpR9gvk0FDBVPKARP84KHEeEu89SNPPPFEh09oxJYNfsDoqmAwsPvqq6/6U9T42dHVQ1Cmn9+In4NbNVABlGLAhK/57DcsRomrlvzoo4/kvvvuS21RWawwIP3444/7dzG4i8vMImgwI8YTqKngSi1ggpdd9ZvlNVwxEbvxO4tO8MFdunRpq1ft5hsGonH6gjfrhSTEJWhxWYNguLCLRAVV6l0kS9JD5lVxr87oLFybPXu2rFixQnINXSd/gygERXtCDCdfPvvss/5d9JH+W7Ufpel3SS20S80gsZtEeVaqXaRgwwCJ5X3FwMsDqq3CN+JcICzz/+CDDySXcF6Rv8UlBmrb2hVbvXq1cyVIbxNyTK9jqTACxgo1VjBUUKVawQS7R37I+A19DlwhcR0++NiWAdce+uyzzySXgicvtqWCQWU1efJk5+cS9+fHz/uCuDNIflimmmFGbFYuVCilXMH4H0L/Q9no3cbXD1Wbr9pm7LPyyiuvSG1tbcFX+SKIHnzwQXn99df9hzCw+4i4ewYHQ5KDvFQUSn0Mxg+a4IcTAYM+CwZfZqm2BetYsDYGlcN3333XqoMfeuihqbUwuMJAEK4qgEuXADb0Dp9giX1ounfv7rwWx8HF2QAXV3vssceCXaoHxb3o/W7v5/ZD0g9PB8dfqFBatYN0F5TppMdwQ/g0iLv0/sxEIlGOcEFFc+KJJ2a91KsPwYFrUGNnPGy5cPjhh6eewxoZvB7PY9OqK664wgkVHwIFe9DgciWjRo2Sk046yTkDe/z48c64kKdO3IDBVQ8QLAlJr8KcKmbg4Iv+WQXVoFTA2PZbK+verBOiPCjVHe0QHn6I+GMwqOYS3vP+SZAIl9dU66Vme67fsmVL+YIFC+Tnn3+W6dOnOxdZywZVysiRI51qI3ypEYy/IHjuuOOO8DWNUq+96KKLnMua4Htx//777xesz/HOk8Ks0Qxxt2VISnq4sItERaPUr4sUnk0KngDp38bWB4vFvUb1v2/durUcm36j4sBMznHHHZf14AiOcHgEZbvWNaDK8a9XjbGXxYsXC05j8Dyh2iZp6hZlC5emlbxEBVDKAROsYvzxiuAVHYMnIP+k2jOq7VIVxLXbt2/f++mnn3bOMbrttttkwIABohO23sSWDN5sE6qVl6SpagmHS7ARFVSpn02daU1MIktDyDyl2gMqZLbhPKCnnnpKbr/9dmeLh/ZAcNxyyy3Su3dv6devnzz88MPBKiUF2zFg1zoPRpl/C/1smWaQRNhFogLjpWObPoTBv/jB7pIEvqK7hDUn+LTfotoBb775pnOdJAziBi5Av0c//vijzJ8/Xx544AHn/k8//SRTpkxxFt5hn97gda2xQXjghMmNkh4o4XDh+AsVDW7Zmnm62p+V8S8BEqwWMLD6d9UeVu1nDLouX77cuYxJa2FbTgQTAsZ7b6e7g5BZtGiRfPjhh2lnYKN6CWyCtUOyj70EqxeigmPAuIJdinDQBMPGb9jg5RPVPseLsGQfVUZrYYOoWbNmOVPP4p5cWe8dy8a1r1ER4Zh+qIQueWJK5vEWW9g1oiLDLlKTTFPXRuh5/3vQsO2ds7k2LkPiX4wNMLUcvg4SwgLbW2ItDS7g5p16gLDCiU4LVTtBtR5qILcPVuuiizRkyBBnvQwqG7zWg+s3ZQsXdo2oqDBg0vkBgg+tXymINL9YW3DTcKfL88gjj8iLL77oBAMWygXHUABjK9iKEwHj7aGLY8dVW6baN+IO3PZW7SpVDVXgTO4lS5Y44zp4XWBXvL7e+zJYqOgxYJoLhox4t4NB4y/CA2clNFb34vrVbYBuF1IG+898JE1ncmO7CKzK+xd1zB5r167N1IXtJu51nFi9UNFjwGQWDhlfsILBtDVOisSJRPuGno9I8038cUzMPmHnf8wEYd+ZleKGjR8MOJtyobhbX1aqdqB3LASQf0lY7PD9hzBYqBNgwGQXDBm/e+QP/vrXUkIFgg98T0m/UmQ3aQqi4DQ4ggELXbBvrn/1xeDMD74f4YNFfW94x8WxEt7rMO6zSTKfDsCQoaLDgGlZeLVveJUvQgZBgS5LRJoCxsxwnEzbRPiDyb5gFwxVzEbJvAgwKaxgqBNgwLROOBwQMqb31YcP/Z4CxsrS/IDwqx5T0isgW9L3rOGCOuoUGDB7FuyCBM9bagw8jsf8cMk2/tJSwPiCYzzB2apM+9bwrGkqegyY1guGCzQGHiuTpqom05VagwETDppgQISnws0Mr/cXAPK8Iyp6DJjWC6/2Dd72181ASwETrmQyVR/h7SLCxwhu88kxGCpqDJjWCa/ytaR5WIR3xAu/Pjzj01LA7Cmk2DWiToEB03Z+mJiB28GAEckcMMHbVuhxO/S6TCHlf1+msGLQUFFiwLSeX8X4ty1pHiit2TouU7cmU8BI6Lad5StR0WLAtE0wCMKDs209RkvPtTY8GDJU1Bgw7WNnuW+04TVEXR4DJrcYIkQB3HCKiLRhwBCRNgwYItKGAUNE2jBgiEgbBgwRacOAISJtGDBdnGFI2gWbjIjZV4jyhAHTxdmGHU9/QKJClCcMmC6uLBmpDz1UOS5W2/qLaBN1AAOmi4vFquLiXuDNV7GfaY0WojxgwJQA27KeDN43DXOoEOUBA6YElNnmwtBDg6rvmT1OiDRjwJQAdJNssdOqGDHMKRNitVEh0ogBUyLKkkZMfQlOWVeUR2QFQ4Z0YsCUCGew15CpoYejCJlJNbWDhEiDtmz1SF2ACpOY+p8+pdkThixMNMrUme6sE1FOMGBK0KSaOXMNMW7N8vRSNe20LGkl62fE7qgXog5gwJSorJUMUQ4xYEoYxl7UP4AF6mZUiDRgwJBU31M7Wv1LQDUTFaIcYsBQSmx6bWVjo3W5mOZAww2bqBB1wD8AobUpv0xPqN8AAAAASUVORK5CYII="></image></defs>',3),Fd=[xd];function Hd(e,t){return u(),T("svg",Ud,Fd)}const zd=H(Ld,[["render",Hd]]),Kd=x({name:"InputPanel",mixins:[Pe],components:{RunData:Tn,NodeExecuteButton:Yt,WireMeUp:zd},props:{currentNodeName:{type:String},runIndex:{type:Number,required:!0},linkedRuns:{type:Boolean},workflow:{},canLinkRuns:{type:Boolean},sessionId:{type:String},readOnly:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1},isPaneActive:{type:Boolean,default:!1}},data(){return{showDraggableHintWithDelay:!1,draggableHintShown:!1,inputMode:"debugging",mappedNode:null,inputModes:[{value:"mapping",label:this.$locale.baseText("ndv.input.mapping")},{value:"debugging",label:this.$locale.baseText("ndv.input.debugging")}]}},computed:{...q(G,ee,Y),focusedMappableInput(){return this.ndvStore.focusedMappableInput},isUserOnboarded(){return this.ndvStore.isMappingOnboarded},isMappingMode(){return this.isActiveNodeConfig&&this.inputMode==="mapping"},showDraggableHint(){const e=[vt,ot,Fn,Hn];return!this.currentNode||e.includes(this.currentNode.type)?!1:!!this.focusedMappableInput&&!this.isUserOnboarded},isActiveNodeConfig(){var o,n;let e=((o=this.activeNodeType)==null?void 0:o.inputs)??[],t=((n=this.activeNodeType)==null?void 0:n.outputs)??[];if(this.activeNode!==null&&this.currentWorkflow!==null){const i=this.currentWorkflow.getNode(this.activeNode.name);e=ge(this.currentWorkflow,i,this.activeNodeType),t=ve(this.currentWorkflow,i,this.activeNodeType)}else Array.isArray(e)||(e=[]),Array.isArray(t)||(t=[]);return!!(e.length===0||e.every(i=>this.filterOutConnectionType(i,$.Main))&&t.find(i=>this.filterOutConnectionType(i,$.Main)))},isMappingEnabled(){return this.readOnly?!1:this.isActiveNodeConfig?this.isMappingMode&&this.mappedNode!==null:!0},isExecutingPrevious(){if(!this.workflowRunning)return!1;const e=this.workflowsStore.executedNode,t=this.workflowsStore.executingNode;return this.activeNode&&e===this.activeNode.name&&!this.workflowsStore.isNodeExecuting(this.activeNode.name)?!0:t.length||e?!!this.parentNodes.find(o=>this.workflowsStore.isNodeExecuting(o.name)||o.name===e):!1},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},currentWorkflow(){return this.workflow},activeNode(){return this.ndvStore.activeNode},rootNode(){return this.currentWorkflow.getChildNodes(this.activeNode.name,"ALL_NON_MAIN")[0]},rootNodesParents(){return[...this.currentWorkflow.getParentNodes(this.rootNode,"main")].reverse()},currentNode(){return this.isActiveNodeConfig?this.mappedNode?this.workflowsStore.getNodeByName(this.mappedNode):this.activeNode:this.workflowsStore.getNodeByName(this.currentNodeName)},connectedCurrentNodeOutputs(){const e=this.parentNodes.find(({name:t})=>t===this.currentNodeName);if(e)return e.indicies},parentNodes(){if(!this.activeNode)return[];const e=this.workflow.getParentNodesByDepth(this.activeNode.name);return e.filter(({name:t},o)=>this.activeNode&&t!==this.activeNode.name&&e.findIndex(n=>n.name===t)===o)},currentNodeDepth(){const e=this.parentNodes.find(t=>this.currentNode&&t.name===this.currentNode.name);return e?e.depth:-1},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},isMultiInputNode(){return this.activeNodeType!==null&&this.activeNodeType.inputs.length>1}},methods:{filterOutConnectionType(e,t){return e?typeof e=="string"?e!==t:e.type!==t:!1},onInputModeChange(e){this.inputMode=e},onMappedNodeSelected(e){this.mappedNode=e,this.onRunIndexChange(0),this.onUnlinkRun()},getMultipleNodesText(e){var i;if(!e||!this.isMultiInputNode||!this.activeNode||((i=this.activeNodeType)==null?void 0:i.inputNames)===void 0)return"";const n=(this.currentWorkflow.connectionsByDestinationNode[this.activeNode.name].main||[]).reduce((s,a,r)=>a[0]&&a[0].node===e?[...s,r]:s,[]).map(s=>{var a,r;return(r=(a=this.activeNodeType)==null?void 0:a.inputNames)==null?void 0:r[s]});return n.length===0?"":`(${n.join(" & ")})`},onNodeExecute(){this.$emit("execute"),this.activeNode&&this.$telemetry.track("User clicked ndv button",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"executePrevious"})},onRunIndexChange(e){this.$emit("runChange",e)},onLinkRun(){this.$emit("linkRun")},onUnlinkRun(){this.$emit("unlinkRun")},onInputNodeChange(e){const t=this.parentNodes.findIndex(o=>o.name===e)+1;this.$emit("changeInputNode",e,t)},onConnectionHelpClick(){this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"not-connected-help"})},truncate(e){const t=e.substring(0,30);return t.length<e.length?`${t}...`:t},activatePane(){this.$emit("activatePane")}},watch:{inputMode:{handler(e){this.onRunIndexChange(-1),e==="mapping"&&(this.onUnlinkRun(),this.mappedNode=this.rootNodesParents[0])},immediate:!0},showDraggableHint(e,t){e&&!t?setTimeout(()=>{this.draggableHintShown||(this.showDraggableHintWithDelay=this.showDraggableHint,this.showDraggableHintWithDelay&&(this.draggableHintShown=!0,this.$telemetry.track("User viewed data mapping tooltip",{type:"unexecuted input pane"})))},1e3):e||(this.showDraggableHintWithDelay=!1)}}}),jd="_mappedNode_13qhk_5",Yd="_titleSection_13qhk_10",Gd="_inputModeTab_13qhk_19",qd="_noOutputData_13qhk_23",Jd="_recoveredOutputData_13qhk_33",Xd="_notConnected_13qhk_42",Qd="_title_13qhk_10",Zd={mappedNode:jd,titleSection:Yd,inputModeTab:Gd,noOutputData:qd,recoveredOutputData:Jd,notConnected:Xd,title:Qd},eu={key:0},tu={key:1},ou=["innerHTML"];function nu(e,t,o,n,i,s){const a=S("n8n-option"),r=S("n8n-select"),l=S("n8n-radio-buttons"),p=S("n8n-text"),h=S("NodeExecuteButton"),d=S("n8n-tooltip"),m=S("WireMeUp"),N=S("RunData");return u(),P(N,{nodeUi:e.currentNode,runIndex:e.runIndex,linkedRuns:e.linkedRuns,canLinkRuns:!e.mappedNode&&e.canLinkRuns,tooMuchDataTitle:e.$locale.baseText("ndv.input.tooMuchData.title"),noDataInBranchMessage:e.$locale.baseText("ndv.input.noOutputDataInBranch"),isExecuting:e.isExecutingPrevious,executingMessage:e.$locale.baseText("ndv.input.executingPrevious"),sessionId:e.sessionId,overrideOutputs:e.connectedCurrentNodeOutputs,mappingEnabled:e.isMappingEnabled,distanceFromActive:e.currentNodeDepth,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isPaneActive,onActivatePane:e.activatePane,paneType:"input",onItemHover:t[2]||(t[2]=k=>e.$emit("itemHover",k)),onLinkRun:e.onLinkRun,onUnlinkRun:e.onUnlinkRun,onRunChange:e.onRunIndexChange,onTableMounted:t[3]||(t[3]=k=>e.$emit("tableMounted",k)),onSearch:t[4]||(t[4]=k=>e.$emit("search",k)),"data-test-id":"ndv-input-panel"},Dt({header:y(()=>[g("div",{class:D(e.$style.titleSection)},[e.parentNodes.length?(u(),P(r,{key:0,teleported:"",size:"small",modelValue:e.currentNodeName,"onUpdate:modelValue":e.onInputNodeChange,"no-data-text":e.$locale.baseText("ndv.input.noNodesFound"),placeholder:e.$locale.baseText("ndv.input.parentNodes"),filterable:"","data-test-id":"ndv-input-select"},{prepend:y(()=>[g("span",{class:D(e.$style.title)},b(e.$locale.baseText("ndv.input")),3)]),default:y(()=>[(u(!0),T(Z,null,de(e.parentNodes,k=>(u(),P(a,{value:k.name,key:k.name,class:"node-option",label:`${e.truncate(k.name)} ${e.getMultipleNodesText(k.name)}`,"data-test-id":"ndv-input-option"},{default:y(()=>[g("span",null,b(e.truncate(k.name))+" ",1),e.getMultipleNodesText(k.name)?(u(),T("span",eu,b(e.getMultipleNodesText(k.name)),1)):(u(),T("span",tu,b(e.$locale.baseText("ndv.input.nodeDistance",{adjustToNumber:k.depth})),1))]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","no-data-text","placeholder"])):(u(),T("span",{key:1,class:D(e.$style.title)},b(e.$locale.baseText("ndv.input")),3)),e.isActiveNodeConfig&&!e.readOnly?(u(),P(l,{key:2,options:e.inputModes,modelValue:e.inputMode,"onUpdate:modelValue":e.onInputModeChange},null,8,["options","modelValue","onUpdate:modelValue"])):C("",!0)],2)]),"node-not-run":y(()=>[e.isActiveNodeConfig&&e.rootNode||e.parentNodes.length?(u(),T("div",{key:0,class:D(e.$style.noOutputData)},[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.noOutputData.title")),1)]),_:1}),e.readOnly?C("",!0):(u(),P(d,{key:0,visible:e.showDraggableHint&&e.showDraggableHintWithDelay},{content:y(()=>[g("div",{innerHTML:e.$locale.baseText("dataMapping.dragFromPreviousHint",{interpolate:{name:e.focusedMappableInput}})},null,8,ou)]),default:y(()=>[v(h,{type:"secondary",transparent:!0,nodeName:e.isActiveNodeConfig?e.rootNode:e.currentNodeName,label:e.$locale.baseText("ndv.input.noOutputData.executePrevious"),onExecute:e.onNodeExecute,telemetrySource:"inputs","data-test-id":"execute-previous-node"},null,8,["nodeName","label","onExecute"])]),_:1},8,["visible"])),e.readOnly?C("",!0):(u(),P(p,{key:1,tag:"div",size:"small"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.noOutputData.hint")),1)]),_:1}))],2)):(u(),T("div",{key:1,class:D(e.$style.notConnected)},[g("div",null,[v(m)]),v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.notConnected.title")),1)]),_:1}),v(p,{tag:"div"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.notConnected.message"))+" ",1),g("a",{href:"https://docs.n8n.io/workflows/connections/",target:"_blank",onClick:t[1]||(t[1]=(...k)=>e.onConnectionHelpClick&&e.onConnectionHelpClick(...k))},b(e.$locale.baseText("ndv.input.notConnected.learnMore")),1)]),_:1})],2))]),"no-output-data":y(()=>[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("ndv.input.noOutputData")),1)]),_:1})]),"recovered-artificial-output-data":y(()=>[g("div",{class:D(e.$style.recoveredOutputData)},[v(p,{tag:"div",bold:!0,color:"text-dark",size:"large"},{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeTitle")),1)]),_:1}),v(p,null,{default:y(()=>[I(b(e.$locale.baseText("executionDetails.executionFailed.recoveredNodeMessage")),1)]),_:1})],2)]),_:2},[e.isMappingMode?{name:"before-data",fn:y(()=>[(u(),P(yn("style"),null,{default:y(()=>[I("button.linkRun { display: none }")]),_:1})),g("div",{class:D(e.$style.mappedNode)},[v(r,{modelValue:e.mappedNode,"onUpdate:modelValue":e.onMappedNodeSelected,size:"small",onClick:t[0]||(t[0]=ie(()=>{},["stop"])),teleported:""},{prepend:y(()=>[I(b(e.$locale.baseText("ndv.input.previousNode")),1)]),default:y(()=>[(u(!0),T(Z,null,de(e.rootNodesParents,k=>(u(),P(a,{key:k,label:k,value:k},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue"])],2)]),key:"0"}:void 0]),1032,["nodeUi","runIndex","linkedRuns","canLinkRuns","tooMuchDataTitle","noDataInBranchMessage","isExecuting","executingMessage","sessionId","overrideOutputs","mappingEnabled","distanceFromActive","isProductionExecutionPreview","isPaneActive","onActivatePane","onLinkRun","onUnlinkRun","onRunChange"])}const iu={$style:Zd},su=H(Kd,[["render",nu],["__cssModules",iu],["__scopeId","data-v-216c34ad"]]),au=x({name:"TriggerPanel",mixins:[Pe,St],components:{NodeExecuteButton:Yt,CopyInput:Ui,NodeIcon:Tt},data:()=>({executionsHelpEventBus:nn()}),props:{nodeName:{type:String},sessionId:{type:String}},computed:{...q(G,ee,ue,Y),node(){return this.workflowsStore.getNodeByName(this.nodeName)},nodeType(){return this.node?this.nodeTypesStore.getNodeType(this.node.type,this.node.typeVersion):null},hasIssues(){var e;return!!((e=this.node)!=null&&e.issues&&(this.node.issues.parameters||this.node.issues.credentials))},serviceName(){return this.nodeType?pt(this.nodeType):""},isWebhookNode(){return!!(this.node&&this.node.type===Le)},webhookHttpMethod(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.getWebhookExpressionValue(this.nodeType.webhooks[0],"httpMethod")},webhookTestUrl(){var e,t;if(!(!this.node||!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)))return this.getWebhookUrl(this.nodeType.webhooks[0],this.node,"test")},isWebhookBasedNode(){var e,t;return!!((t=(e=this.nodeType)==null?void 0:e.webhooks)!=null&&t.length)},isPollingNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isListeningForEvents(){const e=this.workflowsStore.executionWaitingForWebhook,t=this.workflowsStore.executedNode;return!!this.node&&!this.node.disabled&&this.isWebhookBasedNode&&e&&(!t||t===this.nodeName)},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isActivelyPolling(){const e=this.workflowsStore.executedNode;return this.workflowRunning&&this.isPollingNode&&this.nodeName===e},isWorkflowActive(){return this.workflowsStore.isWorkflowActive},listeningTitle(){var e;return((e=this.nodeType)==null?void 0:e.name)===Ue?this.$locale.baseText("ndv.trigger.webhookNode.formTrigger.listening"):this.$locale.baseText("ndv.trigger.webhookNode.listening")},listeningHint(){var e;return((e=this.nodeType)==null?void 0:e.name)===Ue?this.$locale.baseText("ndv.trigger.webhookBasedNode.formTrigger.serviceHint"):this.$locale.baseText("ndv.trigger.webhookBasedNode.serviceHint",{interpolate:{service:this.serviceName}})},header(){var t;const e=this.nodeType?pt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingEvent"):(t=this.nodeType)!=null&&t.triggerPanel&&typeof this.nodeType.triggerPanel.header=="string"?this.nodeType.triggerPanel.header:this.isWebhookBasedNode?this.$locale.baseText("ndv.trigger.webhookBasedNode.action",{interpolate:{name:e}}):""},subheader(){const e=this.nodeType?pt(this.nodeType):"";return this.isActivelyPolling?this.$locale.baseText("ndv.trigger.pollingNode.fetchingHint",{interpolate:{name:e}}):""},executionsHelp(){var e,t;if(((t=(e=this.nodeType)==null?void 0:e.triggerPanel)==null?void 0:t.executionsHelp)!==void 0){if(typeof this.nodeType.triggerPanel.executionsHelp=="string")return this.nodeType.triggerPanel.executionsHelp;if(!this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.inactive)return this.nodeType.triggerPanel.executionsHelp.inactive;if(this.isWorkflowActive&&this.nodeType.triggerPanel.executionsHelp.active)return this.nodeType.triggerPanel.executionsHelp.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.executionsHelp.inactive",{interpolate:{service:this.serviceName}}):""},activationHint(){var e,t;if(this.isActivelyPolling)return"";if((t=(e=this.nodeType)==null?void 0:e.triggerPanel)!=null&&t.activationHint){if(typeof this.nodeType.triggerPanel.activationHint=="string")return this.nodeType.triggerPanel.activationHint;if(!this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.inactive=="string")return this.nodeType.triggerPanel.activationHint.inactive;if(this.isWorkflowActive&&typeof this.nodeType.triggerPanel.activationHint.active=="string")return this.nodeType.triggerPanel.activationHint.active}return this.isWebhookBasedNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.webhookBasedNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):this.isPollingNode?this.isWorkflowActive?this.$locale.baseText("ndv.trigger.pollingNode.activationHint.active",{interpolate:{service:this.serviceName}}):this.$locale.baseText("ndv.trigger.pollingNode.activationHint.inactive",{interpolate:{service:this.serviceName}}):""}},methods:{expandExecutionHelp(){this.$refs.help&&this.executionsHelpEventBus.emit("expand")},onLinkClick(e){var o;if(!e.target)return;const t=e.target;t.localName==="a"&&(o=t.dataset)!=null&&o.key&&(e.stopPropagation(),e.preventDefault(),t.dataset.key==="activate"?this.$emit("activate"):t.dataset.key==="executions"?(this.$telemetry.track("User clicked ndv link",{workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:"input",type:"open-executions-log"}),this.ndvStore.activeNodeName=null,this.$router.push({name:j.EXECUTIONS})):t.dataset.key==="settings"&&this.uiStore.openModal(zn))},onTestLinkCopied(){this.$telemetry.track("User copied webhook URL",{pane:"inputs",type:"test url"})},onNodeExecute(){this.$emit("execute")}}}),ru="_container_2vg29_5",lu="_header_2vg29_22",du="_action_2vg29_29",uu="_shake_2vg29_33",cu="_accordion_2vg29_54",hu={container:ru,header:lu,action:du,shake:uu,accordion:cu},pu={key:"empty"},gu={key:"listening"},fu={key:0},mu={key:1},yu={key:"default"},wu={key:0,class:"mb-xl"},vu=["textContent"],Nu=["innerHTML"];function ku(e,t,o,n,i,s){const a=S("NodeIcon"),r=S("n8n-pulse"),l=S("n8n-text"),p=S("CopyInput"),h=S("NodeExecuteButton"),d=S("n8n-spinner"),m=S("n8n-heading"),N=S("n8n-link"),k=S("n8n-info-accordion");return u(),T("div",{class:D(e.$style.container)},[v(Ds,{name:"fade",mode:"out-in"},{default:y(()=>[e.hasIssues?(u(),T("div",pu)):e.isListeningForEvents?(u(),T("div",gu,[v(r,null,{default:y(()=>[v(a,{nodeType:e.nodeType,size:40},null,8,["nodeType"])]),_:1}),e.isWebhookNode?(u(),T("div",fu,[v(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:y(()=>[I(b(e.$locale.baseText("ndv.trigger.webhookNode.listening")),1)]),_:1}),g("div",{class:D([e.$style.shake,"mb-xs"])},[v(l,null,{default:y(()=>[I(b(e.$locale.baseText("ndv.trigger.webhookNode.requestHint",{interpolate:{type:this.webhookHttpMethod}})),1)]),_:1})],2),v(p,{value:e.webhookTestUrl,toastTitle:e.$locale.baseText("ndv.trigger.copiedTestUrl"),class:"mb-2xl",size:"medium",collapse:!0,"copy-button-text":e.$locale.baseText("generic.clickToCopy"),onCopy:e.onTestLinkCopied},null,8,["value","toastTitle","copy-button-text","onCopy"]),v(h,{"data-test-id":"trigger-execute-button",nodeName:e.nodeName,onExecute:e.onNodeExecute,size:"medium",telemetrySource:"inputs"},null,8,["nodeName","onExecute"])])):(u(),T("div",mu,[v(l,{tag:"div",size:"large",color:"text-dark",class:"mb-2xs",bold:""},{default:y(()=>[I(b(e.listeningTitle),1)]),_:1}),g("div",{class:D([e.$style.shake,"mb-xs"])},[v(l,{tag:"div"},{default:y(()=>[I(b(e.listeningHint),1)]),_:1})],2),v(h,{"data-test-id":"trigger-execute-button",nodeName:e.nodeName,onExecute:e.onNodeExecute,size:"medium",telemetrySource:"inputs"},null,8,["nodeName","onExecute"])]))])):(u(),T("div",yu,[e.isActivelyPolling?(u(),T("div",wu,[v(d,{type:"ring"})])):C("",!0),g("div",{class:D(e.$style.action)},[g("div",{class:D(e.$style.header)},[e.header?(u(),P(m,{key:0,tag:"h1",bold:""},{default:y(()=>[I(b(e.header),1)]),_:1})):C("",!0),e.subheader?(u(),P(l,{key:1},{default:y(()=>[g("span",{textContent:b(e.subheader)},null,8,vu)]),_:1})):C("",!0)],2),v(h,{"data-test-id":"trigger-execute-button",nodeName:e.nodeName,onExecute:e.onNodeExecute,size:"medium",telemetrySource:"inputs"},null,8,["nodeName","onExecute"])],2),e.activationHint?(u(),P(l,{key:1,size:"small",onClick:e.onLinkClick},{default:y(()=>[g("span",{innerHTML:e.activationHint},null,8,Nu),I("  ")]),_:1},8,["onClick"])):C("",!0),e.activationHint&&e.executionsHelp?(u(),P(N,{key:2,size:"small",onClick:e.expandExecutionHelp},{default:y(()=>[I(b(e.$locale.baseText("ndv.trigger.moreInfo")),1)]),_:1},8,["onClick"])):C("",!0),e.executionsHelp?(u(),P(k,{key:3,ref:"help",class:D(e.$style.accordion),title:e.$locale.baseText("ndv.trigger.executionsHint.question"),description:e.executionsHelp,eventBus:e.executionsHelpEventBus,"onClick:body":e.onLinkClick},null,8,["class","title","description","eventBus","onClick:body"])):C("",!0)]))]),_:1})],2)}const bu={$style:hu},Tu=H(au,[["render",ku],["__cssModules",bu],["__scopeId","data-v-d1ba9417"]]),Su=x({name:"NodeDetailsView",mixins:[Ie,Oe,Pe,Ho,ze],components:{NodeSettings:Va,InputPanel:su,OutputPanel:Bd,NDVDraggablePanels:Mr,TriggerPanel:Tu},props:{readOnly:{type:Boolean},renaming:{type:Boolean},isProductionExecutionPreview:{type:Boolean,default:!1}},setup(e){var t,o;return{...Qo(),...xt(),...(o=(t=Ho).setup)==null?void 0:o.call(t,e)}},data(){return{settingsEventBus:nn(),redrawRequired:!1,runInputIndex:-1,runOutputIndex:-1,isLinkingEnabled:!0,selectedInput:void 0,triggerWaitingWarningEnabled:!1,isDragging:!1,mainPanelPosition:0,pinDataDiscoveryTooltipVisible:!1,avgInputRowHeight:0,avgOutputRowHeight:0,isInputPaneActive:!1,isOutputPaneActive:!1,isPairedItemHoveringEnabled:!0}},mounted(){we.on("data-pinning-discovery",this.setIsTooltipVisible)},beforeUnmount(){we.off("data-pinning-discovery",this.setIsTooltipVisible)},computed:{...q(G,ee,ue,Y,sn),sessionId(){return this.ndvStore.sessionId},workflowRunning(){return this.uiStore.isActionActive("workflowRunning")},showTriggerWaitingWarning(){return this.triggerWaitingWarningEnabled&&!!this.activeNodeType&&!this.activeNodeType.group.includes("trigger")&&this.workflowRunning&&this.workflowsStore.executionWaitingForWebhook},activeNode(){return this.ndvStore.activeNode},inputNodeName(){return this.selectedInput||this.parentNode},inputNode(){return this.inputNodeName?this.workflowsStore.getNodeByName(this.inputNodeName):null},activeNodeType(){return this.activeNode?this.nodeTypesStore.getNodeType(this.activeNode.type,this.activeNode.typeVersion):null},showTriggerPanel(){var n,i,s,a;const e=!!((i=(n=this.activeNodeType)==null?void 0:n.webhooks)!=null&&i.length),t=(s=this.activeNodeType)==null?void 0:s.polling,o=!!((a=this.activeNodeType)!=null&&a.triggerPanel);return!this.readOnly&&this.isTriggerNode&&(e||t||o)},workflow(){return this.getCurrentWorkflow()},hasOutputConnection(){var t,o;if(!this.activeNode)return!1;const e=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);return(((o=(t=Object.values(e))==null?void 0:t[0])==null?void 0:o[0])??[]).length>0},parentNodes(){return this.activeNode?this.workflow.getParentNodesByDepth(this.activeNode.name,1).map(({name:e})=>e)||[]:[]},parentNode(){var t;const e=this.workflowsStore.getPinData;for(const o of this.parentNodes)if(e[o]||(t=this.workflowRunData)!=null&&t[o])return o;return this.parentNodes[0]},isExecutableTriggerNode(){return this.activeNodeType?Kn.includes(this.activeNodeType.name):!1},isTriggerNode(){return!!this.activeNodeType&&(this.activeNodeType.group.includes("trigger")||this.activeNodeType.name===vt)},isActiveStickyNode(){return!!this.ndvStore.activeNode&&this.ndvStore.activeNode.type===re},workflowExecution(){return this.workflowsStore.getWorkflowExecution},workflowRunData(){if(this.workflowExecution===null)return null;const e=this.workflowExecution.data;return e!=null&&e.resultData?e.resultData.runData:null},maxOutputRun(){if(this.activeNode===null)return 0;const e=this.workflowRunData;return e===null||!e.hasOwnProperty(this.activeNode.name)?0:e[this.activeNode.name].length?e[this.activeNode.name].length-1:0},outputRun(){return this.runOutputIndex===-1?this.maxOutputRun:Math.min(this.runOutputIndex,this.maxOutputRun)},maxInputRun(){if(this.inputNode===null||this.activeNode===null)return 0;const e=this.workflow.getNode(this.activeNode.name),t=ve(this.workflow,e,this.activeNodeType);let o=this.inputNode;const n=this.workflowRunData;return t.some(i=>i!==$.Main)&&(o=this.activeNode),!o||!n||!n.hasOwnProperty(o.name)?0:n[o.name].length?n[o.name].length-1:0},inputRun(){return this.isLinkingEnabled&&this.maxOutputRun===this.maxInputRun?this.outputRun:this.runInputIndex===-1?this.maxInputRun:Math.min(this.runInputIndex,this.maxInputRun)},canLinkRuns(){return this.maxOutputRun>0&&this.maxOutputRun===this.maxInputRun},linked(){return this.isLinkingEnabled&&this.canLinkRuns},inputPanelMargin(){return this.isTriggerNode?0:80},featureRequestUrl(){return this.activeNodeType?`${jn}${this.activeNodeType.name}`:""},outputPanelEditMode(){return this.ndvStore.outputPanelEditMode},isWorkflowRunning(){return this.uiStore.isActionActive("workflowRunning")},isExecutionWaitingForWebhook(){return this.workflowsStore.executionWaitingForWebhook},blockUi(){return this.isWorkflowRunning||this.isExecutionWaitingForWebhook},foreignCredentials(){const e=(this.activeNode||{}).credentials,t=this.workflowsStore.usedCredentials,o=[];return e&&this.settingsStore.isEnterpriseFeatureEnabled(an.Sharing)&&Object.values(e).forEach(n=>{n.id&&t[n.id]&&!t[n.id].currentUserHasAccess&&o.push(n.id)}),o},hasForeignCredential(){return this.foreignCredentials.length>0}},watch:{activeNode(e,t){e&&e.name!==(t==null?void 0:t.name)&&!this.isActiveStickyNode&&(this.runInputIndex=-1,this.runOutputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=void 0,this.triggerWaitingWarningEnabled=!1,this.avgOutputRowHeight=0,this.avgInputRowHeight=0,setTimeout(()=>this.ndvStore.setNDVSessionId(),0),this.$externalHooks().run("dataDisplay.nodeTypeChanged",{nodeSubtitle:this.getNodeSubtitle(e,this.activeNodeType,this.getCurrentWorkflow())}),setTimeout(()=>{if(this.activeNode){const o=this.workflowsStore.outgoingConnectionsByNodeName(this.activeNode.name);this.$telemetry.track("User opened node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,is_editable:!this.hasForeignCredential,parameters_pane_position:this.mainPanelPosition,input_first_connector_runs:this.maxInputRun,output_first_connector_runs:this.maxOutputRun,selected_view_inputs:this.isTriggerNode?"trigger":this.ndvStore.inputPanelDisplayMode,selected_view_outputs:this.ndvStore.outputPanelDisplayMode,input_connectors:this.parentNodes.length,output_connectors:o&&o.main&&o.main.length,input_displayed_run_index:this.inputRun,output_displayed_run_index:this.outputRun,data_pinning_tooltip_presented:this.pinDataDiscoveryTooltipVisible,input_displayed_row_height_avg:this.avgInputRowHeight,output_displayed_row_height_avg:this.avgOutputRowHeight})}},2e3)),window.top&&!this.isActiveStickyNode&&window.top.postMessage(JSON.stringify({command:e?"openNDV":"closeNDV"}),"*")},maxOutputRun(){this.runOutputIndex=-1},maxInputRun(){this.runInputIndex=-1},inputNodeName(e){setTimeout(()=>{this.ndvStore.setInputNodeName(e)},0)},inputRun(){setTimeout(()=>{this.ndvStore.setInputRunIndex(this.inputRun)},0)}},methods:{setIsTooltipVisible({isTooltipVisible:e}){this.pinDataDiscoveryTooltipVisible=e},onKeyDown(e){if(e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.readOnly)return;this.$emit("saveKeyboardShortcut",e)}},onInputItemHover(e){if(e===null||!this.inputNodeName||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.inputNodeName,runIndex:this.inputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onOutputItemHover(e){if(e===null||!this.activeNode||!this.isPairedItemHoveringEnabled){this.ndvStore.setHoveringItem(null);return}const t={nodeName:this.activeNode.name,runIndex:this.outputRun,outputIndex:e.outputIndex,itemIndex:e.itemIndex};this.ndvStore.setHoveringItem(t)},onInputTableMounted(e){this.avgInputRowHeight=e.avgRowHeight},onOutputTableMounted(e){this.avgOutputRowHeight=e.avgRowHeight},onWorkflowActivate(){this.ndvStore.activeNodeName=null,setTimeout(()=>{this.activateCurrentWorkflow("ndv")},1e3)},onFeatureRequestClick(){window.open(this.featureRequestUrl,"_blank"),this.activeNode&&this.$telemetry.track("User clicked ndv link",{node_type:this.activeNode.type,workflow_id:this.workflowsStore.workflowId,session_id:this.sessionId,pane:$.Main,type:"i-wish-this-node-would"})},onPanelsInit(e){this.mainPanelPosition=e.position},onDragStart(e){this.isDragging=!0,this.mainPanelPosition=e.position},onDragEnd(e){this.isDragging=!1,this.$telemetry.track("User moved parameters pane",{window_width:e.windowWidth,start_position:this.mainPanelPosition,end_position:e.position,node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.mainPanelPosition=e.position},onLinkRunToInput(){this.runOutputIndex=this.runInputIndex,this.isLinkingEnabled=!0,this.trackLinking("input")},onLinkRunToOutput(){this.isLinkingEnabled=!0,this.trackLinking("output")},onUnlinkRun(e){this.runInputIndex=this.runOutputIndex,this.isLinkingEnabled=!1,this.trackLinking(e)},trackLinking(e){this.$telemetry.track("User changed ndv run linking",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,linked:this.linked,pane:e})},onNodeExecute(){setTimeout(()=>{!this.activeNode||!this.workflowRunning||(this.triggerWaitingWarningEnabled=!0)},1e3)},openSettings(){this.settingsEventBus.emit("openSettings")},valueChanged(e){this.$emit("valueChanged",e)},nodeTypeSelected(e){this.$emit("nodeTypeSelected",e)},async onSwitchSelectedNode(e){this.$emit("switchSelectedNode",e)},async close(){var e,t;if(!this.isDragging){if(typeof((e=this.activeNodeType)==null?void 0:e.outputs)=="string"||typeof((t=this.activeNodeType)==null?void 0:t.inputs)=="string"||this.redrawRequired){const o=this.activeNode.name;setTimeout(()=>{this.$emit("redrawNode",o)},1)}if(this.outputPanelEditMode.enabled){if(await this.confirm("",this.$locale.baseText("ndv.pinData.beforeClosing.title"),{confirmButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.confirm"),cancelButtonText:this.$locale.baseText("ndv.pinData.beforeClosing.cancel")})===We){const{value:n}=this.outputPanelEditMode;if(this.activeNode)try{this.setPinData(this.activeNode,Nt(n),"on-ndv-close-modal")}catch(i){console.error(i)}}this.ndvStore.setOutputPanelEditModeEnabled(!1)}await this.$externalHooks().run("dataDisplay.nodeEditingFinished"),this.$telemetry.track("User closed node modal",{node_type:this.activeNodeType?this.activeNodeType.name:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId}),this.triggerWaitingWarningEnabled=!1,this.ndvStore.activeNodeName=null,this.ndvStore.resetNDVSessionId()}},onRunOutputIndexChange(e){this.runOutputIndex=e,this.trackRunChange(e,"output")},onRunInputIndexChange(e){this.runInputIndex=e,this.linked&&(this.runOutputIndex=e),this.trackRunChange(e,"input")},trackRunChange(e,t){this.$telemetry.track("User changed ndv run dropdown",{session_id:this.sessionId,run_index:e,node_type:this.activeNodeType?this.activeNodeType.name:"",pane:t})},onInputNodeChange(e,t){this.runInputIndex=-1,this.isLinkingEnabled=!0,this.selectedInput=e,this.$telemetry.track("User changed ndv input dropdown",{node_type:this.activeNode?this.activeNode.type:"",session_id:this.sessionId,workflow_id:this.workflowsStore.workflowId,selection_value:t,input_node_type:this.inputNode?this.inputNode.type:""})},onStopExecution(){this.$emit("stopExecution")},activateInputPane(){this.isInputPaneActive=!0,this.isOutputPaneActive=!1},activateOutputPane(){this.isInputPaneActive=!1,this.isOutputPaneActive=!0},onSearch(e){this.isPairedItemHoveringEnabled=!e}}}),Du="_modalBackground_17uio_5",Eu="_triggerWarning_17uio_10",Cu="_backToCanvas_17uio_14",Iu="_featureRequest_17uio_35",Pu={modalBackground:Du,triggerWarning:Eu,backToCanvas:Cu,featureRequest:Iu};function Ou(e,t,o,n,i,s){const a=S("n8n-icon"),r=S("n8n-text"),l=S("n8n-tooltip"),p=S("TriggerPanel"),h=S("InputPanel"),d=S("OutputPanel"),m=S("NodeSettings"),N=S("font-awesome-icon"),k=S("NDVDraggablePanels"),w=S("el-dialog");return u(),P(w,{modelValue:(!!e.activeNode||e.renaming)&&!e.isActiveStickyNode,"before-close":e.close,"show-close":!1,class:"data-display-wrapper ndv-wrapper","overlay-class":"data-display-overlay",width:"auto","append-to-body":"","data-test-id":"ndv","data-has-output-connection":e.hasOutputConnection},{default:y(()=>{var c;return[v(l,{placement:"bottom-start",visible:e.showTriggerWaitingWarning,disabled:!e.showTriggerWaitingWarning},{content:y(()=>[g("div",{class:D(e.$style.triggerWarning)},b(e.$locale.baseText("ndv.backToCanvas.waitingForTriggerWarning")),3)]),default:y(()=>[g("div",{class:D(e.$style.backToCanvas),onClick:t[0]||(t[0]=(...f)=>e.close&&e.close(...f)),"data-test-id":"back-to-canvas"},[v(a,{icon:"arrow-left",color:"text-xlight",size:"medium"}),v(r,{color:"text-xlight",size:"medium",bold:!0},{default:y(()=>[I(b(e.$locale.baseText("ndv.backToCanvas")),1)]),_:1})],2)]),_:1},8,["visible","disabled"]),e.activeNode?(u(),T("div",{key:0,class:"data-display",ref:"container",onKeydownCapture:t[6]||(t[6]=(...f)=>e.onKeyDown&&e.onKeyDown(...f)),tabindex:"0"},[g("div",{onClick:t[1]||(t[1]=(...f)=>e.close&&e.close(...f)),class:D(e.$style.modalBackground)},null,2),(u(),P(k,{isTriggerNode:e.isTriggerNode,hideInputAndOutput:e.activeNodeType===null,position:e.isTriggerNode&&!e.showTriggerPanel?0:void 0,isDraggable:!e.isTriggerNode,hasDoubleWidth:((c=e.activeNodeType)==null?void 0:c.parameterPane)==="wide",nodeType:e.activeNodeType,key:e.activeNode.name,onSwitchSelectedNode:e.onSwitchSelectedNode,onClose:e.close,onInit:e.onPanelsInit,onDragstart:e.onDragStart,onDragend:e.onDragEnd},Dt({output:y(()=>[v(d,{"data-test-id":"output-panel",canLinkRuns:e.canLinkRuns,runIndex:e.outputRun,linkedRuns:e.linked,sessionId:e.sessionId,isReadOnly:e.readOnly||e.hasForeignCredential,blockUI:e.blockUi&&e.isTriggerNode&&!e.isExecutableTriggerNode,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isOutputPaneActive,onActivatePane:e.activateOutputPane,onLinkRun:e.onLinkRunToOutput,onUnlinkRun:t[3]||(t[3]=()=>e.onUnlinkRun("output")),onRunChange:e.onRunOutputIndexChange,onOpenSettings:e.openSettings,onTableMounted:e.onOutputTableMounted,onItemHover:e.onOutputItemHover,onSearch:e.onSearch},null,8,["canLinkRuns","runIndex","linkedRuns","sessionId","isReadOnly","blockUI","isProductionExecutionPreview","isPaneActive","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onTableMounted","onItemHover","onSearch"])]),main:y(()=>[v(m,{eventBus:e.settingsEventBus,dragging:e.isDragging,sessionId:e.sessionId,nodeType:e.activeNodeType,foreignCredentials:e.foreignCredentials,readOnly:e.readOnly,blockUI:e.blockUi&&e.showTriggerPanel,executable:!e.readOnly,onValueChanged:e.valueChanged,onExecute:e.onNodeExecute,onStopExecution:e.onStopExecution,onRedrawRequired:t[4]||(t[4]=f=>e.redrawRequired=!0),onActivate:e.onWorkflowActivate},null,8,["eventBus","dragging","sessionId","nodeType","foreignCredentials","readOnly","blockUI","executable","onValueChanged","onExecute","onStopExecution","onActivate"]),e.featureRequestUrl?(u(),T("a",{key:0,onClick:t[5]||(t[5]=(...f)=>e.onFeatureRequestClick&&e.onFeatureRequestClick(...f)),class:D(e.$style.featureRequest),target:"_blank"},[v(N,{icon:"lightbulb"}),I(" "+b(e.$locale.baseText("ndv.featureRequest")),1)],2)):C("",!0)]),_:2},[e.showTriggerPanel||!e.isTriggerNode?{name:"input",fn:y(()=>[e.showTriggerPanel?(u(),P(p,{key:0,nodeName:e.activeNode.name,sessionId:e.sessionId,onExecute:e.onNodeExecute,onActivate:e.onWorkflowActivate},null,8,["nodeName","sessionId","onExecute","onActivate"])):e.isTriggerNode?C("",!0):(u(),P(h,{key:1,workflow:e.workflow,canLinkRuns:e.canLinkRuns,runIndex:e.inputRun,linkedRuns:e.linked,currentNodeName:e.inputNodeName,sessionId:e.sessionId,readOnly:e.readOnly||e.hasForeignCredential,isProductionExecutionPreview:e.isProductionExecutionPreview,isPaneActive:e.isInputPaneActive,onActivatePane:e.activateInputPane,onLinkRun:e.onLinkRunToInput,onUnlinkRun:t[2]||(t[2]=()=>e.onUnlinkRun("input")),onRunChange:e.onRunInputIndexChange,onOpenSettings:e.openSettings,onChangeInputNode:e.onInputNodeChange,onExecute:e.onNodeExecute,onTableMounted:e.onInputTableMounted,onItemHover:e.onInputItemHover,onSearch:e.onSearch},null,8,["workflow","canLinkRuns","runIndex","linkedRuns","currentNodeName","sessionId","readOnly","isProductionExecutionPreview","isPaneActive","onActivatePane","onLinkRun","onRunChange","onOpenSettings","onChangeInputNode","onExecute","onTableMounted","onItemHover","onSearch"]))]),key:"0"}:void 0]),1032,["isTriggerNode","hideInputAndOutput","position","isDraggable","hasDoubleWidth","nodeType","onSwitchSelectedNode","onClose","onInit","onDragstart","onDragend"]))],544)):C("",!0)]}),_:1},8,["modelValue","before-close","data-has-output-connection"])}const Ru={$style:Pu},$u=H(Su,[["render",Ou],["__cssModules",Ru]]),Au=x({__name:"ContextMenu",emits:["action"],setup(e,{emit:t}){const o=it(),{position:n,isOpen:i,actions:s,target:a}=o,r=F();Ht(i,()=>{var h,d;i?(h=r.value)==null||h.open():(d=r.value)==null||d.close()},{flush:"post"});function l(h){const d=h;o._dispatchAction(d),t("action",d,o.targetNodes.value)}function p(h){h||o.close()}return(h,d)=>be(i)?(u(),P(wn,{key:0,to:"body"},[g("div",{class:D(h.$style.contextMenu),style:se({left:`${be(n)[0]}px`,top:`${be(n)[1]}px`})},[v(be(Yn),{ref_key:"dropdown",ref:r,items:be(s),placement:"bottom-start","data-test-id":"context-menu",hideArrow:be(a).source!=="node-button",onSelect:l,onVisibleChange:p},{activator:y(()=>[g("div",{class:D(h.$style.activator)},null,2)]),_:1},8,["items","hideArrow"])],6)])):C("",!0)}}),Mu="_contextMenu_2nizv_5",_u="_activator_2nizv_9",Wu={contextMenu:Mu,activator:_u},Vu={$style:Wu},Bu=H(Au,[["__cssModules",Vu]]),Lu=(e,t)=>{const o=Xn.includes(e);return{type:"N8nAddInput",options:{width:24,height:72,color:t,multiple:o}}},Uu=()=>({type:"Rectangle",options:{height:10,width:10,cssClass:"diamond-output-endpoint"}}),Sn=x({mixins:[kn],mounted(){if(this.data!==null)try{this.__addNode(this.data)}catch{}},data(){return{inputs:[],outputs:[]}},computed:{...q(G,ue,Kt,Y,bt),data(){return this.workflowsStore.getNodeByName(this.name)},nodeId(){var e;return((e=this.data)==null?void 0:e.id)||""}},props:{name:{type:String},instance:{type:Object},isReadOnly:{type:Boolean},isActive:{type:Boolean},hideActions:{type:Boolean},disableSelecting:{type:Boolean},showCustomTooltip:{type:Boolean}},methods:{__addEndpointTestingData(e,t,o){if(window!=null&&window.Cypress&&"canvas"in e.endpoint){const n=e.endpoint.canvas;this.instance.setAttribute(n,"data-endpoint-name",this.data.name),this.instance.setAttribute(n,"data-input-index",o.toString()),this.instance.setAttribute(n,"data-endpoint-type",t)}},__addInputEndpoints(e,t){const o={},n={},i=this.workflowsStore.getCurrentWorkflow(),s=ge(i,this.data,t)||[];this.inputs=s;const a=[...s];a.sort((r,l)=>typeof r=="string"?1:typeof l=="string"||r.required&&!l.required?-1:!r.required&&l.required?1:0),a.forEach((r,l)=>{var A,L;let p;typeof r=="string"?p={type:r}:p=r;const h=p.type,d=h===$.Main?$.Main:"other";o.hasOwnProperty(d)?o[d]++:o[d]=0,n.hasOwnProperty(h)?n[h]++:n[h]=0;const m=o[d],N=n[h],k=s.filter(_=>{const te=typeof _=="string"?_:_.type;return h===$.Main?te===$.Main:te!==$.Main}),w=k.filter(_=>_!==$.Main),c=w.filter(_=>typeof _!="string"&&_.required),f=w.filter(_=>typeof _!="string"&&!_.required),E=this.getSpacerIndexes(c.length,f.length),O=Do(h,"input",k.length,E)[m],R=mt(h),W={uuid:Bt(this.nodeId,h,N),anchor:O,maxConnections:p.maxConnections??-1,endpoint:"Rectangle",paintStyle:Rt(t,"--color-foreground-xdark",h),hoverPaintStyle:Rt(t,"--color-primary",h),scope:xi(R),source:h!==$.Main,target:!this.isReadOnly&&s.length>1,parameters:{connection:"target",nodeId:this.nodeId,type:h,index:N},enabled:!this.isReadOnly,cssClass:"rect-input-endpoint",dragAllowedWhenFull:!0,hoverClass:"rect-input-endpoint-hover",...this.__getInputConnectionStyle(h,t)},V=(A=this.instance)==null?void 0:A.addEndpoint(this.$refs[this.data.name],W);this.__addEndpointTestingData(V,"input",N),(p.displayName||(L=t.inputNames)!=null&&L[l])&&V.addOverlay(Fi(p.displayName||t.inputNames[l],h,p.required)),Array.isArray(V)||(V.__meta={nodeName:e.name,nodeId:this.nodeId,index:N,totalEndpoints:k.length,nodeType:e.type})}),a.length===0&&this.instance.manage(this.$refs[this.data.name])},getSpacerIndexes(e,t,o=Gn,n=qn){const i=[];if(e>0&&t>0){if(o)i.push(e);else if(e+t<n)for(let s=e;s<n-t;s++)i.push(s)}else if(e>0&&e<n&&t===0)for(let s=0;s<n-e;s++)i.push(s+e);else if(e===0&&t>0&&t<n)for(let s=0;s<n-t;s++)i.push(s);return i},__addOutputEndpoints(e,t){const o={},n={},i=this.workflowsStore.getCurrentWorkflow();this.outputs=ve(i,this.data,t)||[];let s=0;const a=[];this.outputs.forEach((l,p)=>{var d;let h;typeof l=="string"?h={type:l}:h=l,(d=t.outputNames)!=null&&d[p]&&(h.displayName=t.outputNames[p]),h.displayName&&(s=h.displayName.length>s?h.displayName.length:s),a.push(h)});const r=s<4?"short":"medium";this.outputs.forEach((l,p)=>{const h=a[p],d=h.type,m=d===$.Main?$.Main:"other";o.hasOwnProperty(m)?o[m]++:o[m]=0,n.hasOwnProperty(d)?n[d]++:n[d]=0;const N=o[m],k=n[d],w=this.outputs.filter(R=>{const W=typeof R=="string"?R:R.type;return d===$.Main?W===$.Main:W!==$.Main}),c=Do(d,"output",w.length)[N],f=mt(d),E={uuid:yt(this.nodeId,d,k),anchor:c,maxConnections:-1,endpoint:{type:"Dot",options:{radius:t&&w.length>2?7:9}},hoverPaintStyle:qe(t,"--color-primary"),scope:f,source:!0,target:d!==$.Main,enabled:!this.isReadOnly,parameters:{connection:"source",nodeId:this.nodeId,type:d,index:k},hoverClass:"dot-output-endpoint-hover",connectionsDirected:!0,dragAllowedWhenFull:!1,...this.__getOutputConnectionStyle(d,h,t)},O=this.instance.addEndpoint(this.$refs[this.data.name],E);if(this.__addEndpointTestingData(O,"output",k),h.displayName){const R=Hi(h.displayName,d,h==null?void 0:h.category);O.addOverlay(R)}if(Array.isArray(O)||(O.__meta={nodeName:e.name,nodeId:this.nodeId,index:k,totalEndpoints:w.length,endpointLabelLength:r}),!this.isReadOnly&&d===$.Main){const R={uuid:yt(this.nodeId,d,k),anchor:c,maxConnections:-1,endpoint:{type:"N8nPlus",options:{dimensions:24,connectedEndpoint:O,showOutputLabel:this.outputs.length===1,size:this.outputs.length>=3?"small":"medium",endpointLabelLength:r,hoverMessage:this.$locale.baseText("nodeBase.clickToAddNodeOrDragToConnect")}},source:!0,target:!1,enabled:!this.isReadOnly,paintStyle:{outlineStroke:"none"},hoverPaintStyle:{outlineStroke:"none"},parameters:{connection:"source",nodeId:this.nodeId,type:d,index:k,category:h==null?void 0:h.category},cssClass:"plus-draggable-endpoint",dragAllowedWhenFull:!1};h!=null&&h.category&&(R.cssClass=`${R.cssClass} ${h==null?void 0:h.category}`);const W=this.instance.addEndpoint(this.$refs[this.data.name],R);this.__addEndpointTestingData(W,"plus",k),Array.isArray(W)||(W.__meta={nodeName:e.name,nodeId:this.nodeId,index:k,nodeType:e.type,totalEndpoints:w.length})}})},__addNode(e){const t=this.nodeTypesStore.getNodeType(e.type,e.typeVersion)??this.nodeTypesStore.getNodeType(Jn);this.__addInputEndpoints(e,t),this.__addOutputEndpoints(e,t)},__getEndpointColor(e){return`--node-type-${e}-color`},__getInputConnectionStyle(e,t){return e===$.Main?{paintStyle:Rt(t,this.__getEndpointColor($.Main),e)}:Object.values($).includes(e)?(n=>({endpoint:Lu(n,this.__getEndpointColor(n))}))(e):{}},__getOutputConnectionStyle(e,t,o){const n="output",i=s=>({endpoint:Uu(),paintStyle:qe(o,this.__getEndpointColor(s)),hoverPaintStyle:qe(o,this.__getEndpointColor(s))});return e===$.Main?t.category==="error"?{paintStyle:{...qe(o,this.__getEndpointColor($.Main)),fill:"var(--node-error-output-color)"},cssClass:`dot-${n}-endpoint`}:{paintStyle:qe(o,this.__getEndpointColor($.Main)),cssClass:`dot-${n}-endpoint`}:Object.values($).includes(e)?i(e):{}},touchEnd(e){this.isTouchDevice&&this.uiStore.isActionActive("dragActive")&&this.uiStore.removeActiveAction("dragActive")},mouseLeftClick(e){const t=e.path||e.composedPath&&e.composedPath();for(let o=0;o<t.length;o++)if(t[o].className&&typeof t[o].className=="string"&&t[o].className.includes("no-select-on-click"))return;this.isTouchDevice||(this.uiStore.isActionActive("dragActive")?this.uiStore.removeActiveAction("dragActive"):(this.isCtrlKeyPressed(e)||this.$emit("deselectAllNodes"),this.uiStore.isNodeSelected(this.data.name)?this.$emit("deselectNode",this.name):this.$emit("nodeSelected",this.name)))}}}),xu=x({name:"Node",setup(){return{contextMenu:it()}},mixins:[Ie,Sn,Oe,Pe,ze,Ft],components:{TitledList:zi,FontAwesomeIcon:Rs,NodeIcon:Tt},props:{isProductionExecutionPreview:{type:Boolean,default:!1}},computed:{...q(G,ee,ue,Y),showPinnedDataInfo(){return this.hasPinData&&!this.isProductionExecutionPreview},isDuplicatable(){return this.nodeType?Jo.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(){var e;return this.workflowsStore.getWorkflowResultDataByNodeName(((e=this.data)==null?void 0:e.name)||"")||[]},hasIssues(){var e;return this.nodeExecutionStatus&&["crashed","error","failed"].includes(this.nodeExecutionStatus)?!0:this.hasPinData?!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?pt(this.nodeType):""}})},isPollingTypeNode(){var e;return!!((e=this.nodeType)!=null&&e.polling)},isExecuting(){return this.workflowsStore.isNodeExecuting(this.data.name)},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(){return this.data.type===ot},isConfigNode(){var e;return this.nodeTypesStore.isConfigNode(this.getCurrentWorkflow(),this.data,((e=this.data)==null?void 0:e.type)??"")},isConfigurableNode(){var e;return this.nodeTypesStore.isConfigurableNode(this.getCurrentWorkflow(),this.data,((e=this.data)==null?void 0:e.type)??"")},isTriggerNode(){var e;return this.nodeTypesStore.isTriggerNode(((e=this.data)==null?void 0:e.type)||"")},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=>e.type===this.data.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(n=>n!==$.Main);o.length&&o.forEach(n=>{e[`node-wrapper--connection-type-${n}`]=!0})}return e},nodeWrapperStyles(){const e={left:this.position[0]+"px",top:this.position[1]+"px"};if(this.node&&this.nodeType){const t=this.workflowsStore.getCurrentWorkflow(),o=ge(t,this.node,this.nodeType)||[],i=fe(o).filter(l=>l!==$.Main);if(i.length){o.filter(p=>typeof p!="string"&&p.required);let l=0;e["--configurable-node-input-count"]=i.length+l}const s=ve(t,this.node,this.nodeType)||[],r=fe(s).filter(l=>l===$.Main);e["--node-main-output-count"]=r.length}return e},nodeClass(){return{"node-box":!0,disabled:this.data.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,n;const e=[],t=(o=this.workflowsStore.getWorkflowRunData)==null?void 0:o[this.name];return t&&t.forEach(i=>{i!=null&&i.error&&e.push(`${i.error.message}${i.error.description?` (${i.error.description})`:""}`)}),((n=this.data)==null?void 0:n.issues)!==void 0&&e.push(...Qn(this.data.issues,this.data)),e},nodeDisabledIcon(){return this.data.disabled===!1?"pause":"play"},position(){return this.node?this.node.position:[0,0]},showDisabledLinethrough(){return!this.isConfigurableNode&&!!(this.data.disabled&&this.inputs.length===1&&this.outputs.length===1)},shortNodeType(){return this.$locale.shortNodeType(this.data.type)},nodeTitle(){return this.data.name==="Start"?this.$locale.headerText({key:"headers.start.displayName",fallback:"Start"}):this.data.name},waiting(){const e=this.workflowsStore.getWorkflowExecution;if(e!=null&&e.waitTill){const t=me(e,"data.resultData.lastNodeExecuted");if(this.name===t){const o=new Date(e.waitTill);return o.toISOString()===Zn?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,n,i;const e={};let t="--color-foreground-xdark";return(this.isConfigurableNode||this.isConfigNode)&&(t="--color-foreground-dark"),this.data.disabled?t="--color-foreground-base":this.isExecuting||(this.hasIssues?((i=(n=(o=this.nodeRunData)==null?void 0:o[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-canvas-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=>e.name===this.data.name)!==void 0},shiftOutputCount(){return!!(this.nodeType&&this.outputs.length>2)},shouldShowTriggerTooltip(){return!!this.node&&this.isTriggerNode&&!this.isPollingTypeNode&&!this.hasPinData&&!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)}},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(e){this.data&&this.$emit("run",{name:this.data.name,data:e,waiting:!!this.waiting})}},created(){De(Wt).value||(this.unwatchWorkflowDataItems=this.$watch("workflowDataItems",t=>{this.showPinDataDiscoveryTooltip(t)}))},mounted(){setTimeout(()=>{this.setSubtitle()},0),this.nodeRunData&&setTimeout(()=>{this.$emit("run",{name:this.data&&this.data.name,data:this.nodeRunData,waiting:!!this.waiting})},0)},data(){return{isTouchActive:!1,nodeSubtitle:"",showTriggerNodeTooltip:!1,pinDataDiscoveryTooltipVisible:!1,dragging:!1,unwatchWorkflowDataItems:()=>{}}},methods:{showPinDataDiscoveryTooltip(e){!this.isTriggerNode||this.isManualTypeNode||this.isScheduledGroup||this.uiStore.isModalActive||e===0||(De(Wt).value="true",this.pinDataDiscoveryTooltipVisible=!0,this.unwatchWorkflowDataItems())},setSubtitle(){try{const e=this.getNodeSubtitle(this.data,this.nodeType,this.getCurrentWorkflow())||"";this.nodeSubtitle=e.includes(ei)?"":e}catch{}},disableNode(){this.data!==null&&(this.disableNodes([this.data]),this.historyStore.pushCommandToUndo(new Ki(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(){this.$emit("runWorkflow",this.data.name,"Node.executeNode"),this.$telemetry.track("User clicked node hover button",{node_type:this.data.type,button_name:"execute",workflow_id:this.workflowsStore.workflowId})},onClick(e){this.callDebounced("onClickDebounced",{debounceTime:50,trailing:!0},e)},onClickDebounced(e){e.detail>=2?this.setNodeActive():this.mouseLeftClick(e)},setNodeActive(){this.ndvStore.activeNodeName=this.data?this.data.name:"",this.pinDataDiscoveryTooltipVisible=!1},touchStart(){this.isTouchDevice===!0&&!this.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})}}}),Dn=e=>(fn("data-v-cd47e477"),e=e(),mn(),e),Fu=["id","data-name"],Hu={class:"select-background"},zu={key:0,class:"trigger-icon"},Ku=["innerHTML"],ju={key:0,class:"node-issues","data-test-id":"node-issues"},Yu={key:1,class:"waiting"},Gu=["textContent"],qu={key:2,class:"node-pin-data-icon"},Ju={key:0,class:"items-count"},Xu={key:3},Qu={key:4,class:"data-count"},Zu={key:0,class:"items-count"},ec=["title"],tc={class:"node-trigger-tooltip__wrapper"},oc=["textContent"],nc=Dn(()=>g("span",null,null,-1)),ic=Dn(()=>g("span",null,null,-1)),sc={key:0,class:"node-options no-select-on-click"},ac={class:"node-description"},rc=["title"],lc={"data-test-id":"canvas-node-box-title"},dc={key:0},uc=["title"];function cc(e,t,o,n,i,s){const a=S("font-awesome-icon"),r=S("n8n-tooltip"),l=S("titled-list"),p=S("NodeIcon"),h=S("n8n-icon-button"),d=zt("touch");return u(),T("div",{class:D(e.nodeWrapperClass),style:se(e.nodeWrapperStyles),id:e.nodeId,"data-test-id":"canvas-node",ref:e.data.name,"data-name":e.data.name,onContextmenu:t[2]||(t[2]=m=>e.openContextMenu(m,"node-right-click"))},[z(g("div",Hu,null,512),[[J,e.isSelected]]),g("div",{class:D({"node-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.isTouchDevice,"menu-open":e.isContextMenuOpen})},[z((u(),T("div",{class:D(e.nodeClass),style:se(e.nodeStyle),onClick:t[0]||(t[0]=ie((...m)=>e.onClick&&e.onClick(...m),["left"]))},[e.isTriggerNode?(u(),T("i",zu,[v(r,{placement:"bottom"},{content:y(()=>[g("span",{innerHTML:e.$locale.baseText("node.thisIsATriggerNode")},null,8,Ku)]),default:y(()=>[v(a,{icon:"bolt",size:"lg"})]),_:1})])):C("",!0),e.data.disabled?C("",!0):(u(),T("div",{key:1,class:D({"node-info-icon":!0,"shift-icon":e.shiftOutputCount})},[e.hasIssues?(u(),T("div",ju,[v(r,{"show-after":500,placement:"bottom"},{content:y(()=>[v(l,{title:`${e.$locale.baseText("node.issues")}:`,items:e.nodeIssues},null,8,["title","items"])]),default:y(()=>[v(a,{icon:"exclamation-triangle"})]),_:1})])):e.waiting||e.nodeExecutionStatus==="waiting"?(u(),T("div",Yu,[v(r,{placement:"bottom"},{content:y(()=>[g("div",{textContent:b(e.waiting)},null,8,Gu)]),default:y(()=>[v(a,{icon:"clock"})]),_:1})])):e.showPinnedDataInfo?(u(),T("span",qu,[v(a,{icon:"thumbtack"}),e.workflowDataItems>1?(u(),T("span",Ju,b(e.workflowDataItems),1)):C("",!0)])):e.nodeExecutionStatus==="unknown"?(u(),T("span",Xu)):e.workflowDataItems?(u(),T("span",Qu,[v(a,{icon:"check"}),e.workflowDataItems>1?(u(),T("span",Zu,b(e.workflowDataItems),1)):C("",!0)])):C("",!0)],2)),g("div",{class:"node-executing-info",title:e.$locale.baseText("node.nodeIsExecuting")},[v(a,{icon:"sync-alt",spin:""})],8,ec),g("div",tc,[v(r,{placement:"top","show-after":500,visible:e.showTriggerNodeTooltip,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:y(()=>[g("div",{textContent:b(e.getTriggerNodeTooltip)},null,8,oc)]),default:y(()=>[nc]),_:1},8,["visible"]),e.isTriggerNode?(u(),P(r,{key:0,placement:"top",visible:e.pinDataDiscoveryTooltipVisible,"popper-class":"node-trigger-tooltip__wrapper--item"},{content:y(()=>[I(b(e.$locale.baseText("node.discovery.pinData.canvas")),1)]),default:y(()=>[ic]),_:1},8,["visible"])):C("",!0)]),v(p,{class:"node-icon",nodeType:e.nodeType,size:40,shrink:!1,colorDefault:e.iconColorDefault,disabled:this.data.disabled},null,8,["nodeType","colorDefault","disabled"])],6)),[[d,e.touchStart,"start"],[d,e.touchEnd,"end"]]),e.isReadOnly?C("",!0):z((u(),T("div",sc,[v(h,{"data-test-id":"execute-node-button",type:"tertiary",text:"",icon:"play",disabled:e.workflowRunning||e.isConfigNode,title:e.$locale.baseText("node.executeNode"),onClick:e.executeNode},null,8,["disabled","title","onClick"]),v(h,{"data-test-id":"overflow-node-button",type:"tertiary",text:"",icon:"ellipsis-h",onClick:t[1]||(t[1]=m=>e.openContextMenu(m,"node-button"))})],512)),[[J,!e.hideActions]]),e.showDisabledLinethrough?(u(),T("div",{key:1,class:D({"disabled-linethrough":!0,success:!["unknown"].includes(e.nodeExecutionStatus)&&e.workflowDataItems>0})},null,2)):C("",!0)],2),g("div",ac,[g("div",{class:"node-name",title:e.nodeTitle},[g("p",lc,b(e.nodeTitle),1),e.data.disabled?(u(),T("p",dc,"("+b(e.$locale.baseText("node.disabled"))+")",1)):C("",!0)],8,rc),e.nodeSubtitle!==void 0?(u(),T("div",{key:0,class:"node-subtitle",title:e.nodeSubtitle},b(e.nodeSubtitle),9,uc)):C("",!0)])],46,Fu)}const hc=H(xu,[["render",cc],["__scopeId","data-v-cd47e477"]]),pc=x({name:"Sticky",mixins:[Ie,Sn,Oe,Pe],setup(){const e=F(),t=F(!1),o=i=>{t.value=i},n=it(i=>{var s;i==="change_color"&&(o(!0),(s=e.value)==null||s.click())});return{colorPopoverTrigger:e,contextMenu:n,forceActions:t,setForceActions:o}},props:{nodeViewScale:{type:Number},gridSize:{type:Number}},computed:{...q(G,ee,ue,Y),defaultText(){if(!this.nodeType)return"";const t=this.nodeType.properties.find(o=>o.name==="content");return t&&Pt(t.default)?t.default:""},isSelected(){return this.uiStore.getSelectedNodes.find(e=>e.name===this.data.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&&at(this.node.parameters.height)?this.node.parameters.height:0},width(){return this.node&&at(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")}},data(){return{isResizing:!1,isTouchActive:!1}},methods:{onShowPopover(){this.setForceActions(!0)},onHidePopover(){this.setForceActions(!1)},async deleteNode(){await this.$nextTick(),this.$emit("removeNode",this.data.name)},changeColor(e){this.workflowsStore.updateNodeProperties({name:this.name,properties:{parameters:{...this.node.parameters,color:e}}})},onEdit(e){e&&!this.isActive&&this.node?this.ndvStore.activeNodeName=this.node.name:this.isActive&&!e&&(this.ndvStore.activeNodeName=null)},onMarkdownClick(e,t){if(e){const o=this.name===rn,n=e.querySelector('img[alt="n8n quickstart video"'),i=o&&n?"welcome_video":o&&e.getAttribute("href")==="/templates"?"templates":"other";this.$telemetry.track("User clicked note link",{type:i})}},onInputChange(e){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:n}){this.node&&((o!==0||n!==0)&&this.setPosition([this.node.position[0]+(o||0),this.node.position[1]+(n||0)]),this.setParameters({height:e,width:t}))},onResizeEnd(){this.isResizing=!1},setParameters(e){if(this.node){const t={content:Pt(e.content)?e.content:this.node.parameters.content,height:at(e.height)?e.height:this.node.parameters.height,width:at(e.width)?e.width:this.node.parameters.width,color:Pt(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.isTouchDevice===!0&&!this.isMacOs&&!this.isTouchActive&&(this.isTouchActive=!0,setTimeout(()=>{this.isTouchActive=!1},2e3))},onContextMenu(e){this.node&&this.contextMenu.open(e,{source:"node-right-click",node:this.node})}}}),gc=["id","data-name"],fc={class:"select-sticky-background"},mc=["title"],yc=["title"],wc={class:"content"},vc=["onClick"];function Nc(e,t,o,n,i,s){const a=S("n8n-sticky"),r=S("font-awesome-icon"),l=S("n8n-popover"),p=zt("touch");return u(),T("div",{class:"sticky-wrapper",id:e.nodeId,ref:e.data.name,style:se(e.stickyPosition),"data-name":e.data.name,"data-test-id":"sticky"},[g("div",{class:D({"sticky-default":!0,"touch-active":e.isTouchActive,"is-touch-device":e.isTouchDevice}),style:se(e.stickySize)},[z(g("div",fc,null,512),[[J,e.isSelected]]),z((u(),T("div",{class:"sticky-box",onClick:t[0]||(t[0]=ie((...h)=>e.mouseLeftClick&&e.mouseLeftClick(...h),["left"])),onContextmenu:t[1]||(t[1]=(...h)=>e.onContextMenu&&e.onContextMenu(...h))},[v(a,{modelValue:e.node.parameters.content,height:e.node.parameters.height,width:e.node.parameters.width,scale:e.nodeViewScale,backgroundColor:e.node.parameters.color,id:e.node.id,readOnly:e.isReadOnly,defaultText:e.defaultText,editMode:e.isActive&&!e.isReadOnly,gridSize:e.gridSize,onEdit:e.onEdit,onResizestart:e.onResizeStart,onResize:e.onResize,onResizeend:e.onResizeEnd,onMarkdownClick:e.onMarkdownClick,"onUpdate:modelValue":e.onInputChange},null,8,["modelValue","height","width","scale","backgroundColor","id","readOnly","defaultText","editMode","gridSize","onEdit","onResizestart","onResize","onResizeend","onMarkdownClick","onUpdate:modelValue"])],32)),[[p,e.touchStart,"start"],[p,e.touchEnd,"end"]]),z(g("div",{class:D({"sticky-options":!0,"no-select-on-click":!0,"force-show":e.forceActions})},[z((u(),T("div",{class:"option","data-test-id":"delete-sticky",title:e.$locale.baseText("node.deleteNode")},[v(r,{icon:"trash"})],8,mc)),[[p,e.deleteNode,"tap"]]),v(l,{effect:"dark","popper-style":{width:"208px"},trigger:"click",placement:"top",onShow:e.onShowPopover,onHide:e.onHidePopover},{reference:y(()=>[g("div",{ref:"colorPopoverTrigger",class:"option","data-test-id":"change-sticky-color",title:e.$locale.baseText("node.changeColor")},[v(r,{icon:"palette"})],8,yc)]),default:y(()=>[g("div",wc,[(u(!0),T(Z,null,de(Array.from({length:7}),(h,d)=>{var m,N;return u(),T("div",{class:D(["color",`sticky-color-${d+1}`]),"data-test-id":"color",key:d,onClick:k=>e.changeColor(d+1),style:se({"border-width":"1px","border-style":"solid","border-color":"var(--color-foreground-xdark)","background-color":`var(--color-sticky-background-${d+1})`,"box-shadow":d===0&&((m=e.node)==null?void 0:m.parameters.color)===""||d+1===((N=e.node)==null?void 0:N.parameters.color)?`0 0 0 1px var(--color-sticky-background-${d+1})`:"none"})},null,14,vc)}),128))])]),_:1},8,["onShow","onHide"])],2),[[J,e.showActions]])],6)],12,gc)}const kc=H(pc,[["render",Nc],["__scopeId","data-v-911250ba"]]),bc=60,Tc=30,Sc=30,Dc=15,Ec=-20,jo=-200,Cc=-5;function Ic(e,t){let o=0,n=0;for(;o<e.length&&n<t.length;){const i=e.charAt(o).toLowerCase(),s=t.charAt(n).toLowerCase();i===s&&o++,++n}return e.length!==0&&t.length!==0&&o===e.length}function Pc(e,t){return En(e,t,0,0,null,[],256,0,0,5)}function En(e,t,o,n,i,s,a,r,l,p){let h=0;if(++l>=p)return{matched:!1,outScore:h};if(o===e.length||n===t.length)return{matched:!1,outScore:h};let d=!1,m=[],N=0,k=!0;for(;o<e.length&&n<t.length;){if(e[o].toLowerCase()===t[n].toLowerCase()){if(r>=a)return{matched:!1,outScore:h};k&&i&&(s=[...i],k=!1);const c=[],f=En(e,t,o,n+1,s,c,a,r,l,p),E=f.outScore;f.matched&&((!d||E>N)&&(m=[...c],N=E),d=!0),s[r++]=n,++o}++n}const w=o===e.length;if(w){h=100;let c=Ec*s[0];c=c<jo?jo:c,h+=c;const f=t.length-r;h+=Cc*f;for(let E=0;E<r;E++){const O=s[E];if(E>0){const R=s[E-1];O===R+1&&(h+=bc)}if(O>0){const R=t[O-1],W=t[O];R!==R.toUpperCase()&&W!==W.toLowerCase()&&(h+=Sc),(R==="_"||R===" ")&&(h+=Tc)}else h+=Dc}return d&&(!w||N>h)?(s=[...m],h=N,{matched:!0,outScore:h}):w?{matched:!0,outScore:h}:{matched:!1,outScore:h}}return{matched:!1,outScore:h}}function Oc(e,t){if(e.hasOwnProperty(t))return e[t];const o=t.split(".");let n=e,i=0;for(;n&&i<o.length;){const s=o[i];n=n[s],i++}return n}function Rc(e,t,o){const n=t.reduce((i,s)=>{let a=[];o.forEach(({key:l,weight:p})=>{const h=Oc(s,l);Array.isArray(h)?a=a.concat(h.map(d=>({value:d,weight:p}))):typeof h=="string"&&a.push({value:h,weight:p})});const r=a.reduce((l,{value:p,weight:h})=>{if(!Ic(e,p))return l;const d=Pc(e,p);d.outScore*=h;const{matched:m,outScore:N}=d;return!l&&m||m&&l&&N>l.outScore?d:l},null);return r&&i.push({score:r.outScore,item:s}),i},[]);return n.sort((i,s)=>s.score-i.score),n}function tt(e,t,o="node"){var i,s,a;const n={uuid:pe(),key:e.name,subcategory:t??((a=(s=(i=e.codex)==null?void 0:i.subcategories)==null?void 0:s[le])==null?void 0:a[0])??nt,properties:{...e},type:o};return n}function $c(e){const t=[le,Lt];return e.reduce((o,n)=>{let i=[nt];return t.forEach(s=>{var a,r,l,p;(r=(a=n.codex)==null?void 0:a.categories)!=null&&r.includes(s)&&(i=((p=(l=n.codex)==null?void 0:l.subcategories)==null?void 0:p[s])??[])}),i.forEach(s=>{o[s]||(o[s]=[]),o[s].push(tt(n,s))}),o},{})}function Ac(e){return e.sort((t,o)=>{var s,a,r,l;if(t.type!=="node"||o.type!=="node")return-1;const n=((a=(s=t.properties)==null?void 0:s.displayName)==null?void 0:a.toLowerCase())||t.key,i=((l=(r=o.properties)==null?void 0:r.displayName)==null?void 0:l.toLowerCase())||o.key;return n.localeCompare(i,void 0,{sensitivity:"base"})})}function Yo(e,t){const o=e.toLowerCase().replace("trigger","").trimEnd();return(Rc(o,t,[{key:"properties.displayName",weight:1.3},{key:"properties.codex.alias",weight:1}])||[]).map(({item:i})=>i)}const wt=kt(ti.NODE_CREATOR,()=>{const e=F(xe),t=F([]),o=F({}),n=F(!1),i=F(""),s=Q(()=>Object.values(t.value).map(d=>tt(d)));function a(d){t.value=d}function r(d){o.value=d}function l(d){n.value=d}function p(d){e.value=d}function h(d){i.value=d}return{openSource:i,selectedView:e,showScrim:n,mergedNodes:t,actions:o,setShowScrim:l,setSelectedView:p,setOpenSource:h,setActions:r,setMergeNodes:a,allNodeCreatorNodes:s}}),Mc=["textContent"],_c=x({__name:"CanvasAddButton",props:{showTooltip:{type:Boolean},position:{}},setup(e){const t=e,o=wt(),n=Q(()=>({"--trigger-placeholder-left-position":`${t.position[0]}px`,"--trigger-placeholder-top-position":`${t.position[1]}px`}));return(i,s)=>{const a=S("font-awesome-icon"),r=S("n8n-tooltip");return u(),T("div",{class:D(i.$style.canvasAddButton),style:se(n.value),ref:"container","data-test-id":"canvas-add-button"},[v(r,{placement:"top",visible:i.showTooltip,disabled:be(o).showScrim,"popper-class":i.$style.tooltip,"show-after":700},{content:y(()=>[I(b(i.$locale.baseText("nodeView.canvasAddButton.addATriggerNodeBeforeExecuting")),1)]),default:y(()=>[g("button",{class:D(i.$style.button),onClick:s[0]||(s[0]=l=>i.$emit("click")),"data-test-id":"canvas-plus-button"},[v(a,{icon:"plus",size:"lg"})],2)]),_:1},8,["visible","disabled","popper-class"]),g("p",{class:D(i.$style.label),textContent:b(i.$locale.baseText("nodeView.canvasAddButton.addFirstStep"))},null,10,Mc)],6)}}}),Wc="_canvasAddButton_mfxxv_5",Vc="_button_mfxxv_17",Bc="_label_mfxxv_38",Lc={canvasAddButton:Wc,button:Vc,label:Bc},Uc={$style:Lc},xc=H(_c,[["__cssModules",Uc]]),Fc="data-keyboard-nav-id",Go=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Escape","Tab"],Hc=kt("nodeCreatorKeyboardNavigation",()=>{const e=F([]),t=F(null),o=F({});function n(c){return c==null?void 0:c.getAttribute("data-keyboard-nav-type")}function i(c){return(c==null?void 0:c.getAttribute(Fc))||void 0}async function s(){return new Promise(c=>{k(),setTimeout(()=>{e.value=Array.from(document.querySelectorAll("[data-keyboard-nav-type]")).map(f=>new WeakRef(f)),c()},0)})}function a(c,f){Object.values(o.value).filter(R=>R.keyboardKeys.includes(c)).forEach(R=>{if(!t.value)return;(R.condition===void 0||R.condition(n(f)||"",t.value))&&t.value&&R.handler(t.value,c)})}async function r(c){var V,A,L;const f=c.key;if(!Go.includes(f))return;c.preventDefault(),c.stopPropagation(),await s();const E=e.value.findIndex(_=>i(_==null?void 0:_.deref())===t.value),O=(V=e.value[E])==null?void 0:V.deref(),R=f==="ArrowDown",W=f==="ArrowUp";if(O){if(R){const _=E<e.value.length-1?E+1:0;p((A=e.value[_])==null?void 0:A.deref())}if(W){const _=E>0?E-1:e.value.length-1;p((L=e.value[_])==null?void 0:L.deref())}a(f,O)}}function l(c){t.value=c}function p(c){const f=i(c);f&&(l(f),c!=null&&c.scrollIntoView&&(c==null||c.scrollIntoView({block:"center"})))}async function h(c){var f;await s(),p((f=e.value[c])==null?void 0:f.deref())}function d(){document.addEventListener("keydown",r,{capture:!0})}function m(){k(),document.removeEventListener("keydown",r,{capture:!0})}function N(c,f){f.keyboardKeys.forEach(E=>{if(Go.includes(E))o.value={...o.value,[c]:f};else throw new Error(`Key ${E} is not supported`)})}function k(){e.value=[]}function w(){return e.value.findIndex(c=>i(c==null?void 0:c.deref())===t.value)}return{activeItemId:t,attachKeydownEvent:d,refreshSelectableItems:s,detachKeydownEvent:m,registerKeyHook:N,getActiveItemIndex:w,setActiveItemId:l,setActiveItemIndex:h}});function qo(e,t){return e.filter(o=>{var n,i,s;return(s=(i=(n=o.codex)==null?void 0:n.subcategories)==null?void 0:i[Lt])==null?void 0:s.includes(t)}).map(o=>({key:o.name,type:"node",properties:{group:[],name:o.name,displayName:o.displayName,title:o.displayName,description:o.description,icon:o.icon}})).sort((o,n)=>o.properties.displayName.localeCompare(n.properties.displayName))}function vh(e){const t=Ee(),o=G(),n=qo(o.allLatestNodeTypes,ni),i=qo(o.allLatestNodeTypes,ii);return{value:et,title:t.baseText("nodeCreator.aiPanel.aiNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),info:t.baseText("nodeCreator.aiPanel.infoBox"),items:[...n,...i,{key:Ut,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.aiOtherNodesDescription")}}]}}function zc(e){const t=Ee();function o(n){return{connectionType:n,iconProps:{color:`var(--node-type-${n}-color)`},panelClass:`nodes-list-panel-${n}`}}return{value:Ut,title:t.baseText("nodeCreator.aiPanel.aiOtherNodes"),subtitle:t.baseText("nodeCreator.aiPanel.selectAiNode"),items:[{key:no,type:"subcategory",properties:{title:no,icon:"file-import",...o($.AiDocument)}},{key:io,type:"subcategory",properties:{title:io,icon:"language",...o($.AiLanguageModel)}},{key:so,type:"subcategory",properties:{title:so,icon:"brain",...o($.AiMemory)}},{key:ao,type:"subcategory",properties:{title:ao,icon:"list",...o($.AiOutputParser)}},{key:ro,type:"subcategory",properties:{title:ro,icon:"search",...o($.AiRetriever)}},{key:lo,type:"subcategory",properties:{title:lo,icon:"grip-lines-vertical",...o($.AiTextSplitter)}},{key:uo,type:"subcategory",properties:{title:uo,icon:"tools",...o($.AiTool)}},{key:co,type:"subcategory",properties:{title:co,icon:"vector-square",...o($.AiEmbedding)}},{key:ho,type:"subcategory",properties:{title:ho,icon:"project-diagram",...o($.AiVectorStore)}},{key:po,type:"subcategory",properties:{title:po,icon:"code"}}]}}function Nh(e){const t=Ee();return{value:xe,title:t.baseText("nodeCreator.triggerHelperPanel.selectATrigger"),subtitle:t.baseText("nodeCreator.triggerHelperPanel.selectATriggerDescription"),items:[{key:nt,type:"subcategory",properties:{forceIncludeNodes:[Le,oi],title:"App Trigger Nodes",icon:"satellite-dish"}},{key:go,type:"node",category:[le],properties:{group:[],name:go,displayName:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.scheduleTriggerDescription"),icon:"fa:clock"}},{key:Le,type:"node",category:[le],properties:{group:[],name:Le,displayName:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.webhookTriggerDescription"),iconData:{type:"file",icon:"webhook",fileBuffer:"/static/webhook-icon.svg"}}},{key:Ue,type:"node",category:[le],properties:{group:[],name:Ue,displayName:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.formTriggerDescription"),iconData:{type:"file",icon:"form",fileBuffer:"/static/form-grey.svg"}}},{key:ot,type:"node",category:[le],properties:{group:[],name:ot,displayName:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.manualTriggerDescription"),icon:"fa:mouse-pointer"}},{key:fo,type:"node",category:[le],properties:{group:[],name:fo,displayName:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDisplayName"),description:t.baseText("nodeCreator.triggerHelperPanel.workflowTriggerDescription"),icon:"fa:sign-out-alt"}},{type:"subcategory",key:mo,category:le,properties:{title:mo,icon:"folder-open"}}]}}function kh(e){const t=Ee(),o={value:Vt,title:t.baseText("nodeCreator.triggerHelperPanel.whatHappensNext"),items:[{key:nt,type:"subcategory",properties:{title:"App Regular Nodes",icon:"globe"}},{type:"subcategory",key:yo,category:le,properties:{title:yo,icon:"pen"}},{type:"subcategory",key:wo,category:le,properties:{title:wo,icon:"toolbox"}},{type:"subcategory",key:vo,category:le,properties:{title:vo,icon:"code-branch"}},{type:"subcategory",key:No,category:le,properties:{title:No,icon:"file-alt"}}]};return(e??[]).some(i=>{var s,a;return(a=(s=i.codex)==null?void 0:s.categories)==null?void 0:a.includes(Lt)})&&o.items.push({key:et,type:"view",properties:{title:t.baseText("nodeCreator.aiPanel.langchainAiNodes"),icon:"robot",description:t.baseText("nodeCreator.aiPanel.nodesForAi")}}),o.items.push({key:xe,type:"view",properties:{title:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTrigger"),icon:"bolt",description:t.baseText("nodeCreator.triggerHelperPanel.addAnotherTriggerDescription")}}),o}const Kc=kt("nodeCreatorViewStacks",()=>{const e=wt(),{getActiveItemIndex:t}=Hc(),o=F([]),n=Q(()=>{const w=o.value[o.value.length-1];if(!(w!=null&&w.baselineItems))return w.items?h(w.items):[];if(w.search&&a.value){const c=a.value.length>0?a.value:w.baselineItems;return h(Yo(w.search||"",c))}return h(w.baselineItems)}),i=Q(()=>{const w=o.value[o.value.length-1];return w?{...w,items:n.value,hasSearch:(w.baselineItems||[]).length>8||(w==null?void 0:w.hasSearch)}:{}}),s=Q(()=>i.value.mode||xe),a=Q(()=>{const w=o.value[o.value.length-1];return w!=null&&w.searchItems?w.searchItems.map(c=>tt(c,w.subcategory)):[]}),r=Q(()=>{const w=o.value[o.value.length-1];if(!(w!=null&&w.search))return[];const c=e.mergedNodes.map(E=>tt(E));return h(Yo(w.search||"",c)).filter(E=>!n.value.find(O=>O.key===E.key))});async function l(w,c,f){var W;const E=Ee();let O,R;c===!0?(O=G().visibleNodeTypesByInputConnectionTypeNames,R={properties:{title:E.baseText("nodeCreator.aiPanel.aiNodes"),icon:"robot"}}):(O=G().visibleNodeTypesByOutputConnectionTypeNames,R=zc().items.find(V=>V.properties.connectionType===w)),await vn(),d({title:R==null?void 0:R.properties.title,rootView:Ut,mode:"nodes",items:e.allNodeCreatorNodes,nodeIcon:{iconType:"icon",icon:R==null?void 0:R.properties.icon,color:(W=R==null?void 0:R.properties.iconProps)==null?void 0:W.color},panelClass:R==null?void 0:R.properties.panelClass,baseFilter:V=>{var L;if(V.key===si)return!1;const A=O[w].includes(V.key);return A&&((L=f==null?void 0:f.nodes)!=null&&L.length)?f.nodes.includes(V.key):A},itemsMapper(V){return{...V,subcategory:w}},preventBack:!0})}function p(){const w=o.value[o.value.length-1];if(!w||!i.value.uuid)return;let c=(w==null?void 0:w.items)??$c(e.mergedNodes)[(w==null?void 0:w.subcategory)??nt]??[];if((w.forceIncludeNodes??[]).length>0){const f=e.mergedNodes.filter(E=>{var O;return(O=w.forceIncludeNodes)==null?void 0:O.includes(E.name)}).map(E=>tt(E,w.subcategory));c.push(...f)}w.baseFilter&&(c=c.filter(w.baseFilter)),w.itemsMapper&&(c=c.map(w.itemsMapper)),w.items||Ac(c),N({baselineItems:c})}function h(w){return w.map(c=>({...c,uuid:`${c.key}-${pe()}`}))}function d(w){i.value.uuid&&N({activeIndex:t()});const c=pe();o.value.push({...w,uuid:c,transitionDirection:"in",activeIndex:0}),p()}function m(){i.value.uuid&&(o.value.pop(),N({transitionDirection:"out"}))}function N(w){const c=o.value[o.value.length-1],f=o.value.findIndex(E=>E.uuid===c.uuid);c&&Object.keys(w).forEach(E=>{const O=E;o.value[f]={...o.value[f],[E]:w[O]}})}function k(){o.value=[]}return{viewStacks:o,activeViewStack:i,activeViewStackMode:s,globalSearchItemsDiff:r,gotoCompatibleConnectionView:l,resetViewStacks:k,updateCurrentViewStack:N,pushViewStack:d,popViewStack:m}}),jc=Re(async()=>Ce(()=>import("./NodeCreation-3pcb_BwC.js").then(e=>e.N),__vite__mapDeps([53,2,3,4,5,6,7,8,1,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,54]))),Yc=Re(async()=>Ce(()=>import("./CanvasControls-6jR1_mnm.js"),__vite__mapDeps([55,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,36,37,38,39,40,41,42,43,44,45,56]))),Gc=x({name:"NodeView",mixins:[St,Ie,pn,Ms,Pe,ft,Ft,Oe,ze],components:{NodeDetailsView:$u,Node:hc,Sticky:kc,CanvasAddButton:xc,KeyboardShortcutTooltip:ji,NodeCreation:jc,CanvasControls:Yc,ContextMenu:Bu},setup(e){var i,s;const t=Ee(),o=it(),n=un();return{locale:t,contextMenu:o,dataSchema:n,..._s(),...Yi(),...ai(),...He(),...xt(),...Ws(),...Is(),...(s=(i=ft).setup)==null?void 0:s.call(i,e)}},errorCaptured:(e,t,o)=>{console.error("errorCaptured"),console.error(e)},watch:{async $route(e,t){this.readOnlyEnvRouteCheck();const o=lt(e),n=!this.uiStore.nodeViewInitialized;let i=t.params.name!==e.params.name&&!(t.params.name==="new"&&this.currentWorkflow===Ye)&&t.name!==j.NEW_WORKFLOW&&e.params.action!=="workflowSave";const s=e.name===j.TEMPLATE_IMPORT;if(o===Ge.WORKFLOW||s){if(i||n||s){if(this.startLoading(),n){const a=this.uiStore.stateIsDirty;this.resetWorkspace(),this.uiStore.stateIsDirty=a}await Promise.all([this.loadCredentials(),this.initView()]),this.stopLoading(),this.blankRedirect&&(this.blankRedirect=!1)}await this.checkAndInitDebugMode()}o===Ge.EXECUTIONS&&(i=t.params.name!==e.params.name&&!(e.params.name==="new"&&t.params.name===void 0),i&&(this.uiStore.nodeViewInitialized=!1))},activeNode(){this.createNodeActive=!1},containsTrigger(e){e===!1&&this.canvasStore.setRecenteredCanvasAddButtonPosition(this.getNodeViewOffsetPosition)},nodeViewScale(e){const t=this.$refs.nodeView;t&&(t.style.transform=`scale(${e})`)}},async beforeRouteLeave(e,t,o){if(lt(e)===Ge.EXECUTIONS||t.name===j.TEMPLATE_IMPORT||lt(e)===Ge.WORKFLOW&&t.name===j.EXECUTION_DEBUG){o();return}if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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});n===We?(this.workflowsStore.setWorkflowId(Ye),await this.saveCurrentWorkflow({},!1)&&await this.settingsStore.fetchPromptsData(),this.uiStore.stateIsDirty=!1,t.name===j.NEW_WORKFLOW?await this.$router.replace({name:j.WORKFLOW,params:{name:this.currentWorkflow}},()=>{this.$router.push(e)}):(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o())):n===ri&&(this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),this.workflowsStore.setWorkflowId(Ye),this.resetWorkspace(),this.uiStore.stateIsDirty=!1,o())}else this.collaborationStore.notifyWorkflowClosed(this.currentWorkflow),o()},computed:{...q(Kt,Xi,tn,wt,G,ee,di,sn,Ji,ue,Y,li,wt,qi,cn,bt,Gi,As,$s),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===j.DEMO},showCanvasAddButton(){return this.loadingService===null&&!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!==re)},stickiesToRender(){return this.workflowsStore.allNodes.filter(e=>e.type===re)},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 Qi(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(){return this.$route.params.name||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===vt||this.nodeTypesStore.isTriggerNode(e.type))},containsTrigger(){return this.triggerNodes.length>0},containsChatNodes(){return!!this.nodes.find(e=>e.type===ui&&e.disabled!==!0)},isExecutionDisabled(){return!this.containsTrigger||this.allTriggersDisabled},getNodeViewOffsetPosition(){return this.uiStore.nodeViewOffsetPosition},nodeViewScale(){return this.canvasStore.nodeViewScale},instance(){return this.canvasStore.jsPlumbInstance}},data(){return{GRID_SIZE:Be,STICKY_NODE_TYPE:re,createNodeActive:!1,lastClickPosition:[450,450],ctrlKeyPressed:!1,moveCanvasKeyPressed:!1,stopExecutionInProgress:!1,blankRedirect:!1,credentialsUpdated:!1,pullConnActiveNodeName:null,pullConnActive:!1,dropPrevented:!1,connectionDragScope:{type:null,connection:null},renamingActive:!1,showStickyButton:!1,isExecutionPreview:!1,showTriggerMissingTooltip:!1,workflowData:null,activeConnection:null,isProductionExecutionPreview:!1,enterTimer:void 0,exitTimer:void 0,readOnlyNotification:null,suspendRecordingDetachedConnections:!1,NODE_CREATOR_OPEN_SOURCES:he,eventsAttached:!1,unloadTimeout:void 0}},methods:{editAllowedCheck(){var e;if(!((e=this.readOnlyNotification)!=null&&e.visible))return 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}),!1):!0},showTriggerMissingToltip(e){this.showTriggerMissingTooltip=e},onRunNode(e,t){const o=this.workflowsStore.getNodeByName(e),n={node_type:o?o.type:null,workflow_id:this.workflowsStore.workflowId,source:"canvas",session_id:this.ndvStore.sessionId};this.$telemetry.track("User clicked execute node button",n),this.$externalHooks().run("nodeView.onRunNode",n),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(ci)},async onRunWorkflow(){this.getWorkflowDataToSave().then(e=>{const t={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Ot(e,this.getNodeTypes()).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)===Zi).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 i;const o=this.instance.getManagedElement(t.id),n=this.instance.getEndpoints(o);Object.keys(((i=t==null?void 0:t.issues)==null?void 0:i.input)??{}).forEach(s=>{n.filter(r=>r._defaultType.scope===s).forEach(r=>{const l=r==null?void 0:r.endpoint;l&&l.setError()})})})},onRunContainerClick(){if(this.containsTrigger&&!this.allTriggersDisabled)return;const e=this.containsTrigger&&this.allTriggersDisabled?this.$locale.baseText("nodeView.addOrEnableTriggerNode"):this.$locale.baseText("nodeView.addATriggerNodeFirst");this.registerCustomAction({key:"showNodeCreator",action:()=>this.showTriggerCreator(he.NO_TRIGGER_EXECUTION_TOOLTIP)});const 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.updateNodesExecutionIssues()},async onSaveKeyboardShortcut(e){let t=await this.saveCurrentWorkflow();t&&(await this.settingsStore.fetchPromptsData(),this.$route.name===j.EXECUTION_DEBUG&&await this.$router.replace({name:j.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"}))},showTriggerCreator(e){this.createNodeActive||(this.nodeCreatorStore.setSelectedView(xe),this.nodeCreatorStore.setShowScrim(!0),this.onToggleNodeCreator({source:e,createNodeActive:!0}))},async openExecution(e){var o,n;this.startLoading(),this.resetWorkspace();let t;try{t=await this.workflowsStore.getExecution(e)}catch(i){this.showError(i,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(Ye),this.workflowsStore.setWorkflowExecutionData(t),t.workflowData.pinData&&this.workflowsStore.setWorkflowPinData(t.workflowData.pinData),t.workflowData.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:t.workflowData.id,ownedBy:t.workflowData.ownedBy}),t.workflowData.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:t.workflowData.id,sharedWith:t.workflowData.sharedWith}),t.workflowData.usedCredentials&&this.workflowsStore.setUsedCredentials(t.workflowData.usedCredentials),await this.addNodes(Te(t.workflowData.nodes),Te(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&&((n=(o=t.data)==null?void 0:o.resultData)!=null&&n.error)){let i=!1;if(t.data.resultData.runData){const s=t.data.resultData.runData;e:for(const a of Object.keys(s))for(const r of s[a])if(r.error){i=!0;break e}}!i&&t.data.resultData.error.stack&&(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.stopLoading()},async importWorkflowExact(e){if(!e.workflow.nodes||!e.workflow.connections)throw new Error("Invalid workflow object");this.resetWorkspace(),e.workflow.nodes=es(e.workflow.nodes),await this.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.startLoading(),this.setLoadingText(this.$locale.baseText("nodeView.loadingTemplate")),this.resetWorkspace(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=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(o){this.showError(o,this.$locale.baseText("nodeView.couldntImportWorkflow")),await this.$router.replace({name:j.NEW_WORKFLOW});return}this.blankRedirect=!0,await this.$router.replace({name:j.NEW_WORKFLOW,query:{templateId:e}}),await this.addNodes(t.workflow.nodes,t.workflow.connections),this.workflowData=await this.workflowsStore.getNewWorkflowData(t.name)||{},await this.$nextTick(),this.canvasStore.zoomToFit(),this.uiStore.stateIsDirty=!0,this.$externalHooks().run("template.open",{templateId:e,templateName:t.name,workflow:t.workflow}),this.stopLoading()},async openWorkflow(e){this.startLoading();const t=this.workflowsStore.activeWorkflowExecution;this.resetWorkspace(),this.workflowsStore.addWorkflow(e),this.workflowsStore.setActive(e.active||!1),this.workflowsStore.setWorkflowId(e.id),this.workflowsStore.setWorkflowName({newName:e.name,setStateDirty:!1}),this.workflowsStore.setWorkflowSettings(e.settings||{}),this.workflowsStore.setWorkflowPinData(e.pinData||{}),this.workflowsStore.setWorkflowVersionId(e.versionId),e.ownedBy&&this.workflowsEEStore.setWorkflowOwnedBy({workflowId:e.id,ownedBy:e.ownedBy}),e.sharedWith&&this.workflowsEEStore.setWorkflowSharedWith({workflowId:e.id,sharedWith:e.sharedWith}),e.usedCredentials&&this.workflowsStore.setUsedCredentials(e.usedCredentials);const o=e.tags||[],n=o.map(i=>i.id);this.workflowsStore.setWorkflowTagIds(n||[]),this.tagsStore.upsertTags(o),await this.addNodes(e.nodes,e.connections),this.credentialsUpdated||(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.workflowsStore.activeWorkflowExecution=null,this.workflowsStore.currentWorkflowExecutions=[]):this.workflowsStore.activeWorkflowExecution=t,this.stopLoading(),this.collaborationStore.notifyWorkflowOpened(e.id)},touchTap(e){this.isTouchDevice&&this.mouseDown(e)},mouseDown(e){this.lastClickPosition=this.getMousePositionWithinNodeView(e),e instanceof MouseEvent&&e.button===1&&(this.moveCanvasKeyPressed=!0),this.mouseDownMouseSelect(e,this.moveCanvasKeyPressed),this.mouseDownMoveWorkflow(e,this.moveCanvasKeyPressed),this.createNodeActive=!1},mouseUp(e){e.button===1&&(this.moveCanvasKeyPressed=!1),this.mouseUpMouseSelect(e),this.mouseUpMoveWorkflow(e)},keyUp(e){e.key===this.controlKeyCode&&(this.ctrlKeyPressed=!1),e.key===" "&&(this.moveCanvasKeyPressed=!1)},async keyDown(e){if(this.contextMenu.close(),e.key==="s"&&this.isCtrlKeyPressed(e)){if(e.stopPropagation(),e.preventDefault(),this.isReadOnlyRoute||this.readOnlyEnv)return;this.callDebounced("onSaveKeyboardShortcut",{debounceTime:1e3},e);return}const t=e.path||e.composedPath&&e.composedPath();for(const n of t)if(n.className&&typeof n.className=="string"&&n.className.includes("ignore-key-press"))return;if(window.document.body.classList.contains("el-popup-parent--hidden"))return;if(e.key==="Escape"){this.createNodeActive=!1,this.activeNode&&(this.$externalHooks().run("dataDisplay.nodeEditingFinished"),this.ndvStore.activeNodeName=null);return}if(this.activeNode)return;const o=this.uiStore.getSelectedNodes.map(n=>n&&this.workflowsStore.getNodeByName(n.name)).filter(n=>!!n);if(e.key==="d"&&!this.isCtrlKeyPressed(e))this.callDebounced("toggleActivationNodes",{debounceTime:350},o);else if(e.key==="d"&&this.isCtrlKeyPressed(e))o.length>0&&(e.preventDefault(),this.duplicateNodes(o));else if(e.key==="p"&&!this.isCtrlKeyPressed(e))o.length>0&&(e.preventDefault(),this.togglePinNodes(o,"keyboard-shortcut"));else if(e.key==="Delete"||e.key==="Backspace")e.stopPropagation(),e.preventDefault(),this.callDebounced("deleteNodes",{debounceTime:500},o);else if(e.key==="Tab")this.onToggleNodeCreator({source:he.TAB,createNodeActive:!this.createNodeActive&&!this.isReadOnlyRoute&&!this.readOnlyEnv});else if(e.key==="Enter"&&this.isCtrlKeyPressed(e)&&!this.isReadOnlyRoute&&!this.readOnlyEnv)this.onRunWorkflow();else if(e.key==="S"&&e.shiftKey&&!this.isReadOnlyRoute&&!this.readOnlyEnv)this.onAddNodes({nodes:[{type:re}],connections:[]});else if(e.key===this.controlKeyCode)this.ctrlKeyPressed=!0;else if(e.key===" ")this.moveCanvasKeyPressed=!0;else if(e.key==="F2"&&!this.isReadOnlyRoute&&!this.readOnlyEnv){const n=this.lastSelectedNode;n!==null&&n.type!==re&&this.callDebounced("renameNodePrompt",{debounceTime:1500},n.name)}else if(e.key==="a"&&this.isCtrlKeyPressed(e))e.stopPropagation(),e.preventDefault(),this.callDebounced("selectAllNodes",{debounceTime:1e3});else if(e.key==="c"&&this.isCtrlKeyPressed(e))this.callDebounced("copyNodes",{debounceTime:1e3},o);else if(e.key==="x"&&this.isCtrlKeyPressed(e))e.stopPropagation(),e.preventDefault(),this.callDebounced("cutNodes",{debounceTime:1e3},o);else if(e.key==="n"&&this.isCtrlKeyPressed(e)&&e.altKey){if(e.stopPropagation(),e.preventDefault(),this.isDemo)return;this.$router.currentRoute.name===j.NEW_WORKFLOW?oe.emit("newWorkflow"):this.$router.push({name:j.NEW_WORKFLOW}),this.showMessage({title:this.$locale.baseText("nodeView.showMessage.keyDown.title"),type:"success"})}else if(e.key==="Enter"){const n=this.lastSelectedNode;if(n!==null){if(n.type===re&&(this.isReadOnlyRoute||this.readOnlyEnv))return;this.ndvStore.activeNodeName=n.name}}else if(e.key==="ArrowRight"&&e.shiftKey)e.stopPropagation(),e.preventDefault(),this.callDebounced("selectDownstreamNodes",{debounceTime:1e3});else if(e.key==="ArrowRight"){const n=this.lastSelectedNode;if(n===null)return;const i=this.workflowsStore.outgoingConnectionsByNodeName(n.name);if(i.main===void 0||i.main.length===0)return;this.callDebounced("nodeSelectedByName",{debounceTime:100},i.main[0][0].node,!1,!0)}else if(e.key==="ArrowLeft"&&e.shiftKey)e.stopPropagation(),e.preventDefault(),this.callDebounced("selectUpstreamNodes",{debounceTime:1e3});else if(e.key==="ArrowLeft"){const n=this.lastSelectedNode;if(n===null)return;const i=this.getCurrentWorkflow();if(!i.connectionsByDestinationNode.hasOwnProperty(n.name))return;const s=i.connectionsByDestinationNode[n.name];if(s.main===void 0||s.main.length===0)return;this.callDebounced("nodeSelectedByName",{debounceTime:100},s.main[0][0].node,!1,!0)}else if(["ArrowUp","ArrowDown"].includes(e.key)){const n=this.lastSelectedNode;if(n===null)return;const i=this.getCurrentWorkflow();if(!i.connectionsByDestinationNode.hasOwnProperty(n.name))return;const s=i.connectionsByDestinationNode[n.name];if(!Array.isArray(s.main)||!s.main.length)return;const a=s.main[0][0].node,r=this.workflowsStore.outgoingConnectionsByNodeName(a);if(!Array.isArray(r.main)||!r.main.length)return;let l,p=e.key==="ArrowUp"?-99999999:99999999,h=null;for(const d of r.main)for(const m of d)m.node!==n.name&&(l=this.workflowsStore.getNodeByName(m.node),l&&(e.key==="ArrowUp"?l.position[1]<=n.position[1]&&l.position[1]>p&&(h=l.name,p=l.position[1]):l.position[1]>=n.position[1]&&l.position[1]<p&&(h=l.name,p=l.position[1])));h!==null&&this.callDebounced("nodeSelectedByName",{debounceTime:100},h,!1,!0)}},toggleActivationNodes(e){this.editAllowedCheck()&&this.disableNodes(e,!0)},togglePinNodes(e,t){if(!this.editAllowedCheck())return;this.historyStore.startRecordingUndo();const o=e.some(n=>!this.workflowsStore.pinDataByNodeName(n.name));for(const n of e)if(o){const i=this.dataSchema.getInputDataWithPinned(n);i.length!==0&&this.setPinData(n,i,t)}else this.unsetPinData(n,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.getCurrentWorkflow(),o=this.getConnectedNodes("upstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},selectDownstreamNodes(){const e=this.lastSelectedNode;if(e===null)return;this.deselectAllNodes();const t=this.getCurrentWorkflow(),o=this.getConnectedNodes("downstream",t,e.name);for(const n of o)this.nodeSelectedByName(n);this.nodeSelectedByName(e.name)},pushDownstreamNodes(e,t,o=!1){const n=this.workflowsStore.nodesByName[e],i=this.getCurrentWorkflow(),s=this.getConnectedNodes("downstream",i,e);for(const a of s){const r=this.workflowsStore.nodesByName[a],l=r.position;if(r.position[0]<n.position[0])continue;const p={name:a,properties:{position:[r.position[0]+t,r.position[1]]}};this.workflowsStore.updateNodeProperties(p),this.onNodeMoved(r),(o&&l[0]!==p.properties.position[0]||l[1]!==p.properties.position[1])&&this.historyStore.pushCommandToUndo(new dn(a,l,p.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 n={meta:{instanceId:this.rootStore.instanceId},...o};this.removeForeignCredentialsFromWorkflow(n,this.credentialsStore.allCredentials);const i=JSON.stringify(n,null,2);this.copyToClipboard(i),o.nodes.length>0&&(t||this.showMessage({title:"Copied!",message:"",type:"success"}),this.$telemetry.track("User copied nodes",{node_types:o.nodes.map(s=>s.type),workflow_id:this.workflowsStore.workflowId}))})},async stopExecution(){const e=this.workflowsStore.activeExecutionId;if(e!==null){try{this.stopExecutionInProgress=!0,await this.workflowsStore.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 n={data:o.data,finished:o.finished,mode:o.mode,startedAt:o.startedAt,stoppedAt:o.stoppedAt},i={data:n,executionId:e,retryOf:o.retryOf};this.workflowsStore.finishActiveExecution(i),this.titleSet(o.workflowData.name,"IDLE"),this.workflowsStore.executingNode.length=0,this.workflowsStore.setWorkflowExecutionData(n),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.getWorkflowDataToSave().then(t=>{const o={workflow_id:this.workflowsStore.workflowId,node_graph_string:JSON.stringify(Ot(t,this.getNodeTypes()).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 receivedCopyPasteData(e){if(this.readOnlyEnv)return;if(lt(this.$route)===Ge.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.receivedCopyPasteData.message",{interpolate:{plainTextData:e}}),this.$locale.baseText("nodeView.confirmMessage.receivedCopyPasteData.headline"),{type:"warning",confirmButtonText:this.$locale.baseText("nodeView.confirmMessage.receivedCopyPasteData.confirmButtonText"),cancelButtonText:this.$locale.baseText("nodeView.confirmMessage.receivedCopyPasteData.cancelButtonText"),dangerouslyUseHTMLString:!0})!==We||(o=await this.getWorkflowDataFromUrl(e),o===void 0))return}else try{if(o=JSON.parse(e),!this.editAllowedCheck())return}catch{return}return this.importWorkflowData(o,"paste",!1)}},async getWorkflowDataFromUrl(e){let t;this.startLoading();try{t=await this.workflowsStore.getWorkflowFromUrl(e)}catch(o){this.stopLoading(),this.showError(o,this.$locale.baseText("nodeView.showError.getWorkflowDataFromUrl.title"));return}return this.stopLoading(),t},async importWorkflowData(e,t,o=!0){if(!(!e.hasOwnProperty("nodes")||!e.hasOwnProperty("connections")))try{const n={};e.nodes&&e.nodes.forEach(l=>{if(l.webhookId&&hi.includes(l.type)&&Object.values(this.getCurrentWorkflow().nodes).some(h=>h.webhookId===l.webhookId)&&(l.webhookId=pe()),l.id){const p=pe();n[p]=l.id,l.id=p}else l.id=pe()}),this.removeUnknownCredentials(e);const i=this.rootStore.instanceId,s=JSON.stringify(Ot(e,this.getNodeTypes(),{nodeIdMap:n,sourceInstanceId:e.meta&&e.meta.instanceId!==i?e.meta.instanceId:""}).nodeGraph);t==="paste"?this.$telemetry.track("User pasted nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:s}):t==="duplicate"?this.$telemetry.track("User duplicated nodes",{workflow_id:this.workflowsStore.workflowId,node_graph_string:s}):this.$telemetry.track("User imported workflow",{source:t,workflow_id:this.workflowsStore.workflowId,node_graph_string:s}),this.deselectAllNodes(),this.updateNodePositions(e,ke(this.nodes,this.lastClickPosition));const a=await this.addNodesToWorkflow(e);setTimeout(()=>{a.nodes.forEach(l=>{this.nodeSelectedByName(l.name)})});const r=this.settingsStore.areTagsEnabled;if(o&&r&&Array.isArray(e.tags)){const l=await this.tagsStore.fetchAll(),p=new Set(l.map(k=>k.name)),h=e.tags,d=h.filter(k=>!p.has(k.name)),m=[];for(const k of d){const w=this.tagsStore.create(k.name).then(c=>(l.push(c),c));m.push(w)}await Promise.all(m);const N=h.reduce((k,w)=>{const c=l.find(f=>f.name===w.name);return c&&k.push(c.id),k},[]);this.workflowsStore.addWorkflowTagIds(N)}}catch(n){this.showError(n,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,n]of Object.entries(t.credentials))n.id!==null&&(this.credentialsStore.getCredentialById(n.id)||delete t.credentials[o])}},onDragOver(e){e.preventDefault()},async onDrop(e){if(!e.dataTransfer)return;const t=Nt(e.dataTransfer.getData(pi));if(t){const o=this.getMousePositionWithinNodeView(e),n=[o[0]-Je/2+Be,o[1]-Je/2];await this.onAddNodes(t,!0,n),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 n=this.workflowsStore.getNodeByName(e);n&&(this.nodeSelected(n),this.uiStore.lastSelectedNode=n.name,this.uiStore.lastSelectedNodeOutputIndex=null,this.uiStore.lastSelectedNodeEndpointUuid=null,this.canvasStore.lastSelectedConnection=null,this.canvasStore.newNodeInsertPosition=null,t&&(this.ndvStore.activeNodeName=n.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 s,a,r,l;let o=e.defaultVersion;o===void 0&&(o=Array.isArray(e.version)?e.version.slice(-1)[0]:e.version);const n={id:pe(),name:t.name??e.defaults.name,type:e.name,typeVersion:o,position:[0,0],parameters:{}},i=(s=e.credentials)==null?void 0:s.map(p=>this.credentialsStore.getUsableCredentialByType(p.name)).flat();if(i&&i.length===1){const p=i[0],h=this.credentialsStore.getCredentialById(p.id),d={id:h.id,name:h.name},m={[p.type]:d};await this.loadNodesProperties([n].map(w=>({name:w.type,version:w.typeVersion})));const N=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),k=Ve((N==null?void 0:N.properties)||[],{},!0,!1,n);if(e.credentials){const w=e.credentials.find(f=>f.name===p.type);if((a=w==null?void 0:w.displayOptions)!=null&&a.hide)return n;const c=(r=w==null?void 0:w.displayOptions)==null?void 0:r.show;if(!c)return n.credentials=m,n;if(Object.keys(c).length===1&&c.authentication){n.credentials=m;let f={};for(const E of Object.keys(c)){if(k&&!k[E]){f={},n.credentials=void 0;break}const O=(l=c[E])==null?void 0:l[0];O&&typeof O=="string"&&(f[E]=O),n.parameters={...n.parameters,...f}}}}}return n},async injectNode(e,t={},o=!0,n=!1,i=!1){var p,h;const s=this.nodeTypesStore.getNodeType(e);if(s===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(s.maxNodes!==void 0&&this.getNodeTypeCount(e)>=s.maxNodes){this.showMaxNodeTypeError(s);return}const a=await this.getNewNodeWithDefaultCredential(s,{name:t.name}),r=this.lastSelectedNode;if(t.position)a.position=ke(this.canvasStore.getNodesWithPlaceholderNode(),t.position);else if(r){const d=this.canvasStore.lastSelectedConnection;if(d){const[m]=ts(d);m<=os&&this.pushDownstreamNodes(r.name,$t,n)}if(this.canvasStore.newNodeInsertPosition)a.position=ke(this.nodes,[this.canvasStore.newNodeInsertPosition[0]+Be,this.canvasStore.newNodeInsertPosition[1]-Je/2]),this.canvasStore.newNodeInsertPosition=null;else{let m=0;const N=this.getCurrentWorkflow();if(d){const f=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(f){const E=[[-100,100],[-140,0,140],[-240,-100,100,240]],O=ve(N,r,f),W=fe(O).filter(V=>V===$.Main);if(W.length>1){const V=E[W.length-2],A=d.__meta?d.__meta.sourceOutputIndex:0;m=V[A]}}}let k=[];try{k=ve(N,a,s)}catch{}const w=fe(k),c=this.nodeTypesStore.getNodeType(r.type,r.typeVersion);if(w.length>0&&w.every(f=>f!==$.Main)){const f=N.getNode(r.name),E=ge(N,f,c),R=(fe(E)||[]).filter(W=>W!==$.Main).findIndex(W=>k[0]===W);a.position=ke(this.nodes,[r.position[0]+Je/(Math.max(((p=c==null?void 0:c.inputs)==null?void 0:p.length)??1),1)*R,r.position[1]+$t],[100,0])}else{const f=ge(N,r,c),E=fe(f);let O=$t;E.find(R=>R!==$.Main)&&(O+=150),a.position=ke(this.nodes,[r.position[0]+O,r.position[1]+m],[100,0])}}}else{const d=this.nodeTypesStore.isTriggerNode(e)&&!this.containsTrigger?this.canvasStore.canvasAddButtonPosition:this.lastClickPosition;a.position=ke(this.nodes,d)}const l=this.locale.localizeNodeName(a.name,a.type);if(a.name=this.uniqueNodeName(l),(h=s.webhooks)!=null&&h.length&&(a.webhookId=pe()),await this.addNodes([a],void 0,n),this.workflowsStore.setNodePristine(a.name,!0),this.uiStore.stateIsDirty=!0,e===re)this.$telemetry.trackNodesPanel("nodeView.addSticky",{workflow_id:this.workflowsStore.workflowId});else{this.$externalHooks().run("nodeView.addNodeButton",{nodeTypeName:e}),ns().trackAddedTrigger(e);const d={node_type:e,node_version:a.typeVersion,is_auto_add:i,workflow_id:this.workflowsStore.workflowId,drag_and_drop:t.dragAndDrop};r&&(d.input_node_type=r.type),this.$telemetry.trackNodesPanel("nodeView.addNodeButton",d)}return n&&(this.deselectAllNodes(),setTimeout(()=>{this.nodeSelectedByName(a.name,o&&e!==re)})),a},getConnection(e,t,o,n,i){const s=this.workflowsStore.outgoingConnectionsByNodeName(e)[i];if(s){const a=s[t];if(a)return a.find(r=>r.node===o&&r.index===n)}},connectTwoNodes(e,t,o,n,i){this.uiStore.stateIsDirty=!0;const s=this.workflowsStore.getNodeByName(e),a=this.workflowsStore.getNodeByName(o);if(s&&a&&!this.checkNodeConnectionAllowed(s,a,i)||this.getConnection(e,t,o,n,i))return;const r=[{node:e,type:i,index:t},{node:o,type:i,index:n}];this.__addConnection(r)},async addNode(e,t={},o=!0,n=!1,i=!1){var m;if(!this.editAllowedCheck())return;const s=this.lastSelectedNode,a=this.uiStore.lastSelectedNodeOutputIndex,r=this.uiStore.lastSelectedNodeEndpointUuid,l=this.canvasStore.lastSelectedConnection;this.historyStore.startRecordingUndo();const p=await this.injectNode(e,t,o,n,i);if(!p)return;const h=a||0,d=r||"";if(r&&!i){const N=this.instance.getEndpoint(r);if(N&&this.checkNodeConnectionAllowed(s,p,N.scope)){const k=N.scope,w=this.instance.getManagedElement(p.id),f=this.instance.getEndpoints(w).find(E=>E.scope===k&&N.parameters.connection!==E.parameters.connection);(m=this.instance)==null||m.connect({uuids:[d,(f==null?void 0:f.uuid)||""],detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),this.historyStore.stopRecordingUndo();return}}if(s&&!i){if(await this.$nextTick(),l!=null&&l.__meta){this.__deleteJSPlumbConnection(l,n);const N=l.__meta.targetNodeName,k=l.__meta.targetOutputIndex;this.connectTwoNodes(p.name,0,N,k,$.Main)}this.connectTwoNodes(s.name,h,p.name,0,$.Main)}this.historyStore.stopRecordingUndo()},getNodeCreatorFilter(e,t){let o;const n=this.getCurrentWorkflow(),i=n.getNode(e);if(!i)return{nodes:[]};const s=this.nodeTypesStore.getNodeType(i==null?void 0:i.type,i.typeVersion);if(s){const r=ge(n,i,s).filter(l=>!(typeof l=="string"||l.type!==t||!l.filter));r.length&&(o=r[0].filter)}return o},insertNodeAfterSelected(e){var s,a,r;const t=e.outputType??$.Main,o=this.workflowsStore.getNodeById(e.sourceId);if(!o)return;this.uiStore.lastSelectedNode=o.name,this.uiStore.lastSelectedNodeEndpointUuid=e.endpointUuid??((a=(s=e.connection)==null?void 0:s.target.jtk)==null?void 0:a.endpoint.uuid),this.uiStore.lastSelectedNodeOutputIndex=e.index,this.canvasStore.newNodeInsertPosition=null,e.connection&&(this.canvasStore.lastSelectedConnection=e.connection),this.onToggleNodeCreator({source:e.eventSource,createNodeActive:!0,nodeCreatorView:e.nodeCreatorView});const n=((r=e.connection)==null?void 0:r.endpoints[0].parameters.connection)==="source";t!==$.Main&&Object.values($).includes(t)&&Kc().gotoCompatibleConnectionView(t,n,this.getNodeCreatorFilter(o.name,t)).catch(l=>{})},onEventConnectionAbort(e){try{if(this.dropPrevented){this.dropPrevented=!1;return}if(this.pullConnActiveNodeName){const t=this.workflowsStore.getNodeById(e.parameters.nodeId);if(t){const o=t.name,n=e.parameters.index;this.connectTwoNodes(o,n,this.pullConnActiveNodeName,0,$.Main),this.pullConnActiveNodeName=null,this.dropPrevented=!0}return}this.insertNodeAfterSelected({sourceId:e.parameters.nodeId,index:e.parameters.index,eventSource:he.NODE_CONNECTION_DROP,connection:e,outputType:e.parameters.type})}catch(t){console.error(t)}},checkNodeConnectionAllowed(e,t,o){var i;const n=this.nodeTypesStore.getNodeType(t.type,t.typeVersion);if((i=n==null?void 0:n.inputs)!=null&&i.length){const s=this.getCurrentWorkflow(),a=s.getNode(t.name);let r=[];n&&(r=ge(s,a,n));for(const l of r||[])if(!(typeof l=="string"||l.type!==o||!l.filter)&&l.filter.nodes.length&&!l.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 n=this.workflowsStore.getNodeById(t.nodeId),i=this.workflowsStore.getNodeById(o.nodeId),s=(n==null?void 0:n.name)||"",a=(i==null?void 0:i.name)||"";return n&&i&&!this.checkNodeConnectionAllowed(n,i,o.type)?!1:this.getConnection(s,t.index,a,o.index,t.type)?(this.dropPrevented=!0,this.pullConnActiveNodeName=null,!1):!0}catch(t){return console.error(t),!0}},onEventConnection(e){var t,o;try{if(e.sourceEndpoint.parameters.connection==="target"){const l=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=l}const n=e.sourceEndpoint.parameters,i=e.targetEndpoint.parameters,s=(t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name,a=(o=this.workflowsStore.getNodeById(i.nodeId))==null?void 0:o.name;s&&a&&(e.connection.__meta={sourceNodeName:s,sourceOutputIndex:n.index,targetNodeName:a,targetOutputIndex:i.index}),Xe(e.connection),is(e.targetEndpoint);const r=[{node:s,type:n.type,index:n.index},{node:a,type:i.type,index:i.index}];if(this.dropPrevented=!0,this.workflowsStore.addConnection({connection:r}),this.uiStore.stateIsDirty=!0,this.suspendRecordingDetachedConnections||this.historyStore.pushCommandToUndo(new ss(r)),!this.isReadOnlyRoute&&!this.readOnlyEnv){as(e.sourceEndpoint),rs(e.connection,()=>{this.activeConnection=null,this.__deleteJSPlumbConnection(e.connection)},()=>{this.insertNodeAfterSelected({sourceId:e.sourceEndpoint.parameters.nodeId,index:n.index,connection:e.connection,eventSource:he.NODE_CONNECTION_ACTION})}),setTimeout(()=>{ls(e.source,e.target,"canvas"in e.connection.connector?e.connection.connector.canvas:void 0)},0);const l=us(e.connection,ds);n.type!==$.Main&&(e.connection.setPaintStyle(cs(e.connection,e.sourceEndpoint.parameters.category)),l==null||l.setVisible(!1))}this.dropPrevented=!1,this.updateNodesInputIssues(),this.resetEndpointsErrors()}catch(n){console.error(n)}},onDragMove(){var e;(e=this.instance)==null||e.connections.forEach(t=>{Eo(t),Co(t),Object.values(t.overlays).forEach(o=>{var n;o.canvas&&((n=this.instance)==null||n.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)&&Io(this.activeConnection),this.enterTimer=void 0,e&&(hs(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)&&(Io(this.activeConnection),this.activeConnection=null)},500)}catch(t){console.error(t)}},onConnectionMoved(e){var t,o;try{Po(e.connection);const n=e.connection.parameters,i=e.originalEndpoint.parameters,s=[{node:((t=this.workflowsStore.getNodeById(n.nodeId))==null?void 0:t.name)||"",type:n.type,index:n.index},{node:((o=this.workflowsStore.getNodeById(i.nodeId))==null?void 0:o.name)||"",type:i.type,index:i.index}];this.__removeConnection(s,!1)}catch(n){console.error(n)}},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){try{if(e.sourceEndpoint.parameters.connection==="target"){const o=e.sourceEndpoint;e.sourceEndpoint=e.targetEndpoint,e.targetEndpoint=o}const t=Oo(e);if(Po(e.targetEndpoint),ps(e.sourceEndpoint,e.connection),e.connection.removeOverlays(),this.__removeConnectionByConnectionInfo(e,!1,!1),this.pullConnActiveNodeName){this.historyStore.startRecordingUndo();const n=this.workflowsStore.getNodeById(e.connection.parameters.nodeId).name,i=e.connection.parameters.index;t&&this.historyStore.pushCommandToUndo(new dt(t)),this.connectTwoNodes(n,i,this.pullConnActiveNodeName,0,$.Main),this.pullConnActiveNodeName=null,await this.$nextTick(),this.historyStore.stopRecordingUndo()}else if(!this.historyStore.bulkInProgress&&!this.suspendRecordingDetachedConnections&&t){const o=new dt(t,this);this.historyStore.pushCommandToUndo(o)}this.updateNodesInputIssues()}catch(t){console.error(t)}},onConnectionDrag(e){var t;(t=e.overlays["midpoint-arrow"])==null||t.setVisible(!1);try{this.pullConnActiveNodeName=null,this.pullConnActive=!0,this.canvasStore.newNodeInsertPosition=null,Xe(e);const o=[...document.querySelectorAll(".node-wrapper")],n=s=>{if(!e)return;const a=document.querySelector(".jtk-endpoint.jtk-drag-hover");if(a){const p=a.jtk.endpoint;Ro(e,p);return}const r=24;o.find(p=>{var c;const{top:h,left:d,right:m,bottom:N}=p.getBoundingClientRect(),[k,w]=Fe(s);if(h<=w&&N>=w&&d-r<=k&&m>=k){const f=p.dataset.name,E=this.workflowsStore.getNodeByName(f);if(E){const O=this.nodeTypesStore.getNodeType(E.type,E.typeVersion),R=this.getCurrentWorkflow(),W=R.getNode(f),V=ge(R,W,O);if(O&&V.length===1){this.pullConnActiveNodeName=E.name;const A=this.getInputEndpointUUID(f,e.parameters.type,0);if(A){const L=(c=this.instance)==null?void 0:c.getEndpoint(A);return Ro(e,L),!0}}}}return!1})||(gs(e),this.pullConnActiveNodeName=null)},i=s=>{this.pullConnActive=!1,this.canvasStore.newNodeInsertPosition=this.getMousePositionWithinNodeView(s),fs(e),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",i),this.connectionDragScope={type:null,connection:null}};window.addEventListener("mousemove",n),window.addEventListener("touchmove",n),window.addEventListener("mouseup",i),window.addEventListener("touchend",n),this.connectionDragScope={type:e.parameters.type,connection:e.parameters.connection}}catch(o){console.error(o)}},onConnectionDragAbortDetached(e){var t;Object.values((t=this.instance)==null?void 0:t.endpointsByElement).flatMap(o=>Object.values(o)).filter(o=>o.endpoint.type==="N8nPlus").forEach(o=>setTimeout(()=>o.instance.revalidate(o.element),0))},onPlusEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:he.PLUS_ENDPOINT,outputType:e.scope,endpointUuid:e.uuid})},onAddInputEndpointClick(e){e!=null&&e.__meta&&this.insertNodeAfterSelected({sourceId:e.__meta.nodeId,index:e.__meta.index,eventSource:he.ADD_INPUT_ENDPOINT,nodeCreatorView:et,outputType:e.scope,endpointUuid:e.uuid})},bindCanvasEvents(){this.eventsAttached||(this.instance.bind(ut,this.onEventConnectionAbort),this.instance.bind(ko,this.onInterceptBeforeDrop),this.instance.bind(bo,this.onEventConnection),this.instance.bind(Vo,this.onDragMove),this.instance.bind(Bo,this.onConnectionMouseOver),this.instance.bind(Lo,this.onConnectionMouseOut),this.instance.bind(To,this.onConnectionMoved),this.instance.bind(Uo,this.onEndpointMouseOver),this.instance.bind(xo,this.onEndpointMouseOut),this.instance.bind(rt,this.onConnectionDetached),this.instance.bind(ct,this.onConnectionDrag),this.instance.bind([ct,ut,rt],this.onConnectionDragAbortDetached),this.instance.bind($o,this.onPlusEndpointClick),this.instance.bind(Ao,this.onAddInputEndpointClick),this.eventsAttached=!0)},unbindCanvasEvents(){this.instance.unbind(ut,this.onEventConnectionAbort),this.instance.unbind(ko,this.onInterceptBeforeDrop),this.instance.unbind(bo,this.onEventConnection),this.instance.unbind(Vo,this.onDragMove),this.instance.unbind(Bo,this.onConnectionMouseOver),this.instance.unbind(Lo,this.onConnectionMouseOut),this.instance.unbind(To,this.onConnectionMoved),this.instance.unbind(Uo,this.onEndpointMouseOver),this.instance.unbind(xo,this.onEndpointMouseOut),this.instance.unbind(rt,this.onConnectionDetached),this.instance.unbind(ct,this.onConnectionDrag),this.instance.unbind(ct,this.onConnectionDragAbortDetached),this.instance.unbind(ut,this.onConnectionDragAbortDetached),this.instance.unbind(rt,this.onConnectionDragAbortDetached),this.instance.unbind($o,this.onPlusEndpointClick),this.instance.unbind(Ao,this.onAddInputEndpointClick),this.eventsAttached=!1},unbindEndpointEventListeners(e=!0){if(this.instance){const t=this.instance.getManagedElements();for(const o of Object.values(t)){const n=o.endpoints;for(const i of n||[]){const s=i==null?void 0:i.endpoint;s&&s.type===ms&&s.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*gi.SECOND),e.returnValue=!0,!0;this.startLoading(this.$locale.baseText("nodeView.redirecting")),this.collaborationStore.notifyWorkflowClosed(this.workflowsStore.workflowId);return}},onUnload(){clearTimeout(this.unloadTimeout)},async newWorkflow(){this.startLoading(),this.resetWorkspace(),this.workflowData=await this.workflowsStore.getNewWorkflowData(),this.workflowsStore.currentWorkflowExecutions=[],this.workflowsStore.activeWorkflowExecution=null,this.uiStore.stateIsDirty=!1,this.canvasStore.setZoomLevel(1,[0,0]),await this.tryToAddWelcomeSticky(),this.uiStore.nodeViewInitialized=!0,this.historyStore.reset(),this.workflowsStore.activeWorkflowExecution=null,this.stopLoading()},async tryToAddWelcomeSticky(){this.canvasStore.zoomToFit()},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===j.TEMPLATE_IMPORT){const o=this.$route.params.id;await this.openWorkflowTemplate(o)}else{if(this.uiStore.stateIsDirty&&!this.readOnlyEnv){const n=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(n===We)await this.saveCurrentWorkflow()&&await this.settingsStore.fetchPromptsData();else if(n===fi)return}let o=null;if(this.$route.params.name&&(o=this.$route.params.name),o!==null){let n;try{n=await this.workflowsStore.fetchWorkflow(o)}catch(i){this.showError(i,this.$locale.baseText("openWorkflow.workflowNotFoundError")),this.$router.push({name:j.NEW_WORKFLOW})}n&&(this.titleSet(n.name,"IDLE"),await this.openWorkflow(n),await this.checkAndInitDebugMode(),(e=n.meta)!=null&&e.onboardingId&&this.$telemetry.track(`User opened workflow from onboarding template with ID ${n.meta.onboardingId}`,{workflow_id:n.id},{withPostHog:!0}))}else((t=this.$route.meta)==null?void 0:t.nodeView)===!0&&await this.newWorkflow()}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)},getOutputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?yt(n.id,t,o):null},getInputEndpointUUID(e,t,o){const n=this.workflowsStore.getNodeByName(e);return n?Bt(n.id,t,o):null},__addConnection(e){var i;const t=this.getOutputEndpointUUID(e[0].node,e[0].type,e[0].index),o=this.getInputEndpointUUID(e[1].node,e[1].type,e[1].index);if(!t||!o)return;const n=[t,o];(i=this.instance)==null||i.connect({uuids:n,detachable:!this.isReadOnlyRoute&&!this.readOnlyEnv}),setTimeout(()=>{this.addPinDataConnections(this.workflowsStore.pinData)})},__removeConnection(e,t=!1){var o,n;if(t){const i=this.workflowsStore.getNodeByName(e[0].node),s=this.workflowsStore.getNodeByName(e[1].node);if(!i||!s)return;const a=this.nodeTypesStore.getNodeType(i.type,i.typeVersion),r=((o=a==null?void 0:a.outputs)==null?void 0:o[e[0].index])||$.Main,l=typeof r=="string"?r:r.name,p=mt(l);((n=this.instance)==null?void 0:n.getConnections({scope:p,source:i.id,target:s.id})).forEach(d=>{d.__meta?d.__meta.sourceOutputIndex===e[0].index&&d.__meta.targetOutputIndex===e[1].index&&this.__deleteJSPlumbConnection(d):this.__deleteJSPlumbConnection(d)})}this.workflowsStore.removeConnection({connection:e})},__deleteJSPlumbConnection(e,t=!1){var o,n,i;if(e.removeOverlays(),this.pullConnActiveNodeName=null,(o=this.instance)==null||o.deleteConnection(e),t&&e.__meta){const s=[{index:(n=e.__meta)==null?void 0:n.sourceOutputIndex,node:e.__meta.sourceNodeName,type:$.Main},{index:(i=e.__meta)==null?void 0:i.targetOutputIndex,node:e.__meta.targetNodeName,type:$.Main}],a=new dt(s,this);this.historyStore.pushCommandToUndo(a)}},__removeConnectionByConnectionInfo(e,t=!1,o=!1){const n=Oo(e);n&&(t?this.__deleteJSPlumbConnection(e.connection,o):o&&this.historyStore.pushCommandToUndo(new dt(n)),this.workflowsStore.removeConnection({connection:n}))},async duplicateNodes(e){if(!this.editAllowedCheck())return;const t=Te(await this.getNodesToSave(e));await this.importWorkflowData(t,"duplicate",!1)},getJSPlumbConnection(e,t,o,n,i){var c,f;const s=this.workflowsStore.getNodeByName(e),a=this.workflowsStore.getNodeByName(o);if(!s||!a)return;const r=s.id,l=a.id,p=yt(r,i,t),h=Bt(l,i,n),d=this.nodeTypesStore.getNodeType(s.type,s.typeVersion),m=((c=d==null?void 0:d.outputs)==null?void 0:c[t])||$.Main,N=typeof m=="string"?m:m.name,k=mt(N);return((f=this.instance)==null?void 0:f.getConnections({scope:k,source:r,target:l})).find(E=>{const O=E.getUuids();return O[0]===p&&O[1]===h})},getJSPlumbEndpoints(e){var i;const t=this.workflowsStore.getNodeByName(e),o=this.instance.getManagedElement(t==null?void 0:t.id);return(i=this.instance)==null?void 0:i.getEndpoints(o)},getPlusEndpoint(e,t){return this.getJSPlumbEndpoints(e).find(n=>{var i;return n.endpoint.type==="N8nPlus"&&((i=n==null?void 0:n.__meta)==null?void 0:i.index)===t})},getIncomingOutgoingConnections(e){var o,n;const t=this.workflowsStore.getNodeByName(e);if(t){const i=(o=this.instance)==null?void 0:o.getConnections({source:t.id});return{incoming:(n=this.instance)==null?void 0:n.getConnections({target:t.id}),outgoing:i}}return{incoming:[],outgoing:[]}},onNodeMoved(e){const{incoming:t,outgoing:o}=this.getIncomingOutgoingConnections(e.name);[...t,...o].forEach(n=>{Co(n),Eo(n)})},onNodeRun({name:e,data:t,waiting:o}){var d;const n=this.workflowsStore.getPinData;if(n!=null&&n[e])return;const i=e,s=this.workflowsStore.getNodeByName(i),a=s!==null?s.id:"";if(t===null||t.length===0||o){((d=this.instance)==null?void 0:d.getConnections({source:a})).forEach(k=>{Xe(k)}),this.getJSPlumbEndpoints(i).forEach(k=>{k.endpoint.type==="N8nPlus"&&k.endpoint.clearSuccessOutput()});return}const r=this.workflowsStore.outgoingConnectionsByNodeName(i),l=Object.keys(r)[0],p=r[l],h=ys(t,p||[],l??$.Main);Object.keys(h).forEach(m=>{Object.keys(h[m]).forEach(N=>{Object.keys(h[m][N]).forEach(k=>{if(N){const c=this.getJSPlumbConnection(i,parseInt(m,10),N,parseInt(k,10),l);if(c){const f=h[m][N][k];f.isArtificialRecoveredEventItem?ws(c):!(f!=null&&f.total)&&!f.isArtificialRecoveredEventItem?Xe(c):Mo(c,f)}}const w=this.getPlusEndpoint(i,parseInt(m,10));if(w!=null&&w.endpoint){const c=h[m][mi][0];c&&c.total>0?w.endpoint.setSuccessOutput(vs(c)):w.endpoint.clearSuccessOutput()}})})})},removeNode(e,t=!1,o=!0){if(!this.editAllowedCheck())return;const n=this.workflowsStore.getNodeByName(e);if(!n)return;t&&o&&this.historyStore.startRecordingUndo();const i=[];if(i.includes(n.type)){let d=!1;for(const m of this.nodes)if(m.name!==n.name&&i.includes(m.type)){d=!0;break}if(!d)return}n.type===re?this.$telemetry.track("User deleted workflow note",{workflow_id:this.workflowsStore.workflowId,is_welcome_note:n.name===rn}):(this.$externalHooks().run("node.deleteNode",{node:n}),this.$telemetry.track("User deleted node",{node_type:n.type,workflow_id:this.workflowsStore.workflowId}));let s=!1;const a=this.nodeTypesStore.getNodeType(n.type,n.typeVersion),r=this.getCurrentWorkflow(),l=r.getNode(n.name);let p=[],h=[];if(a&&(p=ge(r,l,a),h=ve(r,l,a)),h.length===1&&p.length===1){const{incoming:d,outgoing:m}=this.getIncomingOutgoingConnections(n.name);if(d.length===1&&m.length===1){const N=d[0],k=m[0];if(N.__meta&&k.__meta){s=!0;const w=N.__meta.sourceNodeName,c=N.__meta.sourceOutputIndex,f=k.__meta.targetNodeName,E=k.__meta.targetOutputIndex;setTimeout(()=>{var O;this.connectTwoNodes(w,c,f,E,$.Main),s&&((O=this.instance)==null||O.setSuspendDrawing(!1,!0),s=!1)},100)}}}vn(()=>{var d,m,N;(d=this.instance)==null||d.setSuspendDrawing(!0),(((m=this.instance)==null?void 0:m.endpointsByElement[n.id])||[]).flat().forEach(k=>{var w;return(w=this.instance)==null?void 0:w.deleteEndpoint(k)}),this.workflowsStore.removeAllNodeConnection(n),this.workflowsStore.removeNode(n),this.workflowsStore.clearNodeExecutionData(n.name),s||(N=this.instance)==null||N.setSuspendDrawing(!1,!0),this.uiStore.removeNodeFromSelection(n),t&&this.historyStore.pushCommandToUndo(new ks(n))}),t&&o&&setTimeout(()=>{this.historyStore.stopRecordingUndo()},s?100:0)},async onSwitchSelectedNode(e){this.nodeSelectedByName(e,!0,!0)},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});await this.$nextTick();const o=document.querySelector(".rename-prompt .el-input__inner");o&&(o.focus(),o.select());const n=await t;if((n==null?void 0:n.action)!==We)return;await this.renameNode(e,n.value,!0)}catch{}},async renameNode(e,t,o=!1){if(e===t)return;this.suspendRecordingDetachedConnections=!0,o&&this.historyStore.startRecordingUndo();const i=(this.activeNode&&this.activeNode.name)===e;i&&(this.renamingActive=!0),t=this.uniqueNodeName(t);const s=this.getCurrentWorkflow(!0);s.renameNode(e,t),o&&this.historyStore.pushCommandToUndo(new hn(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.addNodes(Object.values(s.nodes),s.connectionsBySourceNode,!1),this.deselectAllNodes(),this.nodeSelectedByName(t),i&&(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}))},matchCredentials(e){e.credentials&&Object.entries(e.credentials).forEach(([t,o])=>{const n=this.credentialsStore.getCredentialsByType(t);if(typeof o=="string"&&(o={id:null,name:o},this.credentialsUpdated=!0),o.id){const s=o.id.toString(),a=n.find(r=>r.id===s);if(a){(a.name!==o.name||typeof o.id=="number")&&(e.credentials[t]={id:a.id,name:a.name},this.credentialsUpdated=!0);return}}e.credentials[t]=o;const i=n.filter(s=>s.name===o.name);i.length===1&&(e.credentials[t].id=i[0].id,this.credentialsUpdated=!0)})},async addNodes(e,t,o=!1){var i,s;if(!(e!=null&&e.length))return;await this.loadNodesProperties(e.map(a=>({name:a.type,version:a.typeVersion})));let n;if(e.forEach(a=>{if(a.id||(a.id=pe()),n=this.nodeTypesStore.getNodeType(a.type,a.typeVersion),a.hasOwnProperty("disabled")||(a.disabled=!1),a.hasOwnProperty("parameters")||(a.parameters={}),n!==null){let r=null;try{r=Ve(n.properties,a.parameters,!0,!1,a)}catch(l){console.error(this.$locale.baseText("nodeView.thereWasAProblemLoadingTheNodeParametersOfNode")+`: "${a.name}"`),console.error(l)}a.parameters=r!==null?r:{},a.type===Le&&a.parameters.path===""&&(a.parameters.path=a.webhookId)}this.matchCredentials(a),this.workflowsStore.addNode(a),o&&this.historyStore.pushCommandToUndo(new Ns(a))}),await this.$nextTick(),(i=this.instance)==null||i.setSuspendDrawing(!0),t!==void 0){let a;for(const r of Object.keys(t))for(const l of Object.keys(t[r]))for(let p=0;p<t[r][l].length;p++){const h=t[r][l][p];h&&h.forEach(d=>{a=[{node:r,type:l,index:p},{node:d.node,type:d.type,index:d.index}],this.__addConnection(a)})}}this.refreshNodeIssues(),(s=this.instance)==null||s.setSuspendDrawing(!1,!0)},async addNodesToWorkflow(e){const t={},o=[];if(!e.nodes)throw new Error(this.$locale.baseText("nodeView.noNodesGivenToAdd"));const n=this.getNodeTypesMaxCount();let i,s;const a=[];await this.loadNodesProperties(e.nodes.map(c=>({name:c.type,version:c.typeVersion}))),e.nodes.forEach(c=>{if(n[c.type]!==void 0)if(n[c.type].exist>=n[c.type].max){t[c.name]=n[c.type].nodeNames[0];return}else n[c.type].exist+=1;i=c.name;const f=this.locale.localizeNodeName(c.name,c.type);s=this.uniqueNodeName(f,o),o.push(s),t[i]=s,a.push(c)});const r={},l=e.connections,p=a.map(c=>c.name);let h,d,m,N,k;for(h of Object.keys(l)){if(!p.includes(h))continue;const c={};for(d of Object.keys(l[h]))for(c[d]=[],m=0;m<l[h][d].length;m++){const f=[];if(l[h][d][m])for(N=0;N<l[h][d][m].length;N++)k=l[h][d][m][N],p.includes(k.node)&&f.push(k);c[d].push(f)}r[h]=c}const w=this.getWorkflow(a,r);for(i in t)i!==t[i]&&w.renameNode(i,t[i]);if(e.pinData){let c=!0;for(const f of Object.keys(e.pinData)){if(!c){this.showError(new Error(this.$locale.baseText("ndv.pinData.error.tooLarge.description")),this.$locale.baseText("ndv.pinData.error.tooLarge.title"));continue}const E=w.nodes[t[f]];try{this.setPinData(E,e.pinData[f],"add-nodes"),c=!0}catch(O){c=!1,console.error(O)}}}return this.historyStore.startRecordingUndo(),await this.addNodes(Object.values(w.nodes),w.connectionsBySourceNode,!0),this.historyStore.stopRecordingUndo(),this.uiStore.stateIsDirty=!0,{nodes:Object.values(w.nodes),connections:w.connectionsBySourceNode}},async getNodesToSave(e){const t={nodes:[],connections:{},pinData:{}};let o;const n=[];for(const d of e){o=this.getNodeDataToSave(d),n.push(d.name),t.nodes.push(o);const m=this.workflowsStore.pinDataByNodeName(d.name);if(m&&(t.pinData[d.name]=m),o.credentials&&this.settingsStore.isEnterpriseFeatureEnabled(an.Sharing)){const N=this.workflowsStore.usedCredentials;o.credentials=Object.fromEntries(Object.entries(o.credentials).filter(([k,w])=>{var c;return w.id&&(!N[w.id]||((c=N[w.id])==null?void 0:c.currentUserHasAccess))}))}}let i,s,a,r,l,p,h;return t.nodes.forEach(d=>{if(s=this.workflowsStore.outgoingConnectionsByNodeName(d.name),Object.keys(s).length!==0){h={};for(a of Object.keys(s))for(l=0;l<s[a].length;l++){for(i=[],r=0;r<s[a][l].length;r++)p=s[a][l][r],n.indexOf(p.node)!==-1&&i.push(p);i.length&&(h.hasOwnProperty(a)||(h[a]=[]),h[a][l]=i)}Object.keys(h).length&&(t.connections[d.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.credentialsUpdated=!1},async loadActiveWorkflows(){await this.workflowsStore.fetchActiveWorkflows()},async loadNodeTypes(){await this.nodeTypesStore.getNodeTypes()},async loadCredentialTypes(){await this.credentialsStore.fetchCredentialTypes(!0)},async loadCredentials(){await this.credentialsStore.fetchAllCredentials()},async loadVariables(){await this.environmentsStore.fetchAllVariables()},async loadSecrets(){await this.externalSecretsStore.fetchAllSecrets()},async loadNodesProperties(e){const t=this.nodeTypesStore.allNodeTypes,o=[];t.forEach(n=>{const i=Array.isArray(n.version)?n.version:[n.version];e.find(s=>s.name===n.name&&i.includes(s.version))&&!n.hasOwnProperty("properties")&&o.push({name:n.name,version:Array.isArray(n.version)?n.version.slice(-1)[0]:n.version})}),o.length>0&&(this.startLoading(),await this.nodeTypesStore.getNodesInformation(o),this.stopLoading())},async onPostMessageReceived(e){var t;if((t=e==null?void 0:e.data)!=null&&t.includes('"command"'))try{const o=JSON.parse(e.data);if(o&&o.command==="openWorkflow")try{await this.importWorkflowExact(o),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(o&&o.command==="openExecution")try{this.isProductionExecutionPreview=o.executionMode!=="manual",await this.openExecution(o.executionId),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(o==null?void 0:o.command)==="setActiveExecution"&&(this.workflowsStore.activeWorkflowExecution=o.execution)}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")},addPinDataConnections(e){Object.keys(e).forEach(t=>{var i;const o=this.workflowsStore.getNodeByName(t);if(!o)return;((i=this.instance)==null?void 0:i.getConnections({source:o.id})).forEach(s=>{Mo(s,{total:e[t].length,iterations:0})})})},removePinDataConnections(e){Object.keys(e).forEach(t=>{var i;const o=this.workflowsStore.getNodeByName(t);if(!o)return;const n=(i=this.instance)==null?void 0:i.getConnections({source:o.id});this.instance.setSuspendDrawing(!0),n.forEach(Xe),this.instance.setSuspendDrawing(!1,!0)})},onToggleNodeCreator({source:e,createNodeActive:t,nodeCreatorView:o}){if(t===this.createNodeActive)return;o||(o=this.containsTrigger?Vt:xe),this.nodeCreatorStore.setSelectedView(o),this.createNodeActive=t;let n;switch(this.nodeCreatorStore.selectedView){case et:n="ai";break;case Vt:n="regular";break;default:n="regular"}t&&this.nodeCreatorStore.setOpenSource(e),this.$externalHooks().run("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t}),this.$telemetry.trackNodesPanel("nodeView.createNodeActiveChanged",{source:e,mode:n,createNodeActive:t,workflow_id:this.workflowsStore.workflowId})},async onAddNodes({nodes:e,connections:t},o=!1,n){let i=n;for(const{type:a,isAutoAdd:r,name:l,openDetail:p,position:h}of e){await this.addNode(a,{position:h??i,dragAndDrop:o,name:l},p??!1,!0,r);const d=this.nodes[this.nodes.length-1];i=[d.position[0]+Je*2+Be,d.position[1]]}const s=this.nodes.length-e.length;for(const{from:a,to:r}of t){const l=this.nodes[s+a.nodeIndex],p=this.nodes[s+r.nodeIndex];this.connectTwoNodes(l.name,a.outputIndex??0,p.name,r.inputIndex??0,$.Main)}},async saveCurrentWorkflowExternal(e){await this.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 n;o&&((n=this.instance)==null||n.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=pe(),await this.addNodes([e]))},onRevertAddConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__removeConnection(e,!0),this.suspendRecordingDetachedConnections=!1},async onRevertRemoveConnection({connection:e}){this.suspendRecordingDetachedConnections=!0,this.__addConnection(e),this.suspendRecordingDetachedConnections=!1},async onRevertNameChange({currentName:e,newName:t}){await this.renameNode(t,e)},onRevertEnableToggle({nodeName:e,isDisabled:t}){const o=this.workflowsStore.getNodeByName(e);o&&this.disableNodes([o])},onPageShow(e){e.persisted&&this.stopLoading()},readOnlyEnvRouteCheck(){this.readOnlyEnv&&[j.NEW_WORKFLOW,j.TEMPLATE_IMPORT].includes(this.$route.name)&&this.$nextTick(async()=>{this.resetWorkspace(),this.uiStore.stateIsDirty=!1,await this.$router.replace({name:j.WORKFLOWS})})},async checkAndInitDebugMode(){this.$route.name===j.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:he.CONTEXT_MENU,createNodeActive:!this.isReadOnlyRoute&&!this.readOnlyEnv});break;case"add_sticky":this.onAddNodes({nodes:[{type:re}],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);try{if(await Promise.all([this.loadCredentials(),this.loadVariables(),this.tagsStore.fetchAll()]),e!==null&&!this.uiStore.stateIsDirty){const t=await this.workflowsStore.fetchWorkflow(e);t&&(this.titleSet(t.name,"IDLE"),await this.openWorkflow(t))}}catch(t){console.error(t)}},async mounted(){var t;this.resetWorkspace(),this.canvasStore.initInstance(this.$refs.nodeView),this.titleReset(),window.addEventListener("message",this.onPostMessageReceived),this.startLoading();const e=[this.loadActiveWorkflows(),this.loadCredentials(),this.loadCredentialTypes(),this.loadVariables(),this.loadSecrets()];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(Cs(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.stopLoading(),setTimeout(()=>{this.usersStore.showPersonalizationSurvey(),this.addPinDataConnections(this.workflowsStore.getPinData||{})},0)}),this.$externalHooks().run("nodeView.mount").catch(o=>{}),((t=this.currentUser)==null?void 0:t.personalizationAnswers)!==null&&this.settingsStore.onboardingCallPromptEnabled&&this.currentUser&&yi(this.currentUser)<=wi){const o=await this.uiStore.getNextOnboardingPrompt(),n=o.toast_sequence_number===1?vi:1e3;o.title&&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(Ni)}})},n)}_o.on("pull",this.onSourceControlPull),this.registerCustomAction({key:"openNodeDetail",action:({node:o})=>{this.nodeSelectedByName(o,!0)}}),this.registerCustomAction({key:"openSelectiveNodeCreator",action:({connectiontype:o,node:n})=>{this.onToggleNodeCreator({source:he.NOTICE_ERROR_MESSAGE,createNodeActive:!0,nodeCreatorView:et}),this.ndvStore.activeNodeName=null;const i=this.workflowsStore.getNodeByName(n);o&&i&&this.insertNodeAfterSelected({index:0,endpointUuid:`${i.id}-input${o}0`,eventSource:he.NOTICE_ERROR_MESSAGE,outputType:o,sourceId:i.id})}}),this.readOnlyEnvRouteCheck(),this.canvasStore.isDemo=this.isDemo},activated(){this.uiStore.addFirstStepOnLoad&&this.showTriggerCreator(he.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),oe.on("newWorkflow",this.newWorkflow),oe.on("importWorkflowData",this.onImportWorkflowDataEvent),oe.on("importWorkflowUrl",this.onImportWorkflowUrlEvent),oe.on("openChat",this.onOpenChat),ne.on("nodeMove",this.onMoveNode),ne.on("revertAddNode",this.onRevertAddNode),ne.on("revertRemoveNode",this.onRevertRemoveNode),ne.on("revertAddConnection",this.onRevertAddConnection),ne.on("revertRemoveConnection",this.onRevertRemoveConnection),ne.on("revertRenameNode",this.onRevertNameChange),ne.on("enableNodeToggle",this.onRevertEnableToggle),we.on("pin-data",this.addPinDataConnections),we.on("unpin-data",this.removePinDataConnections),oe.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),oe.off("newWorkflow",this.newWorkflow),oe.off("importWorkflowData",this.onImportWorkflowDataEvent),oe.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),oe.off("openChat",this.onOpenChat),ne.off("nodeMove",this.onMoveNode),ne.off("revertAddNode",this.onRevertAddNode),ne.off("revertRemoveNode",this.onRevertRemoveNode),ne.off("revertAddConnection",this.onRevertAddConnection),ne.off("revertRemoveConnection",this.onRevertRemoveConnection),ne.off("revertRenameNode",this.onRevertNameChange),ne.off("enableNodeToggle",this.onRevertEnableToggle),we.off("pin-data",this.addPinDataConnections),we.off("unpin-data",this.removePinDataConnections),oe.off("saveWorkflow",this.saveCurrentWorkflowExternal)},beforeMount(){this.isDemo||this.pushStore.pushConnect()},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.resetWorkspace(),this.instance.unbind(),this.instance.destroy(),this.uiStore.stateIsDirty=!1,window.removeEventListener("message",this.onPostMessageReceived),oe.off("newWorkflow",this.newWorkflow),oe.off("importWorkflowData",this.onImportWorkflowDataEvent),oe.off("importWorkflowUrl",this.onImportWorkflowUrlEvent),this.workflowsStore.setWorkflowId(Ye),_o.off("pull",this.onSourceControlPull)}}),qc="_content_8gnvh_5",Jc="_shake_8gnvh_13",Xc={content:qc,shake:Jc},Qc=["textContent"],Zc={key:0,class:"workflow-execute-wrapper"};function eh(e,t,o,n,i,s){const a=S("canvas-add-button"),r=S("node"),l=S("sticky"),p=S("node-details-view"),h=S("NodeCreation"),d=S("CanvasControls"),m=S("ContextMenu"),N=S("n8n-button"),k=S("keyboard-shortcut-tooltip"),w=S("n8n-icon-button"),c=zt("touch");return u(),T("div",{class:D(e.$style.content)},[g("div",{class:"node-view-root do-not-select",id:"node-view-root","data-test-id":"node-view-root",onDragover:t[12]||(t[12]=(...f)=>e.onDragOver&&e.onDragOver(...f)),onDrop:t[13]||(t[13]=(...f)=>e.onDrop&&e.onDrop(...f))},[z((u(),T("div",{class:D(["node-view-wrapper",e.workflowClasses]),"data-test-id":"node-view-wrapper",onTouchstart:t[2]||(t[2]=(...f)=>e.mouseDown&&e.mouseDown(...f)),onTouchend:t[3]||(t[3]=(...f)=>e.mouseUp&&e.mouseUp(...f)),onTouchmove:t[4]||(t[4]=(...f)=>e.mouseMoveNodeWorkflow&&e.mouseMoveNodeWorkflow(...f)),onMousedown:t[5]||(t[5]=(...f)=>e.mouseDown&&e.mouseDown(...f)),onMouseup:t[6]||(t[6]=(...f)=>e.mouseUp&&e.mouseUp(...f)),onContextmenu:t[7]||(t[7]=(...f)=>e.contextMenu.open&&e.contextMenu.open(...f)),onWheel:t[8]||(t[8]=(...f)=>e.canvasStore.wheelScroll&&e.canvasStore.wheelScroll(...f))},[g("div",{id:"node-view-background",class:"node-view-background",style:se(e.backgroundStyle),"data-test-id":"node-view-background"},null,4),g("div",{id:"node-view",class:"node-view",style:se(e.workflowStyle),ref:"nodeView","data-test-id":"node-view"},[z(v(a,{style:se(e.canvasAddButtonStyle),onClick:t[0]||(t[0]=f=>e.showTriggerCreator(e.NODE_CREATOR_OPEN_SOURCES.TRIGGER_PLACEHOLDER_BUTTON)),showTooltip:!e.containsTrigger&&e.showTriggerMissingTooltip,position:e.canvasStore.canvasAddButtonPosition,ref:"canvasAddButton","onHook:mounted":e.canvasStore.setRecenteredCanvasAddButtonPosition,"data-test-id":"canvas-add-button"},null,8,["style","showTooltip","position","onHook:mounted"]),[[J,e.showCanvasAddButton]]),(u(!0),T(Z,null,de(e.nodesToRender,f=>(u(),P(r,{onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRunWorkflow:e.onRunNode,onMoved:e.onNodeMoved,onRun:e.onNodeRun,key:`${f.id}_node`,name:f.name,isReadOnly:e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,isActive:!!e.activeNode&&e.activeNode.name===f.name,hideActions:e.pullConnActive,isProductionExecutionPreview:e.isProductionExecutionPreview},{"custom-tooltip":y(()=>[g("span",{textContent:b(e.$locale.baseText("nodeView.placeholderNode.addTriggerNodeBeforeExecuting"))},null,8,Qc)]),_:2},1032,["onDeselectAllNodes","onDeselectNode","onNodeSelected","onRunWorkflow","onMoved","onRun","name","isReadOnly","instance","isActive","hideActions","isProductionExecutionPreview"]))),128)),(u(!0),T(Z,null,de(e.stickiesToRender,f=>(u(),P(l,{onDeselectAllNodes:e.deselectAllNodes,onDeselectNode:e.nodeDeselectedByName,onNodeSelected:e.nodeSelectedByName,onRemoveNode:t[1]||(t[1]=E=>e.removeNode(E,!0)),key:`${f.id}_sticky`,name:f.name,isReadOnly:e.isReadOnlyRoute||e.readOnlyEnv,instance:e.instance,isActive:!!e.activeNode&&e.activeNode.name===f.name,nodeViewScale:e.nodeViewScale,gridSize:e.GRID_SIZE,hideActions:e.pullConnActive},null,8,["onDeselectAllNodes","onDeselectNode","onNodeSelected","name","isReadOnly","instance","isActive","nodeViewScale","gridSize","hideActions"]))),128))],4)],34)),[[c,e.touchTap,"tap"]]),v(p,{readOnly:e.isReadOnlyRoute||e.readOnlyEnv,renaming:e.renamingActive,isProductionExecutionPreview:e.isProductionExecutionPreview,onRedrawNode:e.redrawNode,onSwitchSelectedNode:e.onSwitchSelectedNode,onValueChanged:e.valueChanged,onStopExecution:e.stopExecution,onSaveKeyboardShortcut:e.onSaveKeyboardShortcut},null,8,["readOnly","renaming","isProductionExecutionPreview","onRedrawNode","onSwitchSelectedNode","onValueChanged","onStopExecution","onSaveKeyboardShortcut"]),(u(),P(Se,null,{default:y(()=>[!e.isReadOnlyRoute&&!e.readOnlyEnv?(u(),P(h,{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"])):C("",!0)]),_:1})),(u(),P(Se,null,{default:y(()=>[v(d)]),_:1})),(u(),P(Se,null,{default:y(()=>[v(m,{onAction:e.onContextMenuAction},null,8,["onAction"])]),_:1})),!e.isReadOnlyRoute&&!e.readOnlyEnv?(u(),T("div",Zc,[g("span",{onMouseenter:t[9]||(t[9]=f=>e.showTriggerMissingToltip(!0)),onMouseleave:t[10]||(t[10]=f=>e.showTriggerMissingToltip(!1)),onClick:t[11]||(t[11]=(...f)=>e.onRunContainerClick&&e.onRunContainerClick(...f))},[v(k,{label:e.runButtonText,shortcut:{metaKey:!0,keys:["↵"]}},{default:y(()=>[v(N,{onClick:ie(e.onRunWorkflow,["stop"]),loading:e.workflowRunning,label:e.runButtonText,size:"large",icon:"play-circle",type:"primary",disabled:e.isExecutionDisabled,"data-test-id":"execute-workflow-button"},null,8,["onClick","loading","label","disabled"])]),_:1},8,["label"])],32),e.containsChatNodes?(u(),P(N,{key:0,onClick:ie(e.onOpenChat,["stop"]),label:"Chat",size:"large",icon:"comment",type:"primary","data-test-id":"workflow-chat-button"},null,8,["onClick"])):C("",!0),e.workflowRunning===!0&&!e.executionWaitingForWebhook?(u(),P(w,{key:1,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,onClick:ie(e.stopExecution,["stop"]),"data-test-id":"stop-execution-button"},null,8,["title","loading","onClick"])):C("",!0),e.workflowRunning===!0&&e.executionWaitingForWebhook===!0?(u(),P(w,{key:2,class:"stop-execution",icon:"stop",size:"large",title:e.$locale.baseText("nodeView.stopWaitingForWebhookCall"),type:"secondary",onClick:ie(e.stopWaitingForWebhook,["stop"]),"data-test-id":"stop-execution-waiting-for-webhook-button"},null,8,["title","onClick"])):C("",!0),!e.isReadOnlyRoute&&!e.readOnlyEnv&&e.workflowExecution&&!e.workflowRunning&&!e.allTriggersDisabled?(u(),P(w,{key:3,title:e.$locale.baseText("nodeView.deletesTheCurrentExecutionData"),icon:"trash",size:"large",onClick:ie(e.clearExecutionData,["stop"]),"data-test-id":"clear-execution-data-button"},null,8,["title","onClick"])):C("",!0)])):C("",!0)],32)],2)}const th={$style:Xc},oh=H(Gc,[["render",eh],["__cssModules",th],["__scopeId","data-v-90cc5b8d"]]),bh=Object.freeze(Object.defineProperty({__proto__:null,default:oh},Symbol.toStringTag,{value:"Module"}));export{vh as A,za as D,bh as N,kh as R,Nh as T,Kt as a,Kc as b,Hc as c,zc as d,ze as p,Ac as s,tt as t,wt as u};
2
+ //# sourceMappingURL=NodeView-LzPrYfwG.js.map
3
3
  function __vite__mapDeps(indexes) {
4
4
  if (!__vite__mapDeps.viteFileDeps) {
5
- __vite__mapDeps.viteFileDeps = ["assets/RunDataTable-690SZ7_1.js","assets/pinia-IhuTtYiV.js","assets/n8n-NE7NqrvB.js","assets/vendor-2CfOYFi2.js","assets/lodash-es-s_m9YyW7.js","assets/@fortawesome/vue-fontawesome-GVmvJ_gj.js","assets/@fortawesome/fontawesome-svg-core-xYGjsix9.js","assets/esprima-next-ulPLCZ1Z.js","assets/luxon-ZRIU05qF.js","assets/@vueuse/core-viEZCtbZ.js","assets/flatted-jPn12Tq4.js","assets/@n8n/permissions-8yMqUF1Y.js","assets/vue-i18n-eiX0lGiQ.js","assets/uuid-McvpxQtQ.js","assets/n8n-zitRoI8t.css","assets/index-hMVAffQ3.js","assets/prettier-s3fE3Qyr.js","assets/codemirror-lang-html-n8n-qoVuUIQR.js","assets/@n8n/codemirror-lang-sql-zd5sOTQ9.js","assets/@lezer/common-aP6EPErF.js","assets/@jsplumb/util-DR0SB56A.js","assets/@jsplumb/core-MKwKlGip.js","assets/@jsplumb/common-Q5_tv_GT.js","assets/@jsplumb/connector-bezier-3dWY17R5.js","assets/@jsplumb/browser-ui-QL7QI0sV.js","assets/codemirror-lang-n8n-expression-qGXLqLTr.js","assets/fast-json-stable-stringify-gO4u4slB.js","assets/timeago.js--Bumj2r9.js","assets/qrcode.vue-f7Vn5Pkq.js","assets/vue3-touch-events-_RfbPMOD.js","assets/@fortawesome/free-solid-svg-icons-KH5RR_hW.js","assets/@fortawesome/free-regular-svg-icons-ipmEYOws.js","assets/chart.js-JtqvIvkt.js","assets/index-DESuWr3H.css","assets/MappingPill-hPP5hJ5G.js","assets/MappingPill-4fPn_DY2.css","assets/useExecutionDebugging-WpRAbEhr.js","assets/file-saver-_vO_MOS2.js","assets/vue-json-pretty-HTL9TWGq.js","assets/RunDataAi-4m1wWDUf.js","assets/vue-markdown-render-Y8yswakT.js","assets/useCopyToClipboard-oKZllDWR.js","assets/copy-to-clipboard-6yTgHm0Q.js","assets/RunDataAi-lJTQYpdI.css","assets/workflowActivate-UB1_xc5U.js","assets/collaboration.store-lUjjktP5.js","assets/RunDataTable-SMFiA3bR.css","assets/RunDataJson-FZZoF8ao.js","assets/RunDataJson-Jt5WVSW6.css","assets/RunDataSchema-wjyR7MiY.js","assets/RunDataSchema-_PH4mUfw.css","assets/RunDataSearch-0UjOZNT9.js","assets/RunDataSearch-EE8rOPoF.css","assets/NodeCreation-OxTpBRfP.js","assets/NodeCreation-vd8OSgfv.css","assets/CanvasControls-kb3__O2G.js","assets/CanvasControls-Bz-QgPul.css"]
5
+ __vite__mapDeps.viteFileDeps = ["assets/RunDataTable-Qas85Wnj.js","assets/pinia-IhuTtYiV.js","assets/n8n-NE7NqrvB.js","assets/vendor-2CfOYFi2.js","assets/lodash-es-s_m9YyW7.js","assets/@fortawesome/vue-fontawesome-GVmvJ_gj.js","assets/@fortawesome/fontawesome-svg-core-xYGjsix9.js","assets/esprima-next-ulPLCZ1Z.js","assets/luxon-ZRIU05qF.js","assets/@vueuse/core-viEZCtbZ.js","assets/flatted-jPn12Tq4.js","assets/@n8n/permissions-8yMqUF1Y.js","assets/vue-i18n-eiX0lGiQ.js","assets/uuid-McvpxQtQ.js","assets/n8n-zitRoI8t.css","assets/index-sMRiWGJS.js","assets/prettier-s3fE3Qyr.js","assets/codemirror-lang-html-n8n-qoVuUIQR.js","assets/@n8n/codemirror-lang-sql-zd5sOTQ9.js","assets/@lezer/common-aP6EPErF.js","assets/@jsplumb/util-DR0SB56A.js","assets/@jsplumb/core-MKwKlGip.js","assets/@jsplumb/common-Q5_tv_GT.js","assets/@jsplumb/connector-bezier-3dWY17R5.js","assets/@jsplumb/browser-ui-QL7QI0sV.js","assets/codemirror-lang-n8n-expression-qGXLqLTr.js","assets/fast-json-stable-stringify-gO4u4slB.js","assets/timeago.js--Bumj2r9.js","assets/qrcode.vue-f7Vn5Pkq.js","assets/vue3-touch-events-_RfbPMOD.js","assets/@fortawesome/free-solid-svg-icons-KH5RR_hW.js","assets/@fortawesome/free-regular-svg-icons-ipmEYOws.js","assets/chart.js-JtqvIvkt.js","assets/index-DESuWr3H.css","assets/MappingPill-hPP5hJ5G.js","assets/MappingPill-4fPn_DY2.css","assets/useExecutionDebugging-vYjc-e7j.js","assets/file-saver-_vO_MOS2.js","assets/vue-json-pretty-HTL9TWGq.js","assets/RunDataAi-ueFTZBht.js","assets/vue-markdown-render-Y8yswakT.js","assets/useCopyToClipboard-oKZllDWR.js","assets/copy-to-clipboard-6yTgHm0Q.js","assets/RunDataAi-lJTQYpdI.css","assets/workflowActivate-FonyQsS3.js","assets/collaboration.store-lUjjktP5.js","assets/RunDataTable-SMFiA3bR.css","assets/RunDataJson-VFzb6R4m.js","assets/RunDataJson-Jt5WVSW6.css","assets/RunDataSchema-BB0j0bVA.js","assets/RunDataSchema-_PH4mUfw.css","assets/RunDataSearch-0UjOZNT9.js","assets/RunDataSearch-EE8rOPoF.css","assets/NodeCreation-3pcb_BwC.js","assets/NodeCreation-vd8OSgfv.css","assets/CanvasControls-6jR1_mnm.js","assets/CanvasControls-Bz-QgPul.css"]
6
6
  }
7
7
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
8
8
  }