var e=`files`,t=`pending`;function n(){return new Promise((t,n)=>{let r=indexedDB.open(`pdfuse-handoff`,1);r.onupgradeneeded=()=>r.result.createObjectStore(e),r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error)})}function r(t,n,r){return new Promise((i,a)=>{let o=r(t.transaction(e,n).objectStore(e));o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)})}async function i(e){let i=await n();try{await r(i,`readwrite`,n=>n.put({files:e},t))}finally{i.close()}}async function a(){let e=await n();try{let n=await r(e,`readonly`,e=>e.get(t));return n&&await r(e,`readwrite`,e=>e.delete(t)),n}finally{e.close()}}export{a as n,i as t};