(function(){/*
  */
 const c=(a,b)=>b.some(d=>a instanceof d);let t,u;const v=new WeakMap,w=new WeakMap,x=new WeakMap;function y(a){const b=new Promise((d,m)=>{const l=()=>{a.removeEventListener("success",k);a.removeEventListener("error",g)},k=()=>{d(z(a.result));l()},g=()=>{m(a.error);l()};a.addEventListener("success",k);a.addEventListener("error",g)});x.set(b,a);return b}
 function A(a){if(!v.has(a)){var b=new Promise((d,m)=>{const l=()=>{a.removeEventListener("complete",k);a.removeEventListener("error",g);a.removeEventListener("abort",g)},k=()=>{d();l()},g=()=>{m(a.error||new DOMException("AbortError","AbortError"));l()};a.addEventListener("complete",k);a.addEventListener("error",g);a.addEventListener("abort",g)});v.set(a,b)}}
 let B={get(a,b,d){if(a instanceof IDBTransaction){if(b==="done")return v.get(a);if(b==="store")return d.objectStoreNames[1]?void 0:d.objectStore(d.objectStoreNames[0])}return z(a[b])},set(a,b,d){a[b]=d;return!0},has(a,b){return a instanceof IDBTransaction&&(b==="done"||b==="store")?!0:b in a}};
 function C(a){return(u||(u=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(a)?function(...b){a.apply(x.get(this),b);return z(this.request)}:function(...b){return z(a.apply(x.get(this),b))}}
 function z(a){if(a instanceof IDBRequest)return y(a);if(w.has(a))return w.get(a);if(typeof a==="function")var b=C(a);else a instanceof IDBTransaction&&A(a),b=c(a,t||(t=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(a,B):a;b!==a&&(w.set(a,b),x.set(b,a));return b}
 function D({g:a,upgrade:b,h:d,i:m}={}){const l=indexedDB.open("downloady",2),k=z(l);b&&l.addEventListener("upgradeneeded",g=>{b(z(l.result),g.oldVersion,g.newVersion,z(l.transaction),g)});a&&l.addEventListener("blocked",g=>a(g.oldVersion,g.newVersion,g));k.then(g=>{m&&g.addEventListener("close",()=>m());d&&g.addEventListener("versionchange",q=>d(q.oldVersion,q.newVersion,q))}).catch(()=>{});return k}const E=["get","getKey","getAll","getAllKeys","count"],F=["put","add","delete","clear"],G=new Map;
 function H(a,b){if(a instanceof IDBDatabase&&!(b in a)&&typeof b==="string"){if(G.get(b))return G.get(b);var d=b.replace(/FromIndex$/,""),m=b!==d,l=F.includes(d);if(d in(m?IDBIndex:IDBObjectStore).prototype&&(l||E.includes(d)))return a=async function(k,...g){k=this.transaction(k,l?"readwrite":"readonly");let q=k.store;m&&(q=q.index(g.shift()));return(await Promise.all([q[d](...g),l&&k.done]))[0]},G.set(b,a),a}}B=(a=>({...a,get:(b,d,m)=>H(b,d)||a.get(b,d,m),has:(b,d)=>!!H(b,d)||a.has(b,d)}))(B);
 const I=["continue","continuePrimaryKey","advance"],J={},K=new WeakMap,L=new WeakMap,M={get(a,b){if(!I.includes(b))return a[b];(a=J[b])||(a=J[b]=function(...d){K.set(this,L.get(this)[b](...d))});return a}};async function*N(...a){let b=this;b instanceof IDBCursor||(b=await b.openCursor(...a));if(b)for(a=new Proxy(b,M),L.set(a,b),x.set(a,x.get(b));b;)yield a,b=await (K.get(a)||b.continue()),K.delete(a)}
 function O(a,b){return b===Symbol.asyncIterator&&c(a,[IDBIndex,IDBObjectStore,IDBCursor])||b==="iterate"&&c(a,[IDBIndex,IDBObjectStore])}B=(a=>({...a,get(b,d,m){return O(b,d)?N:a.get(b,d,m)},has(b,d){return O(b,d)||a.has(b,d)}}))(B);})();