n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 2.71 kB
JavaScript
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.16.1`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`2031a5e1-360f-43a7-b4c2-7090476fd9dc`,e._sentryDebugIdIdentifier=`sentry-dbid-2031a5e1-360f-43a7-b4c2-7090476fd9dc`)})()}catch{}import{$ as e,E as t,Ft as n,N as r,S as i,_n as a,gt as o,it as s}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{m as c,v as l}from"./core-Bz5WjPxS.js";import{Pt as u,lt as d}from"./src-XqE2yCpG.js";import{t as f}from"./_plugin-vue_export-helper-CIL7EULb.js";import{ai as p,it as m,r as h}from"./users.store-xP93bV7X.js";import{Jo as g,Jr as _,Ko as v,Kr as y,Qr as b,Us as x,Yo as S,Yr as C,qo as w}from"./constants-DuQbSl-q.js";import{t as T}from"./settings.store-CAFiYCMH.js";import{c as E}from"./constants-BVzsnVB6.js";import{_ as D,v as O}from"./fileUtils-D6dhtxVJ.js";var k=g(b,S().or(v())),A=C.and(w({cachedDisplayName:S().optional(),cachedIcon:_.optional()})).transform(e=>({...e,cachedDisplayName:e.cachedDisplayName||(O(e)?e.model:``)}));function j(e){let t=n(!1),r=m(),a=T(),s=p(),c=l(x(e),{},{writeDefaults:!1,shallow:!0,serializer:{read:e=>{try{return k.parse(JSON.parse(e))}catch{return{}}},write:e=>JSON.stringify(e)}}),u=i(()=>t.value||r.allCredentials.length>0),d=i(()=>Object.fromEntries(b.options.map(e=>{if(!D(e))return[e,null];let t=y[e];if(!t)return[e,null];let n=r.getCredentialsByType(t),i=a.moduleSettings?.[`chat-hub`]?.providers[e];return i?.credentialId&&n.some(e=>e.id===i.credentialId)?[e,i.credentialId]:[e,n.toSorted((e,t)=>new Date(t.createdAt)-+new Date(e.createdAt))[0]?.id??null]}))),f=i(()=>u.value?b.options.reduce((e,t)=>{let n=c.value[t]??null;return e[t]=n&&r.allCredentials.some(e=>e.id===n)?n:d.value[t],e},{}):null);function h(e,t){c.value={...c.value,[e]:t}}return o(()=>s.personalProject,async e=>{e&&(await Promise.all([r.fetchCredentialTypes(!1),r.fetchAllCredentialsForWorkflow({projectId:e.id})]),t.value=!0)},{immediate:!0}),{credentialsByProvider:f,selectCredential:h}}var M=f(r({__name:`ChatLayout`,setup(n){let r=d(),i=h(),{isCtrlKeyPressed:o}=u();return c(document,`keydown`,e=>{e.key.toLowerCase()===`o`&&o(e)&&e.shiftKey&&!i.isAnyModalOpen&&(e.preventDefault(),e.stopPropagation(),r.push({name:E,force:!0}))}),(n,r)=>(e(),t(`div`,{class:a(n.$style.component)},[s(n.$slots,`default`)],2))}}),[[`__cssModules`,{$style:{component:`_component_1txea_125`}}]]);export{j as n,A as r,M as t};
//# sourceMappingURL=ChatLayout-BF1AmRjI.js.map