UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.97 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./_plugin-vue_export-helper-legacy-DFdC_I5Z.js","./users.store-legacy-azRUgFdP.js","./useRootStore-legacy-CC08el-l.js","./settings.store-legacy-I6rZOvfF.js"],(function(e,n){var t,s,a,i,r,o,l,d,c,m,u,y,p,_,f,g,b,h,v,w,B,k,C,S,$,x,D,T,j,E,I,q;return{setters:[function(e){t=e.$,s=e.C,a=e.Ft,i=e.N,r=e.S,o=e.T,l=e.Wt,d=e._n,c=e.ft,m=e.it,u=e.j,y=e.jt,p=e.w,_=e.yt},function(e){f=e.at},function(e){g=e.G,b=e.Qi,h=e.Yi},function(e){v=e.t},function(e){w=e.t},function(e){B=e.T,k=e.o,C=e.t},function(e){S=e.An,$=e.M,x=e.t}],execute:function(){(D=document.createElement("style")).textContent="._callout_9v94h_125{height:var(--banner--height)}._mainContent_9v94h_129{gap:var(--spacing--4xs);display:flex}._keepSpace_9v94h_134{padding:5px 0}._trailingContent_9v94h_138{align-items:center;gap:var(--spacing--lg);display:flex}._markdown_b7cdq_125 p,._markdown_b7cdq_125 strong,._markdown_b7cdq_125 em,._markdown_b7cdq_125 s,._markdown_b7cdq_125 a{font-size:var(--font-size--2xs)}._markdown_b7cdq_125 p{margin-bottom:0}\n/*$vite$:1*/",document.head.appendChild(D);try{n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(N=(new n.Error).stack)&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[N]="08718491-6cc2-431d-9fdf-66131e6ee391",n._sentryDebugIdIdentifier="sentry-dbid-08718491-6cc2-431d-9fdf-66131e6ee391")}catch(n){}var n,N;T=i({__name:"BaseBanner",props:{name:{},theme:{default:"info"},customIcon:{default:void 0},dismissible:{type:Boolean,default:!0},dismissPermanently:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:n}){const a=f(),i=q(),u=c(),y=e,g=n,v=r((()=>!!u.trailingContent));async function w(){await i.dismissBanner(y.name,y.dismissPermanently?"permanent":"temporary"),g("close")}return(n,i)=>(t(),p(l(h),{class:d(n.$style.callout),theme:y.theme,icon:y.customIcon,"icon-size":"medium","round-corners":!1,"data-test-id":`banners-${y.name}`,"only-bottom-border":!0},{trailingContent:_((()=>[s("div",{class:d(n.$style.trailingContent)},[m(n.$slots,"trailingContent"),e.dismissible?(t(),p(l(b),{key:0,size:"small",icon:"x",title:l(a).baseText("generic.dismiss"),class:"clickable","data-test-id":`banner-${y.name}-close`,onClick:w},null,8,["title","data-test-id"])):o("",!0)],2)])),default:_((()=>[s("div",{class:d([n.$style.mainContent,v.value?"":n.$style.keepSpace])},[m(n.$slots,"mainContent")],2)])),_:3},8,["class","theme","icon","data-test-id"]))}}),e("n",j=v(T,[["__cssModules",{$style:{callout:"_callout_9v94h_125",mainContent:"_mainContent_9v94h_129",keepSpace:"_keepSpace_9v94h_134",trailingContent:"_trailingContent_9v94h_138"}}]])),E=i({__name:"DynamicBanner",props:{name:{},content:{},theme:{},isDismissible:{type:Boolean},dismissPermanently:{type:[Boolean,null]}},setup(e){const n=e;return(e,s)=>(t(),p(j,{name:n.name,theme:n.theme,dismissible:n.isDismissible,"dismiss-permanently":n.dismissPermanently??!1},{mainContent:_((()=>[u(l(g),{content:n.content,class:d(e.$style.markdown)},null,8,["content","class"])])),_:1},8,["name","theme","dismissible","dismiss-permanently"]))}}),I=v(E,[["__cssModules",{$style:{markdown:"_markdown_b7cdq_125"}}]]),e("t",q=B(S.BANNERS,(()=>{const e=x(),t=w(),s=C(),i=a([]),o=a([]),l=a(0);async function d(){if(!e.settings.dynamicBanners.endpoint||!e.settings.dynamicBanners.enabled)return[];const s=e.settings.versionCli,a=(e=>"cloud"===e?"cloud":"self-hosted")(e.settings.deployment?.type??"default");try{return i.value=(await async function(e,n){return await k(e,"",n)}(e.settings.dynamicBanners.endpoint,{version:s,deploymentType:a,instanceId:e.settings.instanceId,planName:e.settings.license?.planName,userCreatedAt:t.currentUser?.createdAt,isOwner:t.currentUser?.isOwner,role:t.currentUser?.role})).map((e=>({...e,id:`dynamic-banner-${e.id}`,component:y(I)}))),i.value}catch(n){return console.error("Failed to fetch dynamic banners:",n),[]}}const c=r((()=>i.value.reduce(((e,n)=>(e[n.id]=n,e)),{}))),m=e=>{o.value=o.value.filter((n=>n!==e))},u=e=>{o.value.includes(e)||o.value.push(e)};return{dynamicBanners:i,bannerStack:o,bannersHeight:l,dynamicBannersMap:c,dismissBanner:async(n,t="temporary")=>{if("permanent"===t)return await $(s.restApiContext,{bannerName:n,dismissedBanners:e.permanentlyDismissedBanners}),void m(n);m(n)},updateBannersHeight:e=>{l.value=e},pushBannerToStack:u,removeBannerFromStack:m,clearBannerStack:()=>{o.value=[]},loadStaticBanners:e=>{e.banners.forEach(u)},loadDynamicBanners:async()=>{(await d())?.filter((n=>!e.permanentlyDismissedBanners.includes(n.id))).forEach((e=>u(e.id)))}}})))}}})); //# sourceMappingURL=banners.store-legacy-QkaJOkrp.js.map