n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 3.93 kB
JavaScript
!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","./users.store-legacy-azRUgFdP.js","./constants-legacy-2_ytuuS3.js","./useRootStore-legacy-CC08el-l.js","./settings.store-legacy-I6rZOvfF.js","./assistant.store-legacy-DDWm4tY4.js"],(function(e,t){var n,s,i,a,o,d,r,c,l,u,f,p,h,w,m,g,b;function y(e,t){return"string"==typeof e&&t.includes(e)}return{setters:[function(e){n=e.S,s=e.gt},function(e){i=e.at},function(e){a=e.ct},function(e){o=e.$n,d=e.Ot,r=e.Qn,c=e.Wn,l=e.hr,u=e.r,f=e.s},function(e){p=e.Hc,h=e.Xo},function(e){w=e.T},function(e){m=e.An,g=e.t},function(e){b=e.t}],execute:function(){try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(M=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[M]="9feab842-48c0-43a6-880c-69d6adfd0d21",t._sentryDebugIdIdentifier="sentry-dbid-9feab842-48c0-43a6-880c-69d6adfd0d21")}catch(t){}var t,M;e("t",w(m.CHAT_PANEL,(()=>{const e=u(),t=a(),w=c(),m=g(),M=f(),A=l(),v=i();let T=null;const C=n((()=>A.isFeatureEnabled(p.name)&&m.isAiAssistantEnabled&&d().isAIBuilderEnabled));function E(e){return"assistant"===e&&C.value?"builder":e}const D=n((()=>"assistant"===w.activeMode)),H=n((()=>"builder"===w.activeMode)),I=n((()=>m.isAiAssistantOrBuilderEnabled&&h.includes(t.name)));async function O(n){if(!m.isAiAssistantOrBuilderEnabled)return;const s=n?.mode?E(n.mode):void 0,i=n?.showCoachmark??!0;s&&(w.activeMode=s),w.showCoachmark=i;const a="assistant"===w.activeMode?r:o,c=t?.name;if(y(c,a)){if(w.isOpen=!0,"builder"===w.activeMode){const e=d();e.streaming||(e.fetchBuilderCredits(),e.loadSessions())}else if("assistant"===w.activeMode){const e=b();e.chatMessages=e.chatMessages.map((e=>({...e,read:!0})))}T&&clearTimeout(T),T=setTimeout((()=>{T=null,e.appGridDimensions={...e.appGridDimensions,width:window.innerWidth-w.width}}),175)}else _()}function _(){T&&(clearTimeout(T),T=null),w.isOpen=!1,w.showCoachmark=!1,setTimeout((()=>{e.appGridDimensions={...e.appGridDimensions,width:window.innerWidth};const t=b();t.isSessionEnded&&t.resetAssistantChat(M.workflowId)}),200)}return s((()=>t?.name),(e=>{if(!e)return;const t=d();!w.isOpen&&t.streaming&&y(e,o)?O({mode:"builder"}):w.isOpen&&(y(e,"assistant"===w.activeMode?r:o)?y(e,o)&&!t.streaming&&t.resetBuilderChat():_())})),{isOpen:n((()=>w.isOpen)),width:n((()=>w.width)),activeMode:n((()=>w.activeMode)),showCoachmark:n((()=>w.showCoachmark)),isAssistantModeActive:D,isBuilderModeActive:H,canShowAiButtonOnCanvas:I,open:O,close:_,toggle:async function(e){w.isOpen?_():await O(e)},switchMode:function(e){const n=E(e),s="assistant"===n?r:o,i=t?.name;y(i,s)?(w.activeMode=n,w.showCoachmark=!1):_()},updateWidth:function(t){const n=Math.min(Math.max(t,380),425);w.width=n,w.isOpen&&(e.appGridDimensions={...e.appGridDimensions,width:window.innerWidth-n})},openWithCredHelp:async function(e){if(C.value){const t=v.baseText("aiAssistant.builder.credentialHelpMessage",{interpolate:{credentialName:e.displayName}});return await O({mode:"builder"}),void(await d().sendChatMessage({text:t,helpMessage:!0}))}await b().initCredHelp(M.workflowId,e),await O({mode:"assistant"})},openWithErrorHelper:async function(e){if(C.value){const t=v.baseText("aiAssistant.builder.errorHelpMessage",{interpolate:{nodeName:e.node.name,errorMessage:e.error.message}});return await O({mode:"builder"}),void(await d().sendChatMessage({text:t,helpMessage:!0}))}await b().initErrorHelper(M.workflowId,e),await O({mode:"assistant"})},DEFAULT_CHAT_WIDTH:400,MIN_CHAT_WIDTH:380,MAX_CHAT_WIDTH:425}})))}}}));
//# sourceMappingURL=chatPanel.store-legacy-BsMvrm8R.js.map