search-index
Version:
A network resilient, persistent full-text search library for the browser and Node.js
2 lines • 212 kB
JavaScript
/*! For license information please see search-index-6.0.1.js.LICENSE.txt */
var SearchIndex;(()=>{var t={796:(t,e,r)=>{"use strict";const n=r(9121),i=r(266),{getOptions:o,emptyOptions:s,noop:a}=r(1343),{prefixDescendantKey:c,isDescendant:u}=r(1450),{PrewriteBatch:l}=r(9767),h=Symbol("status"),f=Symbol("publicOperations"),p=Symbol("legacyOperations"),y=Symbol("privateOperations"),d=Symbol("closePromise"),g=Symbol("length"),m=Symbol("prewriteRun"),v=Symbol("prewriteBatch"),b=Symbol("prewriteData"),E=Symbol("addMode"),w=function(t){let e;return t[d]=new Promise(((r,n)=>{e=()=>{A(t).then(r,n)}})),e},A=async function(t){t[h]="closing",await t._close(),t.db.detachResource(t)};class S{constructor(t,e){this[y]=t,this[f]=e}get length(){return this[y].length}clear(){for(const t of[f,y]){const e=this[t];null!==e&&e.splice(0,e.length)}}}const T=function(t){if("open"!==t[h])throw new i("Batch is not open: cannot change operations after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});if("open"!==t.db.status)throw new i("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})};e.AbstractChainedBatch=class{constructor(t,e){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));const r=t.listenerCount("write")>0,n=!t.hooks.prewrite.noop;if(this[f]=r?[]:null,this[p]=r||n?null:[],this[g]=0,this[h]="open",this[d]=null,this[E]=!0===o(e,s).add,n){const e=new S([],r?[]:null);this[b]=e,this[v]=new l(t,e[y],e[f]),this[m]=t.hooks.prewrite.run}else this[b]=null,this[v]=null,this[m]=null;this.db=t,this.db.attachResource(this)}get length(){return null!==this[b]?this[g]+this[b].length:this[g]}put(t,e,r){T(this);const n=null!=(r=o(r,s)).sublevel,a=n?r.sublevel:this.db,l=r,h=a._checkKey(t),y=a._checkValue(e);if(null!=h)throw h;if(null!=y)throw y;const d=Object.assign({},r,{type:"put",key:t,value:e,keyEncoding:a.keyEncoding(r.keyEncoding),valueEncoding:a.valueEncoding(r.valueEncoding)});if(null!==this[m])try{this[m](d,this[v]),d.keyEncoding=a.keyEncoding(d.keyEncoding),d.valueEncoding=a.valueEncoding(d.valueEncoding)}catch(t){throw new i("The prewrite hook failed on batch.put()",{code:"LEVEL_HOOK_ERROR",cause:t})}const b=d.keyEncoding,w=b.encode(d.key),A=b.format,S=n&&!u(d.sublevel,this.db)&&d.sublevel!==this.db,O=n&&!S?c(w,A,a,this.db):w,I=d.valueEncoding,_=I.encode(d.value),L=I.format;if(n&&!S&&(d.sublevel=null),null===this[f]||S){if(null!==this[p]&&!S){const r=Object.assign({},l);r.type="put",r.key=t,r.value=e,this[p].push(r)}}else{const t=Object.assign({},d);t.encodedKey=O,t.encodedValue=_,n&&(t.key=O,t.value=_,t.keyEncoding=this.db.keyEncoding(A),t.valueEncoding=this.db.valueEncoding(L)),this[f].push(t)}return d.key=S?O:this.db.prefixKey(O,A,!0),d.value=_,d.keyEncoding=A,d.valueEncoding=L,this[E]?this._add(d):this._put(d.key,_,d),this[g]++,this}_put(t,e,r){}del(t,e){T(this);const r=null!=(e=o(e,s)).sublevel,n=r?e.sublevel:this.db,a=e,u=n._checkKey(t);if(null!=u)throw u;const l=Object.assign({},e,{type:"del",key:t,keyEncoding:n.keyEncoding(e.keyEncoding)});if(null!==this[m])try{this[m](l,this[v]),l.keyEncoding=n.keyEncoding(l.keyEncoding)}catch(t){throw new i("The prewrite hook failed on batch.del()",{code:"LEVEL_HOOK_ERROR",cause:t})}const h=l.keyEncoding,y=h.encode(l.key),d=h.format,b=r?c(y,d,n,this.db):y;if(r&&(l.sublevel=null),null!==this[f]){const t=Object.assign({},l);t.encodedKey=b,r&&(t.key=b,t.keyEncoding=this.db.keyEncoding(d)),this[f].push(t)}else if(null!==this[p]){const e=Object.assign({},a);e.type="del",e.key=t,this[p].push(e)}return l.key=this.db.prefixKey(b,d,!0),l.keyEncoding=d,this[E]?this._add(l):this._del(l.key,l),this[g]++,this}_del(t,e){}_add(t){}clear(){return T(this),this._clear(),null!==this[f]&&(this[f]=[]),null!==this[p]&&(this[p]=[]),null!==this[b]&&this[b].clear(),this[g]=0,this}_clear(){}async write(t){if(T(this),t=o(t),0===this[g])return this.close();{this[h]="writing";const e=w(this);try{if(null!==this[b]){const t=this[b][f],e=this[b][y],r=this[b].length;for(let t=0;t<r;t++){const r=e[t];this[E]?this._add(r):"put"===r.type?this._put(r.key,r.value,r):this._del(r.key,r)}null!==t&&0!==r&&(this[f]=this[f].concat(t))}await this._write(t)}catch(t){e();try{await this[d]}catch(e){t=n([t,e])}throw t}return e(),null!==this[f]?this.db.emit("write",this[f]):null!==this[p]&&this.db.emit("batch",this[p]),this[d]}}async _write(t){}async close(){return null!==this[d]?this[d].catch(a):(w(this)(),this[d])}async _close(){}}},3527:(t,e,r)=>{"use strict";const n=r(266),i=r(9121),{getOptions:o,emptyOptions:s,noop:a}=r(1343),{AbortError:c}=r(597),u=Symbol("working"),l=Symbol("decodeOne"),h=Symbol("decodeMany"),f=Symbol("signal"),p=Symbol("pendingClose"),y=Symbol("closingPromise"),d=Symbol("keyEncoding"),g=Symbol("valueEncoding"),m=Symbol("keys"),v=Symbol("values"),b=Symbol("limit"),E=Symbol("count"),w=Symbol("ended");class A{constructor(t,e){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[u]=!1,this[p]=null,this[y]=null,this[d]=e[d],this[g]=e[g],this[b]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[E]=0,this[f]=null!=e.signal?e.signal:null,this[w]=!1,this.db=t,this.db.attachResource(this)}get count(){return this[E]}get limit(){return this[b]}async next(){O(this);try{if(this[w]||this[E]>=this[b])return void(this[w]=!0);let t=await this._next();if(void 0===t)return void(this[w]=!0);try{t=this[l](t)}catch(t){throw new T(t)}return this[E]++,t}finally{I(this)}}async _next(){}async nextv(t,e){if(!Number.isInteger(t))throw new TypeError("The first argument 'size' must be an integer");e=o(e,s),t<1&&(t=1),this[b]<1/0&&(t=Math.min(t,this[b]-this[E])),O(this);try{if(this[w]||t<=0)return this[w]=!0,[];const r=await this._nextv(t,e);if(0===r.length)return this[w]=!0,r;try{this[h](r)}catch(t){throw new T(t)}return this[E]+=r.length,r}finally{I(this)}}async _nextv(t,e){const r=[];for(;r.length<t;){const t=await this._next(e);if(void 0===t){this[w]=!0;break}r.push(t)}return r}async all(t){t=o(t,s),O(this);try{if(this[w]||this[E]>=this[b])return[];const e=await this._all(t);try{this[h](e)}catch(t){throw new T(t)}return this[E]+=e.length,e}catch(t){I(this),await L(this,t)}finally{this[w]=!0,this[u]&&(I(this),await this.close())}}async _all(t){let e=this[E];const r=[];for(;;){const n=this[b]<1/0?Math.min(1e3,this[b]-e):1e3;if(n<=0)return r;const i=await this._nextv(n,t);if(0===i.length)return r;r.push.apply(r,i),e+=i.length}}seek(t,e){if(e=o(e,s),null!==this[y]);else{if(this[u])throw new n("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const r=this.db.keyEncoding(e.keyEncoding||this[d]),n=r.format;e.keyEncoding!==n&&(e={...e,keyEncoding:n});const i=this.db.prefixKey(r.encode(t),n,!1);this._seek(i,e),this[w]=!1}}}_seek(t,e){throw new n("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}async close(){return null!==this[y]?this[y].catch(a):(this[y]=new Promise(((t,e)=>{this[p]=()=>{this[p]=null,_(this).then(t,e)}})),this[u]||this[p](),this[y])}async _close(){}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}catch(t){await L(this,t)}finally{await this.close()}}}class S extends A{constructor(t,e){super(t,e),this[m]=!1!==e.keys,this[v]=!1!==e.values}[l](t){const e=t[0],r=t[1];return void 0!==e&&(t[0]=this[m]?this[d].decode(e):void 0),void 0!==r&&(t[1]=this[v]?this[g].decode(r):void 0),t}[h](t){const e=this[d],r=this[g];for(const n of t){const t=n[0],i=n[1];void 0!==t&&(n[0]=this[m]?e.decode(t):void 0),void 0!==i&&(n[1]=this[v]?r.decode(i):void 0)}}}class T extends n{constructor(t){super("Iterator could not decode data",{code:"LEVEL_DECODE_ERROR",cause:t})}}const O=function(t){if(null!==t[y])throw new n("Iterator is not open: cannot read after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"});if(t[u])throw new n("Iterator is busy: cannot read until previous read has completed",{code:"LEVEL_ITERATOR_BUSY"});if(null!==t[f]&&t[f].aborted)throw new c;t[u]=!0},I=function(t){t[u]=!1,null!==t[p]&&t[p]()},_=async function(t){await t._close(),t.db.detachResource(t)},L=async function(t,e){try{await t.close()}catch(t){throw i([e,t])}throw e};S.keyEncoding=d,S.valueEncoding=g,e.AbstractIterator=S,e.AbstractKeyIterator=class extends A{[l](t){return this[d].decode(t)}[h](t){const e=this[d];for(let r=0;r<t.length;r++){const n=t[r];void 0!==n&&(t[r]=e.decode(n))}}},e.AbstractValueIterator=class extends A{[l](t){return this[g].decode(t)}[h](t){const e=this[g];for(let r=0;r<t.length;r++){const n=t[r];void 0!==n&&(t[r]=e.decode(n))}}}},1983:(t,e,r)=>{"use strict";const{supports:n}=r(5356),{Transcoder:i}=r(6035),{EventEmitter:o}=r(7007),s=r(266),a=r(9121),{AbstractIterator:c}=r(3527),{DefaultKeyIterator:u,DefaultValueIterator:l}=r(5682),{DeferredIterator:h,DeferredKeyIterator:f,DeferredValueIterator:p}=r(4416),{DefaultChainedBatch:y}=r(4669),{DatabaseHooks:d}=r(3172),{PrewriteBatch:g}=r(9767),{EventMonitor:m}=r(2107),{getOptions:v,noop:b,emptyOptions:E,resolvedPromise:w}=r(1343),{prefixDescendantKey:A,isDescendant:S}=r(1450),{DeferredQueue:T}=r(971),O=r(386),I=Symbol("resources"),_=Symbol("closeResources"),L=Symbol("queue"),x=Symbol("deferOpen"),U=Symbol("options"),R=Symbol("status"),k=Symbol("statusChange"),N=Symbol("statusLocked"),C=Symbol("defaultOptions"),D=Symbol("transcoder"),B=Symbol("keyEncoding"),F=Symbol("valueEncoding"),j=Symbol("eventMonitor"),P=Symbol("arrayBatch");class M extends o{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=v(e);const{keyEncoding:r,valueEncoding:o,passive:s,...a}=e;this[I]=new Set,this[L]=new T,this[x]=!0,this[U]=a,this[R]="opening",this[k]=null,this[N]=!1,this.hooks=new d,this.supports=n(t,{deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,write:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[j]=new m(this,[{name:"write"},{name:"put",deprecated:!0,alt:"write"},{name:"del",deprecated:!0,alt:"write"},{name:"batch",deprecated:!0,alt:"write"}]),this[D]=new i(G(this)),this[B]=this[D].encoding(r||"utf8"),this[F]=this[D].encoding(o||"utf8");for(const t of this[D].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[C]={empty:E,entry:Object.freeze({keyEncoding:this[B].commonName,valueEncoding:this[F].commonName}),entryFormat:Object.freeze({keyEncoding:this[B].format,valueEncoding:this[F].format}),key:Object.freeze({keyEncoding:this[B].commonName}),keyFormat:Object.freeze({keyEncoding:this[B].format})},queueMicrotask((()=>{this[x]&&this.open({passive:!1}).catch(b)}))}get status(){return this[R]}get parent(){return null}keyEncoding(t){return this[D].encoding(null!=t?t:this[B])}valueEncoding(t){return this[D].encoding(null!=t?t:this[F])}async open(t){(t={...this[U],...v(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const e=this.hooks.postopen.noop?null:this.hooks.postopen.run,r=t.passive;for(r&&this[x]&&await void 0,z(this);null!==this[k];)await this[k].catch(b);if(z(this),r){if("open"!==this[R])throw new H}else if("closed"===this[R]||this[x]){this[x]=!1,this[k]=w,this[k]=(async()=>{this[R]="opening";try{this.emit("opening"),await this._open(t)}catch(t){this[R]="closed",this[L].drain();try{await this[_]()}catch(e){t=a([t,e])}throw new H(t)}if(this[R]="open",null!==e){let r;try{this[N]=!0,await e(t)}catch(t){r=K(t)}finally{this[N]=!1}if(r){this[R]="closing",this[L].drain();try{await this[_](),await this._close()}catch(t){this[N]=!0,r=a([r,t])}throw this[R]="closed",new s("The postopen hook failed on open()",{code:"LEVEL_HOOK_ERROR",cause:r})}}this[L].drain(),this.emit("open")})();try{await this[k]}finally{this[k]=null}}else if("open"!==this[R])throw new H}async _open(t){}async close(){for(z(this);null!==this[k];)await this[k].catch(b);if(z(this),"open"===this[R]||this[x]){const t=this[x];this[x]=!1,this[k]=w,this[k]=(async()=>{this[R]="closing",this[L].drain();try{this.emit("closing"),await this[_](),t||await this._close()}catch(t){throw this[R]="open",this[L].drain(),new q(t)}this[R]="closed",this[L].drain(),this.emit("closed")})();try{await this[k]}finally{this[k]=null}}else if("closed"!==this[R])throw new q}async[_](){if(0===this[I].size)return;const t=Array.from(this[I]),e=t.map(W);return Promise.allSettled(e).then((async e=>{const r=[];for(let n=0;n<e.length;n++)"fulfilled"===e[n].status?this[I].delete(t[n]):r.push(K(e[n].reason));if(r.length>0)throw a(r)}))}async _close(){}async get(t,e){if(e=v(e,this[C].entry),"opening"===this[R])return this.deferAsync((()=>this.get(t,e)));$(this);const r=this._checkKey(t);if(r)throw r;const n=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),o=n.format,a=i.format;e.keyEncoding===o&&e.valueEncoding===a||(e=Object.assign({},e,{keyEncoding:o,valueEncoding:a}));const c=n.encode(t),u=await this._get(this.prefixKey(c,o,!0),e);try{return void 0===u?u:i.decode(u)}catch(r){throw new s("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:r})}}async _get(t,e){}async getMany(t,e){if(e=v(e,this[C].entry),"opening"===this[R])return this.deferAsync((()=>this.getMany(t,e)));if($(this),!Array.isArray(t))throw new TypeError("The first argument 'keys' must be an array");if(0===t.length)return[];const r=this.keyEncoding(e.keyEncoding),n=this.valueEncoding(e.valueEncoding),i=r.format,o=n.format;e.keyEncoding===i&&e.valueEncoding===o||(e=Object.assign({},e,{keyEncoding:i,valueEncoding:o}));const a=new Array(t.length);for(let e=0;e<t.length;e++){const n=t[e],o=this._checkKey(n);if(o)throw o;a[e]=this.prefixKey(r.encode(n),i,!0)}const c=await this._getMany(a,e);try{for(let t=0;t<c.length;t++)void 0!==c[t]&&(c[t]=n.decode(c[t]))}catch(t){throw new s(`Could not decode one or more of ${c.length} value(s)`,{code:"LEVEL_DECODE_ERROR",cause:t})}return c}async _getMany(t,e){return new Array(t.length).fill(void 0)}async put(t,e,r){if(!this.hooks.prewrite.noop)return this.batch([{type:"put",key:t,value:e}],r);if(r=v(r,this[C].entry),"opening"===this[R])return this.deferAsync((()=>this.put(t,e,r)));$(this);const n=this._checkKey(t)||this._checkValue(e);if(n)throw n;const i=this.keyEncoding(r.keyEncoding),o=this.valueEncoding(r.valueEncoding),s=i.format,a=o.format,c=this[j].write,u=r;r===this[C].entry?r=this[C].entryFormat:r.keyEncoding===s&&r.valueEncoding===a||(r=Object.assign({},r,{keyEncoding:s,valueEncoding:a}));const l=i.encode(t),h=this.prefixKey(l,s,!0),f=o.encode(e);if(await this._put(h,f,r),c){const r=Object.assign({},u,{type:"put",key:t,value:e,keyEncoding:i,valueEncoding:o,encodedKey:l,encodedValue:f});this.emit("write",[r])}else this.emit("put",t,e)}async _put(t,e,r){}async del(t,e){if(!this.hooks.prewrite.noop)return this.batch([{type:"del",key:t}],e);if(e=v(e,this[C].key),"opening"===this[R])return this.deferAsync((()=>this.del(t,e)));$(this);const r=this._checkKey(t);if(r)throw r;const n=this.keyEncoding(e.keyEncoding),i=n.format,o=this[j].write,s=e;e===this[C].key?e=this[C].keyFormat:e.keyEncoding!==i&&(e=Object.assign({},e,{keyEncoding:i}));const a=n.encode(t),c=this.prefixKey(a,i,!0);if(await this._del(c,e),o){const e=Object.assign({},s,{type:"del",key:t,keyEncoding:n,encodedKey:a});this.emit("write",[e])}else this.emit("del",t)}async _del(t,e){}batch(t,e){return arguments.length?(e=v(e,this[C].empty),this[P](t,e)):($(this),this._chainedBatch())}async[P](t,e){if("opening"===this[R])return this.deferAsync((()=>this[P](t,e)));if($(this),!Array.isArray(t))throw new TypeError("The first argument 'operations' must be an array");if(0===t.length)return;const r=t.length,n=!this.hooks.prewrite.noop,i=this[j].write,o=i?new Array(r):null,a=new Array(r),c=n?new g(this,a,o):null;for(let u=0;u<r;u++){const r=Object.assign({},e,t[u]),l="put"===r.type,h=null!=r.sublevel,f=h?r.sublevel:this,p=f._checkKey(r.key);if(null!=p)throw p;if(r.keyEncoding=f.keyEncoding(r.keyEncoding),l){const t=f._checkValue(r.value);if(null!=t)throw t;r.valueEncoding=f.valueEncoding(r.valueEncoding)}else if("del"!==r.type)throw new TypeError("A batch operation must have a type property that is 'put' or 'del'");if(n)try{this.hooks.prewrite.run(r,c),r.keyEncoding=f.keyEncoding(r.keyEncoding),l&&(r.valueEncoding=f.valueEncoding(r.valueEncoding))}catch(t){throw new s("The prewrite hook failed on batch()",{code:"LEVEL_HOOK_ERROR",cause:t})}const y=r.keyEncoding,d=y.encode(r.key),g=y.format,m=h&&!S(r.sublevel,this)&&r.sublevel!==this,v=h&&!m?A(d,g,f,this):d;h&&!m&&(r.sublevel=null);let b=null;if(i&&!m&&(b=Object.assign({},r),b.encodedKey=v,h&&(b.key=v,b.keyEncoding=this.keyEncoding(g)),o[u]=b),r.key=m?v:this.prefixKey(v,g,!0),r.keyEncoding=g,l){const t=r.valueEncoding,e=t.encode(r.value),n=t.format;r.value=e,r.valueEncoding=n,i&&!m&&(b.encodedValue=e,h&&(b.value=e,b.valueEncoding=this.valueEncoding(n)))}a[u]=r}await this._batch(a,e),i?this.emit("write",o):n||this.emit("batch",t)}async _batch(t,e){}sublevel(t,e){const r=V.defaults(e),n=this._sublevel(t,r);if(!this.hooks.newsub.noop)try{this.hooks.newsub.run(n,r)}catch(t){throw new s("The newsub hook failed on sublevel()",{code:"LEVEL_HOOK_ERROR",cause:t})}return n}_sublevel(t,e){return new V(this,t,e)}prefixKey(t,e,r){return t}async clear(t){if(t=v(t,this[C].empty),"opening"===this[R])return this.deferAsync((()=>this.clear(t)));$(this);const e=t,r=this.keyEncoding(t.keyEncoding);(t=O(t,r)).keyEncoding=r.format,0!==t.limit&&(await this._clear(t),this.emit("clear",e))}async _clear(t){}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);return(t=O(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[R]?new h(this,t):($(this),this._iterator(t))}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);return(t=O(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[R]?new f(this,t):($(this),this._keys(t))}_keys(t){return new u(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);return(t=O(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[R]?new p(this,t):($(this),this._values(t))}_values(t){return new l(this,t)}defer(t,e){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[L].add((function(e){e||t()}),e)}deferAsync(t,e){if("function"!=typeof t)throw new TypeError("The first argument must be a function");return new Promise(((r,n)=>{this[L].add((function(e){e?n(e):t().then(r,n)}),e)}))}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[I].add(t)}detachResource(t){this[I].delete(t)}_chainedBatch(){return new y(this)}_checkKey(t){if(null==t)return new s("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new s("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}const{AbstractSublevel:V}=r(9933)({AbstractLevel:M});e.AbstractLevel=M,e.AbstractSublevel=V;const $=function(t){if("open"!==t[R])throw new s("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})},z=function(t){if(t[N])throw new s("Database status is locked",{code:"LEVEL_STATUS_LOCKED"})},G=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))},W=function(t){return t.close()},K=function(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)?t:new TypeError("Promise rejection reason must be an Error, received "+(null===t?"null":typeof t))};class H extends s{constructor(t){super("Database failed to open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})}}class q extends s{constructor(t){super("Database failed to close",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:t})}}},5e3:(t,e,r)=>{"use strict";e.AbstractLevel=r(1983).AbstractLevel,e.AbstractSublevel=r(1983).AbstractSublevel,e.AbstractIterator=r(3527).AbstractIterator,e.AbstractKeyIterator=r(3527).AbstractKeyIterator,e.AbstractValueIterator=r(3527).AbstractValueIterator,e.AbstractChainedBatch=r(796).AbstractChainedBatch},4716:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=Symbol("unfix"),a=Symbol("iterator");class c extends n{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n}async _next(){const t=await this[a].next();if(void 0!==t){const e=t[0];void 0!==e&&(t[0]=this[s](e))}return t}async _nextv(t,e){const r=await this[a].nextv(t,e),n=this[s];for(const t of r){const e=t[0];void 0!==e&&(t[0]=n(e))}return r}async _all(t){const e=await this[a].all(t),r=this[s];for(const t of e){const e=t[0];void 0!==e&&(t[0]=r(e))}return e}}class u extends i{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n}async _next(){const t=await this[a].next();return void 0===t?t:this[s](t)}async _nextv(t,e){const r=await this[a].nextv(t,e),n=this[s];for(let t=0;t<r.length;t++){const e=r[t];void 0!==e&&(r[t]=n(e))}return r}async _all(t){const e=await this[a].all(t),r=this[s];for(let t=0;t<e.length;t++){const n=e[t];void 0!==n&&(e[t]=r(n))}return e}}class l extends o{constructor(t,e,r){super(t,e),this[a]=r}async _next(){return this[a].next()}async _nextv(t,e){return this[a].nextv(t,e)}async _all(t){return this[a].all(t)}}for(const t of[c,u,l])t.prototype._seek=function(t,e){this[a].seek(t,e)},t.prototype._close=async function(){return this[a].close()};e.AbstractSublevelIterator=c,e.AbstractSublevelKeyIterator=u,e.AbstractSublevelValueIterator=l},9933:(t,e,r)=>{"use strict";const n=r(266),{Buffer:i}=r(8287)||{},{AbstractSublevelIterator:o,AbstractSublevelKeyIterator:s,AbstractSublevelValueIterator:a}=r(4716),c=Symbol("prefix"),u=Symbol("localPrefix"),l=Symbol("localPath"),h=Symbol("globalPath"),f=Symbol("upperBound"),p=Symbol("prefixRange"),y=Symbol("root"),d=Symbol("parent"),g=Symbol("unfix"),m=new TextEncoder,v={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){return null==t?v:t.separator?t:{...t,separator:"!"}}constructor(t,r,i){const{separator:o,manifest:s,...a}=e.defaults(i),p=[].concat(r).map((t=>S(t,o))),v=o.charCodeAt(0)+1,E=t[y]||t;if(!p.every((t=>m.encode(t).every((t=>t>v&&t<127)))))throw new n(`Sublevel name must use bytes > ${v} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(b(t,s),a);const T=p.map((t=>o+t+o)).join(""),O=(t.prefix||"")+T,I=O.slice(0,-1)+String.fromCharCode(v);this[y]=E,this[d]=t,this[l]=p,this[h]=t.prefix?t.path().concat(p):p,this[c]=new w(O),this[f]=new w(I),this[u]=new w(T),this[g]=new A}prefixKey(t,e,r){const n=r?this[u]:this[c];if("utf8"===e)return n.utf8+t;if(0===t.byteLength)return n[e];if("view"===e){const e=n.view,r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}{const e=n.buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[p](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e,!1):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e,!1):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e,!1):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e,!1):t.lte=this[f][e]}get prefix(){return this[c].utf8}get db(){return this[y]}get parent(){return this[d]}path(t=!1){return t?this[l]:this[h]}async _open(t){return this[d].open({passive:!0})}async _put(t,e,r){return this[d].put(t,e,r)}async _get(t,e){return this[d].get(t,e)}async _getMany(t,e){return this[d].getMany(t,e)}async _del(t,e){return this[d].del(t,e)}async _batch(t,e){return this[d].batch(t,e)}async _clear(t){return this[p](t,t.keyEncoding),this[y].clear(t)}_iterator(t){this[p](t,t.keyEncoding);const e=this[y].iterator(t),r=this[g].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,r)}_keys(t){this[p](t,t.keyEncoding);const e=this[y].keys(t),r=this[g].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,r)}_values(t){this[p](t,t.keyEncoding);const e=this[y].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const b=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:E(t,"utf8"),buffer:E(t,"buffer"),view:E(t,"view")}}},E=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class w{constructor(t){this.utf8=t,this.view=m.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class A{constructor(){this.cache=new Map}get(t,e){let r=this.cache.get(e);return void 0===r&&(r="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,r)),r}}const S=function(t,e){let r=0,n=t.length;for(;r<n&&t[r]===e;)r++;for(;n>r&&t[n-1]===e;)n--;return t.slice(r,n)}},1343:(t,e,r)=>{"use strict";const n=r(266),i=new Set;e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}},e.emptyOptions=Object.freeze({}),e.noop=function(){},e.resolvedPromise=Promise.resolve(),e.deprecate=function(t){if(!i.has(t)){i.add(t);const e=globalThis.console;void 0!==e&&"function"==typeof e.warn&&e.warn(new n(t,{code:"LEVEL_LEGACY"}))}}},4669:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(796),i=Symbol("encoded");e.DefaultChainedBatch=class extends n{constructor(t){super(t,{add:!0}),this[i]=[]}_add(t){this[i].push(t)}_clear(){this[i]=[]}async _write(t){return this.db._batch(this[i],t)}}},5682:(t,e,r)=>{"use strict";const{AbstractKeyIterator:n,AbstractValueIterator:i}=r(3527),o=Symbol("iterator"),s=Symbol("handleOne"),a=Symbol("handleMany");class c extends n{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!0,values:!1})}[s](t){return t[0]}[a](t){for(let e=0;e<t.length;e++)t[e]=t[e][0]}}class u extends i{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!1,values:!0})}[s](t){return t[1]}[a](t){for(let e=0;e<t.length;e++)t[e]=t[e][1]}}for(const t of[c,u])t.prototype._next=async function(){const t=await this[o].next();return void 0===t?t:this[s](t)},t.prototype._nextv=async function(t,e){const r=await this[o].nextv(t,e);return this[a](r),r},t.prototype._all=async function(t){const e=await this[o].all(t);return this[a](e),e},t.prototype._seek=function(t,e){this[o].seek(t,e)},t.prototype._close=async function(){return this[o].close()};e.DefaultKeyIterator=c,e.DefaultValueIterator=u},4416:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=r(266),a=Symbol("nut"),c=Symbol("undefer"),u=Symbol("factory"),l=Symbol("signalOptions");class h extends n{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.iterator(e),this[l]={signal:e.signal},this.db.defer((()=>this[c]()),this[l])}}class f extends i{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.keys(e),this[l]={signal:e.signal},this.db.defer((()=>this[c]()),this[l])}}class p extends o{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.values(e),this[l]={signal:e.signal},this.db.defer((()=>this[c]()),this[l])}}for(const t of[h,f,p])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[u]())},t.prototype._next=async function(){if(null!==this[a])return this[a].next();if("opening"===this.db.status)return this.db.deferAsync((()=>this._next()),this[l]);throw new s("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})},t.prototype._nextv=async function(t,e){if(null!==this[a])return this[a].nextv(t,e);if("opening"===this.db.status)return this.db.deferAsync((()=>this._nextv(t,e)),this[l]);throw new s("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})},t.prototype._all=async function(t){if(null!==this[a])return this[a].all();if("opening"===this.db.status)return this.db.deferAsync((()=>this._all(t)),this[l]);throw new s("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)),this[l])},t.prototype._close=async function(){return null!==this[a]?this[a].close():"opening"===this.db.status?this.db.deferAsync((()=>this._close())):void 0};e.DeferredIterator=h,e.DeferredKeyIterator=f,e.DeferredValueIterator=p},971:(t,e,r)=>{"use strict";const{getOptions:n,emptyOptions:i}=r(1343),{AbortError:o}=r(597),s=Symbol("operations"),a=Symbol("signals"),c=Symbol("handleAbort");class u{constructor(t,e){this.fn=t,this.signal=e}}e.DeferredQueue=class{constructor(){this[s]=[],this[a]=new Set,this[c]=this[c].bind(this)}add(t,e){const r=(e=n(e,i)).signal;null!=r?r.aborted?t(new o):(this[a].has(r)||(this[a].add(r),r.addEventListener("abort",this[c],{once:!0})),this[s].push(new u(t,r))):this[s].push(new u(t,null))}drain(){const t=this[s],e=this[a];this[s]=[],this[a]=new Set;for(const t of e)t.removeEventListener("abort",this[c]);for(const e of t)e.fn.call(null)}[c](t){const e=t.target,r=new o,n=[];this[s]=this[s].filter((function(t){return null===t.signal||t.signal!==e||(n.push(t),!1)})),this[a].delete(e);for(const t of n)t.fn.call(null,r)}}},597:(t,e,r)=>{"use strict";const n=r(266);e.AbortError=class extends n{constructor(t){super("Operation has been aborted",{code:"LEVEL_ABORTED",cause:t})}get name(){return"AbortError"}}},2107:(t,e,r)=>{"use strict";const{deprecate:n}=r(1343);e.EventMonitor=class{constructor(t,e){for(const t of e)this[t.name]=!1,t.deprecated&&(t.message=`The '${t.name}' event is deprecated in favor of '${t.alt}' and will be removed in a future version of abstract-level`);const r=new Map(e.map((t=>[t.name,t]))),i=this;t.on("newListener",(function(t){const e=r.get(t);void 0!==e&&(i[t]=!0,e.deprecated&&n(e.message))})),t.on("removeListener",(function(t){r.has(t)&&(i[t]=this.listenerCount(t)>0)}))}}},3172:(t,e,r)=>{"use strict";const{noop:n}=r(1343),i=Symbol("functions"),o=Symbol("async");class s{constructor(t){this[o]=t.async,this[i]=new Set,this.noop=!0,this.run=c(this)}add(t){a(t),this[i].add(t),this.noop=!1,this.run=c(this)}delete(t){a(t),this[i].delete(t),this.noop=0===this[i].size,this.run=c(this)}}const a=function(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function, received "+(null===t?"null":typeof t))},c=function(t){if(t.noop)return n;if(1===t[i].size){const[e]=t[i];return e}return t[o]?async function(t,...e){for(const r of t)await r(...e)}.bind(null,Array.from(t[i])):function(t,...e){for(const r of t)r(...e)}.bind(null,Array.from(t[i]))};e.DatabaseHooks=class{constructor(){this.postopen=new s({async:!0}),this.prewrite=new s({async:!1}),this.newsub=new s({async:!1})}}},1450:(t,e)=>{"use strict";e.prefixDescendantKey=function(t,e,r,n){for(;null!==r&&r!==n;)t=r.prefixKey(t,e,!0),r=r.parent;return t},e.isDescendant=function(t,e){for(;;){if(null==t.parent)return!1;if(t.parent===e)return!0;t=t.parent}}},9767:(t,e,r)=>{"use strict";const{prefixDescendantKey:n,isDescendant:i}=r(1450),o=Symbol("db"),s=Symbol("privateOperations"),a=Symbol("publicOperations");e.PrewriteBatch=class{constructor(t,e,r){this[o]=t,this[s]=e,this[a]=r}add(t){const e="put"===t.type,r=null!=t.sublevel,c=r?t.sublevel:this[o],u=c._checkKey(t.key);if(null!=u)throw u;if(t.keyEncoding=c.keyEncoding(t.keyEncoding),e){const e=c._checkValue(t.value);if(null!=e)throw e;t.valueEncoding=c.valueEncoding(t.valueEncoding)}else if("del"!==t.type)throw new TypeError("A batch operation must have a type property that is 'put' or 'del'");const l=t.keyEncoding,h=l.encode(t.key),f=l.format,p=r&&!i(t.sublevel,this[o])&&t.sublevel!==this[o],y=r&&!p?n(h,f,c,this[o]):h;r&&!p&&(t.sublevel=null);let d=null;if(null===this[a]||p||(d=Object.assign({},t),d.encodedKey=y,r&&(d.key=y,d.keyEncoding=this[o].keyEncoding(f)),this[a].push(d)),t.key=p?y:this[o].prefixKey(y,f,!0),t.keyEncoding=f,e){const e=t.valueEncoding,n=e.encode(t.value),i=e.format;t.value=n,t.valueEncoding=i,null!==d&&(d.encodedValue=n,r&&(d.value=n,d.valueEncoding=this[o].valueEncoding(i)))}return this[s].push(t),this}}},386:t=>{"use strict";const e=Object.prototype.hasOwnProperty,r=new Set(["lt","lte","gt","gte"]);t.exports=function(t,n){const i={};for(const o in t)e.call(t,o)&&"keyEncoding"!==o&&"valueEncoding"!==o&&(r.has(o)?i[o]=n.encode(t[o]):i[o]=t[o]);return i.reverse=!!i.reverse,i.limit=Number.isInteger(i.limit)&&i.limit>=0?i.limit:-1,i}},9511:(t,e,r)=>{"use strict";var n=r(6556)("ArrayBuffer.prototype.byteLength",!0),i=r(4670);t.exports=function(t){return i(t)?n?n(t):t.byteLength:NaN}},3870:t=>{"use strict";const e=async function(){}.constructor;t.exports=()=>e},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,h=c>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(t,a,a+s>u?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9148:(t,e,r)=>{"use strict";const{AbstractLevel:n}=r(5e3),{Iterator:i}=r(6296),o=r(5222),s=r(3452),a=r(7766),c="level-js-",u=Symbol("idb"),l=Symbol("namePrefix"),h=Symbol("location"),f=Symbol("version"),p=Symbol("store"),y=Symbol("onComplete");class d extends n{constructor(t,e){const{prefix:r,version:n,...i}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},i),"string"!=typeof t||""===t)throw new TypeError("The first argument 'location' must be a non-empty string");this[h]=t,this[l]=null==r?c:r,this[f]=parseInt(n||1,10),this[u]=null}get location(){return this[h]}get namePrefix(){return this[l]}get version(){return this[f]}get db(){return this[u]}get type(){return"browser-level"}async _open(t){const e=indexedDB.open(this[l]+this[h],this[f]);return e.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[h])||e.createObjectStore(this[h])},new Promise(((t,r)=>{e.onerror=function(){r(e.error||new Error("unknown error"))},e.onsuccess=()=>{this[u]=e.result,t()}}))}[p](t){return this[u].transaction([this[h]],t).objectStore(this[h])}[y](t){const e=t.transaction;return new Promise((function(r,n){e.onabort=function(){n(e.error||new Error("aborted by user"))},e.oncomplete=function(){r(t.result)}}))}async _get(t,e){const r=this[p]("readonly").get(t),n=await this[y](r);return o(n)}async _getMany(t,e){const r=this[p]("readonly"),n=t.values(),i=Math.min(16,t.length),s=new Array(i),a=new Array(t.length);let c=0,u=!1;const l=async function(){try{for(const t of n){if(u)break;const e=c++,n=r.get(t);await new Promise((function(t,r){n.onsuccess=()=>{a[e]=o(n.result),t()},n.onerror=t=>{t.stopPropagation(),r(n.error)}}))}}catch(t){throw u=!0,t}};for(let t=0;t<i;t++)s[t]=l();return await Promise.allSettled(s),a}async _del(t,e){const r=this[p]("readwrite").delete(t);return this[y](r)}async _put(t,e,r){const n=this[p]("readwrite").put(e,t);return this[y](n)}_iterator(t){return new i(this,this[h],t)}async _batch(t,e){const r=this[p]("readwrite"),n=r.transaction;let i,o=0;const s=new Promise((function(t,e){n.onabort=function(){e(i||n.error||new Error("aborted by user"))},n.oncomplete=t}));return function e(){const s=t[o++],a=s.key;let c;try{c="del"===s.type?r.delete(a):r.put(s.value,a)}catch(t){return i=t,void n.abort()}o<t.length?c.onsuccess=e:"function"==typeof n.commit&&n.commit()}(),s}async _clear(t){let e;try{e=a(t)}catch(t){return}if(t.limit>=0)return s(this,this[h],e,t);const r=this[p]("readwrite"),n=e?r.delete(e):r.clear();return this[y](n)}async _close(){this[u].close()}}d.destroy=async function(t,e){null==e&&(e=c);const r=indexedDB.deleteDatabase(e+t);return new Promise((function(t,e){r.onsuccess=t,r.onerror=e}))},e.Z=d},6296:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(5e3),i=r(7766),o=r(5222),s=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),u=Symbol("currentOptions"),l=Symbol("position"),h=Symbol("location"),f=Symbol("first"),p={};function y(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends n{constructor(t,e,r){super(t,r),this[s]=[],this[a]=0===this.limit,this[c]=r,this[u]={...r},this[l]=void 0,this[h]=e,this[f]=!0}async _nextv(t,e){if(this[f]=!1,this[a])return[];if(this[s].length>0)return t=Math.min(t,this[s].length),this[s].splice(0,t);let r;void 0!==this[l]&&(this[c].reverse?(this[u].lt=this[l],this[u].lte=void 0):(this[u].gt=this[l],this[u].gte=void 0));try{r=i(this[u])}catch(t){return this[a]=!0,[]}const n=this.db.db.transaction([this[h]],"readonly"),p=n.objectStore(this[h]),d=[],g=new Promise((function(t,e){n.onabort=()=>{e(n.error||new Error("aborted by user"))},n.oncomplete=()=>{t(d)}}));if(this[c].reverse)p[!this[c].values&&p.openKeyCursor?"openKeyCursor":"openCursor"](r,"prev").onsuccess=e=>{const r=e.target.result;if(r){const{key:e,value:i}=r;this[l]=e,d.push([this[c].keys&&void 0!==e?o(e):void 0,this[c].values&&void 0!==i?o(i):void 0]),d.length<t?r.continue():y(n)}else this[a]=!0};else{let e,i;const s=()=>{if(void 0===e||void 0===i)return;const r=Math.max(e.length,i.length);0===r||t===1/0?this[a]=!0:this[l]=e[r-1],d.length=r;for(let t=0;t<r;t++){const r=e[t],n=i[t];d[t]=[this[c].keys?o(r):void 0,this[c].values?o(n):void 0]}y(n)};this[c].keys||t<1/0?p.getAllKeys(r,t<1/0?t:void 0).onsuccess=t=>{e=t.target.result,s()}:(e=[],s()),this[c].values?p.getAll(r,t<1/0?t:void 0).onsuccess=t=>{i=t.target.result,s()}:(i=[],s())}return g}async _next(){if(this[s].length>0)return this[s].shift();if(!this[a]){let t=Math.min(100,this.limit-this.count);return this[f]&&(this[f]=!1,t=1),this[s]=await this._nextv(t,p),this[s].shift()}}async _all(t){this[f]=!1;const e=this[s].splice(0,this[s].length),r=this.limit-this.count-e.length;if(r<=0)return e;let n=await this._nextv(r,p);return e.length>0&&(n=e.concat(n)),n}_seek(t,e){let r;this[f]=!0,this[s]=[],this[a]=!1,this[l]=void 0,this[u]={...this[c]};try{r=i(this[c])}catch(t){return void(this[a]=!0)}null===r||r.includes(t)?this[c].reverse?this[u].lte=t:this[u].gte=t:this[a]=!0}}},3452:t=>{"use strict";t.exports=async function(t,e,r,n){if(0===n.limit)return;const i=t.db.transaction([e],"readwrite"),o=i.objectStore(e);let s=0;const a=new Promise((function(t,e){i.oncomplete=t,i.onabort=function(){e(i.error||new Error("aborted by user"))}})),c=o.openKeyCursor?"openKeyCursor":"openCursor",u=n.reverse?"prev":"next";return o[c](r,u).onsuccess=function(t){const e=t.target.result;e&&(o.delete(e.key).onsuccess=function(){(n.limit<=0||++s<n.limit)&&e.continue()})},a}},5222:t=>{"use strict";const e=new TextEncoder;t.exports=function(t){return void 0===t||t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},7766:t=>{"use strict";t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,r=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,n=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==r?IDBKeyRange.bound(e,r,n,i):void 0!==e?IDBKeyRange.lowerBound(e,n):void 0!==r?IDBKeyRange.upperBound(r,i):null}},8287:(t,e,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|d(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|y(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||J(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|y(t))}function f(t){const e=t.length<0?0:0|y(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(t,o+n)!==u(e,n)){r=!1;break}if(r)return o}return-1}function E(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(J(n))return s;t[r+s]=n}return s}function w(t,e,r,n){return q(K(e,t.length-r),t,r,n)}function A(t,e,r,n){return q(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return q(H(e),t,r,n)}function T(t,e,r,n){return q(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=_));return r}(n)}e.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},c.allocUnsafe=function(t){return h(t)},c.allocUnsafeSlow=function(t){return h(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Y(e,Uint8Array))i+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?I(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==l[t]){o=u[t],s=l[t];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function U(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=X[t[n]];return i}function R(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function k(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function D(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=Q((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=Q((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||G(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||k(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const P={};function M(t,e,r){P[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function V(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new P.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function z(t,e){if("number"!=typeof t)throw new P.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw z(t,r),new P.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new P.ERR_BUFFER_OUT_OF_BOUNDS;throw new P.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function J(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},3144:(t,e,r)=>{"use strict";var n=r(6743),i=r(1002),o=r(76),s=r(7119);t.exports=s||n.call(o,i)},2205:(t,e,r)=>{"use strict";var n=r(6743),i=r(1002),o=r(3144);t.exports=function(){return o(n,i,arguments)}},1002:t=>{"use strict";t.exports=Function.prototype.apply},76:t=>{"use strict";t.exports=Function.prototype.call},3126:(t,e,r)=>{"use strict";var n=r(6743),i=r(9675),o=r(76),s=r(3144);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new i("a function is required");return s(n,o,t)}},7119:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},487:(t,e,r)=>{"use strict";var n=r(6897),i=r(655),o=r(3126),s=r(2205);t.exports=function(t){var e=o(arguments),r=t.length-(arguments.length-1);return n(e,1+(r>0?r:0),!0)},i?i(t.exports,"apply",{value:s}):t.exports.apply=s},6556:(t,e,r)=>{"use strict";var n=r(453),i=r(3126),o=i([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i([r]):r}},9743:(t,e)=>{function r(t){for(var e="",r=0;r<t.length;r++){var n=t[r];isNaN(Number(n))||" "===n?"-"!==n&&(e+=n):e+=String(9-Number(n))}return e}e.encode=function(t){if(isNaN(t))return"DaN";if(0===t)return"FE 0M0";if(t===1/0)return"FF";if(t===-1/0)return"DD";var e,n=t.toExponential().split("e"),i=Number(n[1])+500,o=n[0]+(-1===n[0].indexOf(".")?".":"")+"0".repeat(20),s="E"+(e=String(i)," ".repeat(3-e.length).substr(0,3)+e+"M")+String(o);return t>0?"F"+s:"D"+r(s)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],n=(e?r(t):t).slice(2).split("M");return Number((e?"-":"")+n[1]+"e"+String(Number(n[0])-500))}},3381:(t,e)=>{var r={"?":"?@","!":"??",'"':"?%"},n={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var r,i=e.split('"'),o=[[]],s=0,a=i.length,c=0;c<a;c++){for(var u=i[c],l=u.length,h=0;"K"==u[h];)h++;for(var f=0;"!"==u[l-f-1];)f++;for(var p=u.slice(h,l-f),y=s+h,d=s;d<y;d++)o[d+1]=[],o[d].push(o[d+1]),r=o[s=y];for(0!==p.length&&r.push(t.decode(/\?[%\?@]/.test(g=p)?g.replace(/\?[%\?@]/g,(function(t){return n[t]})):g)),d=y=s-f;d<s;d++)o[d+1]=[],r=o[s=y]}var g;return o[0][0]}};function e(t){if(null===t)return"A";if(!Array.isArray(t))throw new Error("can only encode arrays");var e=t.length;if(0==e)return"K!";for(var r=i(t[0]),n=1;n<e;n++)r+='"'+i(t[n]);return"K"+r+"!"}function i(n){return"object"==typeof n?e(n):(i=t.encode(n),/[!"]/.test(i)?i.replace(/[\?!"]/g,(function(t){return r[t]})):i);var i}}},9901:(t,e,r)=>{var n=r(9743),i=r(3381);e.flip=function(t){var e=t.toString(),r="";for(var n in e)r+="."==e[n]?".":9-+e[n];return r},e.number=n,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!o[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return o[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var o={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},41:(t,e,r)=>{"use strict";var n=r(655),i=r(8068),o=r(9675),s=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8452:(t,e,r)=>{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),c=r(592)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;c?a(t,e,r,!0):a(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a<o.length;a+=1)u(t,o[a],e[o[a]],r[o[a]])};l.supportsDescriptors=!!c,t.exports=l},7176:(t,e,r)=>{"use strict";var n,i=r(3126),o=r(5795);try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var s=!!n&&o&&o(Object.prototype,"__proto__"),a=Object,c=a.getPrototypeOf;t.exports=s&&"function"==typeof s.get?i([s.get]):"function"==typeof c&&function(t){return c(null==t?t:a(t))}},655:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},1237:t=>{"use strict";t.exports=EvalError},9383:t=>{"use strict";t.exports=Error},9290:t=>{"use strict";t.exports=RangeError},9538:t=>{"use strict";t.exports=ReferenceError},8068:t=>{"use strict";t.exports=SyntaxError},9675:t=>{"use strict";t.exports=TypeError},5345:t=>{"use strict";t.exports=URIError},5388:(t,e,r)=>{"use strict";var n=r(9675);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},9612:t=>{"use strict";t.exports=Object},5437:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(162),o=r(9600),s=r(2120),a=r(3612);t.exports=function(t){if(i(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+String(e)+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(i(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s<a.length;++s)if(r=t[a[s]],o(r)&&(n=r.call(t),i(n)))return n;throw new TypeError("No default value")}(t,"default"===r?"number":r)}},162:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var c,u,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,i),!0;case 5:return l.fn.call(l.context,e,n,i,o),!0;case 6:return l.fn.call(l.context,e,n,i,o,s),!0}for(u=1,c=new Array(h-1);u<h;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var f,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),h){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,n);break;case 4:l[u].fn.call(l[u].context,e,n,i);break;default:if(!c)for(f=1,c=new Array(h-1);f<h;f++)c[f-1]=arguments[f];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==e||i&&!a[c].once||n&&a[c].context!==n)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&s(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},7007:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}d(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&d(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):y(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function d(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=y(c,u);for(r=0;r<u;++r)n(l[r],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,h(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,h(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},8423:(t,e,r)=>{"use strict";var n=r(5767),i=r(3432),o=r(5795);function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function c(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)}var u=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},l=Object.prototype.propertyIsEnumerable,h=Object.getOwnPropertySymbols;function f(t){var e=u(t);if(h)for(var r=h(t),n=0;n<r.length;n++)l.call(t,r[n])&&e.push(r[n]);return e}var p=Object.prototype.hasOwnProperty||function(t,e){return e in t};function y(t,e){if("object"==typeof t&&null!==t){var r;if(a(t))r=[];else if("[object Date]"===s(t))r=new Date(t.getTime?t.getTime():t);else if("[object RegExp]"===s(t))r=new RegExp(t);else if(function(t){return"[object Error]"===s(t)}(t))r={message:t.message};else if(function(t){return"[object Boolean]"===s(t)}(t)||function(t){return"[object Number]"===s(t)}(t)||function(t){return"[object String]"===s(t)}(t))r=Object(t);else{if(n(t))return i(t);if(Object.create&&Object.getPrototypeOf)r=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)r={};else{var o=t.constructor&&t.constructor.prototype||t.__proto__||{},l=function(){};l.prototype=o,r=new l}}return c((e.includeSymbols?f:u)(t),(function(e){r[e]=t[e]})),r}return t}var d={__proto__:null};function g(t,e){var r=[],n=[],i=!0,s=arguments.length>2?arguments[2]:d,l=s.includeSymbols?f:u,h=!!s.immutable;return function t(u){var f=h?y(u,s):u,d={},g=!0,m={node:f,node_:u,path:[].concat(r),parent:n[n.length-1],parents:n,key:r[r.length-1],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(g=!1)},delete:function(t){delete m.parent.node[m.key],t&&(g=!1)},remove:function(t){a(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(g=!1)},keys:null,before:function(t){d.before=t},after:function(t){d.after=t},pre:function(t){d.pre=t},post:function(t){d.post=t},stop:function(){i=!1},block:function(){g=!1}};if(!i)return m;function v(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=l(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t<n.length;t++)if(n[t].node_===u){m.circular=n[t];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}v();var b=e.call(m,m.node);return void 0!==b&&m.update&&m.update(b),d.before&&d.before.call(m,m.node),g?("object"!=typeof m.node||null===m.node||m.circular||(n.push(m),v(),c(m.keys,(function(e,n){r.push(e),d.pre&&d.pre.call(m,m.node[e],e);var i=t(m.node[e]);h&&p.call(m.node,e)&&!function(t,e){return"function"!=typeof o||!o(t,e).writable}(m.node,e)&&(m.node[e]=i.node),i.isLast=n===m.keys.length-1,i.isFirst=0===n,d.post&&d.post.call(m,i),r.pop()})),n.pop()),d.after&&d.after.call(m,m.node),m):m}(t).node}function m(t){this.options=arguments.length>1?arguments[1]:d,this.value=t}function v(t){return new m(t,arguments.length>1?arguments[1]:d)}m.prototype.get=function(t){for(var e=this.value,r=0;e&&r<t.length;r++){var n=t[r];if(!p.call(e,n)||!this.options.includeSymbols&&"symbol"==typeof n)return;e=e[n]}return e},m.prototype.has=function(t){for(var e=this.value,r=0;e&&r<t.length;r++){var n=t[r];if(!p.call(e,n)||!this.options.includeSymbols&&"symbol"==typeof n)return!1;e=e[n]}return!0},m.prototype.set=function(t,e){for(var r=this.value,n=0;n<t.length-1;n++){var i=t[n];p.call(r,i)||(r[i]={}),r=r[i]}return r[t[n]]=e,e},m.prototype.map=function(t){return g(this.value,t,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})},m.prototype.forEach=function(t){return this.value=g(this.value,t,this.options),this.value},m.prototype.reduce=function(t,e){var r=1===arguments.length,n=r?this.value:e;return this.forEach((function(e){this.isRoot&&r||(n=t.call(this,n,e))})),n},m.prototype.paths=function(){var t=[];return this.forEach((function(){t.push(this.path)})),t},m.prototype.nodes=function(){var t=[];return this.forEach((function(){t.push(this.node)})),t},m.prototype.clone=function(){var t=[],e=[],r=this.options;return n(this.value)?i(this.value):function n(i){for(var o=0;o<t.length;o++)if(t[o]===i)return e[o];if("object"==typeof i&&null!==i){var s=y(i,r);return t.push(i),e.push(s),c((r.includeSymbols?f:u)(i),(function(t){s[t]=n(i[t])})),t.pop(),e.pop(),s}return i}(this.value)},c(f(m.prototype),(function(t){v[t]=function(e){var r=[].slice.call(arguments,1),n=new m(e);return n[t].apply(n,r)}})),t.exports=v},2682:(t,e,r)=>{"use strict";var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=r),a=t,"[object Array]"===i.call(a)?function(t,e,r){for(var n=0,i=t.length;n<i;n++)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s):"string"==typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,s):function(t,e,r){for(var n in t)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s)}},9353:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var i=0;i<e.length;i+=1)r[i+t.length]=e[i];return r};t.exports=function(t){var i=this;if("function"!=typeof i||"[object Function]"!==e.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,s=function(t){for(var e=[],r=1,n=0;r<t.length;r+=1,n+=1)e[n]=t[r];return e}(arguments),a=r(0,i.length-s.length),c=[],u=0;u<a;u++)c[u]="$"+u;if(o=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(c)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var e=i.apply(this,n(s,arguments));return Object(e)===e?e:this}return i.apply(t,n(s,arguments))})),i.prototype){var l=function(){};l.prototype=i.prototype,o.prototype=new l,l.prototype=null}return o}},6743:(t,e,r)=>{"use strict";var n=r(9353);t.exports=Function.prototype.bind||n},34:(t,e,r)=>{"use strict";var n=r(9600),i=r(9957),o=r(4462)(),s=r(6556),a=s("Function.prototype.toString"),c=s("String.prototype.match"),u=s("Object.prototype.toString"),l=/^class /,h=/\s*function\s+([^(\s]*)\s*/,f=!(0 in[,]),p=Function.prototype,y=function(){return!1};if("object"==typeof document){var d=document.all;u(d)===u(document.all)&&(y=function(t){if((f||!t)&&(void 0===t||"object"==typeof t))try{var e=u(t);return("[object HTMLAllCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=function(){if(y(this)||!function(t){if(n(t))return!1;if("function"!=typeof t)return!1;try{return!!c(a(t),l)}catch(t){}return!1}(this)&&!n(this))throw new TypeError("Function.prototype.name sham getter called on non-function");if(o&&i(this,"name"))return this.name;if(this===p)return"";var t=a(this),e=c(t,h);return e&&e[1]}},1482:(t,e,r)=>{"use strict";var n=r(8452),i=r(487),o=r(34),s=r(2747),a=r(8013),c=i(o);n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2747:(t,e,r)=>{"use strict";var n=r(34);t.exports=function(){return n}},8013:(t,e,r)=>{"use strict";var n=r(8452).supportsDescriptors,i=r(4462)(),o=r(2747),s=Object.defineProperty,a=TypeError;t.exports=function(){var t=o();if(i)return t;if(!n)throw new a("Shimming Function.prototype.name support requires ES5 property descriptor support.");var e=Function.prototype;return s(e,"name",{configurable:!0,enumerable:!1,get:function(){var r=t.call(this);return this!==e&&s(this,"name",{configurable:!0,enumerable:!1,value:r,writable:!1}),r}}),t}},4462:t=>{"use strict";var e=function(){return"string"==typeof function(){}.name},r=Object.getOwnPropertyDescriptor;if(r)try{r([],"length")}catch(t){r=null}e.functionsHaveConfigurableNames=function(){if(!e()||!r)return!1;var t=r((function(){}),"name");return!!t&&!!t.configurable};var n=Function.prototype.bind;e.boundFunctionsHaveNames=function(){return e()&&"function"==typeof n&&""!==function(){}.bind().name},t.exports=e},453:(t,e,r)=>{"use strict";var n,i=r(9612),o=r(9383),s=r(1237),a=r(9290),c=r(9538),u=r(8068),l=r(9675),h=r(5345),f=r(1514),p=r(8968),y=r(6188),d=r(8002),g=r(5880),m=r(414),v=r(3093),b=Function,E=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(t){}},w=r(5795),A=r(655),S=function(){throw new l},T=w?function(){try{return S}catch(t){try{return w(arguments,"callee").get}catch(t){return S}}}():S,O=r(4039)(),I=r(3628),_=r(1064),L=r(8648),x=r(1002),U=r(76),R={},k="undefined"!=typeof Uint8Array&&I?I(Uint8Array):n,N={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":O&&I?I([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":R,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&I?I(I([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&I?I((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O&&I?I((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&I?I(""[Symbol.iterator]()):n,"%Symbol%":O?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":T,"%TypedArray%":k,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":h,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":U,"%Function.prototype.apply%":x,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":_,"%Math.abs%":f,"%Math.floor%":p,"%Math.max%":y,"%Math.min%":d,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":v,"%Reflect.getPrototypeOf%":L};if(I)try{null.error}catch(t){var C=I(I(t));N["%Error.prototype%"]=C}var D=function t(e){var r;if("%AsyncFunction%"===e)r=E("async function () {}");else if("%GeneratorFunction%"===e)r=E("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=E("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&I&&(r=I(i.prototype))}return N[e]=r,r},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=r(6743),j=r(9957),P=F.call(U,Array.prototype.concat),M=F.call(x,Array.prototype.splice),V=F.call(U,String.prototype.replace),$=F.call(U,String.prototype.slice),z=F.call(U,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,K=function(t,e){var r,n=t;if(j(B,n)&&(n="%"+(r=B[n])[0]+"%"),j(N,n)){var i=N[n];if(i===R&&(i=D(n)),void 0===i&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new u("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=$(t,0,1),r=$(t,-1);if("%"===e&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return V(t,G,(function(t,e,r,i){n[n.length]=r?V(i,W,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=K("%"+n+"%",e),o=i.name,s=i.value,a=!1,c=i.alias;c&&(n=c[0],M(r,P([0,1],c)));for(var h=1,f=!0;h<r.length;h+=1){var p=r[h],y=$(p,0,1),d=$(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===d||"'"===d||"`"===d)&&y!==d)throw new u("property names with quotes must have matching quotes");if("constructor"!==p&&f||(a=!0),j(N,o="%"+(n+="."+p)+"%"))s=N[o];else if(null!=s){if(!(p in s)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(w&&h+1>=r.length){var g=w(s,p);s=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:s[p]}else f=j(s,p),s=s[p];f&&!a&&(N[o]=s)}}return s}},1064:(t,e,r)=>{"use strict";var n=r(9612);t.exports=n.getPrototypeOf||null},8648:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},3628:(t,e,r)=>{"use strict";var n=r(8648),i=r(1064),o=r(7176);t.exports=n?function(t){return n(t)}:i?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return i(t)}:o?function(t){return o(t)}:null},6549:t=>{"use strict";t.exports=Object.getOwnPropertyDescriptor},5795:(t,e,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},9790:t=>{"use strict";var e="undefined"!=typeof BigInt&&BigInt;t.exports=function(){return"function"==typeof e&&"function"==typeof BigInt&&"bigint"==typeof e(42)&&"bigint"==typeof BigInt(42)}},592:(t,e,r)=>{"use strict";var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},4039:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},9092:(t,e,r)=>{"use strict";var n=r(1333);t.exports=function(){return n()&&!!Symbol.toStringTag}},9957:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);t.exports=o.call(n,i)},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=y,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+p]=255&s,p+=y,s/=256,u-=8);t[r+p-y]|=128*d}},4670:(t,e,r)=>{"use strict";var n=r(487),i=r(6556),o=r(453)("%ArrayBuffer%",!0),s=i("ArrayBuffer.prototype.byteLength",!0),a=i("Object.prototype.toString"),c=!!o&&!s&&new o(0).slice,u=!!c&&n(c);t.exports=s||u?function(t){if(!t||"object"!=typeof t)return!1;try{return s?s(t):u(t,0),!0}catch(t){return!1}}:o?function(t){return"[object ArrayBuffer]"===a(t)}:function(t){return!1}},5351:(t,e,r)=>{"use strict";var n=r(6556),i=r(9721),o=n("Object.prototype.toString"),s=n("Function.prototype.toString"),a=i(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),c=r(9092)(),u=r(3628),l=r(3870);t.exports=function(t){if("function"!=typeof t)return!1;if(a(s(t)))return!0;if(!c)return"[object AsyncFunction]"===o(t);if(!u)return!1;var e=l();return e&&e.prototype===u(t)}},9803:(t,e,r)=>{"use strict";if(r(9790)()){var n=BigInt.prototype.valueOf;t.exports=function(t){return null!=t&&"boolean"!=typeof t&&"string"!=typeof t&&"number"!=typeof t&&"symbol"!=typeof t&&"function"!=typeof t&&("bigint"==typeof t||function(t){try{return n.call(t),!0}catch(t){}return!1}(t))}}else t.exports=function(t){return!1}},5128:(t,e,r)=>{"use strict";var n=r(6556),i=n("Boolean.prototype.toString"),o=n("Object.prototype.toString"),s=r(9092)();t.exports=function(t){return"boolean"==typeof t||null!==t&&"object"==typeof t&&(s?function(t){try{return i(t),!0}catch(t){return!1}}(t):"[object Boolean]"===o(t))}},9600:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},2120:(t,e,r)=>{"use strict";var n=r(6556),i=n("Date.prototype.getDay"),o=n("Object.prototype.toString"),s=r(9092)();t.exports=function(t){return"object"==typeof t&&null!==t&&(s?function(t){try{return i(t),!0}catch(t){return!1}}(t):"[object Date]"===o(t))}},3811:(t,e,r)=>{"use strict";var n=r(6556)("FinalizationRegistry.prototype.register",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t,{},null),!0}catch(t){return!1}}:function(t){return!1}},8184:(t,e,r)=>{"use strict";var n,i=r(6556),o=r(9721)(/^\s*(?:function)?\*/),s=r(9092)(),a=r(3628),c=i("Object.prototype.toString"),u=i("Function.prototype.toString");t.exports=function(t){if("function"!=typeof t)return!1;if(o(u(t)))return!0;if(!s)return"[object GeneratorFunction]"===c(t);if(!a)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&a(e)}return a(t)===n}},3802:t=>{"use strict";var e,r="function"==typeof Map&&Map.prototype?Map:null,n="function"==typeof Set&&Set.prototype?Set:null;r||(e=function(t){return!1});var i=r?Map.prototype.has:null,o=n?Set.prototype.has:null;e||i||(e=function(t){return!1}),t.exports=e||function(t){if(!t||"object"!=typeof t)return!1;try{if(i.call(t),o)try{o.call(t)}catch(t){return!0}return t instanceof r}catch(t){}return!1}},1703:(t,e,r)=>{"use strict";var n=r(6556),i=n("Number.prototype.toString"),o=n("Object.prototype.toString"),s=r(9092)();t.exports=function(t){return"number"==typeof t||!(!t||"object"!=typeof t)&&(s?function(t){try{return i(t),!0}catch(t){return!1}}(t):"[object Number]"===o(t))}},4035:(t,e,r)=>{"use strict";var n,i=r(6556),o=r(9092)(),s=r(9957),a=r(5795);if(o){var c=i("RegExp.prototype.exec"),u={},l=function(){throw u},h={toString:l,valueOf:l};"symbol"==typeof Symbol.toPrimitive&&(h[Symbol.toPrimitive]=l),n=function(t){if(!t||"object"!=typeof t)return!1;var e=a(t,"lastIndex");if(!e||!s(e,"value"))return!1;try{c(t,h)}catch(t){return t===u}}}else{var f=i("Object.prototype.toString");n=function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===f(t)}}t.exports=n},256:t=>{"use strict";var e,r="function"==typeof Map&&Map.prototype?Map:null,n="function"==typeof Set&&Set.prototype?Set:null;n||(e=function(t){return!1});var i=r?Map.prototype.has:null,o=n?Set.prototype.has:null;e||o||(e=function(t){return!1}),t.exports=e||function(t){if(!t||"object"!=typeof t)return!1;try{if(o.call(t),i)try{i.call(t)}catch(t){return!0}return t instanceof n}catch(t){}return!1}},7070:(t,e,r)=>{"use strict";var n=r(6556)("SharedArrayBuffer.prototype.byteLength",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}:function(t){return!1}},4761:(t,e,r)=>{"use strict";var n=r(6556),i=n("String.prototype.valueOf"),o=n("Object.prototype.toString"),s=r(9092)();t.exports=function(t){return"string"==typeof t||!(!t||"object"!=typeof t)&&(s?function(t){try{return i(t),!0}catch(t){return!1}}(t):"[object String]"===o(t))}},3612:(t,e,r)=>{"use strict";var n=r(6556),i=n("Object.prototype.toString"),o=r(4039)(),s=r(9721);if(o){var a=n("Symbol.prototype.toString"),c=s(/^Symbol\(.*\)$/);t.exports=function(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||"[object Symbol]"!==i(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&c(a(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},5680:(t,e,r)=>{"use strict";var n=r(5767);t.exports=function(t){return!!n(t)}},7842:t=>{"use strict";var e,r="function"==typeof WeakMap&&WeakMap.prototype?WeakMap:null,n="function"==typeof WeakSet&&WeakSet.prototype?WeakSet:null;r||(e=function(t){return!1});var i=r?r.prototype.has:null,o=n?n.prototype.has:null;e||i||(e=function(t){return!1}),t.exports=e||function(t){if(!t||"object"!=typeof t)return!1;try{if(i.call(t,i),o)try{o.call(t,o)}catch(t){return!0}return t instanceof r}catch(t){}return!1}},8173:(t,e,r)=>{"use strict";var n=r(6556)("WeakRef.prototype.deref",!0);t.exports="undefined"==typeof WeakRef?function(t){return!1}:function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}},2648:(t,e,r)=>{"use strict";var n=r(453),i=r(6556),o=n("%WeakSet%",!0),s=i("WeakSet.prototype.has",!0);if(s){var a=i("WeakMap.prototype.has",!0);t.exports=function(t){if(!t||"object"!=typeof t)return!1;try{if(s(t,s),a)try{a(t,a)}catch(t){return!0}return t instanceof o}catch(t){}return!1}}else t.exports=function(t){return!1}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},5356:(t,e)=>{"use strict";e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{}),r=e.implicitSnapshots||e.snapshots||!1,n=e.explicitSnapshots||!1;return Object.assign(e,{implicitSnapshots:r,explicitSnapshots:n,snapshots:r,has:e.has||!1,permanence:e.permanence||!1,seek:e.seek||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods),signals:Object.assign({},e.signals)})}},6035:(t,e,r)=>{"use strict";const n=r(266),i=r(4341),{Encoding:o}=r(8110),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=Symbol("formats"),l=Symbol("encodings"),h=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>h.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[l]=new Map,this[u]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[l].values()))}encoding(t){let e=this[l].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=p[t],!e)throw new n(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof o)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,r=t.name||e||"anonymous-"+y++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:r});case"utf8":return new c({...t,name:r});case"buffer":return new s({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:r,format:i}=e;if(!this[u].has(i))if(this[u].has("view"))e=e.createViewTranscoder();else if(this[u].has("buffer"))e=e.createBufferTranscoder();else{if(!this[u].has("utf8"))throw new n(`Encoding '${r}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const n of[t,r,e.name,e.commonName])this[l].set(n,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},p={...i,...f};let y=0},8110:(t,e,r)=>{"use strict";const n=r(266),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},4341:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:o}=r(7200)(),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=t=>t;e.utf8=new c({encode:function(t){return n.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?o.decode(t):String(t)},decode:u,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return o.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:n.from(String(t),"utf8")},decode:function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:u,name:"view",createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:`${this.name}+buffer`})}}),e.hex=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},8343:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{},{Encoding:i}=r(8110),o=r(7200);class s extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(n.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new s({encode:t=>{const e=this.encode(t);return n.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=s,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new s({encode:t=>n.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=o();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},7200:t=>{"use strict";let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},1514:t=>{"use strict";t.exports=Math.abs},8968:t=>{"use strict";t.exports=Math.floor},3331:(t,e,r)=>{"use strict";var n=r(4459);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},7440:(t,e,r)=>{"use strict";var n=r(1514),i=r(8968),o=r(4459),s=r(3331);t.exports=function(t){if("number"!=typeof t||o(t)||!s(t))return!1;var e=n(t);return i(e)===e}},4459:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8017:t=>{"use strict";t.exports=function(t){return 0===t&&1/t==-1/0}},6188:t=>{"use strict";t.exports=Math.max},8002:t=>{"use strict";t.exports=Math.min},1350:(t,e,r)=>{"use strict";var n=r(8968);t.exports=function(t,e){var r=t%e;return n(r>=0?r:r+e)}},5880:t=>{"use strict";t.exports=Math.pow},414:t=>{"use strict";t.exports=Math.round},3093:(t,e,r)=>{"use strict";var n=r(4459);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},9121:t=>{"use strict";const e=Symbol("kErrors");t.exports=function(t){if(0!==(t=t.filter(o)).length)return 1===t.length?t[0]:new r(t)};class r extends Error{constructor(t){const r=new Set(t.map(s).filter(Boolean));super(Array.from(r).join("; ")),n(this,"name","CombinedError"),n(this,e,t),i(this,"stack",(()=>t.map(a).join("\n\n"))),i(this,"transient",(()=>t.length>0&&t.every(c))),i(this,"expected",(()=>t.length>0&&t.every(u)))}[Symbol.iterator](){return this[e][Symbol.iterator]()}}function n(t,e,r){Object.defineProperty(t,e,{value:r})}function i(t,e,r){Object.defineProperty(t,e,{get:r})}function o(t){return null!=t}function s(t){return t.message}function a(t){return t.stack}function c(t){return!0===t.transient}function u(t){return!0===t.expected}},266:t=>{"use strict";t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},8508:function(t,e){!function(t){"use strict";const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.ngraminator=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},8859:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,d=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,E=String.prototype.toUpperCase,w=String.prototype.toLowerCase,A=RegExp.prototype.test,S=Array.prototype.concat,T=Array.prototype.join,O=Array.prototype.slice,I=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,U="function"==typeof Symbol&&"object"==typeof Symbol.iterator,R="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function C(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||A.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-I(-t):I(t);if(n!==t){var i=String(n),o=v.call(e,i.length+1);return b.call(i,r,"$&_")+"."+b.call(b.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(e,r,"$&_")}var D=r(2634),B=D.custom,F=W(B)?B:null,j={__proto__:null,double:'"',single:"'"},P={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function M(t,e,r){var n=r.quoteStyle||e,i=j[n];return i+t+i}function V(t){return b.call(String(t),/"/g,""")}function $(t){return!R||!("object"==typeof t&&(R in t||void 0!==t[R]))}function z(t){return"[object Array]"===q(t)&&$(t)}function G(t){return"[object RegExp]"===q(t)&&$(t)}function W(t){if(U)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,i,a){var c=n||{};if(H(c,"quoteStyle")&&!H(j,c.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var d=!H(c,"customInspect")||c.customInspect;if("boolean"!=typeof d&&"symbol"!==d)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return J(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var A=String(e);return E?C(e,A):A}if("bigint"==typeof e){var I=String(e)+"n";return E?C(e,I):I}var L=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=L&&L>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var B,P=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=T.call(Array(t.indent+1)," ")}return{base:r,prev:T.call(Array(e+1),r)}}(c,i);if(void 0===a)a=[];else if(Y(a,e)>=0)return"[Circular]";function K(e,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:c.depth};return H(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,i+1,a)}return t(e,c,i+1,a)}if("function"==typeof e&&!G(e)){var X=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),nt=rt(e,K);return"[Function"+(X?": "+X:" (anonymous)")+"]"+(nt.length>0?" { "+T.call(nt,", ")+" }":"")}if(W(e)){var it=U?b.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(e);return"object"!=typeof e||U?it:Q(it)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var ot="<"+w.call(String(e.nodeName)),st=e.attributes||[],at=0;at<st.length;at++)ot+=" "+st[at].name+"="+M(V(st[at].value),"double",c);return ot+=">",e.childNodes&&e.childNodes.length&&(ot+="..."),ot+"</"+w.call(String(e.nodeName))+">"}if(z(e)){if(0===e.length)return"[]";var ct=rt(e,K);return P&&!function(t){for(var e=0;e<t.length;e++)if(Y(t[e],"\n")>=0)return!1;return!0}(ct)?"["+et(ct,P)+"]":"[ "+T.call(ct,", ")+" ]"}if(function(t){return"[object Error]"===q(t)&&$(t)}(e)){var ut=rt(e,K);return"cause"in Error.prototype||!("cause"in e)||k.call(e,"cause")?0===ut.length?"["+String(e)+"]":"{ ["+String(e)+"] "+T.call(ut,", ")+" }":"{ ["+String(e)+"] "+T.call(S.call("[cause]: "+K(e.cause),ut),", ")+" }"}if("object"==typeof e&&d){if(F&&"function"==typeof e[F]&&D)return D(e,{depth:L-i});if("symbol"!==d&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var lt=[];return s&&s.call(e,(function(t,r){lt.push(K(r,e,!0)+" => "+K(t,e))})),tt("Map",o.call(e),lt,P)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ht=[];return l&&l.call(e,(function(t){ht.push(K(t,e))})),tt("Set",u.call(e),ht,P)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Z("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Z("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return Z("WeakRef");if(function(t){return"[object Number]"===q(t)&&$(t)}(e))return Q(K(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}(e))return Q(K(_.call(e)));if(function(t){return"[object Boolean]"===q(t)&&$(t)}(e))return Q(y.call(e));if(function(t){return"[object String]"===q(t)&&$(t)}(e))return Q(K(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===q(t)&&$(t)}(e)&&!G(e)){var ft=rt(e,K),pt=N?N(e)===Object.prototype:e instanceof Object||e.constructor===Object,yt=e instanceof Object?"":"null prototype",dt=!pt&&R&&Object(e)===e&&R in e?v.call(q(e),8,-1):yt?"Object":"",gt=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(dt||yt?"["+T.call(S.call([],dt||[],yt||[]),": ")+"] ":"");return 0===ft.length?gt+"{}":P?gt+"{"+et(ft,P)+"}":gt+"{ "+T.call(ft,", ")+" }"}return String(e)};var K=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return K.call(t,e)}function q(t){return d.call(t)}function Y(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function J(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(v.call(t,0,e.maxStringLength),e)+n}var i=P[e.quoteStyle||"single"];return i.lastIndex=0,M(b.call(b.call(t,i,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+E.call(e.toString(16))}function Q(t){return"Object("+t+")"}function Z(t){return t+" { ? }"}function tt(t,e,r,n){return t+" ("+e+") {"+(n?et(r,n):T.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+T.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=z(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=H(t,i)?e(t[i],t):""}var o,s="function"==typeof L?L(t):[];if(U){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var c in t)H(t,c)&&(r&&String(Number(c))===c&&c<t.length||U&&o["$"+c]instanceof Symbol||(A.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if("function"==typeof L)for(var u=0;u<s.length;u++)k.call(t,s[u])&&n.push("["+e(s[u])+"]: "+e(t[s[u]],t));return n}},8875:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(3474),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var y=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var d=0;d<t.length;++d)f.push(String(d));if(n&&t.length>0)for(var g=0;g<t.length;++g)f.push(String(g));else for(var m in t)y&&"prototype"===m||!i.call(t,m)||f.push(String(m));if(c)for(var v=function(t){if("undefined"==typeof window||!p)return h(t);try{return h(t)}catch(t){return!1}}(t),b=0;b<l.length;++b)v&&"constructor"===l[b]||!i.call(t,l[b])||f.push(l[b]);return f}}t.exports=n},1189:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(3474),o=Object.keys,s=o?function(t){return o(t)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},3474:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6578:t=>{"use strict";t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function y(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new p(t,e)),1!==c.length||u||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},4399:(t,e,r)=>{"use strict";var n=r(453)("%Array.prototype.concat%"),i=r(487),o=r(6556)("Array.prototype.slice"),s=r(1333)()&&Symbol.isConcatSpreadable,a=[],c=s?i.apply(n,a):null,u=s?r(4634):null;t.exports=s?function(t){for(var e=0;e<arguments.length;e+=1){var r=arguments[e];if(r&&"object"==typeof r&&"boolean"==typeof r[s]){a[s]||(a[s]=!0);var n=u(r)?o(r):[r];n[s]=!0,arguments[e]=n}}return c(arguments)}:i(n,a)},9721:(t,e,r)=>{"use strict";var n=r(6556),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==o(t,e)}}},6897:(t,e,r)=>{"use strict";var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},8206:(t,e,r)=>{"use strict";var n=r(5388),i=r(4810),o=r(6556)("String.prototype.replace"),s=/^\s$/.test(""),a=s?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=s?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=i(n(this));return o(o(t,a,""),c,"")}},214:(t,e,r)=>{"use strict";var n=r(487),i=r(8452),o=r(5388),s=r(8206),a=r(4895),c=r(9377),u=n(a()),l=function(t){return o(t),u(t)};i(l,{getPolyfill:a,implementation:s,shim:c}),t.exports=l},4895:(t,e,r)=>{"use strict";var n=r(8206);t.exports=function(){return String.prototype.trim&&""==="".trim()&&""==="".trim()&&"_"==="_".trim()&&"_"==="_".trim()?String.prototype.trim:n}},9377:(t,e,r)=>{"use strict";var n=r(592)(),i=r(41),o=r(4895);t.exports=function(){var t=o();return String.prototype.trim!==t&&(n?i(String.prototype,"trim",t,!0):i(String.prototype,"trim",t)),t}},1093:t=>{t.exports=(t,e)=>{e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{const o=i.slice(n,n+e);o.length===e&&(r=JSON.stringify(o),t[r]=t[r]||[],t[r].push(n))})),t)),{});return Object.keys(r).map((t=>({term:JSON.parse(t),positions:r[t]}))).sort(((t,e)=>{for(let r=0;r<t.term.length&&r<e.term.length;r++)if(t.term[r]!==e.term[r])return t.term[r].localeCompare(e.term[r]);return 0}))}},4372:(t,e,r)=>{"use strict";var n=r(9675),i=r(6556)("TypedArray.prototype.buffer",!0),o=r(5680);t.exports=i||function(t){if(!o(t))throw new n("Not a Typed Array");return t.buffer}},2308:(t,e,r)=>{"use strict";var n=r(2682),i=r(487),o=r(9897)(),s=r(9209)(),a={__proto__:null},c=r(5795),u=Object.defineProperty;if(c){var l=function(t){return t.byteOffset};n(s,(function(t){if("function"==typeof r.g[t]||"object"==typeof r.g[t]){var e=r.g[t].prototype,n=c(e,"byteOffset");if(!n){var s=o(e);n=c(s,"byteOffset")}if(n&&n.get)a[t]=i(n.get);else if(u){var h=new r.g[t](2);(n=c(h,"byteOffset"))&&n.configurable&&u(h,"length",{value:3}),2===h.length&&(a[t]=l)}}}))}var h=r(5680);t.exports=function(t){return!!h(t)&&function(t){var e;return n(a,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},6058:(t,e,r)=>{"use strict";var n=r(487),i=r(2682),o=r(5795),s=r(5680),a=r(6578),c=r(9897)(),u={__proto__:null},l=Object.defineProperty;if(o){var h=function(t){return t.length};i(a,(function(t){var e=r.g[t];if("function"==typeof e||"object"==typeof e){var i=e.prototype,s=o(i,"length");if(!s){var a=c(i);s=o(a,"length")}if(s&&s.get)u["$"+t]=n(s.get);else if(l){var f=new r.g[t](2);(s=o(f,"length"))&&s.configurable&&l(f,"length",{value:3}),2===f.length&&(u["$"+t]=h)}}}))}t.exports=function(t){return!!s(t)&&function(t){var e;return i(u,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},8268:(t,e,r)=>{"use strict";var n=r(9675),i=r(280),o=r(2282),s=r(5910),a=r(6188),c=r(8002),u=r(2076),l=r(2138),h=r(7196),f=r(4810),p=r(4742),y=r(6419),d=r(7057),g=r(1509),m=r(4372),v=r(2308);t.exports=function(t,e){var r=this;g(r,"SEQ-CST");var b,E=r.length,w=h(t);b=w===-1/0?0:w<0?a(E+w,0):c(w,E);var A,S=void 0===e?E:h(e);A=S===-1/0?0:S<0?a(E+S,0):c(S,E);var T=a(A-b,0),O=d(r,[T]);if(T>0){if(s(m(r)))throw new n("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");if(y(r)===y(O))for(var I=m(r),_=m(O),L=p(r),x=b*L+v(r),U=v(O),R=U+T*L;U<R;){var k=o(I,x,"UINT8",!0,"UNORDERED");l(_,U,"UINT8",k,!0,"UNORDERED"),x+=1,U+=1}else for(var N=0;b<A;){var C=f(b),D=i(r,C);u(O,f(N),D,!0),b+=1,N+=1}}return O}},3432:(t,e,r)=>{"use strict";var n=r(8452),i=r(487),o=r(8268),s=r(2521),a=r(8599),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2521:(t,e,r)=>{"use strict";var n=r(8268);t.exports=function(){return"function"==typeof Uint8Array&&Uint8Array.prototype.slice||n}},8599:(t,e,r)=>{"use strict";var n=r(8452),i=r(3628),o=r(2521);t.exports=function(){if("function"==typeof Uint8Array){var t=o(),e=i(Uint8Array.prototype);n(e,{slice:t},{slice:function(){return e.slice!==t}})}return t}},1539:(t,e,r)=>{"use strict";var n=r(4761),i=r(1703),o=r(5128),s=r(3612),a=r(9803);t.exports=function(t){return null==t||"object"!=typeof t&&"function"!=typeof t?null:n(t)?"String":i(t)?"Number":o(t)?"Boolean":s(t)?"Symbol":a(t)?"BigInt":void 0}},9723:(t,e,r)=>{"use strict";var n=r(1539),i=r(593),o=r(5767),s=r(4634),a=r(2120),c=r(4035),u=r(8173),l=r(3811),h=r(1482),f=r(8184),p=r(5351),y=r(6556),d=r(9092)()&&Symbol.toStringTag,g=Object,m=y("Promise.prototype.then",!0),v=function(t){return!!t&&"BigInt"!==t&&"Boolean"!==t&&"Null"!==t&&"Number"!==t&&"String"!==t&&"Symbol"!==t&&"Undefined"!==t&&"Math"!==t&&"JSON"!==t&&"Reflect"!==t&&"Atomics"!==t&&"Map"!==t&&"Set"!==t&&"WeakMap"!==t&&"WeakSet"!==t&&"BigInt64Array"!==t&&"BigUint64Array"!==t&&"Float32Array"!==t&&"Float64Array"!==t&&"Int16Array"!==t&&"Int32Array"!==t&&"Int8Array"!==t&&"Uint16Array"!==t&&"Uint32Array"!==t&&"Uint8Array"!==t&&"Uint8ClampedArray"!==t&&"Array"!==t&&"Date"!==t&&"FinalizationRegistry"!==t&&"Promise"!==t&&"RegExp"!==t&&"WeakRef"!==t&&"Function"!==t&&"GeneratorFunction"!==t&&"AsyncFunction"!==t};t.exports=function(t){if(null==t)return t;var e=n(g(t))||i(t)||o(t);if(e)return e;if(s(t))return"Array";if(a(t))return"Date";if(c(t))return"RegExp";if(u(t))return"WeakRef";if(l(t))return"FinalizationRegistry";if("function"==typeof t)return f(t)?"GeneratorFunction":p(t)?"AsyncFunction":"Function";if(function(t){if(!t||"object"!=typeof t||!m)return!1;try{return m(t,null,(function(){})),!0}catch(t){}return!1}(t))return"Promise";if(d&&d in t){var r=t[d];if(v(r))return r}if("function"==typeof t.constructor){var y=h(t.constructor);if(v(y))return y}return"Object"}},593:(t,e,r)=>{"use strict";var n=r(3802),i=r(256),o=r(7842),s=r(2648);t.exports=function(t){if(t&&"object"==typeof t){if(n(t))return"Map";if(i(t))return"Set";if(o(t))return"WeakMap";if(s(t))return"WeakSet"}return!1}},5767:(t,e,r)=>{"use strict";var n=r(2682),i=r(9209),o=r(487),s=r(6556),a=r(5795),c=s("Object.prototype.toString"),u=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),f=s("String.prototype.slice"),p=Object.getPrototypeOf,y=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},d={__proto__:null};n(h,u&&a&&p?function(t){var e=new l[t];if(Symbol.toStringTag in e){var r=p(e),n=a(r,Symbol.toStringTag);if(!n){var i=p(r);n=a(i,Symbol.toStringTag)}d["$"+t]=o(n.get)}}:function(t){var e=new l[t],r=e.slice||e.set;r&&(d["$"+t]=o(r))}),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!u){var e=f(c(t),8,-1);return y(h,e)>-1?e:"Object"===e&&function(t){var e=!1;return n(d,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(d,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},2634:()=>{},9209:(t,e,r)=>{"use strict";var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},7149:(t,e,r)=>{"use strict";var n=r(9675),i=r(5910),o=r(4670),s=r(7070),a=r(9511);t.exports=function(t,e){var r=s(t);if(!o(t)&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(i(t))throw new n("Assertion failed: `arrayBuffer` must not be detached");return a(t)}},9969:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9290),o=r(9675),s=n&&n(0);t.exports=function(t,e){if("bigint"!=typeof t||"bigint"!=typeof e)throw new o("Assertion failed: `n` and `d` arguments must be BigInts");if(e===s)throw new i("Division by zero");return t===s?s:t%e}},893:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(4769),s=r(7030),a=r(8131),c=r(3541),u=r(2875),l=r(259),h=r(2702);t.exports=function(t,e,r){if(!h(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: P is not a Property Key");var f=i(r)?r:l(r);if(!i(f))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(a,u,s,t,e,f)}},7030:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(2997);t.exports=function(t){if(void 0!==t&&!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return o(t)}},280:(t,e,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(2702),s=r(3541);t.exports=function(t,e){if(!o(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: P is not a Property Key, got "+i(e));return t[e]}},2282:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=r(6556),a=r(7440),c=n("%Uint8Array%",!0),u=s("Array.prototype.slice"),l=r(5910),h=r(6167),f=r(4670),p=r(7070),y=r(4399),d=r(4097),g=r(5100);t.exports=function(t,e,r,n,s){var m=p(t);if(!f(t)&&!m)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!a(e))throw new o("Assertion failed: `byteIndex` must be an integer");if("string"!=typeof r||"number"!=typeof d.size["$"+r])throw new o("Assertion failed: `type` must be a Typed Array element type");if("boolean"!=typeof n)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==s&&"UNORDERED"!==s)throw new o("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&"boolean"!=typeof arguments[5])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(l(t))throw new o("Assertion failed: `arrayBuffer` is detached");if(e<0)throw new o("Assertion failed: `byteIndex` must be non-negative");var v,b=d.size["$"+r];if(!b)throw new o('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');if(m)throw new i("SharedArrayBuffer is not supported by this implementation");v=u(new c(t,e),0,b);var E=arguments.length>5?arguments[5]:"little"===g,w=E?u(y([0,0,0,0,0,0,0,0],v),-b):u(y(v,[0,0,0,0,0,0,0,0]),0,b);return h(r,w,E)}},2491:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(2702),s=r(3541);t.exports=function(t,e){if(!o(t))throw new n("Assertion failed: `O` must be an Object");if(!s(e))throw new n("Assertion failed: `P` must be a Property Key");return i(t,e)}},533:(t,e,r)=>{"use strict";t.exports=r(1412)},7881:t=>{"use strict";t.exports=function(t){return"BIGUINT64"===t||"BIGINT64"===t}},6966:(t,e,r)=>{"use strict";t.exports=r(9600)},4528:(t,e,r)=>{"use strict";var n=r(1376)("%Reflect.construct%",!0),i=r(893);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},8131:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(5701);t.exports=function(t){if(void 0===t)return!1;if(!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!i(t,"[[Value]]")&&!i(t,"[[Writable]]"))}},5910:(t,e,r)=>{"use strict";var n=r(9675),i=r(9511),o=r(9209)(),s=r(6556),a=r(4670),c=r(7070),u=s("SharedArrayBuffer.prototype.byteLength",!0);t.exports=function(t){var e=c(t);if(!a(t)&&!e)throw new n("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if(0===(e?u:i)(t))try{new r.g[o[0]](t)}catch(t){return!!t&&"TypeError"===t.name}return!1}},6575:(t,e,r)=>{"use strict";var n=r(9675),i=r(6556),o=i("%ArrayBuffer.prototype.resizable%",!0),s=i("%SharedArrayBuffer.prototype.growable%",!0),a=r(4670),c=r(7070);t.exports=function(t){var e=a(t),r=c(t);if(!e&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return e&&o?!o(t):!r||!s||!s(t)}},5291:(t,e,r)=>{"use strict";var n=r(9675),i=r(5910),o=r(4742),s=r(9346),a=r(4372),c=r(2308),u=r(6058);t.exports=function(t){if(!s(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var e=t["[[Object]]"],r=t["[[CachedBufferByteLength]]"];if(i(a(e))&&"DETACHED"!==r)throw new n("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if("DETACHED"===r)return!0;var l,h=c(e),f=u(e);return l="AUTO"===f?r:h+f*o(e),h>r||l>r}},9373:t=>{"use strict";t.exports=function(t){return"UINT8"===t||"UINT8C"===t||"UINT16"===t||"UINT32"===t||"BIGUINT64"===t}},6681:(t,e,r)=>{"use strict";var n=r(9675),i=r(7149),o=r(5910),s=r(5680),a=r(4372);t.exports=function(t,e){if(!s(t))throw new n("Assertion failed: `obj` must be a Typed Array");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var r=a(t);return{"[[Object]]":t,"[[CachedBufferByteLength]]":o(r)?"DETACHED":i(r,e)}}},5015:(t,e,r)=>{"use strict";var n=r(9675),i=r(2491),o=r(3446),s=r(9887),a=r(3557),c=r(2475),u=r(7088),l=r(172),h=r(4770),f=r(6039),p=r(9308),y=r(2779),d=r(8894),g=r(4751),m=r(1189),v={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},b={__proto__:null,INT8:u,UINT8:f,UINT8C:p,INT16:a,UINT16:l,INT32:c,UINT32:h,BIGINT64:o,BIGUINT64:s};t.exports=function(t,e,r){if("string"!=typeof t||!i(v,t))throw new n("Assertion failed: `type` must be a TypedArray element type: "+m(v));if("number"!=typeof e&&"bigint"!=typeof e)throw new n("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof r)throw new n("Assertion failed: `isLittleEndian` must be a Boolean");if("FLOAT32"===t)return y(e,r);if("FLOAT64"===t)return d(e,r);var o=v[t],s=(0,b[t])(e);return g(s,o,r)}},6167:(t,e,r)=>{"use strict";var n=r(453),i=r(6556),o=r(9290),s=r(8068),a=r(9675),c=n("%BigInt%",!0),u=r(2491),l=r(533),h=r(7881),f=r(9373),p=r(4915),y=r(6587),d=r(6570),g=r(4138),m=r(2158),v=i("Array.prototype.reverse"),b=i("Array.prototype.slice"),E=r(1189),w={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};t.exports=function(t,e,r){if(!u(w,t))throw new a("Assertion failed: `type` must be a TypedArray element type: "+E(w));if(!l(e)||!g(e,m))throw new a("Assertion failed: `rawBytes` must be an Array of bytes");if("boolean"!=typeof r)throw new a("Assertion failed: `isLittleEndian` must be a Boolean");var n=w[t];if(e.length!==n)throw new o("Assertion failed: `rawBytes` must have a length of "+n+" for type "+t);var i=h(t);if(i&&!c)throw new s("this environment does not support BigInts");return e=b(e,0,n),r||v(e),"FLOAT32"===t?p(e):"FLOAT64"===t?y(e):d(e,n,f(t),i)}},2875:(t,e,r)=>{"use strict";var n=r(4459);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},2076:(t,e,r)=>{"use strict";var n=r(9675),i=r(3541),o=r(2875),s=r(2702),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if(!s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof c)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},2138:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=r(7440),a=n("%Uint8Array%",!0),c=r(7881),u=r(5910),l=r(5015),h=r(4670),f=r(7070),p=r(9957),y=r(4097),d=r(5100),g=r(3795);t.exports=function(t,e,r,n,m,v){var b=f(t);if(!h(t)&&!b)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!s(e)||e<0)throw new o("Assertion failed: `byteIndex` must be a non-negative integer");if("string"!=typeof r||!p(y.size,"$"+r))throw new o("Assertion failed: `type` must be a Typed Array Element Type");if("number"!=typeof n&&"bigint"!=typeof n)throw new o("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof m)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==v&&"UNORDERED"!==v&&"INIT"!==v)throw new o('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: ArrayBuffer is detached");if(c(r)?"bigint"!=typeof n:"number"!=typeof n)throw new o("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var E=y.size["$"+r],w=l(r,n,arguments.length>6?arguments[6]:"little"===d);if(b)throw new i("SharedArrayBuffer is not supported by this implementation");var A=new a(t,e,E);g(w,(function(t,e){A[e]=t}))}},7732:(t,e,r)=>{"use strict";var n=r(453)("%Symbol.species%",!0),i=r(9675),o=r(4528),s=r(2702);t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if(!s(r))throw new i("O.constructor is not an Object");var a=n?r[n]:void 0;if(null==a)return e;if(o(a))return a;throw new i("no constructor found")}},9693:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9675),o=r(8068);t.exports=function(t){if("string"!=typeof t)throw new i("`argument` must be a string");if(!n)throw new o("BigInts are not supported in this environment");try{return n(t)}catch(t){return}}},8679:(t,e,r)=>{"use strict";var n=r(453),i=n("%RegExp%"),o=r(9675),s=n("%parseInt%"),a=r(6556),c=r(9721),u=a("String.prototype.slice"),l=c(/^0b[01]+$/i),h=c(/^0o[0-7]+$/i),f=c(/^[-+]0x[0-9a-f]+$/i),p=c(new i("["+["
","",""].join("")+"]","g")),y=r(214);t.exports=function t(e){if("string"!=typeof e)throw new o("Assertion failed: `argument` is not a String");if(l(e))return+s(u(e,2),2);if(h(e))return+s(u(e,2),8);if(p(e)||f(e))return NaN;var r=y(e);return r!==e?t(r):+e}},2964:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Number%"),s=r(9675),a=r(8068),c=r(9693),u=r(866);t.exports=function(t){if(!i)throw new a("BigInts are not supported in this environment");var e=u(t,o);if(null==e)throw new s("Cannot convert null or undefined to a BigInt");if("boolean"==typeof e)return i(e?1:0);if("number"==typeof e)throw new s("Cannot convert a Number value to a BigInt");if("string"==typeof e){var r=c(e);if(void 0===r)throw new s("Failed to parse String to BigInt");return r}if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a BigInt");if("bigint"!=typeof e)throw new a("Assertion failed: unknown primitive type");return e}},3446:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(5880),o=r(2964),s=r(9969),a=r(122),c=n&&BigInt(i(2,32))*BigInt(i(2,31)),u=n&&BigInt(i(2,32))*BigInt(i(2,32));t.exports=function(t){var e=o(t),r=a(s,e,u);return r>=c?r-u:r}},9887:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(5880),o=r(2964),s=r(9969),a=r(122),c=n&&BigInt(i(2,32))*BigInt(i(2,32));t.exports=function(t){var e=o(t);return a(s,e,c)}},4323:t=>{"use strict";t.exports=function(t){return!!t}},3557:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(3331);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return a>=32768?a-65536:a}},2475:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(3331),a=4294967296;t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),c=n(r,a),u=c>=2147483648?c-a:c;return 0===u?0:u}},7088:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(3331);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,256);return a>=128?a-256:a}},7196:(t,e,r)=>{"use strict";var n=r(8410),i=r(3384),o=r(4459),s=r(3331);t.exports=function(t){var e=n(t);return o(e)||0===e?0:s(e)?i(e):e}},8410:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Number%"),s=r(6600),a=r(866),c=r(8679);t.exports=function(t){var e=s(t)?t:a(t,o);if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):+e}},866:(t,e,r)=>{"use strict";var n=r(5437);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},259:(t,e,r)=>{"use strict";var n=r(9957),i=r(9675),o=r(6966),s=r(4323),a=r(2702);t.exports=function(t){if(!a(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!o(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!o(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},4810:(t,e,r)=>{"use strict";var n=r(453)("%String%"),i=r(9675);t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return n(t)}},172:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(3331);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return 0===a?0:a}},4770:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(3331);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,4294967296);return 0===a?0:a}},6039:(t,e,r)=>{"use strict";var n=r(3331),i=r(4224),o=r(8410),s=r(3384);t.exports=function(t){var e=o(t);if(!n(e)||0===e)return 0;var r=s(e);return i(r,256)}},9308:(t,e,r)=>{"use strict";var n=r(9719),i=r(8410),o=r(5986),s=r(4459);t.exports=function(t){var e=i(t);if(s(e))return 0;var r=n(e,0,255),a=o(r);return r<a+.5?a:r>a+.5?a+1:a%2==0?a:a+1}},9531:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(533),s=r(4528),a=r(5291),c=r(9271),u=r(1509),l=r(9209)();t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: `constructor` must be a constructor");if(!o(e))throw new i("Assertion failed: `argumentList` must be a List");if(0===l.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r;r=0===e.length?new t:1===e.length?new t(e[0]):2===e.length?new t(e[0],e[1]):new t(e[0],e[1],e[2]);var h=u(r,"SEQ-CST");if(1===e.length&&"number"==typeof e[0]){if(a(h))throw new i("new Typed Array is out of bounds");if(c(h)<e[0])throw new i("`argumentList[0]` must be <= `newTypedArray.length`")}return r}},4742:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(7440),s=r(5767),a=r(4097);t.exports=function(t){var e=s(t);if(!e)throw new i("Assertion failed: `O` must be a TypedArray");var r=a.size["$"+a.name["$"+e]];if(!o(r)||r<0)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},6419:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(4097);t.exports=function(t){var e=o(t);if(!e)throw new i("Assertion failed: `O` must be a TypedArray");var r=s.name["$"+e];if("string"!=typeof r)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},9271:(t,e,r)=>{"use strict";var n=r(9675),i=r(5986),o=r(6575),s=r(5291),a=r(4742),c=r(9346),u=r(4372),l=r(2308),h=r(6058);t.exports=function(t){if(!c(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(s(t))throw new n("Assertion failed: `taRecord` is out of bounds");var e=t["[[Object]]"],r=h(e);if("AUTO"!==r)return r;if(o(u(e)))throw new n("Assertion failed: array buffer is not fixed length");var f=l(e),p=a(e),y=t["[[CachedBufferByteLength]]"];if("DETACHED"===y)throw new n("Assertion failed: typed array is detached");return i((y-f)/p)}},7057:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(9209)(),a=r(533),c=r(7732),u=r(9531),l=r(2697);t.exports=function(t,e){if(0===s.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r=o(t);if(!r)throw new i("Assertion failed: exemplar must be a TypedArray");if(!a(e))throw new i("Assertion failed: `argumentList` must be a List");var h=l(r);if("function"!=typeof h)throw new n("Assertion failed: `constructor` of `exemplar` ("+r+") must exist. Please report this!");var f=c(t,h);return u(f,e)}},1509:(t,e,r)=>{"use strict";var n=r(9675),i=r(5291),o=r(6681),s=r(2702),a=r(5680);t.exports=function(t,e){if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!s(t))throw new n("Assertion failed: `O` must be an Object");if(!a(t))throw new n("Assertion failed: `O` must be a Typed Array");var r=o(t,e);if(i(r))throw new n("`O` must be in-bounds and backed by a non-detached buffer");return r}},9719:(t,e,r)=>{"use strict";var n=r(9675),i=r(6188),o=r(8002);t.exports=function(t,e,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r||!(e<=r))throw new n("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return o(i(e,t),r)}},5986:(t,e,r)=>{"use strict";var n=r(8968);t.exports=function(t){return"bigint"==typeof t?t:n(t)}},4224:(t,e,r)=>{"use strict";var n=r(113);t.exports=function(t,e){return n(t,e)}},4097:t=>{"use strict";t.exports={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}}},3384:(t,e,r)=>{"use strict";var n=r(5986),i=r(9675);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},1376:(t,e,r)=>{"use strict";t.exports=r(453)},4769:(t,e,r)=>{"use strict";var n=r(592),i=r(655),o=n.hasArrayLengthDefineBug(),s=o&&r(1412),a=r(6556)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,c,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(c in n&&a(n,c)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[c]=l,e(n[c],l)}return o&&"length"===c&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,c,r(u)),!0)}},1412:(t,e,r)=>{"use strict";var n=r(453)("%Array%"),i=!n.isArray&&r(6556)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4915:(t,e,r)=>{"use strict";var n=r(5880);t.exports=function(t){var e=128&t[3]?-1:1,r=(127&t[3])<<1|t[2]>>7,i=(127&t[2])<<16|t[1]<<8|t[0];return 0===r&&0===i?1===e?0:-0:255===r&&0===i?1===e?1/0:-1/0:255===r&&0!==i?NaN:-127==(r-=127)?e*i*n(2,-149):e*(1+i*n(2,-23))*n(2,r)}},6587:(t,e,r)=>{"use strict";var n=r(5880);t.exports=function(t){var e=128&t[7]?-1:1,r=(127&t[7])<<4|(240&t[6])>>4,i=281474976710656*(15&t[6])+1099511627776*t[5]+4294967296*t[4]+16777216*t[3]+65536*t[2]+256*t[1]+t[0];return 0===r&&0===i?0*e:2047===r&&0!==i?NaN:2047===r&&0===i?e*(1/0):-1023==(r-=1023)?e*i*5e-324:e*(1+i/4503599627370496)*n(2,r)}},6570:(t,e,r)=>{"use strict";var n=r(453),i=r(5880),o=n("%Number%"),s=n("%BigInt%",!0);t.exports=function(t,e,r,n){for(var a=n?s:o,c=a(0),u=0;u<t.length;u++)c+=a(t[u]*i(2,8*u));if(!r){var l=8*e;128&t[e-1]&&(c-=a(i(2,l)))}return c}},5100:(t,e,r)=>{"use strict";var n=r(453),i=n("%Uint8Array%",!0),o=n("%Uint32Array%",!0),s=r(4372),a=o&&new o([305419896]),c=a&&new i(s(a));t.exports=c?120===c[0]?"little":18===c[0]?"big":52===c[0]?"mixed":"unknown":"indeterminate"},4138:t=>{"use strict";t.exports=function(t,e){for(var r=0;r<t.length;r+=1)if(!e(t[r],r,t))return!1;return!0}},3795:t=>{"use strict";t.exports=function(t,e){for(var r=0;r<t.length;r+=1)e(t[r],r,t)}},9154:t=>{"use strict";var e=1075;t.exports=function(t){var r="";if(0===t)return r;for(var n,i=e,o=0;o<e;o+=1)if((n=2*t)>=1?(t=n-1,r+="1",i===e&&(i=o)):(t=n,r+="0"),1===n||o-i>54)return r;return r}},2997:t=>{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},8213:(t,e,r)=>{"use strict";var n=r(8968);t.exports=function(t){for(var e,r="";t>0;)r=(e=t/2)===(t=n(e))?"0"+r:"1"+r;return r}},4751:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%BigInt%",!0);t.exports=function(t,e,r){var n="bigint"==typeof t?o:i;t<0&&(t>>>=0);for(var s=[],a=0;a<e;a++)s[r?a:e-1-a]=i(t&n(255)),t>>=n(8);return s}},2158:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=0&&t<=255&&(0|t)===t}},1087:(t,e,r)=>{"use strict";t.exports=r(7440)},2702:t=>{"use strict";t.exports=function(t){return!!t&&("function"==typeof t||"object"==typeof t)}},6600:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},3541:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},113:(t,e,r)=>{"use strict";t.exports=r(1350)},122:t=>{"use strict";t.exports=function(t,e,r){var n=t(e,r);return n>=0?n:n+r}},5701:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(i(t,e)&&!o[e])return!1;var r=i(t,"[[Value]]")||i(t,"[[Writable]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(r&&s)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}},9346:(t,e,r)=>{"use strict";var n=r(9957),i=r(5680),o=r(1087);t.exports=function(t){return!!t&&"object"==typeof t&&n(t,"[[Object]]")&&n(t,"[[CachedBufferByteLength]]")&&(o(t["[[CachedBufferByteLength]]"])&&t["[[CachedBufferByteLength]]"]>=0||"DETACHED"===t["[[CachedBufferByteLength]]"])&&i(t["[[Object]]"])}},2697:(t,e,r)=>{"use strict";var n=r(453),i={__proto__:null,$Int8Array:n("%Int8Array%",!0),$Uint8Array:n("%Uint8Array%",!0),$Uint8ClampedArray:n("%Uint8ClampedArray%",!0),$Int16Array:n("%Int16Array%",!0),$Uint16Array:n("%Uint16Array%",!0),$Int32Array:n("%Int32Array%",!0),$Uint32Array:n("%Uint32Array%",!0),$BigInt64Array:n("%BigInt64Array%",!0),$BigUint64Array:n("%BigUint64Array%",!0),$Float32Array:n("%Float32Array%",!0),$Float64Array:n("%Float64Array%",!0)};t.exports=function(t){return i["$"+t]}},2779:(t,e,r)=>{"use strict";var n=r(1514),i=r(8968),o=r(5880),s=r(3331),a=r(4459),c=r(8017);t.exports=function(t,e){if(a(t))return e?[0,0,192,127]:[127,192,0,0];var r;if(0===t)return r=c(t)?128:0,e?[0,0,0,r]:[r,0,0,0];if(n(t)>34028234663852886e22||!s(t))return r=t<0?255:127,e?[0,0,128,r]:[r,128,0,0];var u=t<0?1:0;t=n(t);for(var l=0;t>=2;)l+=1,t/=2;for(;t<1;)l-=1,t*=2;var h=t-1;h*=o(2,23)+.5,l+=127;var f=u<<31|(l<<=23)|(h=i(h)),p=255&f,y=255&(f>>=8),d=255&(f>>=8),g=255&(f>>=8);return e?[p,y,d,g]:[g,d,y,p]}},8894:(t,e,r)=>{"use strict";var n=r(453)("%parseInt%"),i=r(1514),o=r(8968),s=r(8017),a=r(6556),c=a("String.prototype.indexOf"),u=a("String.prototype.slice"),l=r(9154),h=r(8213),f="11111111111",p="00000000000",y=p+p+p+p+"0000000";t.exports=function(t,e){var r,a,d=t<0||s(t)?"1":"0";if(isNaN(t))r=f,a="1"+y;else if(isFinite(t))if(0===t)r=p,a="0"+y;else{t=i(t);var g,m=o(t),v=h(m),b=l(t-m);if(v)r=v.length-1;else{var E=c(b,"1");E>-1&&(g=E+1),r=-g}a=v+b,r<0?(r<=-1023&&(g=1022),a=u(a,g)):a=u(a,1),r=u(p+h(r+1023),-11),a=u(a+y+"0",0,52)}else r=f,a="0"+y;for(var w=d+r+a,A=[],S=0;S<8;S++)A[e?8-S-1:S]=n(u(w,8*S,8*(S+1)),2);return A}},6268:(t,e,r)=>{"use strict";var n=r(453),i=r(6966),o=r(2702),s=r(9723),a=r(9675),c=r(3628),u=r(9612);t.exports=function(t){if(!o(t))throw new a("Reflect.getPrototypeOf called on non-object");if(c)return c(t);var e=s(t);if(e){var r=n("%"+e+".prototype%",!0);if(r)return r}return i(t.constructor)?t.constructor.prototype:t instanceof Object?u.prototype:null}},9897:(t,e,r)=>{"use strict";var n=r(6268),i=r(3628);t.exports=function(){return"object"==typeof Reflect&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:i?function(t){return i(t)}:n}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{SearchIndex:()=>Q,UI:()=>Z});var t=r(1093),e=r(8508);const i=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),o=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],s=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),a=([t,e,r])=>{const{fields:n,values:i}=r.replace,o=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?n?n.includes(e)?Promise.resolve([o(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([o(),e,r]):Promise.resolve([t,e,r])},c=([t,r,n])=>{let{fields:i,lengths:o,join:s=" "}=n.ngrams;return i||(i=[r]),o&&i.includes(r)?[(0,e.ngraminator)(t.filter((t=>null!==t)),o).map((t=>t.join(s))),r,n]:Promise.resolve([t,r,n])},u=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([e,r,n])=>{const i=t(e),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>[t.term[0],(t.positions.length/o).toFixed(2)])).sort(),r,n])},h={SPLIT:i,SKIP:o,LOWCASE:s,REPLACE:a,NGRAMS:c,STOPWORDS:u,SCORE_TERM_FREQUENCY:l,SPY:([t,e,r])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,r]))},f=(t,e,r)=>i([t,e,r]).then(o).then(s).then(a).then(c).then(u).then(l).then((([t,e,r])=>t));var p=r(9148),y=r(7007),d=r(9901);function g(t,e){const r=t=>"string"==typeof t,n=async(r,n=t=>new Promise((e=>e(t))))=>new Promise((async(i,o)=>{const a=t=>void 0===t?i(void 0):t instanceof Promise?i(t):void 0;try{a(r),r=e.parse(r),a(r=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(r)),a(r=await n(r))}catch(t){return o(t)}return Array.isArray(r)?i(r):i(s(r))})),i=async(t,e)=>Promise.all(t).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),o=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(d.HI),["IDX",t,n]},s=t=>new Promise((e=>{if(void 0===t)return e(void 0);const r=new Map;Promise.all(t.FIELD.map((e=>{const n={gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0),limit:t.LIMIT,reverse:t.REVERSE};return u(n).then((t=>t.forEach((t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})])))))))}))).then((()=>e(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),a=(t,e,r=!0)=>e?0===e.length?[]:(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]}))).filter((t=>!r||t._id.length))):t,c=t=>(t=e.parse(t),n(t).then((e=>({_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE,...t})))),u=e=>t.db.iterator(e).all().then((t=>t.map((([t,e])=>({key:t,value:e}))))),l=(t,r)=>s({...e.parse(t),LIMIT:1,REVERSE:r}).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),h=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>{let r=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(r+="○");let n=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(n+=" "),u({gte:o(e,n),lte:o(e,r,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))).then((t=>t.flat()))),f=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))).then((t=>t.flat()))),p=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:r})=>Promise.all([t,e,r]).then((([t=[],e=[],r=[]])=>({BUCKETS:a(t.flat(),r),FACETS:a(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:a,BUCKET:c,BUCKETS:(...t)=>Promise.all(t.map(c)),CREATED:()=>t.db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(h):[h({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t.db.get([t.docExistsSpace,e]).catch((t=>null))))).then((t=>t.reduce(((t,r,n)=>(null!=r&&t.push(e[n]),t)),[]))),EXPORT:u,FACETS:(...t)=>Promise.all(t.length?t.map(f):[f({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:()=>u({gte:["FIELD",d.LO],lte:["FIELD",d.HI]}).then((t=>t.map((t=>t.key[1])))),GET:n,INTERSECTION:(t,e)=>i(t).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t.db.get(["~LAST_UPDATED"]),MAX:t=>l(t,!0),MIN:l,OBJECT:e=>Promise.all(e.map((e=>t.db.get(["DOC",e._id]).catch((t=>null))))).then((t=>e.map(((e,r)=>(e._object=t[r],e))))),SET_SUBTRACTION:(t,e)=>Promise.all([r(t)?n(t):t,r(e)?n(e):e]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>p.compare(t._id,e._id)))))),UNION:i}}d.LO=null,d.HI=void 0;var m=r(8423);const v=null,b=void 0;class E{availableFields=[];#t;constructor(t){this.#t=t}setAvailableFields=t=>{this.availableFields=t};#e=t=>{const e=t=>this.#t||"string"!=typeof t?t:t.toLowerCase();return{FIELD:t.FIELD.map(e),VALUE:{GTE:e(t.VALUE.GTE),LTE:e(t.VALUE.LTE)}}};parse(t){if(t instanceof Promise)return t;if(Array.isArray(t))throw new Error("token cannot be Array");if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return this.#e({FIELD:this.availableFields,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return this.#e({FIELD:[e],VALUE:{GTE:r.join(":"),LTE:r.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:v,LTE:b}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=v),void 0===t.VALUE.LTE&&(t.VALUE.LTE=b),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?this.#e({FIELD:this.availableFields,...t}):(t.FIELD=[t.FIELD].flat(),this.#e(t))}}class w{constructor(t={}){t={caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC",db:new t.Level(t.name,{keyEncoding:d,valueEncoding:"json"}),...t};const e=new E(t.caseSensitive),r=new y,n=g(t,e),i=function(t,e){let r=0;const n=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const n=[];return m(e._object).forEach((function(e){const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==i&&!r.doNotIndexField.filter((t=>i.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([i,[this.node].flat(1/0).map((e=>"string"!=typeof e||t.caseSensitive?e:e.toLowerCase()))]);n.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:n}},i=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),o=(e,o,s,a,c)=>new Promise((u=>{e=e.map((t=>{var e;return t._id="string"==typeof(e=t._id)||"number"==typeof e?e:++r,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),g(t).EXIST(...e.map((t=>t._id))).then((t=>((t,e,r)=>{const n=Object.keys(t);return Promise.all(n.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((r,n)=>e.get(t).then(r).catch((t=>r([])))))))).then((e=>e.map(((e,i)=>{const o=new Set(e),s=new Set(t[n[i]]);if("put"===r)return{key:["IDX",...JSON.parse(n[i])],type:r,value:[...new Set([...o,...s])].sort()};if("del"===r){const t=[...new Set([...o].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>n(t,e))).reduce(i,{}))(e,c),o,s).then((t=>o.batch(t.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(e,s):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(t))))).then((()=>u(e.map((e=>{let r;return"put"===s?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===s&&(r=void 0===e._object?"FAILED":"DELETED"),{_id:e._id,operation:a,status:r}})))))))})),s=()=>(new Date).toISOString(),a=e=>t.db.put(["~LAST_UPDATED"],s()).then((()=>e));return{DELETE:e=>g(t).OBJECT(e.map((t=>({_id:t})))).then((e=>o(e,t.db,"del","DELETE",{}))).then(a),IMPORT:r=>t.db.clear().then((()=>t.db.batch(r.map((t=>Object.assign(t,{type:"put"})))))).then((()=>g(t).FIELDS())).then((t=>e.setAvailableFields(t))),PUT:(r,n={})=>o(r.map((t=>({_id:t._id,_object:t}))),t.db,"put","PUT",n).then(a).then((async r=>(e.setAvailableFields(await g(t).FIELDS()),r))),TIMESTAMP:()=>t.db.get(["~CREATED"]).then((e=>!!e||t.db.put(["~CREATED"],s()).then(a))),TIMESTAMP_LAST_UPDATED:a}}(t,e);n.FIELDS().then((t=>e.setAvailableFields(t))).then((()=>i.TIMESTAMP())).then((()=>r.emit("ready"))),this.AGGREGATION_FILTER=n.AGGREGATION_FILTER,this.AND=(t,e)=>n.INTERSECTION(t.map((t=>this.GET(t,e)))).then(this.flattenMatchArrayInResults),this.BUCKET=n.BUCKET,this.BUCKETS=n.BUCKETS,this.CREATED=n.CREATED,this.DELETE=i.DELETE,this.DISTINCT=n.DISTINCT,this.EVENTS=r,this.EXIST=n.EXIST,this.EXPORT=n.EXPORT,this.FACETS=n.FACETS,this.FIELDS=n.FIELDS,this.GET=(t,e)=>n.GET(t,e).then(this.flattenMatchArrayInResults),this.IMPORT=i.IMPORT,this.LAST_UPDATED=n.LAST_UPDATED,this.MAX=n.MAX,this.MIN=n.MIN,this.NOT=(...t)=>n.SET_SUBTRACTION(...t).then(this.flattenMatchArrayInResults),this.OBJECT=n.OBJECT,this.OR=(t,e)=>n.UNION(t.map((t=>this.GET(t,e)))).then((t=>t.union)).then(this.flattenMatchArrayInResults),this.PUT=i.PUT,this.SORT=n.SORT,this.STORE=t.db,this.TIMESTAMP_LAST_UPDATED=i.TIMESTAMP_LAST_UPDATED,this.TOKEN_PARSER=e}flattenMatchArrayInResults(t){return void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELD<e.FIELD?-1:t.FIELD>e.FIELD?1:t.VALUE<e.VALUE?-1:t.VALUE>e.VALUE?1:t.SCORE<e.SCORE?-1:t.SCORE>e.SCORE?1:0)),t)))}}class A{constructor(t={}){return new w({Level:p.Z,...t})}}var S=r(5606);const T="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,O=new Set,I="object"==typeof S&&S?S:{},_=(t,e,r,n)=>{"function"==typeof I.emitWarning?I.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)};let L=globalThis.AbortController,x=globalThis.AbortSignal;if(void 0===L){x=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},L=class{constructor(){e()}signal=new x;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==I.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,_("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const U=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),R=t=>U(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?k:null:null;class k extends Array{constructor(t){super(t),this.fill(0)}}class N{heap;length;static#r=!1;static create(t){const e=R(t);if(!e)return[];N.#r=!0;const r=new N(t,e);return N.#r=!1,r}constructor(t,e){if(!N.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class C{#n;#i;#o;#s;#a;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#h;#f;#p;#y;#d;#g;#m;#v;#b;#E;#w;#A;#S;#T;#O;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#A,sizes:t.#E,keyMap:t.#h,keyList:t.#f,valList:t.#p,next:t.#y,prev:t.#d,get head(){return t.#g},get tail(){return t.#m},free:t.#v,isBackgroundFetch:e=>t.#I(e),backgroundFetch:(e,r,n,i)=>t.#_(e,r,n,i),moveToTail:e=>t.#L(e),indexes:e=>t.#x(e),rindexes:e=>t.#U(e),isStale:e=>t.#R(e)}}get max(){return this.#n}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#c}get dispose(){return this.#o}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:l,noUpdateTTL:h,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:y,fetchMethod:d,memoMethod:g,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=t;if(0!==e&&!U(e))throw new TypeError("max option must be a nonnegative integer");const A=e?R(e):Array;if(!A)throw new Error("invalid max value: "+e);if(this.#n=e,this.#i=f,this.maxEntrySize=p||this.#i,this.sizeCalculation=y,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("memoMethod must be a function if defined");if(this.#c=g,void 0!==d&&"function"!=typeof d)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=d,this.#T=!!d,this.#h=new Map,this.#f=new Array(e).fill(void 0),this.#p=new Array(e).fill(void 0),this.#y=new A(e),this.#d=new A(e),this.#g=0,this.#m=0,this.#v=N.create(e),this.#u=0,this.#l=0,"function"==typeof c&&(this.#o=c),"function"==typeof u?(this.#s=u,this.#b=[]):(this.#s=void 0,this.#b=void 0),this.#S=!!this.#o,this.#O=!!this.#s,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!U(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!U(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=U(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!U(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(0===this.#n&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!O.has(t))(t)&&(O.add(t),_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,C))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#N(){const t=new k(this.#n),e=new k(this.#n);this.#A=t,this.#w=e,this.#C=(r,n,i=T.now())=>{if(e[r]=0!==n?i:0,t[r]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.#R(r)&&this.#D(this.#f[r],"expire")}),n+1);t.unref&&t.unref()}},this.#B=r=>{e[r]=0!==t[r]?T.now():0},this.#F=(i,o)=>{if(t[o]){const s=t[o],a=e[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const t=T.now();if(this.ttlResolution>0){r=t;const e=setTimeout((()=>r=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const o=this.#h.get(i);if(void 0===o)return 0;const s=t[o],a=e[o];return s&&a?s-((r||n())-a):1/0},this.#R=i=>{const o=e[i],s=t[i];return!!s&&!!o&&(r||n())-o>s}}#B=()=>{};#F=()=>{};#C=()=>{};#R=()=>!1;#k(){const t=new k(this.#n);this.#l=0,this.#E=t,this.#j=e=>{this.#l-=t[e],t[e]=0},this.#P=(t,e,r,n)=>{if(this.#I(e))return 0;if(!U(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!U(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#M=(e,r,n)=>{if(t[e]=r,this.#i){const r=this.#i-t[e];for(;this.#l>r;)this.#V(!0)}this.#l+=t[e],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#j=t=>{};#M=(t,e,r)=>{};#P=(t,e,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#m;this.#$(e)&&(!t&&this.#R(e)||(yield e),e!==this.#g);)e=this.#d[e]}*#U({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#g;this.#$(e)&&(!t&&this.#R(e)||(yield e),e!==this.#m);)e=this.#y[e]}#$(t){return void 0!==t&&this.#h.get(this.#f[t])===t}*entries(){for(const t of this.#x())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*rentries(){for(const t of this.#U())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*keys(){for(const t of this.#x()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*rkeys(){for(const t of this.#U()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*values(){for(const t of this.#x())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}*rvalues(){for(const t of this.#U())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0!==i&&t(i,this.#f[r],this))return this.get(this.#f[r],e)}}forEach(t,e=this){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}rforEach(t,e=this){for(const r of this.#U()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}purgeStale(){let t=!1;for(const e of this.#U({allowStale:!0}))this.#R(e)&&(this.#D(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const r=this.#p[e],n=this.#I(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#A&&this.#w){const t=this.#A[e],r=this.#w[e];if(t&&r){const e=t-(T.now()-r);i.ttl=e,i.start=Date.now()}}return this.#E&&(i.size=this.#E[e]),i}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const r=this.#f[e],n=this.#p[e],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#A&&this.#w){o.ttl=this.#A[e];const t=T.now()-this.#w[e];o.start=Math.floor(Date.now()-t)}this.#E&&(o.size=this.#E[e]),t.unshift([r,o])}return t}load(t){this.clear();for(const[e,r]of t){if(r.start){const t=Date.now()-r.start;r.start=T.now()-t}this.set(e,r.value,r)}}set(t,e,r={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#P(t,e,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#D(t,"set"),this;let l=0===this.#u?void 0:this.#h.get(t);if(void 0===l)l=0===this.#u?this.#m:0!==this.#v.length?this.#v.pop():this.#u===this.#n?this.#V(!1):this.#u,this.#f[l]=t,this.#p[l]=e,this.#h.set(t,l),this.#y[this.#m]=l,this.#d[l]=this.#m,this.#m=l,this.#u++,this.#M(l,u,a),a&&(a.set="add"),c=!1;else{this.#L(l);const r=this.#p[l];if(e!==r){if(this.#T&&this.#I(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=r;void 0===e||o||(this.#S&&this.#o?.(e,t,"set"),this.#O&&this.#b?.push([e,t,"set"]))}else o||(this.#S&&this.#o?.(r,t,"set"),this.#O&&this.#b?.push([r,t,"set"]));if(this.#j(l),this.#M(l,u,a),this.#p[l]=e,a){a.set="replace";const t=r&&this.#I(r)?r.__staleWhileFetching:r;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#A||this.#N(),this.#A&&(c||this.#C(l,n,i),a&&this.#F(a,l)),!o&&this.#O&&this.#b){const t=this.#b;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#u;){const t=this.#p[this.#g];if(this.#V(!0),this.#I(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#b){const t=this.#b;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#V(t){const e=this.#g,r=this.#f[e],n=this.#p[e];return this.#T&&this.#I(n)?n.__abortController.abort(new Error("evicted")):(this.#S||this.#O)&&(this.#S&&this.#o?.(n,r,"evict"),this.#O&&this.#b?.push([n,r,"evict"])),this.#j(e),t&&(this.#f[e]=void 0,this.#p[e]=void 0,this.#v.push(e)),1===this.#u?(this.#g=this.#m=0,this.#v.length=0):this.#g=this.#y[e],this.#h.delete(r),this.#u--,e}has(t,e={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=e,i=this.#h.get(t);if(void 0!==i){const t=this.#p[i];if(this.#I(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#R(i))return r&&this.#B(i),n&&(n.has="hit",this.#F(n,i)),!0;n&&(n.has="stale",this.#F(n,i))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:r=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!r&&this.#R(n))return;const i=this.#p[n];return this.#I(i)?i.__staleWhileFetching:i}#_(t,e,r,n){const i=void 0===e?void 0:this.#p[e];if(this.#I(i))return i;const o=new L,{signal:s}=r;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!i)return u(o.signal.reason);const h=l;return this.#p[e]===l&&(void 0===n?h.__staleWhileFetching?this.#p[e]=h.__staleWhileFetching:this.#D(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,u=l;if(this.#p[e]===l&&(c&&void 0!==u.__staleWhileFetching?s||(this.#p[e]=u.__staleWhileFetching):this.#D(t,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const l=new Promise(((e,n)=>{const s=this.#a?.(t,i,a);s&&s instanceof Promise&&s.then((t=>e(void 0===t?void 0:t)),n),o.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),u(t)))),h=Object.assign(l,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,h,{...a.options,status:void 0}),e=this.#h.get(t)):this.#p[e]=h,h}#I(t){if(!this.#T)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof L}async fetch(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:y,forceRefresh:d=!1,status:g,signal:m}=e;if(!this.#T)return g&&(g.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const v={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:m};let b=this.#h.get(t);if(void 0===b){g&&(g.fetch="miss");const e=this.#_(t,b,v,y);return e.__returned=e}{const e=this.#p[b];if(this.#I(e)){const t=r&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#R(b);if(!d&&!i)return g&&(g.fetch="hit"),this.#L(b),n&&this.#B(b),g&&this.#F(g,b),e;const o=this.#_(t,b,v,y),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const r=await this.fetch(t,e);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(t,e={}){const r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=e,s=this.get(t,o);if(!i&&void 0!==s)return s;const a=r(t,s,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,s=this.#h.get(t);if(void 0!==s){const e=this.#p[s],a=this.#I(e);return o&&this.#F(o,s),this.#R(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),r?e.__staleWhileFetching:void 0):(i||this.#D(t,"expire"),o&&r&&(o.returnedStale=!0),r?e:void 0)):(o&&(o.get="hit"),a?e.__staleWhileFetching:(this.#L(s),n&&this.#B(s),e))}o&&(o.get="miss")}#z(t,e){this.#d[e]=t,this.#y[t]=e}#L(t){t!==this.#m&&(t===this.#g?this.#g=this.#y[t]:this.#z(this.#d[t],this.#y[t]),this.#z(this.#m,t),this.#m=t)}delete(t){return this.#D(t,"delete")}#D(t,e){let r=!1;if(0!==this.#u){const n=this.#h.get(t);if(void 0!==n)if(r=!0,1===this.#u)this.#G(e);else{this.#j(n);const r=this.#p[n];if(this.#I(r)?r.__abortController.abort(new Error("deleted")):(this.#S||this.#O)&&(this.#S&&this.#o?.(r,t,e),this.#O&&this.#b?.push([r,t,e])),this.#h.delete(t),this.#f[n]=void 0,this.#p[n]=void 0,n===this.#m)this.#m=this.#d[n];else if(n===this.#g)this.#g=this.#y[n];else{const t=this.#d[n];this.#y[t]=this.#y[n];const e=this.#y[n];this.#d[e]=this.#d[n]}this.#u--,this.#v.push(n)}}if(this.#O&&this.#b?.length){const t=this.#b;let e;for(;e=t?.shift();)this.#s?.(...e)}return r}clear(){return this.#G("delete")}#G(t){for(const e of this.#U({allowStale:!0})){const r=this.#p[e];if(this.#I(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#f[e];this.#S&&this.#o?.(r,n,t),this.#O&&this.#b?.push([r,n,t])}}if(this.#h.clear(),this.#p.fill(void 0),this.#f.fill(void 0),this.#A&&this.#w&&(this.#A.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#g=0,this.#m=0,this.#v.length=0,this.#l=0,this.#u=0,this.#O&&this.#b){const t=this.#b;let e;for(;e=t?.shift();)this.#s?.(...e)}}}class D{#W;#K;#H;constructor(t,e,r){this.#K=t.docExistsSpace,this.#H=r,this.#W=e}#q=(t,e={})=>{const r=t=>"string"==typeof t||"number"==typeof t?this.#H.GET(t,e.PIPELINE):t.FIELD||t.VALUE?this.#H.GET(t):t.AND?this.#H.AND(t.AND.map(r),e.PIPELINE):t.GET?this.#H.GET(t.GET,e.PIPELINE):t.NOT?this.#H.NOT(r(t.NOT.INCLUDE),r(t.NOT.EXCLUDE)):t.OR?this.#H.OR(t.OR.map(r),e.PIPELINE):t.ALL_DOCUMENTS?this.ALL_DOCUMENTS(t.ALL_DOCUMENTS):void 0;return r(t).then((r=>r.RESULT?Object.assign(r,{QUERY:{q:t,options:e},RESULT_LENGTH:r.RESULT.length}):{QUERY:t,OPTIONS:e,RESULT_LENGTH:r.length,RESULT:r})).then((t=>e.BUCKETS?this.#H.BUCKETS(...e.BUCKETS).then((e=>Object.assign(t,{BUCKETS:this.#H.AGGREGATION_FILTER(e,t.RESULT,!1)}))):t)).then((r=>e.FACETS?r.RESULT.length?t.ALL_DOCUMENTS?this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:t}))):this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:this.#H.AGGREGATION_FILTER(t,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>e.WEIGHT?Object.assign({RESULT:this.WEIGHT(t.RESULT,e.WEIGHT)},t):t)).then((t=>e.SCORE?this.SCORE(t.RESULT,e.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,e.SORT?{RESULT:this.SORT(t.RESULT,e.SORT)}:{}))).then((t=>{let r;return Object.assign(t,{RESULT:this.PAGE(t.RESULT,e.PAGE,(t=>{r=t}))},{PAGING:r})})).then((t=>e.DOCUMENTS?this.DOCUMENTS(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))};#Y=(t,e={})=>this.DISTINCT(t).then((t=>({RESULT:Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))),OPTIONS:e})));#J=(...t)=>t.length?Promise.all(t.map((t=>this.#H.STORE.get([this.#K,t]).catch((t=>null))))):this.ALL_DOCUMENTS();#X=(t,e)=>this.#q({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e));ALL_DOCUMENTS=t=>this.#H.STORE.iterator({gte:[this.#K,null],lte:[this.#K,void 0],limit:t}).all().then((t=>t.map((([t,e])=>({_id:e._id,_doc:e})))));cachePipeline=(t,e,...r)=>{const n=JSON.stringify({funcLabel:e,params:r});return this.#W.has(n)?Promise.resolve(this.#W.get(n)):t(...r).then((t=>(this.#W.set(n,t),t)))};DICTIONARY=(t,e)=>this.cachePipeline(this.#Y,"#DICTIONARY",t,e);DISTINCT=(...t)=>this.#H.DISTINCT(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));DOCUMENTS=(...t)=>this.cachePipeline(this.#J,"#DOCUMENTS",...t);DOCUMENT_COUNT=()=>this.#H.STORE.get(["DOCUMENT_COUNT"]).then(((t=0)=>t));DOCUMENT_VECTORS=(...t)=>Promise.all(t.map((t=>this.#H.STORE.get(["DOC",t]).catch((t=>null)))));FACETS=(...t)=>this.#H.FACETS(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));PAGE=(t,e={},r=()=>null)=>((e={NUMBER:0,SIZE:20,...e}).TOTAL=Math.ceil(t.length/e.SIZE),e.DOC_OFFSET=e.NUMBER*e.SIZE,r(e),t.slice(e.DOC_OFFSET,e.DOC_OFFSET+e.SIZE||void 0));QUERY=(t,e)=>this.cachePipeline(this.#q,"#parseJsonQuery",t,e);SCORE=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),n=t=>(t||[]).filter(r);return new Promise((i=>i("TFIDF"===e.TYPE?this.DOCUMENT_COUNT().then((e=>t.map(((t,n,i)=>{const o=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(r).reduce(((t,e)=>t+o*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))};SEARCH=(t,e)=>this.cachePipeline(this.#X,"#SEARCH",t,e);SORT=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._id<e._id?-1:t._id>e._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._score<e._score?1:t._score>e._score?-1:0,ASCENDING:(t,e)=>t._score<e._score?-1:t._score>e._score?1:0}}[e.TYPE][e.DIRECTION]));WEIGHT=(t,e)=>t.map((t=>(t._match=t._match.map((t=>(e.forEach((e=>{let r=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(r=!0):e.FIELD?e.FIELD===t.FIELD&&(r=!0):e.VALUE&&e.VALUE===t.VALUE&&(r=!0),r&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t)))}var B=r(228);class F extends Error{constructor(t){super(t),this.name="TimeoutError"}}class j extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const P=t=>void 0===globalThis.DOMException?new j(t):new DOMException(t),M=t=>{const e=void 0===t.reason?P("This operation was aborted."):t.reason;return e instanceof Error?e:P(e)};class V{#Q=[];enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,id:e.id,run:t};if(0===this.size||this.#Q[this.size-1].priority>=e.priority)return void this.#Q.push(r);const n=function(t,e){let r=0,n=t.length;for(;n>0;){const o=Math.trunc(n/2);let s=r+o;i=t[s],e.priority-i.priority<=0?(r=++s,n-=o+1):n=o}var i;return r}(this.#Q,r);this.#Q.splice(n,0,r)}setPriority(t,e){const r=this.#Q.findIndex((e=>e.id===t));if(-1===r)throw new ReferenceError(`No promise function with the id "${t}" exists in the queue.`);const[n]=this.#Q.splice(r,1);this.enqueue(n.run,{priority:e,id:t})}dequeue(){const t=this.#Q.shift();return t?.run}filter(t){return this.#Q.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this.#Q.length}}class $ extends B{#Z;#tt;#et=0;#rt;#nt;#it=0;#ot;#st;#Q;#at;#ct=0;#ut;#lt;#ht;#ft=1n;timeout;constructor(t){if(super(),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:V,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#Z=t.carryoverConcurrencyCount,this.#tt=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this.#rt=t.intervalCap,this.#nt=t.interval,this.#Q=new t.queueClass,this.#at=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#ht=!0===t.throwOnTimeout,this.#lt=!1===t.autoStart}get#pt(){return this.#tt||this.#et<this.#rt}get#yt(){return this.#ct<this.#ut}#y(){this.#ct--,this.#dt(),this.emit("next")}#gt(){this.#mt(),this.#vt(),this.#st=void 0}get#bt(){const t=Date.now();if(void 0===this.#ot){const e=this.#it-t;if(!(e<0))return void 0===this.#st&&(this.#st=setTimeout((()=>{this.#gt()}),e)),!0;this.#et=this.#Z?this.#ct:0}return!1}#dt(){if(0===this.#Q.size)return this.#ot&&clearInterval(this.#ot),this.#ot=void 0,this.emit("empty"),0===this.#ct&&this.emit("idle"),!1;if(!this.#lt){const t=!this.#bt;if(this.#pt&&this.#yt){const e=this.#Q.dequeue();return!!e&&(this.emit("active"),e(),t&&this.#vt(),!0)}}return!1}#vt(){this.#tt||void 0!==this.#ot||(this.#ot=setInterval((()=>{this.#mt()}),this.#nt),this.#it=Date.now()+this.#nt)}#mt(){0===this.#et&&0===this.#ct&&this.#ot&&(clearInterval(this.#ot),this.#ot=void 0),this.#et=this.#Z?this.#ct:0,this.#Et()}#Et(){for(;this.#dt(););}get concurrency(){return this.#ut}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#ut=t,this.#Et()}async#wt(t){return new Promise(((e,r)=>{t.addEventListener("abort",(()=>{r(t.reason)}),{once:!0})}))}setPriority(t,e){this.#Q.setPriority(t,e)}async add(t,e={}){return e.id??=(this.#ft++).toString(),e={timeout:this.timeout,throwOnTimeout:this.#ht,...e},new Promise(((r,n)=>{this.#Q.enqueue((async()=>{this.#ct++,this.#et++;try{e.signal?.throwIfAborted();let n=t({signal:e.signal});e.timeout&&(n=function(t,e){const{milliseconds:r,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e;let s,a;const c=new Promise(((c,u)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){const{signal:t}=e;t.aborted&&u(M(t)),a=()=>{u(M(t))},t.addEventListener("abort",a,{once:!0})}if(r===Number.POSITIVE_INFINITY)return void t.then(c,u);const l=new F;s=o.setTimeout.call(void 0,(()=>{if(n)try{c(n())}catch(t){u(t)}else"function"==typeof t.cancel&&t.cancel(),!1===i?c():i instanceof Error?u(i):(l.message=i??`Promise timed out after ${r} milliseconds`,u(l))}),r),(async()=>{try{c(await t)}catch(t){u(t)}})()})).finally((()=>{c.clear(),a&&e.signal&&e.signal.removeEventListener("abort",a)}));return c.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},c}(Promise.resolve(n),{milliseconds:e.timeout})),e.signal&&(n=Promise.race([n,this.#wt(e.signal)]));const i=await n;r(i),this.emit("completed",i)}catch(t){if(t instanceof F&&!e.throwOnTimeout)return void r();n(t),this.emit("error",t)}finally{this.#y()}}),e),this.emit("add"),this.#dt()}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this.#lt?(this.#lt=!1,this.#Et(),this):this}pause(){this.#lt=!0}clear(){this.#Q=new this.#at}async onEmpty(){0!==this.#Q.size&&await this.#At("empty")}async onSizeLessThan(t){this.#Q.size<t||await this.#At("next",(()=>this.#Q.size<t))}async onIdle(){0===this.#ct&&0===this.#Q.size||await this.#At("idle")}async#At(t,e){return new Promise((r=>{const n=()=>{e&&!e()||(this.off(t,n),r())};this.on(t,n)}))}get size(){return this.#Q.size}sizeBy(t){return this.#Q.filter(t).length}get pending(){return this.#ct}get isPaused(){return this.#lt}}class z{#W;#H;#St;#Q;constructor(t,e,r){this.#W=e,this.#H=r,this.#St=t,this.#Q=new $({concurrency:1}),this.#Tt(0)}#Tt=(t=0)=>this.#H.STORE.get(["DOCUMENT_COUNT"]).then(((e=0)=>this.#H.STORE.put(["DOCUMENT_COUNT"],+e+ +t)));#Ot=(t,e)=>{this.#W.clear();const r={...this.#St,...e};return((t,e)=>{const r=t=>"string"==typeof t||t instanceof String,n=(t,i)=>new Promise((async o=>{return null===t?o([null,"1.00"]):(s=t)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o([[],"1.00"]):Number.isInteger(t)?o([t,t]):r(t)?o(e.tokenizer(t,i,e)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(t)?o((a=t,new Promise((async t=>{const r={};for(const t in a)r[t]=await n(a[t],t,e);return t(r)})))):(t=>Array.isArray(t))(t)?o((c=t,Promise.all(c.map(n)))):o(t);var s,a,c}));return Promise.all(t.map((async t=>new Promise((async i=>{r(t)&&(t={body:t}),Object.prototype.hasOwnProperty.call(t,"_id")||(t._id=e.idGenerator.next().value);const o={};for(const e in t)o[e]="_id"!==e?await n(t[e],e):t[e];return i(o)})))))})(t,r).then((t=>this.#H.PUT(t,e))).then((e=>this.PUT_RAW(t,e.map((t=>t._id)),!r.storeRawDocs).then((()=>this.#Tt(e.filter((t=>"CREATED"===t.status)).length))).then((()=>e))))};#It=t=>this.#H.DELETE(t).then((e=>this.DELETE_RAW(...t).then((()=>this.#Tt(-e.filter((t=>"DELETED"===t.status)).length))).then((()=>this.#W.clear())).then((()=>e))));DELETE=(...t)=>this.#It(t);DELETE_RAW=(...t)=>Promise.all(t.map((t=>this.#H.STORE.del([this.#St.docExistsSpace,t]))));FLUSH=()=>this.#H.STORE.clear().then((()=>{this.#W.clear();const t=(new Date).toISOString();return this.#H.STORE.batch([{type:"put",key:["~CREATED"],value:t},{type:"put",key:["~LAST_UPDATED"],value:t},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0));IMPORT=t=>(this.#W.clear(),Promise.resolve(this.#H.IMPORT(t)));PUT=(t,e)=>this.#Q.add((()=>this.#Ot(t,e)));PUT_RAW=(t,e,r)=>Promise.all(t.map(((t,n)=>this.#H.STORE.put([this.#St.docExistsSpace,e[n]],r?{}:t)))).then((r=>(this.#W.clear(),t.map(((t,r)=>({_id:e[r],status:"OK",operation:"_PUT_RAW"}))))))}class G{constructor(t={}){t={cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],name:"index",ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:f,...t},this.INDEX=new A({...t,isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t))}),this.EVENTS=this.INDEX.EVENTS,this._CACHE=new C({max:t.cacheLength}),this.r=new D(t,this._CACHE,this.INDEX),this.w=new z(t,this._CACHE,this.INDEX),(t=>{const e=["CREATED_WITH"];t.STORE.get(e).then((r=>{const n="search-index@6.0.1";return void 0===r?t.STORE.put(e,n):n!==r?new Error("This index was created with "+r+", you are running "+n):void 0}))})(this.INDEX)}ALL_DOCUMENTS=t=>this.r.ALL_DOCUMENTS(t);BUCKETS=(...t)=>this.INDEX.BUCKETS(...t);CREATED=()=>this.INDEX.CREATED();DELETE=(...t)=>this.w.DELETE(...t);DELETE_RAW=(...t)=>this.w.DELETE_RAW(...t);DICTIONARY=(t,e)=>this.r.DICTIONARY(t,e);DISTINCT=(...t)=>this.r.DISTINCT(...t);DOCUMENTS=(...t)=>this.r.DOCUMENTS(...t);DOCUMENT_COUNT=()=>this.r.DOCUMENT_COUNT();DOCUMENT_VECTORS=(...t)=>this.r.DOCUMENT_VECTORS(...t);EXPORT=()=>this.INDEX.EXPORT();FACETS=(...t)=>this.r.FACETS(...t);FIELDS=()=>this.INDEX.FIELDS();FLUSH=()=>this.w.FLUSH();IMPORT=t=>this.w.IMPORT(t);LAST_UPDATED=()=>this.INDEX.LAST_UPDATED();MAX=t=>this.INDEX.MAX(t);MIN=t=>this.INDEX.MIN(t);PUT=(t,e)=>this.w.PUT(t,e);PUT_RAW=(t,e,r)=>this.w.PUT_RAW(t,e,r);QUERY=(t,e)=>this.r.QUERY(t,e);SEARCH=(t,e)=>this.r.SEARCH(t,e);TOKENIZATION_PIPELINE_STAGES=h;_AND=(t,e)=>this.INDEX.AND(t,e);_BUCKET=t=>this.INDEX.BUCKET(t);_GET=(t,e)=>this.INDEX.GET(t,e);_NOT=(t,e)=>this.INDEX.NOT(t,e);_OR=(t,e)=>this.INDEX.OR(t,e);_PAGE=(t,e)=>this.r.PAGE(t,e);_SORT=(t,e)=>this.r.SORT(t,e)}class W{constructor({template:t=t=>`${t} hits`,elementId:e="count"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=this.template(t)}class K{constructor({template:t=t=>`<p>${JSON.stringify(t)}</p>`,elementId:e="hits"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=t.map((({_doc:t})=>this.template(t))).join("\n")}class H{constructor({pageLinkTemplate:t=(t,e,r)=>`\n <li class="page-item ${e===r?"active":""}">\n <a class="page-link" data-page=${e} href="#">\n ${t}\n </a>\n </li>`,navLinkTemplate:e=(t,e,r)=>`\n <li class="page-item ${r?"disabled":""}">\n <a class="page-link" data-page=${e} href="#">\n ${t}\n </a>\n </li>`,elementId:r="paging"},n){this.pageLinkTemplate=t,this.navLinkTemplate=e,this.el=document.getElementById(r),this.search=n,this.page={NUMBER:0,SIZE:10}}template=t=>{let e=0,r=t.TOTAL;return t.TOTAL>7&&(e=t.NUMBER>3?t.NUMBER-3:0,r=7+e),r>t.TOTAL&&(e=t.TOTAL-6-1,r=t.TOTAL),`\n <ul class="pagination">\n ${this.navLinkTemplate("First",0,0===t.NUMBER)}\n ${this.navLinkTemplate("‹",t.NUMBER-1,0===t.NUMBER)}\n ${(()=>{let n="";for(let i=e;i<r;i++)n+=this.pageLinkTemplate(i+1,i,t.NUMBER);return n})()}\n ${this.navLinkTemplate("›",t.NUMBER+1,t.NUMBER>=t.TOTAL-1)}\n ${this.navLinkTemplate("Last",t.TOTAL-1,t.NUMBER>=t.TOTAL-1)}\n </ul>`};update=t=>{if(console.log(t),t.TOTAL<=1)return void(this.el.innerHTML="");this.el.innerHTML=this.template(t);const e=document.getElementsByClassName("page-link");for(let t=0;t<e.length;t++)e[t].addEventListener("mousedown",(t=>{console.log("AYO!"),console.log(this.search()),this.page.NUMBER=+t.target.attributes["data-page"].value,this.search()}))}}class q{constructor({elementId:t="",facetOptionTemplate:e=(t,e)=>`\n <input class="filter-select"\n id=${t.FIELD+":"+t.VALUE}\n name=${t.FIELD+":"+t.VALUE}\n type="checkbox"\n data-field=${t.FIELD}\n data-value=${t.VALUE}\n ${e?"checked":""}>\n <label for=${t.FIELD+":"+t.VALUE}>${t.VALUE} (${t._id.length})</label>\n <br>`,field:r=null,mode:n="OR",sort:i=(t,e)=>{t.VALUE.localeCompare(e.VALUE)},title:o="<p>"+r.toUpperCase()+"</p>"},s){this.activeFilters=[],this.el=document.getElementById(t),this.elementId=t,this.facetOptionTemplate=e,this.field=r,this.mode=n,this.search=s,this.sort=i,this.title=o}getActiveFilters=()=>this.activeFilters.length?[{[this.mode]:this.activeFilters}]:[];update=(t,e)=>{if("facet"===e&&"OR"===this.mode)return;const r=t.filter((t=>t.FIELD===this.field));this.el.innerHTML=r.length?this.title+r.sort(this.sort).reduce(((t,e)=>t+this.facetOptionTemplate(e,this.activeFilters.includes(e.FIELD+":"+e.VALUE))),""):"",this.activeFilters.forEach((t=>{if(!document.getElementById(t)){const[e,r]=t.split(":");this.el.innerHTML+=this.facetOptionTemplate({FIELD:e,VALUE:r,_id:[]},!0)}}));for(const t of document.querySelectorAll("#"+this.elementId+" > .filter-select"))t.addEventListener("input",(t=>{console.log(this.elementId),console.log(this.mode);const e=t.target.attributes["data-field"].value+":"+t.target.attributes["data-value"].value;t.target.checked?this.activeFilters.push(e):this.activeFilters=this.activeFilters.filter((t=>t!==e)),this.search("facet")}))}}class Y{constructor(t,e,r={}){this.autoCompleteFunction=r.autoCompleteFunction,this.currentFocus=-1,this.searchboxEl=t,this.search=e,this.limit=r.limit||20,this.threshold=r.threshold||2,this.autocompleteListId=t.id+"-autocomplete-list",this.suggestionsElementId=r.elementId,t.addEventListener("input",this.searchBoxInputListener),t.addEventListener("keydown",this.searchBoxKeydownListener),document.addEventListener("click",(t=>{this.closeAllLists(t.target)}))}closeAllLists=t=>{for(const e of document.getElementsByClassName("autocomplete-items"))t!==e&&t!==this.searchboxEl&&e.parentNode.removeChild(e)};searchBoxKeydownListener=t=>{let e=document.getElementById(this.autocompleteListId);e&&(e=e.getElementsByTagName("div")),40===t.keyCode?(this.currentFocus++,this.addActive(e)):38===t.keyCode?(this.currentFocus--,this.addActive(e)):13===t.keyCode||9===t.keyCode?(t.preventDefault(),this.currentFocus>-1?e&&e[this.currentFocus].click():this.closeAllLists()):27===t.keyCode&&this.closeAllLists()};searchBoxInputListener=async t=>{const e=(await this.autoCompleteFunction(t.target.value)).slice(0,this.limit);let r;const n=t.target.value;if(this.closeAllLists(),!n)return!1;if(n.length<this.threshold)return!1;this.currentFocus=-1;const i=document.createElement("DIV");i.setAttribute("id",this.autocompleteListId),i.setAttribute("class","autocomplete-items"),i.setAttribute("style","position: absolute; background-color:cyan;"),document.getElementById(this.suggestionsElementId).appendChild(i),e.forEach((t=>{r=document.createElement("DIV"),r.innerHTML="<strong>"+t.substr(0,n.length)+"</strong>",r.innerHTML+=t.substr(n.length),r.innerHTML+="<input type='hidden' value='"+t+"'>",r.addEventListener("click",(t=>{this.searchboxEl.value=t.target.getElementsByTagName("input")[0].value,this.closeAllLists(),this.search()})),i.appendChild(r)}))};addActive=t=>{if(!t)return!1;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1),t[this.currentFocus].classList.add("autocomplete-active")};removeActive=t=>{for(let e=0;e<t.length;e++)t[e].classList.remove("autocomplete-active")}}class J{constructor({elementId:t="searchInput",suggestions:e={}},r,n){this.el=document.getElementById(t),this.el.addEventListener("input",(t=>{n.page.NUMBER=0,r("searchInput")})),this.autocomplete=new Y(this.el,r,e)}}class X{constructor({index:t=null,count:e={},hits:r={},facets:n=[],searchInput:i={},paging:o={},suggestions:s={}}){this.index=t,this.count=new W(e),this.paging=new H(o,this.search),this.hits=new K(r),this.searchInput=new J({...i,suggestions:{autoCompleteFunction:this.index.DICTIONARY,...i.suggestions}},this.search,this.paging),this.facets=n.map((t=>new q(t,this.search))),this.search()}queryOptions=()=>({FACETS:this.facets.map((t=>({FIELD:t.field}))),DOCUMENTS:!0,PAGE:this.paging.page});emptySearchQuery=()=>[{ALL_DOCUMENTS:!0},this.queryOptions()];searchQuery=()=>[[...this.searchInput.el.value.split(/\s+/).filter((t=>t)),...this.facets.map((t=>t.getActiveFilters())).flat(1/0)],this.queryOptions()];search=t=>(this.searchInput.el.value.length+this.facets.map((t=>t.getActiveFilters())).flat(1/0).length?this.index.SEARCH(...this.searchQuery()):this.index.QUERY(...this.emptySearchQuery())).then((e=>{this.hits.update(e.RESULT),this.count.update(e.RESULT_LENGTH),this.facets.forEach((r=>r.update(e.FACETS,t))),this.paging.update(e.PAGING)}))}class Q{constructor(t={}){return new G({Level:p.Z,...t})}}class Z{constructor(t={}){return new X(t)}}})(),SearchIndex=n})();