UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.34 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.13.4"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-IafOlCW8.js","./users.store-legacy-OKuN0qAC.js","./constants-legacy-DNCca_FT.js","./_baseOrderBy-legacy-PsQY_Pvh.js"],(function(e,a){var t,s,n,l,i,o,r,u,c,d,f,v,h,w,b,g,m,p,y;return{setters:[function(e){t=e.Ft,s=e.S},function(e){n=e.As,l=e.Ms,i=e.Tr,o=e.en,r=e.js,u=e.qr,c=e.r,d=e.sl,f=e.t},function(e){v=e.$a,h=e.Hs,w=e.Vs,b=e.cc,g=e.xc},function(e){m=e.j,p=e.r}],execute:function(){try{a="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(N=(new a.Error).stack)&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[N]="a5b62214-dad9-4669-bb60-f300d194f49e",a._sentryDebugIdIdentifier="sentry-dbid-a5b62214-dad9-4669-bb60-f300d194f49e")}catch(a){}var a,N;y=/^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,e("t",m(d.VERSIONS,(()=>{const e=t({enabled:!1,whatsNewEnabled:!1,endpoint:"",whatsNewEndpoint:"",infoUrl:""}),d=t([]),m=t(),N=t({title:"",createdAt:(new Date).toISOString(),updatedAt:null,calloutText:"",footer:"",items:[]}),A=t(),V=o(),{showToast:S,showMessage:C}=i(),I=c(),k=n(),E=f(),T=u(g),j=u(b),D=s((()=>"stable"===k.settings.releaseChannel&&d.value.length>0)),W=s((()=>{if(!D.value||!m.value||!z.value)return!1;if(m.value.hasSecurityIssue)return!0;const e=m.value.name.match(y),a=z.value.name.match(y);if(!e?.groups||!a?.groups)return!1;if(Number(e.groups.major)!==Number(a.groups.major))return!0;const t=Number(e.groups.minor);return Number(a.groups.minor)-t>=2})),z=s((()=>d.value[0]??m.value)),U=s((()=>e.value.enabled)),_=s((()=>e.value.infoUrl)),x=s((()=>T.value?v(T.value,{fallbackValue:[]}):[])),O=s((()=>j.value?v(j.value,{fallbackValue:[]}):[])),Z=s((()=>N.value.items)),F=async()=>{try{const{enabled:a,endpoint:t}=e.value;if(a&&t){const e=p(),a=e.versionCli,s=e.instanceId;M({versions:await r(t,a,s),currentVersion:a})}}catch(a){console.error("Failed to fetch versions:",a)}},M=e=>{d.value=e.versions.filter((a=>a.name!==e.currentVersion)),m.value=e.versions.find((a=>a.name===e.currentVersion))},R=()=>{j.value=JSON.stringify(Z.value.map((e=>e.id)))},P=()=>{const e=E.currentUser?.createdAt;let a=!1;if(e){const t=new Date(e).getTime();a=Z.value.some((e=>(e.updatedAt?new Date(e.updatedAt).getTime():0)>t))}else a=!0;const t=Z.value.every((e=>O.value.includes(e.id)));return a&&!t},$=async()=>{try{const{enabled:a,whatsNewEnabled:t,whatsNewEndpoint:s}=e.value;if(a&&t&&s){const e=p(),a=e.versionCli,t=e.instanceId,n=await l(s,a,t);n.items?.length>0&&((e=>{N.value=e})(n),P()&&(A.value=C({title:N.value.title,message:N.value.calloutText,duration:0,position:"bottom-left",customClass:"clickable whats-new-notification",onClick:()=>{const e=N.value.items[0]?.id??0;V.track("User clicked on what's new notification",{article_id:e}),I.openModalWithData({name:h,data:{articleId:e}})},onClose:()=>{R()}})))}}catch(a){console.error("Failed to fetch Whats New section:",a)}};return{currentVersion:m,latestVersion:z,nextVersions:d,hasVersionUpdates:D,hasSignificantUpdates:W,areNotificationsEnabled:U,infoUrl:_,fetchVersions:F,setVersions:M,initialize:a=>{e.value=a},checkForNewVersions:async()=>{if(U.value&&(await Promise.all([F(),$()]),m.value&&m.value.hasSecurityIssue&&d.value.length)){const e=m.value.securityIssueFixVersion;let a="Please update to latest version.";e&&(a=`Please update to version ${e} or higher.`),a=`${a} <a class="primary-color">More info</a>`,S({title:"Critical update available",message:a,onClick:()=>{I.openModal(w)},closeOnClick:!0,customClass:"clickable",type:"warning",duration:0})}},fetchWhatsNew:$,whatsNew:N,whatsNewArticles:Z,isWhatsNewArticleRead:e=>x.value.includes(e),setWhatsNewArticleRead:e=>{x.value.includes(e)||(T.value=JSON.stringify([...x.value,e]))},closeWhatsNewCallout:()=>{A.value?.close(),A.value=void 0},shouldShowWhatsNewCallout:P,dismissWhatsNewCallout:R}})))}}})); //# sourceMappingURL=versions.store-legacy-BoVYiMEK.js.map