(window["arcWidgetJsonp"]=window["arcWidgetJsonp"]||[]).push([["brokers"],{"364d":function(t,e,n){"use strict";const r=(t,e)=>function(...n){const r=e.promiseModule;return new r((r,s)=>{e.multiArgs?n.push((...t)=>{e.errorFirst?t[0]?s(t):(t.shift(),r(t)):r(t)}):e.errorFirst?n.push((t,e)=>{t?s(t):r(e)}):n.push(r),t.apply(this,n)})};t.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const n=typeof t;if(null===t||"object"!==n&&"function"!==n)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":n}\``);const s=t=>{const n=e=>"string"===typeof e?t===e:e.test(t);return e.include?e.include.some(n):!e.exclude.some(n)};let o;o="function"===n?function(...n){return e.excludeMain?t(...n):r(t,e).apply(this,n)}:Object.create(Object.getPrototypeOf(t));for(const i in t){const n=t[i];o[i]="function"===typeof n&&s(i)?r(n,e):n}return o}},"4aad":function(t,e,n){"use strict";n.r(e),n.d(e,"Broker",(function(){return R})),n.d(e,"MemoryBroker",(function(){return M})),n.d(e,"ProxyBroker",(function(){return W})),n.d(e,"MemoryProxyBroker",(function(){return $}));var r={};n.r(r),n.d(r,"getWidgetOptState",(function(){return g})),n.d(r,"setWidgetOptState",(function(){return b})),n.d(r,"enableWidget",(function(){return k})),n.d(r,"disableWidget",(function(){return v}));var s={};n.r(s),n.d(s,"hasNewPropertySession",(function(){return F})),n.d(s,"enableMasterEligibility",(function(){return _})),n.d(s,"getBrokerIds",(function(){return N})),n.d(s,"listPropertySessions",(function(){return P}));var o=n("ade3"),i=n("3d15"),c=n("a78e"),a=n.n(c),u=n("2677"),d=n.n(u),l=n("a5a5");const f=new Date("January 1, 2036"),h="arc.io",y={state:l["j"].UNDECIDED,date:new Date,dismissedAt:null},p=()=>({domain:w(),expires:f,sameSite:"None",secure:!0});function w(){const{hostname:t}=window.location;return m(t)?h:t}function m(t){return t.endsWith("."+h)||t===h}async function g(){let t=a.a.get(l["i"]);return t?(t=JSON.parse(t),t.date=new Date(t.date),t):(b(y),y)}async function b(t){return t=JSON.stringify(t),a.a.set(l["i"],t,p())}async function k(t,e){const n={state:l["j"].OPTED_IN,date:Date.now(),referrerPropertyId:t,referrerOrigin:e};return b(n)}async function v(t,e){const n={state:l["j"].OPTED_OUT,date:Date.now(),referrerPropertyId:t,referrerOrigin:e};return b(n)}var S=n("6179"),I=n("82c0"),x=n("8c32"),T=n("d167");const O=n("34eb")("arc:broker"),E="propertySessions";class D{static establishRpc(t){return"_rpc|establish:"+t}static confirmRpc(t){return"_rpc|confirm:"+t}static rpcPair(t,e){return`_rpc|pair:${t}-${e}`}}const C=()=>n.e("lazy-iwc").then(n.bind(null,"0475")).then(t=>t.SJ.iwc),j=t=>new Promise(e=>t.onReady(e));function A(t,e){const n=new Set(e),r={};for(const[s,o]of Object.entries(t)){const t=o.activeBrokers.filter(t=>{const e=n.has(t.brokerId);return e});t.length>0&&(r[s]={propertySessionId:o.propertySessionId,activeBrokers:t})}return r}function B(t,e,n,r){t=t||{},t=A(t,e);const{propertyId:s,myBrokerId:o,...i}=n;s in t||(t[s]={propertySessionId:r,activeBrokers:[]});const{activeBrokers:c}=t[s];return c.find(t=>t.brokerId===o)||t[s].activeBrokers.push({brokerId:o,propertyId:s,...i}),t}function F(t,e){const n=Object.values(t),r=e.some(t=>n.some(({activeBrokers:e})=>{const n=1===e.length&&e[0].brokerId===t;return n}));return r}async function _(t,e,n=!1){const r=this;window.name=Object(x["g"])();const[s,{uuid4:o}]=await Promise.all([C(),Object(T["a"])()]),i=s.WindowMonitor;await j(i);const c=i.getThisWindowId();O("broker is eligible to become master. myBrokerId: "+c);const a=new s.SharedData("master"),u=new s.SharedData(E);function d(){const t=a.get();return c===t}function l(t,e,n){for(const r of n)s.EventBus.un(D.rpcPair(r,c));const o=t.getOpenWindowIds();o.sort(),a.change(t=>(t=t||null,o.includes(t)||(t=null),t||o[0]!==c||(t=c),t)),O("brokers changed. \nmyBrokerId %s \nbrokerIds %o \nnewBrokers %o \nclosedBrokers %o",c,o,e,n),d()&&(e.length&&u.onceChanged(t=>{F(t,e)&&r.emit("newSession")}),n.length&&(O("master: cleaning sessions b/c brokers closed. %o",n),u.change(t=>(t=t||{},A(t,o)))))}a.onChanged(()=>{if(d()){r.emit("master"),O("master: cleaning sessions b/c im the new master");const t=i.getOpenWindowIds();u.change(e=>(e=e||{},A(e,t)))}}),u.onChanged((e={})=>{if(O("propertySessions changed %o",e),!(t in e))return;const{propertySessionId:n}=e[t];r.emit("propertySessionId",n)});const f=()=>{const r=i.getOpenWindowIds(),s={myBrokerId:c,propertyId:t,origin:e,isSwActive:n};u.change(t=>B(t,r,s,o()))};f(),setInterval(f,3e4),l(i,[c],[]),i.onWindowsChanged((...t)=>l(i,...t))}async function N(){const t=await C(),e=t.WindowMonitor;await j(e);const n=e.getOpenWindowIds();return n}async function P(){const t=await C(),e=[],n=new t.SharedData(E).get();for(const[r,s]of Object.entries(n)){const{activeBrokers:t=[],propertySessionId:n}=s;if(!t.length)continue;const o=[...new Set(t.map(t=>t.origin))].filter(Boolean),i=t.some(t=>t.isSwActive);e.push({propertyId:r,propertySessionId:n,origins:o,isSwActive:i,status:"open"})}return e}class L{constructor(){Object(o["a"])(this,"events",{})}async on(t,e){t in this.events||(this.events[t]=[]),this.events[t].push(e)}async once(t,e){const n=this;this.on(t,(function r(){n.removeListener(t,r),e()}))}async emit(t,...e){if(!(t in this.events))return;const n=this.events[t].slice();for(const r of n)r(...e)}async removeListener(t,e){if(!(t in this.events))return;const n=this.events[t].indexOf(e);-1!==n&&this.events[t].splice(n,1)}async removeAllListeners(t){t?this.events[t]=[]:this.events={}}async destroy(){this.removeAllListeners()}}class R extends L{constructor(){super(),Object(o["a"])(this,"Cookies",i["b"](a.a)),Object(o["a"])(this,"localStorage",i["b"](localStorage)),Object.assign(this,s),Object.assign(this,I),Object.assign(this,r)}async createStore(t){return new S["a"](t)}}class M extends R{async createStore({torrentFileObj:t}){const{pieceLength:e,length:n}=t;return d()(e,{length:n})}}class W extends R{async createStore(t){const e=new S["a"](t);return i["b"](e)}}class $ extends R{async createStore({torrentFileObj:t}){const{pieceLength:e,length:n}=t,r=d()(e,{length:n});return i["b"](r)}}},"4abc":function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("517b"),s=(n("c4d1"),n("82c0"));const o=n("34eb")("arc:storage:quota"),i=300;console.log;class c{constructor(t,e){this.fid=t,this.dbAsync=e,this.evictionCallback=()=>{},this.updateAccessTime=Object(r["a"])(this.updateAccessTime,2500)}onEviction(t){this.evictionCallback=t}async willExceedCustomQuota(t){const{usage:e,customQuota:n}=await Object(s["getCustomStorageEstimate"])();return e+t>n}async clearStorageForChunk(t){const e=1.25;t*=e;try{const e=await this._evictChunks(t);for(const t of e){const{index:e,buffer:n}=t;this.evictionCallback(e,n)}}catch(n){o(n)}}async _evictChunks(t){const e=await this.dbAsync,n=[];let r=0;const i=await this._getFilesEligibleForEviction();for(const c of i){const{fid:i}=c;let a=!0;const u=e.transaction(s["CHUNK_STORE"],"readwrite"),d=IDBKeyRange.bound([i,0],[i,1/0]);let l=await u.store.openCursor(d,"prev");while(l){if(r>t){a=!1;break}const e=l.value,{index:s,buffer:c}=e;this._isCurrentFile(i)&&n.push(e),r+=c.length,o(`Deleting fid: ${i}, index: ${s}`),await l.delete(),l=await l.continue()}if(a&&!this._isCurrentFile(i)&&(o("Deleting torrentFile: "+i),await e.delete(s["FILE_INFO_STORE"],i)),r>t)break}return n}async _getFilesEligibleForEviction(){const t=await this.dbAsync,e=await t.getAll(s["FILE_INFO_STORE"]);return e.filter(t=>{const{fid:e,accessTime:n}=t;return this._isCurrentFile(e)||this._hasTimedOut(n)}).sort((t,e)=>t.accessTime.getTime()-e.accessTime.getTime())}_hasTimedOut(t){const e=((new Date).getTime()-t.getTime())/1e3,n=Math.abs(e)>i;return n}async updateAccessTime(){try{const t=await this.dbAsync,e=t.transaction(s["FILE_INFO_STORE"],"readwrite"),n=e.store,r=await n.get(this.fid);if(!r)return;r.accessTime=new Date,await n.put(r)}catch(t){}}_isCurrentFile(t){return t===this.fid}}},6179:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return y}));var r=n("3d15"),s=n("2677"),o=n.n(s),i=n("364d"),c=n.n(i),a=n("82c0"),u=n("4abc");const d=n("34eb")("arc:storage:store");console.log;function l(t,e){return`chunk-${t}-${e}`}function f(t,e="Async"){const{prototype:n}=t.constructor,r=["get","put","close","destroy","remove"];for(const s of r){if(!(s in n))continue;const t=s+e;n[t]=c()(n[s])}return t}class h{constructor(t,e={}){this.chunkLength=t,this.fid=e.fid,this.dbAsync=e.dbAsync,this.closed=!1}async get(e,n,r){if("function"===typeof n)return this.get(e,null,n);if(this.closed)return this._alreadyClosedErrback(r);try{const s=[this.fid,e],o=await(await this.dbAsync).get(a["CHUNK_STORE"],s);if(!o){const n=new Error(`No chunk at index ${e}.`);return void t.nextTick(r,n)}n=n||{};const{buffer:i}=o,c=n.offset||0,u=n.length||i.length-c,d=i.slice(c,c+u);t.nextTick(r,null,d)}catch(s){d(s),t.nextTick(r,s)}}async put(e,n,r){if(this.closed)this._alreadyClosedErrback(r);else try{await(await this.dbAsync).put(a["CHUNK_STORE"],{fid:this.fid,index:e,buffer:n}),t.nextTick(r,null)}catch(s){t.nextTick(r,s)}}async remove(e,n){if(this.closed)this._alreadyClosedErrback(n);else try{const r=[this.fid,e];await(await this.dbAsync).delete(a["CHUNK_STORE"],r),t.nextTick(n,null)}catch(r){t.nextTick(n,r)}}async close(e){this.closed?this._alreadyClosedErrback(e):((await this.dbAsync).close(),this.closed=!0,t.nextTick(e,null))}async destroy(e){if(this.closed)this._alreadyClosedErrback(e);else try{const n=IDBKeyRange.bound([this.fid,0],[this.fid,1/0]);await(await this.dbAsync).delete(a["CHUNK_STORE"],n),t.nextTick(e,null)}catch(n){t.nextTick(e,n)}}_alreadyClosedErrback(e){t.nextTick(e,new Error("Store is closed"))}}class y{constructor(t){const{fid:e,torrentFileObj:n}=t;this.fid=e;const r=n.pieceLength,s=Object(a["initDb"])();this.dbAsync=s;const i=f;this.diskStore=i(new h(r,{fid:e,dbAsync:s})),this.memStore=i(new o.a(r,n)),this.quota=new u["a"](e,s),this.promises=[Object(a["storeFileInfo"])(t)],this._addQuotaListeners()}_addQuotaListeners(){this.quota.onEviction((t,e)=>{d("eviction, storing in memStore",t,e.length),this.memStore.putAsync(t,e)})}async get(e,n,s){this.promises.push(this.quota.updateAccessTime());let o=null;try{o=await this.memStore.getAsync(e,n)}catch(c){o=null}const i=l(e,this.fid);if(null!==o)return d("memStore get: "+i),void t.nextTick(s,null,r["c"](o,[o.buffer]));try{o=await this.diskStore.getAsync(e,n),d("diskStore get: "+i),t.nextTick(s,null,r["c"](o,[o.buffer]))}catch(c){t.nextTick(s,c)}}async put(e,n,r){const s=l(e,this.fid);let o=!1;try{await this.quota.willExceedCustomQuota(n.length)&&await this.quota.clearStorageForChunk(n.length),d("diskStore put: "+s),await this.diskStore.putAsync(e,n),t.nextTick(r,null)}catch(i){o=!0,"QuotaExceededError"===i.name&&await this.quota.clearStorageForChunk(n.length)}if(o)try{d("memStore put: "+s),await this.memStore.putAsync(e,n),t.nextTick(r,null)}catch(i){t.nextTick(r,i)}}async remove(e,n){if(this.closed)this._alreadyClosedErrback(n);else try{await this.diskStore.removeAsync(e),t.nextTick(n,null)}catch(r){t.nextTick(n,r)}}async close(e){if(this.closed)this._alreadyClosedErrback(e);else{this.closed=!0;try{await Promise.all([this.diskStore.closeAsync(),this.memStore.closeAsync()]),t.nextTick(e,null)}catch(n){t.nextTick(e,n)}}}async destroy(e){if(this.closed)this._alreadyClosedErrback(e);else{this.closed=!0;try{await Promise.all(this.promises),await Promise.all([this.diskStore.destroyAsync(),this.memStore.destroyAsync(),(await this.dbAsync).delete(a["FILE_INFO_STORE"],this.fid)]),t.nextTick(e,null)}catch(n){t.nextTick(e,n)}}}_alreadyClosedErrback(e){t.nextTick(e,new Error("FileChunkStore is closed."))}}}).call(this,n("4362"))},"82c0":function(t,e,n){"use strict";n.r(e),n.d(e,"CHUNK_STORE",(function(){return nt})),n.d(e,"FILE_INFO_STORE",(function(){return rt})),n.d(e,"getOrGenerateMyNodeId",(function(){return st})),n.d(e,"isStorageAccessDenied",(function(){return ot})),n.d(e,"initDb",(function(){return it})),n.d(e,"destroyDb",(function(){return ct})),n.d(e,"forceDbCompaction",(function(){return at})),n.d(e,"storeFileInfo",(function(){return ut})),n.d(e,"getFilesToSeed",(function(){return dt})),n.d(e,"listFilesToSeed",(function(){return lt})),n.d(e,"getTorrentFileObject",(function(){return ft})),n.d(e,"destroyFile",(function(){return ht})),n.d(e,"generateStorageReport",(function(){return yt})),n.d(e,"getStoredFids",(function(){return pt})),n.d(e,"getCustomStorageEstimate",(function(){return wt}));const r=(t,e)=>e.some(e=>t instanceof e);let s,o;function i(){return s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function c(){return o||(o=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const a=new WeakMap,u=new WeakMap,d=new WeakMap,l=new WeakMap,f=new WeakMap;function h(t){const e=new Promise((e,n)=>{const r=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{e(b(t.result)),r()},o=()=>{n(t.error),r()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(e=>{e instanceof IDBCursor&&a.set(e,t)}).catch(()=>{}),f.set(e,t),e}function y(t){if(u.has(t))return;const e=new Promise((e,n)=>{const r=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{e(),r()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),r()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});u.set(t,e)}let p={get(t,e,n){if(t instanceof IDBTransaction){if("done"===e)return u.get(t);if("objectStoreNames"===e)return t.objectStoreNames||d.get(t);if("store"===e)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return b(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t}};function w(t){p=t(p)}function m(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?c().includes(t)?function(...e){return t.apply(k(this),e),b(a.get(this))}:function(...e){return b(t.apply(k(this),e))}:function(e,...n){const r=t.call(k(this),e,...n);return d.set(r,e.sort?e.sort():[e]),b(r)}}function g(t){return"function"===typeof t?m(t):(t instanceof IDBTransaction&&y(t),r(t,i())?new Proxy(t,p):t)}function b(t){if(t instanceof IDBRequest)return h(t);if(l.has(t))return l.get(t);const e=g(t);return e!==t&&(l.set(t,e),f.set(e,t)),e}const k=t=>f.get(t);function v(t,e,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(t,e),c=b(i);return r&&i.addEventListener("upgradeneeded",t=>{r(b(i.result),t.oldVersion,t.newVersion,b(i.transaction))}),n&&i.addEventListener("blocked",()=>n()),c.then(t=>{o&&t.addEventListener("close",()=>o()),s&&t.addEventListener("versionchange",()=>s())}).catch(()=>{}),c}function S(t,{blocked:e}={}){const n=indexedDB.deleteDatabase(t);return e&&n.addEventListener("blocked",()=>e()),b(n).then(()=>{})}const I=["get","getKey","getAll","getAllKeys","count"],x=["put","add","delete","clear"],T=new Map;function O(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!==typeof e)return;if(T.get(e))return T.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,s=x.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!I.includes(n))return;const o=async function(t,...e){const o=this.transaction(t,s?"readwrite":"readonly");let i=o.store;r&&(i=i.index(e.shift()));const c=await i[n](...e);return s&&await o.done,c};return T.set(e,o),o}w(t=>({...t,get:(e,n,r)=>O(e,n)||t.get(e,n,r),has:(e,n)=>!!O(e,n)||t.has(e,n)}));var E=n("a78e"),D=n.n(E);const C=365,j=F(),A=!!j,B=j?"None":"Lax";function F(){try{return!Boolean(window.top.location.href)}catch(t){return!0}}class _{constructor({ttl:t=C,secure:e=A,sameSite:n=B}={}){return this.ttl=t,this.secure=e,this.sameSite=n,(async()=>this)()}async get(t){const e=D.a.get(t);return"string"===typeof e?e:void 0}async set(t,e){D.a.set(t,e,this._constructCookieParams())}async remove(t){D.a.remove(t,this._constructCookieParams())}_constructCookieParams(){return{expires:this.ttl,secure:this.secure,sameSite:this.sameSite}}}var N=n("ced0");const P="ImmortalDB",L="key-value-pairs";class R{constructor(t=P,e=L){return this.store=new N["a"](t,e),(async()=>{try{await this.store._dbp}catch(t){if("SecurityError"===t.name)return null;throw t}return this})()}async get(t){const e=await Object(N["c"])(t,this.store);return"string"===typeof e?e:void 0}async set(t,e){await Object(N["d"])(t,e,this.store)}async remove(t){await Object(N["b"])(t,this.store)}}class M{constructor(t){return this.store=t,(async()=>this)()}async get(t){const e=this.store.getItem(t);return"string"===typeof e?e:void 0}async set(t,e){this.store.setItem(t,e)}async remove(t){this.store.removeItem(t)}}class W extends M{constructor(){super(window.localStorage)}}const $=console.log,K="_immortal|",U="undefined"!==typeof window,q=[_];try{U&&window.indexedDB&&q.push(R)}catch(mt){}try{U&&window.localStorage&&q.push(W)}catch(mt){}function J(t,e,n=null){return e in t?t[e]:n}function Q(t){const e=new Map;let n=t.slice();for(const r of n){let t=0;for(const e of n)r===e&&(t+=1);t>0&&(e.set(r,t),n=n.filter(t=>t!==r))}return e}class H{constructor(t=q){this.stores=[],this.onReady=(async()=>{this.stores=(await Promise.all(t.map(async t=>{if("object"===typeof t)return t;try{return await new t}catch(mt){return null}}))).filter(Boolean)})()}async get(t,e=null){await this.onReady;const n=`${K}${t}`,r=await Promise.all(this.stores.map(async t=>{try{return await t.get(n)}catch(mt){$(mt)}})),s=Array.from(Q(r).entries());let o;s.sort((t,e)=>t[1]<=e[1]);const[i,c]=J(s,0,[void 0,0]),[a,u]=J(s,1,[void 0,0]);return o=c>u||c===u&&void 0!==i?i:a,void 0!==o?(await this.set(t,o),o):(await this.remove(t),e)}async set(t,e){return await this.onReady,t=`${K}${t}`,await Promise.all(this.stores.map(async n=>{try{await n.set(t,e)}catch(mt){$(mt)}})),e}async remove(t){await this.onReady,t=`${K}${t}`,await Promise.all(this.stores.map(async e=>{try{await e.remove(t)}catch(mt){$(mt)}}))}}const z=new H;var V=n("a5a5"),G=n("5de4"),Z=n("d167");const X=n("34eb")("arc:broker"),Y="Arc_nodeId",tt="arc",et=60,nt=(console.log,"fileChunks"),rt="fileInfo";async function st(){let t=await z.get(Y);if(!t){const{guid:e}=await Object(Z["a"])();t=e(),await z.set(Y,t)}return t}async function ot(){try{return window.localStorage.getItem("test"),await it(),!1}catch{return!0}}async function it(){const t=await v(tt,et,{upgrade(t,e,n,r){let s,o;if(t.objectStoreNames.contains(nt))s=r.objectStore(nt);else{const e={keyPath:["fid","index"]};s=t.createObjectStore(nt,e)}if(s.indexNames.contains("fid")||s.createIndex("fid","fid"),t.objectStoreNames.contains(rt))o=r.objectStore(rt);else{const e={keyPath:"fid"};o=t.createObjectStore(rt,e)}o.indexNames.contains("accessTime")||o.createIndex("accessTime","accessTime"),o.indexNames.contains("expiresAt")||o.createIndex("expiresAt","expiresAt"),o.indexNames.contains("seedTaskDate")||o.createIndex("seedTaskDate","seedTaskDate")},blocked(){},blocking(){},terminated(){}});return t}async function ct(){return S(tt)}async function at(){try{const t="tempDb",e="temp",n=await v(t,1,{upgrade(t){t.createObjectStore(e,{keyPath:"id"})}});await n.put(e,{id:"fucboi"}),await S(t)}catch(mt){console.log(mt)}}async function ut(t){const{parseTorrent:e}=await Object(Z["a"])(),{fid:n,torrentFileObj:r,expiresAt:s,seedTaskDate:o}=t,i=e.toTorrentFile(r),c={fid:n,torrentFile:i,expiresAt:s?new Date(s):null,seedTaskDate:o?new Date(o):null,accessTime:new Date},a=await it();await a.put(rt,c)}async function dt(t=5,e=[]){const{parseTorrent:n,Buffer:r}=await Object(Z["a"])(),s={};let o=0;const i=await it();let c=await i.transaction(rt).store.openCursor();while(c&&oV["d"];!u&&d&&(s[t]=a,o++),c=await c.continue()}return s}async function lt(t=5,e=[]){const{parseTorrent:n,Buffer:r}=await Object(Z["a"])(),s=[],o=await it(),i=o.transaction(rt).store,c=async o=>{while(o&&s.lengthe.fid===t),d=a.length>V["d"];!u&&d&&s.push({fid:t,torrentFileObj:a,...c}),o=await o.continue()}};if(i.indexNames.contains("seedTaskDate")){const t=i.index("seedTaskDate"),e=await t.openCursor(null,"prev");await c(e)}if(s.length