UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 3.9 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","./_MapCache-legacy-DwgdC8YO.js","./src-legacy-Dwzr7bD0.js","./users.store-legacy-OKuN0qAC.js","./constants-legacy-DNCca_FT.js","./_baseOrderBy-legacy-PsQY_Pvh.js","./assistant.store-legacy-kpq6KUPM.js"],(function(e,s){var i,n,t,a,o,d,r,l,c,u,f,p,h,w,m,g,b;function y(e,s){return"string"==typeof e&&s.includes(e)}return{setters:[function(e){i=e.S,n=e.gt},function(e){t=e.bt},function(e){a=e.gt},function(e){o=e.As,d=e.Hr,r=e.Lr,l=e.Ur,c=e.Wr,u=e.cn,f=e.r,p=e.s,h=e.sl},function(e){e.Rl,w=e.fs,m=e.nl,e.zl},function(e){g=e.j},function(e){b=e.t}],execute:function(){try{s="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(M=(new s.Error).stack)&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[M]="4a932f9a-ba7e-4f69-8d55-033bf51ef9e8",s._sentryDebugIdIdentifier="sentry-dbid-4a932f9a-ba7e-4f69-8d55-033bf51ef9e8")}catch(s){}var s,M;e("t",g(h.CHAT_PANEL,(()=>{const e=f(),s=a(),h=r(),g=o(),M=p(),A=d(),v=t();let C=null;const T=i((()=>A.isFeatureEnabled(m.name)&&g.isAiAssistantEnabled&&u().isAIBuilderEnabled));function E(e){return"assistant"===e&&T.value?"builder":e}const H=i((()=>"assistant"===h.activeMode)),D=i((()=>"builder"===h.activeMode)),_=i((()=>g.isAiAssistantOrBuilderEnabled&&w.includes(s.name)));async function I(i){if(!g.isAiAssistantOrBuilderEnabled)return;const n=i?.mode?E(i.mode):void 0,t=i?.showCoachmark??!0;n&&(h.activeMode=n),h.showCoachmark=t;const a="assistant"===h.activeMode?l:c,o=s?.name;if(y(o,a)){if(h.isOpen=!0,"builder"===h.activeMode){const e=u();e.streaming||(e.fetchBuilderCredits(),e.loadSessions())}else if("assistant"===h.activeMode){const e=b();e.chatMessages=e.chatMessages.map((e=>({...e,read:!0})))}C&&clearTimeout(C),C=setTimeout((()=>{C=null,e.appGridDimensions={...e.appGridDimensions,width:window.innerWidth-h.width}}),175)}else O()}function O(){C&&(clearTimeout(C),C=null),h.isOpen=!1,h.showCoachmark=!1,setTimeout((()=>{e.appGridDimensions={...e.appGridDimensions,width:window.innerWidth};const s=b();s.isSessionEnded&&s.resetAssistantChat(M.workflowId)}),200)}return n((()=>s?.name),(e=>{if(!e)return;const s=u();!h.isOpen&&s.streaming&&y(e,c)?I({mode:"builder"}):h.isOpen&&(y(e,"assistant"===h.activeMode?l:c)?y(e,c)&&!s.streaming&&s.resetBuilderChat():O())})),{isOpen:i((()=>h.isOpen)),width:i((()=>h.width)),activeMode:i((()=>h.activeMode)),showCoachmark:i((()=>h.showCoachmark)),isAssistantModeActive:H,isBuilderModeActive:D,canShowAiButtonOnCanvas:_,open:I,close:O,toggle:async function(e){h.isOpen?O():await I(e)},switchMode:function(e){const i=E(e),n="assistant"===i?l:c,t=s?.name;y(t,n)?(h.activeMode=i,h.showCoachmark=!1):O()},updateWidth:function(s){const i=Math.min(Math.max(s,380),425);h.width=i,h.isOpen&&(e.appGridDimensions={...e.appGridDimensions,width:window.innerWidth-i})},openWithCredHelp:async function(e){if(T.value){const s=v.baseText("aiAssistant.builder.credentialHelpMessage",{interpolate:{credentialName:e.displayName}});return await I({mode:"builder"}),void(await u().sendChatMessage({text:s,helpMessage:!0}))}await b().initCredHelp(M.workflowId,e),await I({mode:"assistant"})},openWithErrorHelper:async function(e){if(T.value){const s=v.baseText("aiAssistant.builder.errorHelpMessage",{interpolate:{nodeName:e.node.name,errorMessage:e.error.message}});return await I({mode:"builder"}),void(await u().sendChatMessage({text:s,helpMessage:!0}))}await b().initErrorHelper(M.workflowId,e),await I({mode:"assistant"})},DEFAULT_CHAT_WIDTH:400,MIN_CHAT_WIDTH:380,MAX_CHAT_WIDTH:425}})))}}})); //# sourceMappingURL=chatPanel.store-legacy-BXT37O-E.js.map