(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.20.10`}}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]=`4dc10f38-a49a-44ad-a117-db7b8c5b4418`,e._sentryDebugIdIdentifier=`sentry-dbid-4dc10f38-a49a-44ad-a117-db7b8c5b4418`)})()}catch{}import{Ft as e}from"./vue.runtime.esm-bundler-D_yZoh5k.js";import{ss as t}from"./constants-DEcjX7rm.js";async function n(e,t){let n={};await r();async function r(){await u(`readonly`,async(e,t)=>await new Promise((r,i)=>{let a=e.openCursor();a.onsuccess=e=>{let i=e.target.result;i?(n[i.key]=i.value.value,i.continue()):(t.close(),r())},a.onerror=e=>{t.close(),i(e)}}))}async function i(){return await new Promise((n,r)=>{let i=indexedDB.open(e,1);i.onupgradeneeded=()=>{i.result.createObjectStore(t,{keyPath:`key`})},i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error)})}function a(e,t){n[e]=t,d(e,t)}function o(e){return n[e]??null}function s(e){delete n[e],f(e)}function c(){n={},p()}async function l(e){let t=IDBKeyRange.bound(e,e+``,!1,!1),n={};return await u(`readonly`,async e=>await new Promise((r,i)=>{let a=e.openCursor(t);a.onsuccess=e=>{let t=e.target.result;t?(n[t.key]=t.value.value,t.continue()):r(n)},a.onerror=()=>{i(a.error)}}))}async function u(e,n){let r=await i(),a=r.transaction(t,e),o=await n(a.objectStore(t),r);return await new Promise((e,t)=>{a.oncomplete=()=>{r.close(),e(o)},a.onerror=()=>{r.close(),t(a.error)}})}async function d(e,t){await u(`readwrite`,n=>{n.put({key:e,value:t})})}async function f(e){await u(`readwrite`,t=>{t.delete(e)})}async function p(){await u(`readwrite`,e=>{e.clear()})}return{getItem:o,removeItem:s,setItem:a,clear:c,getAllWithPrefix:l}}function r(){let r=e(!0),i=e(n(`n8n-local`,`workflows`).finally(()=>{r.value=!1}));async function a(){return await i.value}async function o(e){return t((await a()).getItem(e)??``,{fallbackValue:{}})}async function s(e){let n=await o(e),r=t((await a()).getItem(`*`)??``,{fallbackValue:{}});return n.suggestedActions={...n.suggestedActions??{},...r.suggestedActions??{}},n}async function c(e,t){let n=await a(),r=await o(e),i={...r,...t};t.suggestedActions&&(i.suggestedActions={...r.suggestedActions??{},...t.suggestedActions}),n.setItem(e,JSON.stringify(i))}async function l(e){(await o(e))?.firstActivatedAt||await c(e,{firstActivatedAt:Date.now()})}async function u(e,t){await c(e,{suggestedActions:{[t]:{ignored:!0}}})}async function d(e){return(await o(e))?.evaluationRuns??{order:[],visibility:{}}}async function f(e,t){await c(e,{evaluationRuns:t})}async function p(e){await c(`*`,e.reduce((e,t)=>(e.suggestedActions=e.suggestedActions??{},e.suggestedActions[t]={ignored:!0},e),{}))}return{getWorkflowSettings:o,getMergedWorkflowSettings:s,upsertWorkflowSettings:c,updateFirstActivatedAt:l,ignoreSuggestedAction:u,ignoreAllSuggestedActionsForAllWorkflows:p,getEvaluationPreferences:d,saveEvaluationPreferences:f,isCacheLoading:r}}export{r as t};
//# sourceMappingURL=useWorkflowsCache-DIB3FupD.js.map