From 430c5168247f3ce49cc811510a8dd7b6ee943d3b Mon Sep 17 00:00:00 2001 From: Moe Jangda Date: Wed, 6 Jul 2022 13:15:36 -0500 Subject: [PATCH 1/3] handle deprecation warning: `[LRU_CACHE_METHOD_reset] DeprecationWarning: The reset method is deprecated. Please use cache.clear() instead.` --- src/write.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/write.js b/src/write.js index d2730a4d..7692e69e 100755 --- a/src/write.js +++ b/src/write.js @@ -15,7 +15,7 @@ module.exports = (ops, cache, queue) => { ) const _PUT = (docs, putOptions) => { - cache.reset() + cache.clear() putOptions = Object.assign(ops, putOptions) @@ -36,7 +36,7 @@ module.exports = (ops, cache, queue) => { } const _PUT_RAW = (docs, ids, dontStoreValue) => { - cache.reset() + cache.clear() return Promise.all( docs.map((doc, i) => ops.fii.STORE.put(['DOC_RAW', ids[i]], dontStoreValue ? {} : doc) @@ -54,7 +54,7 @@ module.exports = (ops, cache, queue) => { const _DELETE = _ids => ops.fii.DELETE(_ids).then(result => { - cache.reset() + cache.clear() const deleted = result.filter(d => d.status === 'DELETED') return Promise.all([ Promise.all(deleted.map(r => ops.fii.STORE.del(['DOC_RAW', r._id]))), @@ -65,7 +65,7 @@ module.exports = (ops, cache, queue) => { const _FLUSH = () => ops.fii.STORE.clear() .then(() => { - cache.reset() + cache.clear() const timestamp = Date.now() return ops.fii.STORE.batch([ { type: 'put', key: ['~CREATED'], value: timestamp }, @@ -80,7 +80,7 @@ module.exports = (ops, cache, queue) => { FLUSH: _FLUSH, // TODO: IMPORT needs a test IMPORT: index => { - cache.reset() + cache.clear() return Promise.resolve(ops.fii.IMPORT(index)) }, PUT: (docs, pops) => queue.add(() => _PUT(docs, pops)), From 09838bdce85dff4a2babd164928ed258eb7809cd Mon Sep 17 00:00:00 2001 From: Moe Jangda Date: Wed, 6 Jul 2022 13:16:40 -0500 Subject: [PATCH 2/3] 3.1.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7478590..98f052b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "search-index", - "version": "3.1.2", + "version": "3.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "search-index", - "version": "3.1.2", + "version": "3.1.3", "license": "MIT", "dependencies": { "fergies-inverted-index": "10.0.6", diff --git a/package.json b/package.json index 35b19eb7..848a9683 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "search-index", - "version": "3.1.2", + "version": "3.1.3", "description": "A network resilient, persistent full-text search library for the browser and Node.js", "keywords": [ "search", From 075bbd030e3b8295ebc7d6bc4b8faae3d69bb1c0 Mon Sep 17 00:00:00 2001 From: Moe Jangda Date: Wed, 6 Jul 2022 13:17:28 -0500 Subject: [PATCH 3/3] rebuild bundles --- dist/{search-index-3.1.2.js => search-index-3.1.3.js} | 4 ++-- ...3.1.2.js.LICENSE.txt => search-index-3.1.3.js.LICENSE.txt} | 0 dist/{search-index-esm-3.1.2.js => search-index-esm-3.1.3.js} | 4 ++-- ...2.js.LICENSE.txt => search-index-esm-3.1.3.js.LICENSE.txt} | 0 dist/search-index.js | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) rename dist/{search-index-3.1.2.js => search-index-3.1.3.js} (99%) rename dist/{search-index-3.1.2.js.LICENSE.txt => search-index-3.1.3.js.LICENSE.txt} (100%) rename dist/{search-index-esm-3.1.2.js => search-index-esm-3.1.3.js} (99%) rename dist/{search-index-esm-3.1.2.js.LICENSE.txt => search-index-esm-3.1.3.js.LICENSE.txt} (100%) diff --git a/dist/search-index-3.1.2.js b/dist/search-index-3.1.3.js similarity index 99% rename from dist/search-index-3.1.2.js rename to dist/search-index-3.1.3.js index 1a30142e..d602978b 100644 --- a/dist/search-index-3.1.2.js +++ b/dist/search-index-3.1.3.js @@ -1,2 +1,2 @@ -/*! For license information please see search-index-3.1.2.js.LICENSE.txt */ -var SearchIndex;(()=>{var t={8508:(t,e,r)=>{"use strict";const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{"use strict";function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{"use strict";const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,f=Object.prototype.hasOwnProperty,l=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!f.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==l.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{"use strict";e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?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,a=o.length;s0)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>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(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(J(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(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 u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(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 l(t){return f(t),a(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:q(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 L(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t>>=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(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}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){V(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 U(t,e,r,n,i){V(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 D(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 N(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||j(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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=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>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r,n,i,o){if(t>r||t3?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 B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(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")}},1924:(t,e,r)=>{"use strict";var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},6957:(t,e,r)=>{"use strict";var n=r(886);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(t,e)=>{function r(t){for(var e="",r=0;r0?"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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function f(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(f,n),f.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},f.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},f.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},f.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])f.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=f},6944:(t,e,r)=>{"use strict";const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],f=Symbol("innerDb"),l=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[f]=t,this[l]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[f][r](...t);const e=a(t,h);return"opening"===this.status?this[l].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[f].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[l].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[f]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[f].status)return e(t||new Error("Database is not open"));const r=this[l];this[l]=[];for(const t of r)t.iterator?t.iterator.setDb(this[f]):this[f][t.method](...t.args);if(this[l].length>0)throw new Error("Did not expect further operations");e()};"new"===this[f].status||"closed"===this[f].status?this[f].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[f].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{"use strict";e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{"use strict";const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function f(t,e){if(!(this instanceof f))return new f(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function l(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=f,s(f,n),f.prototype.type="encoding-down",f.prototype._serializeKey=f.prototype._serializeValue=function(t){return t},f.prototype._open=function(t,e){this.db.open(t,e)},f.prototype._close=function(t){this.db.close(t)},f.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},f.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},f.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},l.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},l.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729: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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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{"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))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){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 l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(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;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,f=d(u,c);for(r=0;r=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=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return i({FIELD:n,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return i({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:e,LTE:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,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(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(t,e)))).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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),f=(t,e)=>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))))]})))):t,l=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:f(t.flat(),r),FACETS:f(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:f,BUCKET:l,BUCKETS:(...t)=>Promise.all(t.map(l)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((f=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>f(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},4029:(t,e,r)=>{"use strict";var n=r(5320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(t,e,r){for(var n=0,i=t.length;n=3&&(o=r),"[object Array]"===i.call(t)?s(t,e,o):"string"==typeof t?a(t,e,o):u(t,e,o)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),f=[],l=0;l{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},f=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=m.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,x=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,A,(function(t,e,r,i){n[n.length]=r?_(i,O,"$1"):e||t})),n},k=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/g,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=x(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),a=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!f&&(y[a]=c)}}return c}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419: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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},5320: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=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,c="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(u)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},8662:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{"use strict";const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{"use strict";const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{"use strict";function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{"use strict";const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{"use strict";t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),f=r(2854),l=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return f(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{"use strict";const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t._nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{"use strict";const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{"use strict";const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{"use strict";function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{"use strict";const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{"use strict";const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),f=r(6957),l=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=f.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=f.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=l(r,n),w(this,n=f.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=l(t,e),t=h(t),w(this,e=f.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{var n=r(4155);const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if("abort"===t){this.aborted=!0;const e={type:t,target:this};this.onabort(e),this._listeners.forEach((t=>t(e)),this)}}onabort(){}addEventListener(t,e){"abort"===t&&this._listeners.push(e)}removeEventListener(t,e){"abort"===t&&(this._listeners=this._listeners.filter((t=>t!==e)))}},c=new Set,f=(t,e)=>{const r=`LRU_CACHE_OPTION_${t}`;p(r)&&d(r,`${t} option`,`options.${e}`,v)},l=(t,e)=>{const r=`LRU_CACHE_METHOD_${t}`;if(p(r)){const{prototype:n}=v,{get:i}=Object.getOwnPropertyDescriptor(n,t);d(r,`${t} method`,`cache.${e}()`,i)}},h=(...t)=>{"object"==typeof n&&n&&"function"==typeof n.emitWarning?n.emitWarning(...t):console.error(...t)},p=t=>!c.has(t),d=(t,e,r,n)=>{c.add(t),h(`The ${e} is deprecated. Please use ${r} instead.`,"DeprecationWarning",t,n)},y=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),g=t=>y(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?b:null:null;class b extends Array{constructor(t){super(t),this.fill(0)}}class m{constructor(t){if(0===t)return[];const e=g(t);this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class v{constructor(t={}){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:b,maxSize:w=0,sizeCalculation:E,fetchMethod:_,fetchContext:S,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:A}=t,{length:O,maxAge:x,stale:k}=t instanceof v?{}:t;if(0!==e&&!y(e))throw new TypeError("max option must be a nonnegative integer");const R=e?g(e):Array;if(!R)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=w,this.sizeCalculation=E||O,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=S,!this.fetchMethod&&void 0!==S)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new R(e),this.prev=new R(e),this.head=0,this.tail=0,this.free=new m(e),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!T,0!==this.maxSize){if(!y(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!k,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=y(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||x||0,this.ttl){if(!y(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const t="LRU_CACHE_UNBOUNDED";p(t)&&(c.add(t),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,v))}k&&f("stale","allowStale"),x&&f("maxAge","ttl"),O&&f("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new b(this.max),this.starts=new b(this.max),this.setItemTTL=(t,e,r=i.now())=>{if(this.starts[t]=0!==e?r:0,this.ttls[t]=e,0!==e&&this.ttlAutopurge){const r=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),e+1);r.unref&&r.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const e=()=>{const e=i.now();if(this.ttlResolution>0){t=e;const r=setTimeout((()=>t=0),this.ttlResolution);r.unref&&r.unref()}return e};this.getRemainingTTL=r=>{const n=this.keyMap.get(r);return void 0===n?0:0===this.ttls[n]||0===this.starts[n]?1/0:this.starts[n]+this.ttls[n]-(t||e())},this.isStale=r=>0!==this.ttls[r]&&0!==this.starts[r]&&(t||e())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,e,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new b(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.requireSize=(t,e,r,n)=>{if(!y(r)){if(!n)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!y(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.addItemSize=(t,e,r,n)=>{this.sizes[t]=n;const i=this.maxSize-this.sizes[t];for(;this.calculatedSize>i;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,e,r,n){}requireSize(t,e,r,n){if(r||n)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.tail;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.head);)e=this.prev[e]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.head;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.tail);)e=this.next[e]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],e)}forEach(t,e=this){for(const r of this.indexes())t.call(e,this.valList[r],this.keyList[r],this)}rforEach(t,e=this){for(const r of this.rindexes())t.call(e,this.valList[r],this.keyList[r],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),t=!0);return t}dump(){const t=[];for(const e of this.indexes({allowStale:!0})){const r=this.keyList[e],n=this.valList[e],o={value:this.isBackgroundFetch(n)?n.__staleWhileFetching:n};if(this.ttls){o.ttl=this.ttls[e];const t=i.now()-this.starts[e];o.start=Math.floor(Date.now()-t)}this.sizes&&(o.size=this.sizes[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=i.now()-t}this.set(e,r.value,r)}}dispose(t,e,r){}set(t,e,{ttl:r=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){o=this.requireSize(t,e,o,s);let u=0===this.size?void 0:this.keyMap.get(t);if(void 0===u)u=this.newIndex(),this.keyList[u]=t,this.valList[u]=e,this.keyMap.set(t,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,e,t,o),a=!1;else{const r=this.valList[u];e!==r&&(this.isBackgroundFetch(r)?r.__abortController.abort():i||(this.dispose(r,t,"set"),this.disposeAfter&&this.disposed.push([r,t,"set"])),this.removeItemSize(u),this.valList[u]=e,this.addItemSize(u,e,t,o)),this.moveToTail(u)}if(0===r||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,r,n),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const e=this.head,r=this.keyList[e],n=this.valList[e];return this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,r,"evict"),this.disposeAfter&&this.disposed.push([n,r,"evict"])),this.removeItemSize(e),t&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(r),this.size--,e}has(t,{updateAgeOnHas:e=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return void 0!==r&&!this.isStale(r)&&(e&&this.updateItemAge(r),!0)}peek(t,{allowStale:e=this.allowStale}={}){const r=this.keyMap.get(t);if(void 0!==r&&(e||!this.isStale(r)))return this.valList[r]}backgroundFetch(t,e,r,n){const i=void 0===e?void 0:this.valList[e];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:r,context:n},u=new Promise((e=>e(this.fetchMethod(t,i,a)))).then((e=>(s.signal.aborted||this.set(t,e,a.options),e)),(n=>{if(this.valList[e]===u&&(r.noDeleteOnFetchRejection&&void 0!==u.__staleWhileFetching?this.valList[e]=u.__staleWhileFetching:this.delete(t)),u.__returned===u)throw n}));return u.__abortController=s,u.__staleWhileFetching=i,u.__returned=null,void 0===e?(this.set(t,u,a.options),e=this.keyMap.get(t)):this.valList[e]=u,u}isBackgroundFetch(t){return t&&"object"==typeof t&&"function"==typeof t.then&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||null===t.__returned)}async fetch(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext}={}){if(!this.fetchMethod)return this.get(t,{allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n});const l={allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:c};let h=this.keyMap.get(t);if(void 0===h){const e=this.backgroundFetch(t,h,l,f);return e.__returned=e}{const n=this.valList[h];if(this.isBackgroundFetch(n))return e&&void 0!==n.__staleWhileFetching?n.__staleWhileFetching:n.__returned=n;if(!this.isStale(h))return this.moveToTail(h),r&&this.updateItemAge(h),n;const i=this.backgroundFetch(t,h,l,f);return e&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(t);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?e?o.__staleWhileFetching:void 0:(n||this.delete(t),e?o:void 0);if(s)return;return this.moveToTail(i),r&&this.updateItemAge(i),o}}connect(t,e){this.prev[e]=t,this.next[t]=e}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return l("del","delete"),this.delete}delete(t){let e=!1;if(0!==this.size){const r=this.keyMap.get(t);if(void 0!==r)if(e=!0,1===this.size)this.clear();else{this.removeItemSize(r);const e=this.valList[r];this.isBackgroundFetch(e)?e.__abortController.abort():(this.dispose(e,t,"delete"),this.disposeAfter&&this.disposed.push([e,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(const t of this.rindexes({allowStale:!0})){const e=this.valList[t];if(this.isBackgroundFetch(e))e.__abortController.abort();else{const r=this.keyList[t];this.dispose(e,r,"delete"),this.disposeAfter&&this.disposed.push([e,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return((t,e)=>{const r="LRU_CACHE_PROPERTY_length";if(p(r)){const{prototype:e}=v,{get:n}=Object.getOwnPropertyDescriptor(e,t);d(r,"length property","cache.size",n)}})("length"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}t.exports=v},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},f=e.upperBoundInclusive=function(t){return!o(t,"lt")},l=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!f(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?f(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):f(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&l(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},6349: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)},4155: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,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(9481),s=r(4229);r(5717)(f,o);for(var a=i(s.prototype),u=0;u{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},f=r(4616);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):x(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):P(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(j,t,e))}function j(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function D(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var f=!1;function l(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(C,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(C,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{"use strict";t.exports=f;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,f=r.g.Uint8Array||function(){},l=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,e))}(t,r,n,e,o);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),n?i.nextTick(x,t,r,s,o):x(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(L,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[l]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[l]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,u,c,f=!0;function l(t){function e(){r&&r(t,i),r=null}f?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)l(r);else if(!u&&c{"use strict";var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var 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)=>t.term[0]>e.term[0]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],f=!0;return function t(l){var h=r?i(l):l,p={},d=!0,y={node:h,node_:l,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){f=!1},block:function(){d=!1}};if(!f)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=a(Object.prototype.toString),l=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function m(t){return"[object Set]"===f(t)}function v(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===f(t)}function x(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function k(t){return g(t,l)}function R(t){return g(t,h)}function L(t){return g(t,p)}function I(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=k,e.isStringObject=R,e.isBooleanObject=L,e.isBigIntObject=I,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return k(t)||R(t)||L(t)||I(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function l(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,f="",l=!1,_=["{","}"];return y(r)&&(l=!0,_=["[","]"]),A(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(f=" "+RegExp.prototype.toString.call(r)),S(r)&&(f=" "+Date.prototype.toUTCString.call(r)),T(r)&&(f=" "+p(r)),0!==s.length||l&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=l?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),L(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",R(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("String.prototype.slice"),l={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}l[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(l,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(s(t),8,-1))}},1861:t=>{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return null===n?o(JSON.stringify([null,"1.00"])):(s=n)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o(JSON.stringify([[],"1.00"])):Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(n)?o((a=n,new Promise((async e=>{const n={};for(const e in a)n[e]=await r(a[e],e,t);return e(n)})))):(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(n);var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o({max:1e3}),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),f=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:f.PAGE,_SCORE:f.SCORE,_SEARCH:f.SEARCH,_SORT:f.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:f.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:f.DICTIONARY,DISTINCT:f.DISTINCT,DOCUMENTS:f.DOCUMENTS,DOCUMENT_COUNT:f.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:f.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:f.QUERY,SEARCH:f.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenAppend:"#",tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:i.tokenizer},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),f=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},l=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>l((t=>i(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>l(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>l(f(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>l(((t,e)=>f({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),{ngraminator:i}=r(6349),o=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([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,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},f=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(f).then(l).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=f,e.SCORE_TERM_FREQUENCY=l},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.reset(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.reset();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.reset();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.reset(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.reset(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbortError:()=>W,default:()=>G});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const s=t=>void 0===globalThis.DOMException?new o(t):new DOMException(t),a=t=>{const e=void 0===t.reason?s("This operation was aborted."):t.reason;return e instanceof Error?e:s(e)};var u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(){u.set(this,[])}enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&c(this,u,"f")[this.size-1].priority>=e.priority)return void c(this,u,"f").push(r);const n=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(c(this,u,"f"),r);c(this,u,"f").splice(n,0,r)}dequeue(){const t=c(this,u,"f").shift();return null==t?void 0:t.run}filter(t){return c(this,u,"f").filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return c(this,u,"f").length}}u=new WeakMap;var l,h,p,d,y,g,b,m,v,w,E,_,S,T,A,O,x,k,R,L,I,P,j,C,U,D,N,M,B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const z=()=>{},V=new i;class W extends Error{}class G extends n{constructor(t){var e,r,n,i;if(super(),l.add(this),h.set(this,void 0),p.set(this,void 0),d.set(this,0),y.set(this,void 0),g.set(this,void 0),b.set(this,0),m.set(this,void 0),v.set(this,void 0),w.set(this,void 0),E.set(this,void 0),_.set(this,0),S.set(this,void 0),T.set(this,void 0),A.set(this,z),O.set(this,z),x.set(this,void 0),k.set(this,void 0),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:f,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);B(this,h,t.carryoverConcurrencyCount,"f"),B(this,p,t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,"f"),B(this,y,t.intervalCap,"f"),B(this,g,t.interval,"f"),B(this,w,new t.queueClass,"f"),B(this,E,t.queueClass,"f"),this.concurrency=t.concurrency,B(this,x,t.timeout,"f"),B(this,k,!0===t.throwOnTimeout,"f"),B(this,T,!1===t.autoStart,"f")}get concurrency(){return F(this,S,"f")}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})`);B(this,S,t,"f"),F(this,l,"m",M).call(this)}async add(t,e={}){return new Promise(((r,n)=>{F(this,w,"f").enqueue((async()=>{var i,o,s;B(this,_,(o=F(this,_,"f"),++o),"f"),B(this,d,(s=F(this,d,"f"),++s),"f");try{if(null===(i=e.signal)||void 0===i?void 0:i.aborted)return void n(new W("The task was aborted."));const o=void 0===F(this,x,"f")&&void 0===e.timeout?t({signal:e.signal}):function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e!==Number.POSITIVE_INFINITY){if((n={customTimers:{setTimeout,clearTimeout},...n}).signal){const{signal:t}=n;t.aborted&&s(a(t)),t.addEventListener("abort",(()=>{s(a(t))}))}i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()}else o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t({signal:e.signal})),void 0===e.timeout?F(this,x,"f"):e.timeout,(()=>{(void 0===e.throwOnTimeout?F(this,k,"f"):e.throwOnTimeout)&&n(V)})),s=await o;r(s),this.emit("completed",s)}catch(t){n(t),this.emit("error",t)}F(this,l,"m",I).call(this)}),e),F(this,l,"m",U).call(this),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return F(this,T,"f")?(B(this,T,!1,"f"),F(this,l,"m",M).call(this),this):this}pause(){B(this,T,!0,"f")}clear(){B(this,w,new(F(this,E,"f")),"f")}async onEmpty(){if(0!==F(this,w,"f").size)return new Promise((t=>{const e=F(this,A,"f");B(this,A,(()=>{e(),t()}),"f")}))}async onSizeLessThan(t){if(!(F(this,w,"f").size{const r=()=>{F(this,w,"f").size{const e=F(this,O,"f");B(this,O,(()=>{e(),t()}),"f")}))}get size(){return F(this,w,"f").size}sizeBy(t){return F(this,w,"f").filter(t).length}get pending(){return F(this,_,"f")}get isPaused(){return F(this,T,"f")}get timeout(){return F(this,x,"f")}set timeout(t){B(this,x,t,"f")}}h=new WeakMap,p=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,E=new WeakMap,_=new WeakMap,S=new WeakMap,T=new WeakMap,A=new WeakMap,O=new WeakMap,x=new WeakMap,k=new WeakMap,l=new WeakSet,R=function(){return F(this,p,"f")||F(this,d,"f"){F(this,l,"m",j).call(this)}),e),"f"),!0;B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f")}return!1},U=function(){if(0===F(this,w,"f").size)return F(this,m,"f")&&clearInterval(F(this,m,"f")),B(this,m,void 0,"f"),F(this,l,"m",P).call(this),!1;if(!F(this,T,"f")){const t=!F(this,l,"m",C).call(this);if(F(this,l,"a",R)&&F(this,l,"a",L)){const e=F(this,w,"f").dequeue();return!!e&&(this.emit("active"),e(),t&&F(this,l,"m",D).call(this),!0)}}return!1},D=function(){F(this,p,"f")||void 0!==F(this,m,"f")||(B(this,m,setInterval((()=>{F(this,l,"m",N).call(this)}),F(this,g,"f")),"f"),B(this,b,Date.now()+F(this,g,"f"),"f"))},N=function(){0===F(this,d,"f")&&0===F(this,_,"f")&&F(this,m,"f")&&(clearInterval(F(this,m,"f")),B(this,m,void 0,"f")),B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f"),F(this,l,"m",M).call(this)},M=function(){for(;F(this,l,"m",U).call(this););}},4147:t=>{"use strict";t.exports=JSON.parse('{"name":"search-index","version":"3.1.2","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.2.0","fuzzyset":"1.0.5","http-server":"14.1.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^17.0.0","stemmer":"^1.0.5","stopword":"^2.0.2","stream-browserify":"^3.0.0","tape":"^5.5.3","tape-run":"^10.0.0","webpack":"^5.72.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.6","level-js":"^6.1.0","leveldown":"^6.1.1","lru-cache":"^7.9.0","ngraminator":"^3.0.1","p-queue":"^7.2.0","term-vector":"^1.0.0"}}')}},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=r(2225);SearchIndex=n})(); \ No newline at end of file +/*! For license information please see search-index-3.1.3.js.LICENSE.txt */ +var SearchIndex;(()=>{var t={8508:(t,e,r)=>{"use strict";const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{"use strict";function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{"use strict";const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,f=Object.prototype.hasOwnProperty,l=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!f.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==l.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{"use strict";e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?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,a=o.length;s0)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>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(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(J(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(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 u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(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 l(t){return f(t),a(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:q(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 L(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t>>=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(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}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){V(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 U(t,e,r,n,i){V(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 D(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 N(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||j(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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=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>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r,n,i,o){if(t>r||t3?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 B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(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")}},1924:(t,e,r)=>{"use strict";var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},6957:(t,e,r)=>{"use strict";var n=r(886);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(t,e)=>{function r(t){for(var e="",r=0;r0?"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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function f(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(f,n),f.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},f.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},f.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},f.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])f.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=f},6944:(t,e,r)=>{"use strict";const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],f=Symbol("innerDb"),l=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[f]=t,this[l]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[f][r](...t);const e=a(t,h);return"opening"===this.status?this[l].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[f].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[l].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[f]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[f].status)return e(t||new Error("Database is not open"));const r=this[l];this[l]=[];for(const t of r)t.iterator?t.iterator.setDb(this[f]):this[f][t.method](...t.args);if(this[l].length>0)throw new Error("Did not expect further operations");e()};"new"===this[f].status||"closed"===this[f].status?this[f].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[f].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{"use strict";e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{"use strict";const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function f(t,e){if(!(this instanceof f))return new f(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function l(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=f,s(f,n),f.prototype.type="encoding-down",f.prototype._serializeKey=f.prototype._serializeValue=function(t){return t},f.prototype._open=function(t,e){this.db.open(t,e)},f.prototype._close=function(t){this.db.close(t)},f.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},f.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},f.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},l.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},l.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729: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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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{"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))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){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 l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(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;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,f=d(u,c);for(r=0;r=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=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return i({FIELD:n,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return i({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:e,LTE:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,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(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(t,e)))).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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),f=(t,e)=>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))))]})))):t,l=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:f(t.flat(),r),FACETS:f(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:f,BUCKET:l,BUCKETS:(...t)=>Promise.all(t.map(l)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((f=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>f(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},4029:(t,e,r)=>{"use strict";var n=r(5320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(t,e,r){for(var n=0,i=t.length;n=3&&(o=r),"[object Array]"===i.call(t)?s(t,e,o):"string"==typeof t?a(t,e,o):u(t,e,o)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),f=[],l=0;l{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},f=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=m.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,x=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,A,(function(t,e,r,i){n[n.length]=r?_(i,O,"$1"):e||t})),n},k=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/g,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=x(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),a=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!f&&(y[a]=c)}}return c}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419: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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},5320: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=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,c="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(u)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},8662:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{"use strict";const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{"use strict";const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{"use strict";function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{"use strict";const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{"use strict";t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),f=r(2854),l=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return f(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{"use strict";const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t._nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{"use strict";const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{"use strict";const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{"use strict";function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{"use strict";const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{"use strict";const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),f=r(6957),l=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=f.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=f.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=l(r,n),w(this,n=f.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=l(t,e),t=h(t),w(this,e=f.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{var n=r(4155);const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if("abort"===t){this.aborted=!0;const e={type:t,target:this};this.onabort(e),this._listeners.forEach((t=>t(e)),this)}}onabort(){}addEventListener(t,e){"abort"===t&&this._listeners.push(e)}removeEventListener(t,e){"abort"===t&&(this._listeners=this._listeners.filter((t=>t!==e)))}},c=new Set,f=(t,e)=>{const r=`LRU_CACHE_OPTION_${t}`;p(r)&&d(r,`${t} option`,`options.${e}`,v)},l=(t,e)=>{const r=`LRU_CACHE_METHOD_${t}`;if(p(r)){const{prototype:n}=v,{get:i}=Object.getOwnPropertyDescriptor(n,t);d(r,`${t} method`,`cache.${e}()`,i)}},h=(...t)=>{"object"==typeof n&&n&&"function"==typeof n.emitWarning?n.emitWarning(...t):console.error(...t)},p=t=>!c.has(t),d=(t,e,r,n)=>{c.add(t),h(`The ${e} is deprecated. Please use ${r} instead.`,"DeprecationWarning",t,n)},y=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),g=t=>y(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?b:null:null;class b extends Array{constructor(t){super(t),this.fill(0)}}class m{constructor(t){if(0===t)return[];const e=g(t);this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class v{constructor(t={}){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:b,maxSize:w=0,sizeCalculation:E,fetchMethod:_,fetchContext:S,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:A}=t,{length:O,maxAge:x,stale:k}=t instanceof v?{}:t;if(0!==e&&!y(e))throw new TypeError("max option must be a nonnegative integer");const R=e?g(e):Array;if(!R)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=w,this.sizeCalculation=E||O,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=S,!this.fetchMethod&&void 0!==S)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new R(e),this.prev=new R(e),this.head=0,this.tail=0,this.free=new m(e),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!T,0!==this.maxSize){if(!y(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!k,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=y(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||x||0,this.ttl){if(!y(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const t="LRU_CACHE_UNBOUNDED";p(t)&&(c.add(t),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,v))}k&&f("stale","allowStale"),x&&f("maxAge","ttl"),O&&f("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new b(this.max),this.starts=new b(this.max),this.setItemTTL=(t,e,r=i.now())=>{if(this.starts[t]=0!==e?r:0,this.ttls[t]=e,0!==e&&this.ttlAutopurge){const r=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),e+1);r.unref&&r.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const e=()=>{const e=i.now();if(this.ttlResolution>0){t=e;const r=setTimeout((()=>t=0),this.ttlResolution);r.unref&&r.unref()}return e};this.getRemainingTTL=r=>{const n=this.keyMap.get(r);return void 0===n?0:0===this.ttls[n]||0===this.starts[n]?1/0:this.starts[n]+this.ttls[n]-(t||e())},this.isStale=r=>0!==this.ttls[r]&&0!==this.starts[r]&&(t||e())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,e,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new b(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.requireSize=(t,e,r,n)=>{if(!y(r)){if(!n)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!y(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.addItemSize=(t,e,r,n)=>{this.sizes[t]=n;const i=this.maxSize-this.sizes[t];for(;this.calculatedSize>i;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,e,r,n){}requireSize(t,e,r,n){if(r||n)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.tail;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.head);)e=this.prev[e]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.head;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.tail);)e=this.next[e]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],e)}forEach(t,e=this){for(const r of this.indexes())t.call(e,this.valList[r],this.keyList[r],this)}rforEach(t,e=this){for(const r of this.rindexes())t.call(e,this.valList[r],this.keyList[r],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),t=!0);return t}dump(){const t=[];for(const e of this.indexes({allowStale:!0})){const r=this.keyList[e],n=this.valList[e],o={value:this.isBackgroundFetch(n)?n.__staleWhileFetching:n};if(this.ttls){o.ttl=this.ttls[e];const t=i.now()-this.starts[e];o.start=Math.floor(Date.now()-t)}this.sizes&&(o.size=this.sizes[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=i.now()-t}this.set(e,r.value,r)}}dispose(t,e,r){}set(t,e,{ttl:r=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){o=this.requireSize(t,e,o,s);let u=0===this.size?void 0:this.keyMap.get(t);if(void 0===u)u=this.newIndex(),this.keyList[u]=t,this.valList[u]=e,this.keyMap.set(t,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,e,t,o),a=!1;else{const r=this.valList[u];e!==r&&(this.isBackgroundFetch(r)?r.__abortController.abort():i||(this.dispose(r,t,"set"),this.disposeAfter&&this.disposed.push([r,t,"set"])),this.removeItemSize(u),this.valList[u]=e,this.addItemSize(u,e,t,o)),this.moveToTail(u)}if(0===r||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,r,n),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const e=this.head,r=this.keyList[e],n=this.valList[e];return this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,r,"evict"),this.disposeAfter&&this.disposed.push([n,r,"evict"])),this.removeItemSize(e),t&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(r),this.size--,e}has(t,{updateAgeOnHas:e=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return void 0!==r&&!this.isStale(r)&&(e&&this.updateItemAge(r),!0)}peek(t,{allowStale:e=this.allowStale}={}){const r=this.keyMap.get(t);if(void 0!==r&&(e||!this.isStale(r)))return this.valList[r]}backgroundFetch(t,e,r,n){const i=void 0===e?void 0:this.valList[e];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:r,context:n},u=new Promise((e=>e(this.fetchMethod(t,i,a)))).then((e=>(s.signal.aborted||this.set(t,e,a.options),e)),(n=>{if(this.valList[e]===u&&(r.noDeleteOnFetchRejection&&void 0!==u.__staleWhileFetching?this.valList[e]=u.__staleWhileFetching:this.delete(t)),u.__returned===u)throw n}));return u.__abortController=s,u.__staleWhileFetching=i,u.__returned=null,void 0===e?(this.set(t,u,a.options),e=this.keyMap.get(t)):this.valList[e]=u,u}isBackgroundFetch(t){return t&&"object"==typeof t&&"function"==typeof t.then&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||null===t.__returned)}async fetch(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext}={}){if(!this.fetchMethod)return this.get(t,{allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n});const l={allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:c};let h=this.keyMap.get(t);if(void 0===h){const e=this.backgroundFetch(t,h,l,f);return e.__returned=e}{const n=this.valList[h];if(this.isBackgroundFetch(n))return e&&void 0!==n.__staleWhileFetching?n.__staleWhileFetching:n.__returned=n;if(!this.isStale(h))return this.moveToTail(h),r&&this.updateItemAge(h),n;const i=this.backgroundFetch(t,h,l,f);return e&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(t);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?e?o.__staleWhileFetching:void 0:(n||this.delete(t),e?o:void 0);if(s)return;return this.moveToTail(i),r&&this.updateItemAge(i),o}}connect(t,e){this.prev[e]=t,this.next[t]=e}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return l("del","delete"),this.delete}delete(t){let e=!1;if(0!==this.size){const r=this.keyMap.get(t);if(void 0!==r)if(e=!0,1===this.size)this.clear();else{this.removeItemSize(r);const e=this.valList[r];this.isBackgroundFetch(e)?e.__abortController.abort():(this.dispose(e,t,"delete"),this.disposeAfter&&this.disposed.push([e,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(const t of this.rindexes({allowStale:!0})){const e=this.valList[t];if(this.isBackgroundFetch(e))e.__abortController.abort();else{const r=this.keyList[t];this.dispose(e,r,"delete"),this.disposeAfter&&this.disposed.push([e,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return((t,e)=>{const r="LRU_CACHE_PROPERTY_length";if(p(r)){const{prototype:e}=v,{get:n}=Object.getOwnPropertyDescriptor(e,t);d(r,"length property","cache.size",n)}})("length"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}t.exports=v},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},f=e.upperBoundInclusive=function(t){return!o(t,"lt")},l=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!f(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?f(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):f(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&l(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},6349: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)},4155: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,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(9481),s=r(4229);r(5717)(f,o);for(var a=i(s.prototype),u=0;u{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},f=r(4616);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):x(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):P(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(j,t,e))}function j(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function D(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var f=!1;function l(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(C,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(C,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{"use strict";t.exports=f;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,f=r.g.Uint8Array||function(){},l=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,e))}(t,r,n,e,o);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),n?i.nextTick(x,t,r,s,o):x(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(L,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[l]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[l]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,u,c,f=!0;function l(t){function e(){r&&r(t,i),r=null}f?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)l(r);else if(!u&&c{"use strict";var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var 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)=>t.term[0]>e.term[0]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],f=!0;return function t(l){var h=r?i(l):l,p={},d=!0,y={node:h,node_:l,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){f=!1},block:function(){d=!1}};if(!f)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=a(Object.prototype.toString),l=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function m(t){return"[object Set]"===f(t)}function v(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===f(t)}function x(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function k(t){return g(t,l)}function R(t){return g(t,h)}function L(t){return g(t,p)}function I(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=k,e.isStringObject=R,e.isBooleanObject=L,e.isBigIntObject=I,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return k(t)||R(t)||L(t)||I(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function l(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,f="",l=!1,_=["{","}"];return y(r)&&(l=!0,_=["[","]"]),A(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(f=" "+RegExp.prototype.toString.call(r)),S(r)&&(f=" "+Date.prototype.toUTCString.call(r)),T(r)&&(f=" "+p(r)),0!==s.length||l&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=l?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),L(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",R(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("String.prototype.slice"),l={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}l[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(l,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(s(t),8,-1))}},1861:t=>{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return null===n?o(JSON.stringify([null,"1.00"])):(s=n)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o(JSON.stringify([[],"1.00"])):Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(n)?o((a=n,new Promise((async e=>{const n={};for(const e in a)n[e]=await r(a[e],e,t);return e(n)})))):(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(n);var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o({max:1e3}),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),f=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:f.PAGE,_SCORE:f.SCORE,_SEARCH:f.SEARCH,_SORT:f.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:f.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:f.DICTIONARY,DISTINCT:f.DISTINCT,DOCUMENTS:f.DOCUMENTS,DOCUMENT_COUNT:f.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:f.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:f.QUERY,SEARCH:f.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenAppend:"#",tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:i.tokenizer},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),f=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},l=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>l((t=>i(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>l(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>l(f(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>l(((t,e)=>f({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),{ngraminator:i}=r(6349),o=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([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,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},f=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(f).then(l).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=f,e.SCORE_TERM_FREQUENCY=l},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.clear(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.clear();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.clear();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.clear(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.clear(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbortError:()=>W,default:()=>G});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const s=t=>void 0===globalThis.DOMException?new o(t):new DOMException(t),a=t=>{const e=void 0===t.reason?s("This operation was aborted."):t.reason;return e instanceof Error?e:s(e)};var u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(){u.set(this,[])}enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&c(this,u,"f")[this.size-1].priority>=e.priority)return void c(this,u,"f").push(r);const n=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(c(this,u,"f"),r);c(this,u,"f").splice(n,0,r)}dequeue(){const t=c(this,u,"f").shift();return null==t?void 0:t.run}filter(t){return c(this,u,"f").filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return c(this,u,"f").length}}u=new WeakMap;var l,h,p,d,y,g,b,m,v,w,E,_,S,T,A,O,x,k,R,L,I,P,j,C,U,D,N,M,B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const z=()=>{},V=new i;class W extends Error{}class G extends n{constructor(t){var e,r,n,i;if(super(),l.add(this),h.set(this,void 0),p.set(this,void 0),d.set(this,0),y.set(this,void 0),g.set(this,void 0),b.set(this,0),m.set(this,void 0),v.set(this,void 0),w.set(this,void 0),E.set(this,void 0),_.set(this,0),S.set(this,void 0),T.set(this,void 0),A.set(this,z),O.set(this,z),x.set(this,void 0),k.set(this,void 0),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:f,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);B(this,h,t.carryoverConcurrencyCount,"f"),B(this,p,t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,"f"),B(this,y,t.intervalCap,"f"),B(this,g,t.interval,"f"),B(this,w,new t.queueClass,"f"),B(this,E,t.queueClass,"f"),this.concurrency=t.concurrency,B(this,x,t.timeout,"f"),B(this,k,!0===t.throwOnTimeout,"f"),B(this,T,!1===t.autoStart,"f")}get concurrency(){return F(this,S,"f")}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})`);B(this,S,t,"f"),F(this,l,"m",M).call(this)}async add(t,e={}){return new Promise(((r,n)=>{F(this,w,"f").enqueue((async()=>{var i,o,s;B(this,_,(o=F(this,_,"f"),++o),"f"),B(this,d,(s=F(this,d,"f"),++s),"f");try{if(null===(i=e.signal)||void 0===i?void 0:i.aborted)return void n(new W("The task was aborted."));const o=void 0===F(this,x,"f")&&void 0===e.timeout?t({signal:e.signal}):function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e!==Number.POSITIVE_INFINITY){if((n={customTimers:{setTimeout,clearTimeout},...n}).signal){const{signal:t}=n;t.aborted&&s(a(t)),t.addEventListener("abort",(()=>{s(a(t))}))}i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()}else o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t({signal:e.signal})),void 0===e.timeout?F(this,x,"f"):e.timeout,(()=>{(void 0===e.throwOnTimeout?F(this,k,"f"):e.throwOnTimeout)&&n(V)})),s=await o;r(s),this.emit("completed",s)}catch(t){n(t),this.emit("error",t)}F(this,l,"m",I).call(this)}),e),F(this,l,"m",U).call(this),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return F(this,T,"f")?(B(this,T,!1,"f"),F(this,l,"m",M).call(this),this):this}pause(){B(this,T,!0,"f")}clear(){B(this,w,new(F(this,E,"f")),"f")}async onEmpty(){if(0!==F(this,w,"f").size)return new Promise((t=>{const e=F(this,A,"f");B(this,A,(()=>{e(),t()}),"f")}))}async onSizeLessThan(t){if(!(F(this,w,"f").size{const r=()=>{F(this,w,"f").size{const e=F(this,O,"f");B(this,O,(()=>{e(),t()}),"f")}))}get size(){return F(this,w,"f").size}sizeBy(t){return F(this,w,"f").filter(t).length}get pending(){return F(this,_,"f")}get isPaused(){return F(this,T,"f")}get timeout(){return F(this,x,"f")}set timeout(t){B(this,x,t,"f")}}h=new WeakMap,p=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,E=new WeakMap,_=new WeakMap,S=new WeakMap,T=new WeakMap,A=new WeakMap,O=new WeakMap,x=new WeakMap,k=new WeakMap,l=new WeakSet,R=function(){return F(this,p,"f")||F(this,d,"f"){F(this,l,"m",j).call(this)}),e),"f"),!0;B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f")}return!1},U=function(){if(0===F(this,w,"f").size)return F(this,m,"f")&&clearInterval(F(this,m,"f")),B(this,m,void 0,"f"),F(this,l,"m",P).call(this),!1;if(!F(this,T,"f")){const t=!F(this,l,"m",C).call(this);if(F(this,l,"a",R)&&F(this,l,"a",L)){const e=F(this,w,"f").dequeue();return!!e&&(this.emit("active"),e(),t&&F(this,l,"m",D).call(this),!0)}}return!1},D=function(){F(this,p,"f")||void 0!==F(this,m,"f")||(B(this,m,setInterval((()=>{F(this,l,"m",N).call(this)}),F(this,g,"f")),"f"),B(this,b,Date.now()+F(this,g,"f"),"f"))},N=function(){0===F(this,d,"f")&&0===F(this,_,"f")&&F(this,m,"f")&&(clearInterval(F(this,m,"f")),B(this,m,void 0,"f")),B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f"),F(this,l,"m",M).call(this)},M=function(){for(;F(this,l,"m",U).call(this););}},4147:t=>{"use strict";t.exports=JSON.parse('{"name":"search-index","version":"3.1.3","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.2.0","fuzzyset":"1.0.5","http-server":"14.1.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^17.0.0","stemmer":"^1.0.5","stopword":"^2.0.2","stream-browserify":"^3.0.0","tape":"^5.5.3","tape-run":"^10.0.0","webpack":"^5.72.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.6","level-js":"^6.1.0","leveldown":"^6.1.1","lru-cache":"^7.9.0","ngraminator":"^3.0.1","p-queue":"^7.2.0","term-vector":"^1.0.0"}}')}},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=r(2225);SearchIndex=n})(); \ No newline at end of file diff --git a/dist/search-index-3.1.2.js.LICENSE.txt b/dist/search-index-3.1.3.js.LICENSE.txt similarity index 100% rename from dist/search-index-3.1.2.js.LICENSE.txt rename to dist/search-index-3.1.3.js.LICENSE.txt diff --git a/dist/search-index-esm-3.1.2.js b/dist/search-index-esm-3.1.3.js similarity index 99% rename from dist/search-index-esm-3.1.2.js rename to dist/search-index-esm-3.1.3.js index 47572353..0af7a75b 100644 --- a/dist/search-index-esm-3.1.2.js +++ b/dist/search-index-esm-3.1.3.js @@ -1,2 +1,2 @@ -/*! For license information please see search-index-esm-3.1.2.js.LICENSE.txt */ -var t={8508:(t,e,r)=>{const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,f=Object.prototype.hasOwnProperty,l=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!f.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==l.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?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,a=o.length;s0)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>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(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(J(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(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 u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(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 l(t){return f(t),a(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:q(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 L(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t>>=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(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}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function x(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){V(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 U(t,e,r,n,i){V(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 D(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 N(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||j(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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=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>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r,n,i,o){if(t>r||t3?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 B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(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")}},1924:(t,e,r)=>{var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},6957:(t,e,r)=>{var n=r(886);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(t,e)=>{function r(t){for(var e="",r=0;r0?"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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function f(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(f,n),f.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},f.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},f.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},f.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])f.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=f},6944:(t,e,r)=>{const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],f=Symbol("innerDb"),l=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[f]=t,this[l]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[f][r](...t);const e=a(t,h);return"opening"===this.status?this[l].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[f].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[l].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[f]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[f].status)return e(t||new Error("Database is not open"));const r=this[l];this[l]=[];for(const t of r)t.iterator?t.iterator.setDb(this[f]):this[f][t.method](...t.args);if(this[l].length>0)throw new Error("Did not expect further operations");e()};"new"===this[f].status||"closed"===this[f].status?this[f].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[f].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function f(t,e){if(!(this instanceof f))return new f(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function l(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=f,s(f,n),f.prototype.type="encoding-down",f.prototype._serializeKey=f.prototype._serializeValue=function(t){return t},f.prototype._open=function(t,e){this.db.open(t,e)},f.prototype._close=function(t){this.db.close(t)},f.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},f.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},f.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},l.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},l.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729:t=>{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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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{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))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){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 l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(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;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,f=d(u,c);for(r=0;r=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=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return i({FIELD:n,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return i({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:e,LTE:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,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(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(t,e)))).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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),f=(t,e)=>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))))]})))):t,l=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:f(t.flat(),r),FACETS:f(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:f,BUCKET:l,BUCKETS:(...t)=>Promise.all(t.map(l)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((f=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>f(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},4029:(t,e,r)=>{var n=r(5320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(t,e,r){for(var n=0,i=t.length;n=3&&(o=r),"[object Array]"===i.call(t)?s(t,e,o):"string"==typeof t?a(t,e,o):u(t,e,o)}},7648:t=>{var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),f=[],l=0;l{var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},f=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=m.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,k=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,A,(function(t,e,r,i){n[n.length]=r?_(i,O,"$1"):e||t})),n},x=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/g,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=k(t),n=r.length>0?r[0]:"",o=x("%"+n+"%",e),a=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!f&&(y[a]=c)}}return c}},1405:(t,e,r)=>{var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:t=>{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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,r)=>{var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},5320:t=>{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=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,c="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(u)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},8662:(t,e,r)=>{var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),f=r(2854),l=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return f(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854:t=>{t.exports=function(t,e,r,n,i){if(0===n.limit)return t._nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),f=r(6957),l=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=f.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=f.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=l(r,n),w(this,n=f.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=l(t,e),t=h(t),w(this,e=f.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{var n=r(4155);const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if("abort"===t){this.aborted=!0;const e={type:t,target:this};this.onabort(e),this._listeners.forEach((t=>t(e)),this)}}onabort(){}addEventListener(t,e){"abort"===t&&this._listeners.push(e)}removeEventListener(t,e){"abort"===t&&(this._listeners=this._listeners.filter((t=>t!==e)))}},c=new Set,f=(t,e)=>{const r=`LRU_CACHE_OPTION_${t}`;p(r)&&d(r,`${t} option`,`options.${e}`,v)},l=(t,e)=>{const r=`LRU_CACHE_METHOD_${t}`;if(p(r)){const{prototype:n}=v,{get:i}=Object.getOwnPropertyDescriptor(n,t);d(r,`${t} method`,`cache.${e}()`,i)}},h=(...t)=>{"object"==typeof n&&n&&"function"==typeof n.emitWarning?n.emitWarning(...t):console.error(...t)},p=t=>!c.has(t),d=(t,e,r,n)=>{c.add(t),h(`The ${e} is deprecated. Please use ${r} instead.`,"DeprecationWarning",t,n)},y=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),g=t=>y(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?b:null:null;class b extends Array{constructor(t){super(t),this.fill(0)}}class m{constructor(t){if(0===t)return[];const e=g(t);this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class v{constructor(t={}){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:b,maxSize:w=0,sizeCalculation:E,fetchMethod:_,fetchContext:S,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:A}=t,{length:O,maxAge:k,stale:x}=t instanceof v?{}:t;if(0!==e&&!y(e))throw new TypeError("max option must be a nonnegative integer");const R=e?g(e):Array;if(!R)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=w,this.sizeCalculation=E||O,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=S,!this.fetchMethod&&void 0!==S)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new R(e),this.prev=new R(e),this.head=0,this.tail=0,this.free=new m(e),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!T,0!==this.maxSize){if(!y(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!x,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=y(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||k||0,this.ttl){if(!y(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const t="LRU_CACHE_UNBOUNDED";p(t)&&(c.add(t),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,v))}x&&f("stale","allowStale"),k&&f("maxAge","ttl"),O&&f("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new b(this.max),this.starts=new b(this.max),this.setItemTTL=(t,e,r=i.now())=>{if(this.starts[t]=0!==e?r:0,this.ttls[t]=e,0!==e&&this.ttlAutopurge){const r=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),e+1);r.unref&&r.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const e=()=>{const e=i.now();if(this.ttlResolution>0){t=e;const r=setTimeout((()=>t=0),this.ttlResolution);r.unref&&r.unref()}return e};this.getRemainingTTL=r=>{const n=this.keyMap.get(r);return void 0===n?0:0===this.ttls[n]||0===this.starts[n]?1/0:this.starts[n]+this.ttls[n]-(t||e())},this.isStale=r=>0!==this.ttls[r]&&0!==this.starts[r]&&(t||e())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,e,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new b(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.requireSize=(t,e,r,n)=>{if(!y(r)){if(!n)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!y(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.addItemSize=(t,e,r,n)=>{this.sizes[t]=n;const i=this.maxSize-this.sizes[t];for(;this.calculatedSize>i;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,e,r,n){}requireSize(t,e,r,n){if(r||n)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.tail;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.head);)e=this.prev[e]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.head;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.tail);)e=this.next[e]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],e)}forEach(t,e=this){for(const r of this.indexes())t.call(e,this.valList[r],this.keyList[r],this)}rforEach(t,e=this){for(const r of this.rindexes())t.call(e,this.valList[r],this.keyList[r],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),t=!0);return t}dump(){const t=[];for(const e of this.indexes({allowStale:!0})){const r=this.keyList[e],n=this.valList[e],o={value:this.isBackgroundFetch(n)?n.__staleWhileFetching:n};if(this.ttls){o.ttl=this.ttls[e];const t=i.now()-this.starts[e];o.start=Math.floor(Date.now()-t)}this.sizes&&(o.size=this.sizes[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=i.now()-t}this.set(e,r.value,r)}}dispose(t,e,r){}set(t,e,{ttl:r=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){o=this.requireSize(t,e,o,s);let u=0===this.size?void 0:this.keyMap.get(t);if(void 0===u)u=this.newIndex(),this.keyList[u]=t,this.valList[u]=e,this.keyMap.set(t,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,e,t,o),a=!1;else{const r=this.valList[u];e!==r&&(this.isBackgroundFetch(r)?r.__abortController.abort():i||(this.dispose(r,t,"set"),this.disposeAfter&&this.disposed.push([r,t,"set"])),this.removeItemSize(u),this.valList[u]=e,this.addItemSize(u,e,t,o)),this.moveToTail(u)}if(0===r||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,r,n),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const e=this.head,r=this.keyList[e],n=this.valList[e];return this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,r,"evict"),this.disposeAfter&&this.disposed.push([n,r,"evict"])),this.removeItemSize(e),t&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(r),this.size--,e}has(t,{updateAgeOnHas:e=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return void 0!==r&&!this.isStale(r)&&(e&&this.updateItemAge(r),!0)}peek(t,{allowStale:e=this.allowStale}={}){const r=this.keyMap.get(t);if(void 0!==r&&(e||!this.isStale(r)))return this.valList[r]}backgroundFetch(t,e,r,n){const i=void 0===e?void 0:this.valList[e];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:r,context:n},u=new Promise((e=>e(this.fetchMethod(t,i,a)))).then((e=>(s.signal.aborted||this.set(t,e,a.options),e)),(n=>{if(this.valList[e]===u&&(r.noDeleteOnFetchRejection&&void 0!==u.__staleWhileFetching?this.valList[e]=u.__staleWhileFetching:this.delete(t)),u.__returned===u)throw n}));return u.__abortController=s,u.__staleWhileFetching=i,u.__returned=null,void 0===e?(this.set(t,u,a.options),e=this.keyMap.get(t)):this.valList[e]=u,u}isBackgroundFetch(t){return t&&"object"==typeof t&&"function"==typeof t.then&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||null===t.__returned)}async fetch(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext}={}){if(!this.fetchMethod)return this.get(t,{allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n});const l={allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:c};let h=this.keyMap.get(t);if(void 0===h){const e=this.backgroundFetch(t,h,l,f);return e.__returned=e}{const n=this.valList[h];if(this.isBackgroundFetch(n))return e&&void 0!==n.__staleWhileFetching?n.__staleWhileFetching:n.__returned=n;if(!this.isStale(h))return this.moveToTail(h),r&&this.updateItemAge(h),n;const i=this.backgroundFetch(t,h,l,f);return e&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(t);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?e?o.__staleWhileFetching:void 0:(n||this.delete(t),e?o:void 0);if(s)return;return this.moveToTail(i),r&&this.updateItemAge(i),o}}connect(t,e){this.prev[e]=t,this.next[t]=e}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return l("del","delete"),this.delete}delete(t){let e=!1;if(0!==this.size){const r=this.keyMap.get(t);if(void 0!==r)if(e=!0,1===this.size)this.clear();else{this.removeItemSize(r);const e=this.valList[r];this.isBackgroundFetch(e)?e.__abortController.abort():(this.dispose(e,t,"delete"),this.disposeAfter&&this.disposed.push([e,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(const t of this.rindexes({allowStale:!0})){const e=this.valList[t];if(this.isBackgroundFetch(e))e.__abortController.abort();else{const r=this.keyList[t];this.dispose(e,r,"delete"),this.disposeAfter&&this.disposed.push([e,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return((t,e)=>{const r="LRU_CACHE_PROPERTY_length";if(p(r)){const{prototype:e}=v,{get:n}=Object.getOwnPropertyDescriptor(e,t);d(r,"length property","cache.size",n)}})("length"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}t.exports=v},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},f=e.upperBoundInclusive=function(t){return!o(t,"lt")},l=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!f(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?f(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):f(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&l(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},6349:function(t,e){!function(t){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)},4155: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,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},4281:t=>{var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(9481),s=r(4229);r(5717)(f,o);for(var a=i(s.prototype),u=0;u{t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},f=r(4616);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):k(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?k(t,a,e,!1):P(t,a)):k(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(j,t,e))}function j(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function D(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var f=!1;function l(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(C,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(C,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{t.exports=f;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,f=r.g.Uint8Array||function(){},l=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,e))}(t,r,n,e,o);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?i.nextTick(k,t,r,s,o):k(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(L,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[l]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[l]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},2457:(t,e,r)=>{var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,u,c,f=!0;function l(t){function e(){r&&r(t,i),r=null}f?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)l(r);else if(!u&&c{var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var 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)=>t.term[0]>e.term[0]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],f=!0;return function t(l){var h=r?i(l):l,p={},d=!0,y={node:h,node_:l,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){f=!1},block:function(){d=!1}};if(!f)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=a(Object.prototype.toString),l=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function m(t){return"[object Set]"===f(t)}function v(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===f(t)}function k(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function x(t){return g(t,l)}function R(t){return g(t,h)}function L(t){return g(t,p)}function I(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=k,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=x,e.isStringObject=R,e.isBooleanObject=L,e.isBigIntObject=I,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return x(t)||R(t)||L(t)||I(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||k(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function l(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,f="",l=!1,_=["{","}"];return y(r)&&(l=!0,_=["[","]"]),A(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(f=" "+RegExp.prototype.toString.call(r)),S(r)&&(f=" "+Date.prototype.toUTCString.call(r)),T(r)&&(f=" "+p(r)),0!==s.length||l&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=l?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),L(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),x[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",R(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("String.prototype.slice"),l={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}l[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(l,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(s(t),8,-1))}},1861:t=>{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return null===n?o(JSON.stringify([null,"1.00"])):(s=n)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o(JSON.stringify([[],"1.00"])):Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(n)?o((a=n,new Promise((async e=>{const n={};for(const e in a)n[e]=await r(a[e],e,t);return e(n)})))):(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(n);var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o({max:1e3}),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),f=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:f.PAGE,_SCORE:f.SCORE,_SEARCH:f.SEARCH,_SORT:f.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:f.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:f.DICTIONARY,DISTINCT:f.DISTINCT,DOCUMENTS:f.DOCUMENTS,DOCUMENT_COUNT:f.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:f.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:f.QUERY,SEARCH:f.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenAppend:"#",tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:i.tokenizer},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),f=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},l=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>l((t=>i(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>l(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>l(f(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>l(((t,e)=>f({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),{ngraminator:i}=r(6349),o=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([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,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},f=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(f).then(l).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=f,e.SCORE_TERM_FREQUENCY=l},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.reset(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.reset();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.reset();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.reset(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.reset(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{r.r(e),r.d(e,{AbortError:()=>W,default:()=>G});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const s=t=>void 0===globalThis.DOMException?new o(t):new DOMException(t),a=t=>{const e=void 0===t.reason?s("This operation was aborted."):t.reason;return e instanceof Error?e:s(e)};var u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(){u.set(this,[])}enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&c(this,u,"f")[this.size-1].priority>=e.priority)return void c(this,u,"f").push(r);const n=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(c(this,u,"f"),r);c(this,u,"f").splice(n,0,r)}dequeue(){const t=c(this,u,"f").shift();return null==t?void 0:t.run}filter(t){return c(this,u,"f").filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return c(this,u,"f").length}}u=new WeakMap;var l,h,p,d,y,g,b,m,v,w,E,_,S,T,A,O,k,x,R,L,I,P,j,C,U,D,N,M,B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const z=()=>{},V=new i;class W extends Error{}class G extends n{constructor(t){var e,r,n,i;if(super(),l.add(this),h.set(this,void 0),p.set(this,void 0),d.set(this,0),y.set(this,void 0),g.set(this,void 0),b.set(this,0),m.set(this,void 0),v.set(this,void 0),w.set(this,void 0),E.set(this,void 0),_.set(this,0),S.set(this,void 0),T.set(this,void 0),A.set(this,z),O.set(this,z),k.set(this,void 0),x.set(this,void 0),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:f,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);B(this,h,t.carryoverConcurrencyCount,"f"),B(this,p,t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,"f"),B(this,y,t.intervalCap,"f"),B(this,g,t.interval,"f"),B(this,w,new t.queueClass,"f"),B(this,E,t.queueClass,"f"),this.concurrency=t.concurrency,B(this,k,t.timeout,"f"),B(this,x,!0===t.throwOnTimeout,"f"),B(this,T,!1===t.autoStart,"f")}get concurrency(){return F(this,S,"f")}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})`);B(this,S,t,"f"),F(this,l,"m",M).call(this)}async add(t,e={}){return new Promise(((r,n)=>{F(this,w,"f").enqueue((async()=>{var i,o,s;B(this,_,(o=F(this,_,"f"),++o),"f"),B(this,d,(s=F(this,d,"f"),++s),"f");try{if(null===(i=e.signal)||void 0===i?void 0:i.aborted)return void n(new W("The task was aborted."));const o=void 0===F(this,k,"f")&&void 0===e.timeout?t({signal:e.signal}):function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e!==Number.POSITIVE_INFINITY){if((n={customTimers:{setTimeout,clearTimeout},...n}).signal){const{signal:t}=n;t.aborted&&s(a(t)),t.addEventListener("abort",(()=>{s(a(t))}))}i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()}else o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t({signal:e.signal})),void 0===e.timeout?F(this,k,"f"):e.timeout,(()=>{(void 0===e.throwOnTimeout?F(this,x,"f"):e.throwOnTimeout)&&n(V)})),s=await o;r(s),this.emit("completed",s)}catch(t){n(t),this.emit("error",t)}F(this,l,"m",I).call(this)}),e),F(this,l,"m",U).call(this),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return F(this,T,"f")?(B(this,T,!1,"f"),F(this,l,"m",M).call(this),this):this}pause(){B(this,T,!0,"f")}clear(){B(this,w,new(F(this,E,"f")),"f")}async onEmpty(){if(0!==F(this,w,"f").size)return new Promise((t=>{const e=F(this,A,"f");B(this,A,(()=>{e(),t()}),"f")}))}async onSizeLessThan(t){if(!(F(this,w,"f").size{const r=()=>{F(this,w,"f").size{const e=F(this,O,"f");B(this,O,(()=>{e(),t()}),"f")}))}get size(){return F(this,w,"f").size}sizeBy(t){return F(this,w,"f").filter(t).length}get pending(){return F(this,_,"f")}get isPaused(){return F(this,T,"f")}get timeout(){return F(this,k,"f")}set timeout(t){B(this,k,t,"f")}}h=new WeakMap,p=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,E=new WeakMap,_=new WeakMap,S=new WeakMap,T=new WeakMap,A=new WeakMap,O=new WeakMap,k=new WeakMap,x=new WeakMap,l=new WeakSet,R=function(){return F(this,p,"f")||F(this,d,"f"){F(this,l,"m",j).call(this)}),e),"f"),!0;B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f")}return!1},U=function(){if(0===F(this,w,"f").size)return F(this,m,"f")&&clearInterval(F(this,m,"f")),B(this,m,void 0,"f"),F(this,l,"m",P).call(this),!1;if(!F(this,T,"f")){const t=!F(this,l,"m",C).call(this);if(F(this,l,"a",R)&&F(this,l,"a",L)){const e=F(this,w,"f").dequeue();return!!e&&(this.emit("active"),e(),t&&F(this,l,"m",D).call(this),!0)}}return!1},D=function(){F(this,p,"f")||void 0!==F(this,m,"f")||(B(this,m,setInterval((()=>{F(this,l,"m",N).call(this)}),F(this,g,"f")),"f"),B(this,b,Date.now()+F(this,g,"f"),"f"))},N=function(){0===F(this,d,"f")&&0===F(this,_,"f")&&F(this,m,"f")&&(clearInterval(F(this,m,"f")),B(this,m,void 0,"f")),B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f"),F(this,l,"m",M).call(this)},M=function(){for(;F(this,l,"m",U).call(this););}},4147:t=>{t.exports=JSON.parse('{"name":"search-index","version":"3.1.2","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.2.0","fuzzyset":"1.0.5","http-server":"14.1.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^17.0.0","stemmer":"^1.0.5","stopword":"^2.0.2","stream-browserify":"^3.0.0","tape":"^5.5.3","tape-run":"^10.0.0","webpack":"^5.72.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.6","level-js":"^6.1.0","leveldown":"^6.1.1","lru-cache":"^7.9.0","ngraminator":"^3.0.1","p-queue":"^7.2.0","term-vector":"^1.0.0"}}')}},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})},r(2225); \ No newline at end of file +/*! For license information please see search-index-esm-3.1.3.js.LICENSE.txt */ +var t={8508:(t,e,r)=>{const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,f=Object.prototype.hasOwnProperty,l=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!f.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==l.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?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,a=o.length;s0)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>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(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(J(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(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 u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(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 l(t){return f(t),a(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:q(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 L(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t>>=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(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}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function x(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){V(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 U(t,e,r,n,i){V(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 D(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 N(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||j(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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=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>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r,n,i,o){if(t>r||t3?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 B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(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")}},1924:(t,e,r)=>{var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},6957:(t,e,r)=>{var n=r(886);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(t,e)=>{function r(t){for(var e="",r=0;r0?"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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function f(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(f,n),f.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},f.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},f.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},f.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])f.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=f},6944:(t,e,r)=>{const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],f=Symbol("innerDb"),l=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[f]=t,this[l]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[f][r](...t);const e=a(t,h);return"opening"===this.status?this[l].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[f].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[l].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[f]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[f].status)return e(t||new Error("Database is not open"));const r=this[l];this[l]=[];for(const t of r)t.iterator?t.iterator.setDb(this[f]):this[f][t.method](...t.args);if(this[l].length>0)throw new Error("Did not expect further operations");e()};"new"===this[f].status||"closed"===this[f].status?this[f].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[f].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function f(t,e){if(!(this instanceof f))return new f(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function l(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=f,s(f,n),f.prototype.type="encoding-down",f.prototype._serializeKey=f.prototype._serializeValue=function(t){return t},f.prototype._open=function(t,e){this.db.open(t,e)},f.prototype._close=function(t){this.db.close(t)},f.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},f.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},f.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},l.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},l.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729:t=>{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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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{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))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){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 l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(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;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,f=d(u,c);for(r=0;r=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=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return i({FIELD:n,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return i({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:e,LTE:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,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(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(t,e)))).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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),f=(t,e)=>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))))]})))):t,l=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:f(t.flat(),r),FACETS:f(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:f,BUCKET:l,BUCKETS:(...t)=>Promise.all(t.map(l)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((f=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>f(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},4029:(t,e,r)=>{var n=r(5320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(t,e,r){for(var n=0,i=t.length;n=3&&(o=r),"[object Array]"===i.call(t)?s(t,e,o):"string"==typeof t?a(t,e,o):u(t,e,o)}},7648:t=>{var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),f=[],l=0;l{var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},f=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=m.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,k=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,A,(function(t,e,r,i){n[n.length]=r?_(i,O,"$1"):e||t})),n},x=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/g,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=k(t),n=r.length>0?r[0]:"",o=x("%"+n+"%",e),a=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!f&&(y[a]=c)}}return c}},1405:(t,e,r)=>{var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:t=>{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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,r)=>{var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},5320:t=>{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=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,c="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(u)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},8662:(t,e,r)=>{var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),f=r(2854),l=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return f(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854:t=>{t.exports=function(t,e,r,n,i){if(0===n.limit)return t._nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),f=r(6957),l=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=f.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=f.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=l(r,n),w(this,n=f.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=l(t,e),t=h(t),w(this,e=f.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{var n=r(4155);const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if("abort"===t){this.aborted=!0;const e={type:t,target:this};this.onabort(e),this._listeners.forEach((t=>t(e)),this)}}onabort(){}addEventListener(t,e){"abort"===t&&this._listeners.push(e)}removeEventListener(t,e){"abort"===t&&(this._listeners=this._listeners.filter((t=>t!==e)))}},c=new Set,f=(t,e)=>{const r=`LRU_CACHE_OPTION_${t}`;p(r)&&d(r,`${t} option`,`options.${e}`,v)},l=(t,e)=>{const r=`LRU_CACHE_METHOD_${t}`;if(p(r)){const{prototype:n}=v,{get:i}=Object.getOwnPropertyDescriptor(n,t);d(r,`${t} method`,`cache.${e}()`,i)}},h=(...t)=>{"object"==typeof n&&n&&"function"==typeof n.emitWarning?n.emitWarning(...t):console.error(...t)},p=t=>!c.has(t),d=(t,e,r,n)=>{c.add(t),h(`The ${e} is deprecated. Please use ${r} instead.`,"DeprecationWarning",t,n)},y=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),g=t=>y(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?b:null:null;class b extends Array{constructor(t){super(t),this.fill(0)}}class m{constructor(t){if(0===t)return[];const e=g(t);this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class v{constructor(t={}){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:b,maxSize:w=0,sizeCalculation:E,fetchMethod:_,fetchContext:S,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:A}=t,{length:O,maxAge:k,stale:x}=t instanceof v?{}:t;if(0!==e&&!y(e))throw new TypeError("max option must be a nonnegative integer");const R=e?g(e):Array;if(!R)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=w,this.sizeCalculation=E||O,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=S,!this.fetchMethod&&void 0!==S)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new R(e),this.prev=new R(e),this.head=0,this.tail=0,this.free=new m(e),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!T,0!==this.maxSize){if(!y(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!x,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=y(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||k||0,this.ttl){if(!y(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const t="LRU_CACHE_UNBOUNDED";p(t)&&(c.add(t),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,v))}x&&f("stale","allowStale"),k&&f("maxAge","ttl"),O&&f("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new b(this.max),this.starts=new b(this.max),this.setItemTTL=(t,e,r=i.now())=>{if(this.starts[t]=0!==e?r:0,this.ttls[t]=e,0!==e&&this.ttlAutopurge){const r=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),e+1);r.unref&&r.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const e=()=>{const e=i.now();if(this.ttlResolution>0){t=e;const r=setTimeout((()=>t=0),this.ttlResolution);r.unref&&r.unref()}return e};this.getRemainingTTL=r=>{const n=this.keyMap.get(r);return void 0===n?0:0===this.ttls[n]||0===this.starts[n]?1/0:this.starts[n]+this.ttls[n]-(t||e())},this.isStale=r=>0!==this.ttls[r]&&0!==this.starts[r]&&(t||e())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,e,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new b(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.requireSize=(t,e,r,n)=>{if(!y(r)){if(!n)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!y(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.addItemSize=(t,e,r,n)=>{this.sizes[t]=n;const i=this.maxSize-this.sizes[t];for(;this.calculatedSize>i;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,e,r,n){}requireSize(t,e,r,n){if(r||n)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.tail;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.head);)e=this.prev[e]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.head;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.tail);)e=this.next[e]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],e)}forEach(t,e=this){for(const r of this.indexes())t.call(e,this.valList[r],this.keyList[r],this)}rforEach(t,e=this){for(const r of this.rindexes())t.call(e,this.valList[r],this.keyList[r],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),t=!0);return t}dump(){const t=[];for(const e of this.indexes({allowStale:!0})){const r=this.keyList[e],n=this.valList[e],o={value:this.isBackgroundFetch(n)?n.__staleWhileFetching:n};if(this.ttls){o.ttl=this.ttls[e];const t=i.now()-this.starts[e];o.start=Math.floor(Date.now()-t)}this.sizes&&(o.size=this.sizes[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=i.now()-t}this.set(e,r.value,r)}}dispose(t,e,r){}set(t,e,{ttl:r=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){o=this.requireSize(t,e,o,s);let u=0===this.size?void 0:this.keyMap.get(t);if(void 0===u)u=this.newIndex(),this.keyList[u]=t,this.valList[u]=e,this.keyMap.set(t,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,e,t,o),a=!1;else{const r=this.valList[u];e!==r&&(this.isBackgroundFetch(r)?r.__abortController.abort():i||(this.dispose(r,t,"set"),this.disposeAfter&&this.disposed.push([r,t,"set"])),this.removeItemSize(u),this.valList[u]=e,this.addItemSize(u,e,t,o)),this.moveToTail(u)}if(0===r||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,r,n),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const e=this.head,r=this.keyList[e],n=this.valList[e];return this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,r,"evict"),this.disposeAfter&&this.disposed.push([n,r,"evict"])),this.removeItemSize(e),t&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(r),this.size--,e}has(t,{updateAgeOnHas:e=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return void 0!==r&&!this.isStale(r)&&(e&&this.updateItemAge(r),!0)}peek(t,{allowStale:e=this.allowStale}={}){const r=this.keyMap.get(t);if(void 0!==r&&(e||!this.isStale(r)))return this.valList[r]}backgroundFetch(t,e,r,n){const i=void 0===e?void 0:this.valList[e];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:r,context:n},u=new Promise((e=>e(this.fetchMethod(t,i,a)))).then((e=>(s.signal.aborted||this.set(t,e,a.options),e)),(n=>{if(this.valList[e]===u&&(r.noDeleteOnFetchRejection&&void 0!==u.__staleWhileFetching?this.valList[e]=u.__staleWhileFetching:this.delete(t)),u.__returned===u)throw n}));return u.__abortController=s,u.__staleWhileFetching=i,u.__returned=null,void 0===e?(this.set(t,u,a.options),e=this.keyMap.get(t)):this.valList[e]=u,u}isBackgroundFetch(t){return t&&"object"==typeof t&&"function"==typeof t.then&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||null===t.__returned)}async fetch(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext}={}){if(!this.fetchMethod)return this.get(t,{allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n});const l={allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:c};let h=this.keyMap.get(t);if(void 0===h){const e=this.backgroundFetch(t,h,l,f);return e.__returned=e}{const n=this.valList[h];if(this.isBackgroundFetch(n))return e&&void 0!==n.__staleWhileFetching?n.__staleWhileFetching:n.__returned=n;if(!this.isStale(h))return this.moveToTail(h),r&&this.updateItemAge(h),n;const i=this.backgroundFetch(t,h,l,f);return e&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(t);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?e?o.__staleWhileFetching:void 0:(n||this.delete(t),e?o:void 0);if(s)return;return this.moveToTail(i),r&&this.updateItemAge(i),o}}connect(t,e){this.prev[e]=t,this.next[t]=e}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return l("del","delete"),this.delete}delete(t){let e=!1;if(0!==this.size){const r=this.keyMap.get(t);if(void 0!==r)if(e=!0,1===this.size)this.clear();else{this.removeItemSize(r);const e=this.valList[r];this.isBackgroundFetch(e)?e.__abortController.abort():(this.dispose(e,t,"delete"),this.disposeAfter&&this.disposed.push([e,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(const t of this.rindexes({allowStale:!0})){const e=this.valList[t];if(this.isBackgroundFetch(e))e.__abortController.abort();else{const r=this.keyList[t];this.dispose(e,r,"delete"),this.disposeAfter&&this.disposed.push([e,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return((t,e)=>{const r="LRU_CACHE_PROPERTY_length";if(p(r)){const{prototype:e}=v,{get:n}=Object.getOwnPropertyDescriptor(e,t);d(r,"length property","cache.size",n)}})("length"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}t.exports=v},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},f=e.upperBoundInclusive=function(t){return!o(t,"lt")},l=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!f(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?f(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):f(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&l(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},6349:function(t,e){!function(t){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)},4155: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,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},4281:t=>{var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(9481),s=r(4229);r(5717)(f,o);for(var a=i(s.prototype),u=0;u{t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},f=r(4616);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):k(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?k(t,a,e,!1):P(t,a)):k(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(j,t,e))}function j(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function D(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var f=!1;function l(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(C,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(C,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{t.exports=f;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,f=r.g.Uint8Array||function(){},l=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,e))}(t,r,n,e,o);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?i.nextTick(k,t,r,s,o):k(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(L,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[l]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[l]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},2457:(t,e,r)=>{var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,u,c,f=!0;function l(t){function e(){r&&r(t,i),r=null}f?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)l(r);else if(!u&&c{var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var 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)=>t.term[0]>e.term[0]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],f=!0;return function t(l){var h=r?i(l):l,p={},d=!0,y={node:h,node_:l,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){f=!1},block:function(){d=!1}};if(!f)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=a(Object.prototype.toString),l=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function m(t){return"[object Set]"===f(t)}function v(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===f(t)}function k(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function x(t){return g(t,l)}function R(t){return g(t,h)}function L(t){return g(t,p)}function I(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=k,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=x,e.isStringObject=R,e.isBooleanObject=L,e.isBigIntObject=I,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return x(t)||R(t)||L(t)||I(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||k(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function l(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,f="",l=!1,_=["{","}"];return y(r)&&(l=!0,_=["[","]"]),A(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(f=" "+RegExp.prototype.toString.call(r)),S(r)&&(f=" "+Date.prototype.toUTCString.call(r)),T(r)&&(f=" "+p(r)),0!==s.length||l&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=l?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),L(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),x[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",R(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("String.prototype.slice"),l={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}l[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(l,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(s(t),8,-1))}},1861:t=>{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return null===n?o(JSON.stringify([null,"1.00"])):(s=n)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o(JSON.stringify([[],"1.00"])):Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(n)?o((a=n,new Promise((async e=>{const n={};for(const e in a)n[e]=await r(a[e],e,t);return e(n)})))):(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(n);var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o({max:1e3}),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),f=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:f.PAGE,_SCORE:f.SCORE,_SEARCH:f.SEARCH,_SORT:f.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:f.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:f.DICTIONARY,DISTINCT:f.DISTINCT,DOCUMENTS:f.DOCUMENTS,DOCUMENT_COUNT:f.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:f.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:f.QUERY,SEARCH:f.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenAppend:"#",tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:i.tokenizer},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),f=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},l=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>l((t=>i(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>l(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>l(f(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>l(((t,e)=>f({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),{ngraminator:i}=r(6349),o=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([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,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},f=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(f).then(l).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=f,e.SCORE_TERM_FREQUENCY=l},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.clear(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.clear();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.clear();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.clear(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.clear(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{r.r(e),r.d(e,{AbortError:()=>W,default:()=>G});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const s=t=>void 0===globalThis.DOMException?new o(t):new DOMException(t),a=t=>{const e=void 0===t.reason?s("This operation was aborted."):t.reason;return e instanceof Error?e:s(e)};var u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(){u.set(this,[])}enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&c(this,u,"f")[this.size-1].priority>=e.priority)return void c(this,u,"f").push(r);const n=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(c(this,u,"f"),r);c(this,u,"f").splice(n,0,r)}dequeue(){const t=c(this,u,"f").shift();return null==t?void 0:t.run}filter(t){return c(this,u,"f").filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return c(this,u,"f").length}}u=new WeakMap;var l,h,p,d,y,g,b,m,v,w,E,_,S,T,A,O,k,x,R,L,I,P,j,C,U,D,N,M,B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const z=()=>{},V=new i;class W extends Error{}class G extends n{constructor(t){var e,r,n,i;if(super(),l.add(this),h.set(this,void 0),p.set(this,void 0),d.set(this,0),y.set(this,void 0),g.set(this,void 0),b.set(this,0),m.set(this,void 0),v.set(this,void 0),w.set(this,void 0),E.set(this,void 0),_.set(this,0),S.set(this,void 0),T.set(this,void 0),A.set(this,z),O.set(this,z),k.set(this,void 0),x.set(this,void 0),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:f,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);B(this,h,t.carryoverConcurrencyCount,"f"),B(this,p,t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,"f"),B(this,y,t.intervalCap,"f"),B(this,g,t.interval,"f"),B(this,w,new t.queueClass,"f"),B(this,E,t.queueClass,"f"),this.concurrency=t.concurrency,B(this,k,t.timeout,"f"),B(this,x,!0===t.throwOnTimeout,"f"),B(this,T,!1===t.autoStart,"f")}get concurrency(){return F(this,S,"f")}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})`);B(this,S,t,"f"),F(this,l,"m",M).call(this)}async add(t,e={}){return new Promise(((r,n)=>{F(this,w,"f").enqueue((async()=>{var i,o,s;B(this,_,(o=F(this,_,"f"),++o),"f"),B(this,d,(s=F(this,d,"f"),++s),"f");try{if(null===(i=e.signal)||void 0===i?void 0:i.aborted)return void n(new W("The task was aborted."));const o=void 0===F(this,k,"f")&&void 0===e.timeout?t({signal:e.signal}):function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e!==Number.POSITIVE_INFINITY){if((n={customTimers:{setTimeout,clearTimeout},...n}).signal){const{signal:t}=n;t.aborted&&s(a(t)),t.addEventListener("abort",(()=>{s(a(t))}))}i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()}else o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t({signal:e.signal})),void 0===e.timeout?F(this,k,"f"):e.timeout,(()=>{(void 0===e.throwOnTimeout?F(this,x,"f"):e.throwOnTimeout)&&n(V)})),s=await o;r(s),this.emit("completed",s)}catch(t){n(t),this.emit("error",t)}F(this,l,"m",I).call(this)}),e),F(this,l,"m",U).call(this),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return F(this,T,"f")?(B(this,T,!1,"f"),F(this,l,"m",M).call(this),this):this}pause(){B(this,T,!0,"f")}clear(){B(this,w,new(F(this,E,"f")),"f")}async onEmpty(){if(0!==F(this,w,"f").size)return new Promise((t=>{const e=F(this,A,"f");B(this,A,(()=>{e(),t()}),"f")}))}async onSizeLessThan(t){if(!(F(this,w,"f").size{const r=()=>{F(this,w,"f").size{const e=F(this,O,"f");B(this,O,(()=>{e(),t()}),"f")}))}get size(){return F(this,w,"f").size}sizeBy(t){return F(this,w,"f").filter(t).length}get pending(){return F(this,_,"f")}get isPaused(){return F(this,T,"f")}get timeout(){return F(this,k,"f")}set timeout(t){B(this,k,t,"f")}}h=new WeakMap,p=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,E=new WeakMap,_=new WeakMap,S=new WeakMap,T=new WeakMap,A=new WeakMap,O=new WeakMap,k=new WeakMap,x=new WeakMap,l=new WeakSet,R=function(){return F(this,p,"f")||F(this,d,"f"){F(this,l,"m",j).call(this)}),e),"f"),!0;B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f")}return!1},U=function(){if(0===F(this,w,"f").size)return F(this,m,"f")&&clearInterval(F(this,m,"f")),B(this,m,void 0,"f"),F(this,l,"m",P).call(this),!1;if(!F(this,T,"f")){const t=!F(this,l,"m",C).call(this);if(F(this,l,"a",R)&&F(this,l,"a",L)){const e=F(this,w,"f").dequeue();return!!e&&(this.emit("active"),e(),t&&F(this,l,"m",D).call(this),!0)}}return!1},D=function(){F(this,p,"f")||void 0!==F(this,m,"f")||(B(this,m,setInterval((()=>{F(this,l,"m",N).call(this)}),F(this,g,"f")),"f"),B(this,b,Date.now()+F(this,g,"f"),"f"))},N=function(){0===F(this,d,"f")&&0===F(this,_,"f")&&F(this,m,"f")&&(clearInterval(F(this,m,"f")),B(this,m,void 0,"f")),B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f"),F(this,l,"m",M).call(this)},M=function(){for(;F(this,l,"m",U).call(this););}},4147:t=>{t.exports=JSON.parse('{"name":"search-index","version":"3.1.3","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.2.0","fuzzyset":"1.0.5","http-server":"14.1.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^17.0.0","stemmer":"^1.0.5","stopword":"^2.0.2","stream-browserify":"^3.0.0","tape":"^5.5.3","tape-run":"^10.0.0","webpack":"^5.72.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.6","level-js":"^6.1.0","leveldown":"^6.1.1","lru-cache":"^7.9.0","ngraminator":"^3.0.1","p-queue":"^7.2.0","term-vector":"^1.0.0"}}')}},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})},r(2225); \ No newline at end of file diff --git a/dist/search-index-esm-3.1.2.js.LICENSE.txt b/dist/search-index-esm-3.1.3.js.LICENSE.txt similarity index 100% rename from dist/search-index-esm-3.1.2.js.LICENSE.txt rename to dist/search-index-esm-3.1.3.js.LICENSE.txt diff --git a/dist/search-index.js b/dist/search-index.js index 1a30142e..d602978b 100644 --- a/dist/search-index.js +++ b/dist/search-index.js @@ -1,2 +1,2 @@ -/*! For license information please see search-index-3.1.2.js.LICENSE.txt */ -var SearchIndex;(()=>{var t={8508:(t,e,r)=>{"use strict";const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{"use strict";function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{"use strict";const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,f=Object.prototype.hasOwnProperty,l=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!f.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==l.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{"use strict";e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?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,a=o.length;s0)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>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(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(J(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(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 u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(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 l(t){return f(t),a(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:q(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 L(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t>>=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(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}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){V(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 U(t,e,r,n,i){V(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 D(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 N(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||j(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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=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>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r,n,i,o){if(t>r||t3?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 B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(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")}},1924:(t,e,r)=>{"use strict";var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},6957:(t,e,r)=>{"use strict";var n=r(886);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(t,e)=>{function r(t){for(var e="",r=0;r0?"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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function f(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(f,n),f.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},f.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},f.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},f.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])f.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=f},6944:(t,e,r)=>{"use strict";const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],f=Symbol("innerDb"),l=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[f]=t,this[l]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[f][r](...t);const e=a(t,h);return"opening"===this.status?this[l].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[f].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[l].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[f]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[f].status)return e(t||new Error("Database is not open"));const r=this[l];this[l]=[];for(const t of r)t.iterator?t.iterator.setDb(this[f]):this[f][t.method](...t.args);if(this[l].length>0)throw new Error("Did not expect further operations");e()};"new"===this[f].status||"closed"===this[f].status?this[f].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[f].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{"use strict";e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{"use strict";const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function f(t,e){if(!(this instanceof f))return new f(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function l(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=f,s(f,n),f.prototype.type="encoding-down",f.prototype._serializeKey=f.prototype._serializeValue=function(t){return t},f.prototype._open=function(t,e){this.db.open(t,e)},f.prototype._close=function(t){this.db.close(t)},f.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},f.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},f.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},l.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},l.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729: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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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{"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))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){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 l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(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;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,f=d(u,c);for(r=0;r=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=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return i({FIELD:n,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return i({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:e,LTE:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,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(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(t,e)))).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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),f=(t,e)=>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))))]})))):t,l=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:f(t.flat(),r),FACETS:f(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:f,BUCKET:l,BUCKETS:(...t)=>Promise.all(t.map(l)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((f=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>f(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},4029:(t,e,r)=>{"use strict";var n=r(5320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(t,e,r){for(var n=0,i=t.length;n=3&&(o=r),"[object Array]"===i.call(t)?s(t,e,o):"string"==typeof t?a(t,e,o):u(t,e,o)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),f=[],l=0;l{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},f=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=m.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,x=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,A,(function(t,e,r,i){n[n.length]=r?_(i,O,"$1"):e||t})),n},k=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/g,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=x(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),a=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!f&&(y[a]=c)}}return c}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419: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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},5320: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=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,c="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(u)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},8662:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{"use strict";const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{"use strict";const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{"use strict";function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{"use strict";const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{"use strict";t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),f=r(2854),l=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return f(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{"use strict";const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t._nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{"use strict";const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{"use strict";const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{"use strict";function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{"use strict";const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{"use strict";const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),f=r(6957),l=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=f.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=f.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=l(r,n),w(this,n=f.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=l(t,e),t=h(t),w(this,e=f.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{var n=r(4155);const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if("abort"===t){this.aborted=!0;const e={type:t,target:this};this.onabort(e),this._listeners.forEach((t=>t(e)),this)}}onabort(){}addEventListener(t,e){"abort"===t&&this._listeners.push(e)}removeEventListener(t,e){"abort"===t&&(this._listeners=this._listeners.filter((t=>t!==e)))}},c=new Set,f=(t,e)=>{const r=`LRU_CACHE_OPTION_${t}`;p(r)&&d(r,`${t} option`,`options.${e}`,v)},l=(t,e)=>{const r=`LRU_CACHE_METHOD_${t}`;if(p(r)){const{prototype:n}=v,{get:i}=Object.getOwnPropertyDescriptor(n,t);d(r,`${t} method`,`cache.${e}()`,i)}},h=(...t)=>{"object"==typeof n&&n&&"function"==typeof n.emitWarning?n.emitWarning(...t):console.error(...t)},p=t=>!c.has(t),d=(t,e,r,n)=>{c.add(t),h(`The ${e} is deprecated. Please use ${r} instead.`,"DeprecationWarning",t,n)},y=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),g=t=>y(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?b:null:null;class b extends Array{constructor(t){super(t),this.fill(0)}}class m{constructor(t){if(0===t)return[];const e=g(t);this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class v{constructor(t={}){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:b,maxSize:w=0,sizeCalculation:E,fetchMethod:_,fetchContext:S,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:A}=t,{length:O,maxAge:x,stale:k}=t instanceof v?{}:t;if(0!==e&&!y(e))throw new TypeError("max option must be a nonnegative integer");const R=e?g(e):Array;if(!R)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=w,this.sizeCalculation=E||O,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=S,!this.fetchMethod&&void 0!==S)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new R(e),this.prev=new R(e),this.head=0,this.tail=0,this.free=new m(e),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!T,0!==this.maxSize){if(!y(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!k,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=y(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||x||0,this.ttl){if(!y(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const t="LRU_CACHE_UNBOUNDED";p(t)&&(c.add(t),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,v))}k&&f("stale","allowStale"),x&&f("maxAge","ttl"),O&&f("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new b(this.max),this.starts=new b(this.max),this.setItemTTL=(t,e,r=i.now())=>{if(this.starts[t]=0!==e?r:0,this.ttls[t]=e,0!==e&&this.ttlAutopurge){const r=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),e+1);r.unref&&r.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const e=()=>{const e=i.now();if(this.ttlResolution>0){t=e;const r=setTimeout((()=>t=0),this.ttlResolution);r.unref&&r.unref()}return e};this.getRemainingTTL=r=>{const n=this.keyMap.get(r);return void 0===n?0:0===this.ttls[n]||0===this.starts[n]?1/0:this.starts[n]+this.ttls[n]-(t||e())},this.isStale=r=>0!==this.ttls[r]&&0!==this.starts[r]&&(t||e())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,e,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new b(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.requireSize=(t,e,r,n)=>{if(!y(r)){if(!n)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!y(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.addItemSize=(t,e,r,n)=>{this.sizes[t]=n;const i=this.maxSize-this.sizes[t];for(;this.calculatedSize>i;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,e,r,n){}requireSize(t,e,r,n){if(r||n)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.tail;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.head);)e=this.prev[e]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.head;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.tail);)e=this.next[e]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],e)}forEach(t,e=this){for(const r of this.indexes())t.call(e,this.valList[r],this.keyList[r],this)}rforEach(t,e=this){for(const r of this.rindexes())t.call(e,this.valList[r],this.keyList[r],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),t=!0);return t}dump(){const t=[];for(const e of this.indexes({allowStale:!0})){const r=this.keyList[e],n=this.valList[e],o={value:this.isBackgroundFetch(n)?n.__staleWhileFetching:n};if(this.ttls){o.ttl=this.ttls[e];const t=i.now()-this.starts[e];o.start=Math.floor(Date.now()-t)}this.sizes&&(o.size=this.sizes[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=i.now()-t}this.set(e,r.value,r)}}dispose(t,e,r){}set(t,e,{ttl:r=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){o=this.requireSize(t,e,o,s);let u=0===this.size?void 0:this.keyMap.get(t);if(void 0===u)u=this.newIndex(),this.keyList[u]=t,this.valList[u]=e,this.keyMap.set(t,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,e,t,o),a=!1;else{const r=this.valList[u];e!==r&&(this.isBackgroundFetch(r)?r.__abortController.abort():i||(this.dispose(r,t,"set"),this.disposeAfter&&this.disposed.push([r,t,"set"])),this.removeItemSize(u),this.valList[u]=e,this.addItemSize(u,e,t,o)),this.moveToTail(u)}if(0===r||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,r,n),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const e=this.head,r=this.keyList[e],n=this.valList[e];return this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,r,"evict"),this.disposeAfter&&this.disposed.push([n,r,"evict"])),this.removeItemSize(e),t&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(r),this.size--,e}has(t,{updateAgeOnHas:e=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return void 0!==r&&!this.isStale(r)&&(e&&this.updateItemAge(r),!0)}peek(t,{allowStale:e=this.allowStale}={}){const r=this.keyMap.get(t);if(void 0!==r&&(e||!this.isStale(r)))return this.valList[r]}backgroundFetch(t,e,r,n){const i=void 0===e?void 0:this.valList[e];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:r,context:n},u=new Promise((e=>e(this.fetchMethod(t,i,a)))).then((e=>(s.signal.aborted||this.set(t,e,a.options),e)),(n=>{if(this.valList[e]===u&&(r.noDeleteOnFetchRejection&&void 0!==u.__staleWhileFetching?this.valList[e]=u.__staleWhileFetching:this.delete(t)),u.__returned===u)throw n}));return u.__abortController=s,u.__staleWhileFetching=i,u.__returned=null,void 0===e?(this.set(t,u,a.options),e=this.keyMap.get(t)):this.valList[e]=u,u}isBackgroundFetch(t){return t&&"object"==typeof t&&"function"==typeof t.then&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||null===t.__returned)}async fetch(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext}={}){if(!this.fetchMethod)return this.get(t,{allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n});const l={allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:c};let h=this.keyMap.get(t);if(void 0===h){const e=this.backgroundFetch(t,h,l,f);return e.__returned=e}{const n=this.valList[h];if(this.isBackgroundFetch(n))return e&&void 0!==n.__staleWhileFetching?n.__staleWhileFetching:n.__returned=n;if(!this.isStale(h))return this.moveToTail(h),r&&this.updateItemAge(h),n;const i=this.backgroundFetch(t,h,l,f);return e&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(t);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?e?o.__staleWhileFetching:void 0:(n||this.delete(t),e?o:void 0);if(s)return;return this.moveToTail(i),r&&this.updateItemAge(i),o}}connect(t,e){this.prev[e]=t,this.next[t]=e}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return l("del","delete"),this.delete}delete(t){let e=!1;if(0!==this.size){const r=this.keyMap.get(t);if(void 0!==r)if(e=!0,1===this.size)this.clear();else{this.removeItemSize(r);const e=this.valList[r];this.isBackgroundFetch(e)?e.__abortController.abort():(this.dispose(e,t,"delete"),this.disposeAfter&&this.disposed.push([e,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(const t of this.rindexes({allowStale:!0})){const e=this.valList[t];if(this.isBackgroundFetch(e))e.__abortController.abort();else{const r=this.keyList[t];this.dispose(e,r,"delete"),this.disposeAfter&&this.disposed.push([e,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return((t,e)=>{const r="LRU_CACHE_PROPERTY_length";if(p(r)){const{prototype:e}=v,{get:n}=Object.getOwnPropertyDescriptor(e,t);d(r,"length property","cache.size",n)}})("length"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}t.exports=v},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},f=e.upperBoundInclusive=function(t){return!o(t,"lt")},l=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!f(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?f(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):f(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&l(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},6349: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)},4155: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,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(9481),s=r(4229);r(5717)(f,o);for(var a=i(s.prototype),u=0;u{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},f=r(4616);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):x(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):P(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(j,t,e))}function j(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function D(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var f=!1;function l(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(C,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(C,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{"use strict";t.exports=f;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,f=r.g.Uint8Array||function(){},l=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,e))}(t,r,n,e,o);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),n?i.nextTick(x,t,r,s,o):x(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(L,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[l]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[l]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,u,c,f=!0;function l(t){function e(){r&&r(t,i),r=null}f?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)l(r);else if(!u&&c{"use strict";var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var 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)=>t.term[0]>e.term[0]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],f=!0;return function t(l){var h=r?i(l):l,p={},d=!0,y={node:h,node_:l,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){f=!1},block:function(){d=!1}};if(!f)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=a(Object.prototype.toString),l=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function m(t){return"[object Set]"===f(t)}function v(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===f(t)}function x(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function k(t){return g(t,l)}function R(t){return g(t,h)}function L(t){return g(t,p)}function I(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=k,e.isStringObject=R,e.isBooleanObject=L,e.isBigIntObject=I,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return k(t)||R(t)||L(t)||I(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function l(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,f="",l=!1,_=["{","}"];return y(r)&&(l=!0,_=["[","]"]),A(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(f=" "+RegExp.prototype.toString.call(r)),S(r)&&(f=" "+Date.prototype.toUTCString.call(r)),T(r)&&(f=" "+p(r)),0!==s.length||l&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=l?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),L(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",R(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("String.prototype.slice"),l={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}l[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(l,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(s(t),8,-1))}},1861:t=>{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return null===n?o(JSON.stringify([null,"1.00"])):(s=n)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o(JSON.stringify([[],"1.00"])):Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(n)?o((a=n,new Promise((async e=>{const n={};for(const e in a)n[e]=await r(a[e],e,t);return e(n)})))):(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(n);var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o({max:1e3}),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),f=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:f.PAGE,_SCORE:f.SCORE,_SEARCH:f.SEARCH,_SORT:f.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:f.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:f.DICTIONARY,DISTINCT:f.DISTINCT,DOCUMENTS:f.DOCUMENTS,DOCUMENT_COUNT:f.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:f.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:f.QUERY,SEARCH:f.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenAppend:"#",tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:i.tokenizer},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),f=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},l=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>l((t=>i(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>l(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>l(f(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>l(((t,e)=>f({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),{ngraminator:i}=r(6349),o=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([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,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},f=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(f).then(l).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=f,e.SCORE_TERM_FREQUENCY=l},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.reset(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.reset();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.reset();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.reset(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.reset(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbortError:()=>W,default:()=>G});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const s=t=>void 0===globalThis.DOMException?new o(t):new DOMException(t),a=t=>{const e=void 0===t.reason?s("This operation was aborted."):t.reason;return e instanceof Error?e:s(e)};var u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(){u.set(this,[])}enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&c(this,u,"f")[this.size-1].priority>=e.priority)return void c(this,u,"f").push(r);const n=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(c(this,u,"f"),r);c(this,u,"f").splice(n,0,r)}dequeue(){const t=c(this,u,"f").shift();return null==t?void 0:t.run}filter(t){return c(this,u,"f").filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return c(this,u,"f").length}}u=new WeakMap;var l,h,p,d,y,g,b,m,v,w,E,_,S,T,A,O,x,k,R,L,I,P,j,C,U,D,N,M,B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const z=()=>{},V=new i;class W extends Error{}class G extends n{constructor(t){var e,r,n,i;if(super(),l.add(this),h.set(this,void 0),p.set(this,void 0),d.set(this,0),y.set(this,void 0),g.set(this,void 0),b.set(this,0),m.set(this,void 0),v.set(this,void 0),w.set(this,void 0),E.set(this,void 0),_.set(this,0),S.set(this,void 0),T.set(this,void 0),A.set(this,z),O.set(this,z),x.set(this,void 0),k.set(this,void 0),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:f,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);B(this,h,t.carryoverConcurrencyCount,"f"),B(this,p,t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,"f"),B(this,y,t.intervalCap,"f"),B(this,g,t.interval,"f"),B(this,w,new t.queueClass,"f"),B(this,E,t.queueClass,"f"),this.concurrency=t.concurrency,B(this,x,t.timeout,"f"),B(this,k,!0===t.throwOnTimeout,"f"),B(this,T,!1===t.autoStart,"f")}get concurrency(){return F(this,S,"f")}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})`);B(this,S,t,"f"),F(this,l,"m",M).call(this)}async add(t,e={}){return new Promise(((r,n)=>{F(this,w,"f").enqueue((async()=>{var i,o,s;B(this,_,(o=F(this,_,"f"),++o),"f"),B(this,d,(s=F(this,d,"f"),++s),"f");try{if(null===(i=e.signal)||void 0===i?void 0:i.aborted)return void n(new W("The task was aborted."));const o=void 0===F(this,x,"f")&&void 0===e.timeout?t({signal:e.signal}):function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e!==Number.POSITIVE_INFINITY){if((n={customTimers:{setTimeout,clearTimeout},...n}).signal){const{signal:t}=n;t.aborted&&s(a(t)),t.addEventListener("abort",(()=>{s(a(t))}))}i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()}else o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t({signal:e.signal})),void 0===e.timeout?F(this,x,"f"):e.timeout,(()=>{(void 0===e.throwOnTimeout?F(this,k,"f"):e.throwOnTimeout)&&n(V)})),s=await o;r(s),this.emit("completed",s)}catch(t){n(t),this.emit("error",t)}F(this,l,"m",I).call(this)}),e),F(this,l,"m",U).call(this),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return F(this,T,"f")?(B(this,T,!1,"f"),F(this,l,"m",M).call(this),this):this}pause(){B(this,T,!0,"f")}clear(){B(this,w,new(F(this,E,"f")),"f")}async onEmpty(){if(0!==F(this,w,"f").size)return new Promise((t=>{const e=F(this,A,"f");B(this,A,(()=>{e(),t()}),"f")}))}async onSizeLessThan(t){if(!(F(this,w,"f").size{const r=()=>{F(this,w,"f").size{const e=F(this,O,"f");B(this,O,(()=>{e(),t()}),"f")}))}get size(){return F(this,w,"f").size}sizeBy(t){return F(this,w,"f").filter(t).length}get pending(){return F(this,_,"f")}get isPaused(){return F(this,T,"f")}get timeout(){return F(this,x,"f")}set timeout(t){B(this,x,t,"f")}}h=new WeakMap,p=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,E=new WeakMap,_=new WeakMap,S=new WeakMap,T=new WeakMap,A=new WeakMap,O=new WeakMap,x=new WeakMap,k=new WeakMap,l=new WeakSet,R=function(){return F(this,p,"f")||F(this,d,"f"){F(this,l,"m",j).call(this)}),e),"f"),!0;B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f")}return!1},U=function(){if(0===F(this,w,"f").size)return F(this,m,"f")&&clearInterval(F(this,m,"f")),B(this,m,void 0,"f"),F(this,l,"m",P).call(this),!1;if(!F(this,T,"f")){const t=!F(this,l,"m",C).call(this);if(F(this,l,"a",R)&&F(this,l,"a",L)){const e=F(this,w,"f").dequeue();return!!e&&(this.emit("active"),e(),t&&F(this,l,"m",D).call(this),!0)}}return!1},D=function(){F(this,p,"f")||void 0!==F(this,m,"f")||(B(this,m,setInterval((()=>{F(this,l,"m",N).call(this)}),F(this,g,"f")),"f"),B(this,b,Date.now()+F(this,g,"f"),"f"))},N=function(){0===F(this,d,"f")&&0===F(this,_,"f")&&F(this,m,"f")&&(clearInterval(F(this,m,"f")),B(this,m,void 0,"f")),B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f"),F(this,l,"m",M).call(this)},M=function(){for(;F(this,l,"m",U).call(this););}},4147:t=>{"use strict";t.exports=JSON.parse('{"name":"search-index","version":"3.1.2","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.2.0","fuzzyset":"1.0.5","http-server":"14.1.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^17.0.0","stemmer":"^1.0.5","stopword":"^2.0.2","stream-browserify":"^3.0.0","tape":"^5.5.3","tape-run":"^10.0.0","webpack":"^5.72.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.6","level-js":"^6.1.0","leveldown":"^6.1.1","lru-cache":"^7.9.0","ngraminator":"^3.0.1","p-queue":"^7.2.0","term-vector":"^1.0.0"}}')}},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=r(2225);SearchIndex=n})(); \ No newline at end of file +/*! For license information please see search-index-3.1.3.js.LICENSE.txt */ +var SearchIndex;(()=>{var t={8508:(t,e,r)=>{"use strict";const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{"use strict";function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{"use strict";const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,f=Object.prototype.hasOwnProperty,l=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!f.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==l.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{"use strict";e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?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,a=o.length;s0)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>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(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(J(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(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 u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(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 l(t){return f(t),a(t<0?0:0|d(t))}function h(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:q(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 L(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(J(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t>>=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(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}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){V(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 U(t,e,r,n,i){V(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 D(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 N(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(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)<>>=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)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||j(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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=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>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r,n,i,o){if(t>r||t3?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 B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||G(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(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")}},1924:(t,e,r)=>{"use strict";var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},6957:(t,e,r)=>{"use strict";var n=r(886);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(t,e)=>{function r(t){for(var e="",r=0;r0?"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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function f(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(f,n),f.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},f.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},f.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},f.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])f.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=f},6944:(t,e,r)=>{"use strict";const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],f=Symbol("innerDb"),l=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[f]=t,this[l]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[f][r](...t);const e=a(t,h);return"opening"===this.status?this[l].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[f].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[l].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[f]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[f].status)return e(t||new Error("Database is not open"));const r=this[l];this[l]=[];for(const t of r)t.iterator?t.iterator.setDb(this[f]):this[f][t.method](...t.args);if(this[l].length>0)throw new Error("Did not expect further operations");e()};"new"===this[f].status||"closed"===this[f].status?this[f].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[f].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{"use strict";e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{"use strict";const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function f(t,e){if(!(this instanceof f))return new f(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function l(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=f,s(f,n),f.prototype.type="encoding-down",f.prototype._serializeKey=f.prototype._serializeValue=function(t){return t},f.prototype._open=function(t,e){this.db.open(t,e)},f.prototype._close=function(t){this.db.close(t)},f.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},f.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},f.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},l.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},l.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729: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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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{"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))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){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 l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(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;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,f=d(u,c);for(r=0;r=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=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return i({FIELD:n,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return i({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:e,LTE:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,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(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(t,e)))).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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),f=(t,e)=>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))))]})))):t,l=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:f(t.flat(),r),FACETS:f(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:f,BUCKET:l,BUCKETS:(...t)=>Promise.all(t.map(l)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((f=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>f(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},4029:(t,e,r)=>{"use strict";var n=r(5320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(t,e,r){for(var n=0,i=t.length;n=3&&(o=r),"[object Array]"===i.call(t)?s(t,e,o):"string"==typeof t?a(t,e,o):u(t,e,o)}},7648:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),f=[],l=0;l{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},f=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":f,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=m.call(Function.call,RegExp.prototype.exec),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,x=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,A,(function(t,e,r,i){n[n.length]=r?_(i,O,"$1"):e||t})),n},k=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/g,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=x(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),a=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],E(r,w([0,1],l)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!f&&(y[a]=c)}}return c}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419: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(e 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 n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},5320: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=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,c="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=i?function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)}:function(t){if(t===c)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(u)return function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var e=a.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},8662:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{"use strict";const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{"use strict";const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{"use strict";function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{"use strict";const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{"use strict";t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),f=r(2854),l=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return f(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{"use strict";const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t._nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{"use strict";const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{"use strict";const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{"use strict";function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{"use strict";const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{"use strict";const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),f=r(6957),l=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=f.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=f.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=l(r,n),w(this,n=f.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:l(e,r),w(this,r=f.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=l(t,e),t=h(t),w(this,e=f.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{var n=r(4155);const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o="function"==typeof AbortController?AbortController:class{constructor(){this.signal=new u}abort(){this.signal.dispatchEvent("abort")}},s="function"==typeof AbortSignal,a="function"==typeof o.AbortSignal,u=s?AbortSignal:a?o.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if("abort"===t){this.aborted=!0;const e={type:t,target:this};this.onabort(e),this._listeners.forEach((t=>t(e)),this)}}onabort(){}addEventListener(t,e){"abort"===t&&this._listeners.push(e)}removeEventListener(t,e){"abort"===t&&(this._listeners=this._listeners.filter((t=>t!==e)))}},c=new Set,f=(t,e)=>{const r=`LRU_CACHE_OPTION_${t}`;p(r)&&d(r,`${t} option`,`options.${e}`,v)},l=(t,e)=>{const r=`LRU_CACHE_METHOD_${t}`;if(p(r)){const{prototype:n}=v,{get:i}=Object.getOwnPropertyDescriptor(n,t);d(r,`${t} method`,`cache.${e}()`,i)}},h=(...t)=>{"object"==typeof n&&n&&"function"==typeof n.emitWarning?n.emitWarning(...t):console.error(...t)},p=t=>!c.has(t),d=(t,e,r,n)=>{c.add(t),h(`The ${e} is deprecated. Please use ${r} instead.`,"DeprecationWarning",t,n)},y=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),g=t=>y(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?b:null:null;class b extends Array{constructor(t){super(t),this.fill(0)}}class m{constructor(t){if(0===t)return[];const e=g(t);this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class v{constructor(t={}){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:u,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:b,maxSize:w=0,sizeCalculation:E,fetchMethod:_,fetchContext:S,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:A}=t,{length:O,maxAge:x,stale:k}=t instanceof v?{}:t;if(0!==e&&!y(e))throw new TypeError("max option must be a nonnegative integer");const R=e?g(e):Array;if(!R)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=w,this.sizeCalculation=E||O,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=_||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=S,!this.fetchMethod&&void 0!==S)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(e).fill(null),this.valList=new Array(e).fill(null),this.next=new R(e),this.prev=new R(e),this.head=0,this.tail=0,this.free=new m(e),this.initialFill=1,this.size=0,"function"==typeof u&&(this.dispose=u),"function"==typeof l?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!T,0!==this.maxSize){if(!y(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!k,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=y(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||x||0,this.ttl){if(!y(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const t="LRU_CACHE_UNBOUNDED";p(t)&&(c.add(t),h("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,v))}k&&f("stale","allowStale"),x&&f("maxAge","ttl"),O&&f("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new b(this.max),this.starts=new b(this.max),this.setItemTTL=(t,e,r=i.now())=>{if(this.starts[t]=0!==e?r:0,this.ttls[t]=e,0!==e&&this.ttlAutopurge){const r=setTimeout((()=>{this.isStale(t)&&this.delete(this.keyList[t])}),e+1);r.unref&&r.unref()}},this.updateItemAge=t=>{this.starts[t]=0!==this.ttls[t]?i.now():0};let t=0;const e=()=>{const e=i.now();if(this.ttlResolution>0){t=e;const r=setTimeout((()=>t=0),this.ttlResolution);r.unref&&r.unref()}return e};this.getRemainingTTL=r=>{const n=this.keyMap.get(r);return void 0===n?0:0===this.ttls[n]||0===this.starts[n]?1/0:this.starts[n]+this.ttls[n]-(t||e())},this.isStale=r=>0!==this.ttls[r]&&0!==this.starts[r]&&(t||e())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,e,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new b(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.requireSize=(t,e,r,n)=>{if(!y(r)){if(!n)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!y(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.addItemSize=(t,e,r,n)=>{this.sizes[t]=n;const i=this.maxSize-this.sizes[t];for(;this.calculatedSize>i;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,e,r,n){}requireSize(t,e,r,n){if(r||n)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.tail;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.head);)e=this.prev[e]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.head;this.isValidIndex(e)&&(!t&&this.isStale(e)||(yield e),e!==this.tail);)e=this.next[e]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,e={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],e)}forEach(t,e=this){for(const r of this.indexes())t.call(e,this.valList[r],this.keyList[r],this)}rforEach(t,e=this){for(const r of this.rindexes())t.call(e,this.valList[r],this.keyList[r],this)}get prune(){return l("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const e of this.rindexes({allowStale:!0}))this.isStale(e)&&(this.delete(this.keyList[e]),t=!0);return t}dump(){const t=[];for(const e of this.indexes({allowStale:!0})){const r=this.keyList[e],n=this.valList[e],o={value:this.isBackgroundFetch(n)?n.__staleWhileFetching:n};if(this.ttls){o.ttl=this.ttls[e];const t=i.now()-this.starts[e];o.start=Math.floor(Date.now()-t)}this.sizes&&(o.size=this.sizes[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=i.now()-t}this.set(e,r.value,r)}}dispose(t,e,r){}set(t,e,{ttl:r=this.ttl,start:n,noDisposeOnSet:i=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){o=this.requireSize(t,e,o,s);let u=0===this.size?void 0:this.keyMap.get(t);if(void 0===u)u=this.newIndex(),this.keyList[u]=t,this.valList[u]=e,this.keyMap.set(t,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,e,t,o),a=!1;else{const r=this.valList[u];e!==r&&(this.isBackgroundFetch(r)?r.__abortController.abort():i||(this.dispose(r,t,"set"),this.disposeAfter&&this.disposed.push([r,t,"set"])),this.removeItemSize(u),this.valList[u]=e,this.addItemSize(u,e,t,o)),this.moveToTail(u)}if(0===r||0!==this.ttl||this.ttls||this.initializeTTLTracking(),a||this.setItemTTL(u,r,n),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const e=this.head,r=this.keyList[e],n=this.valList[e];return this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,r,"evict"),this.disposeAfter&&this.disposed.push([n,r,"evict"])),this.removeItemSize(e),t&&(this.keyList[e]=null,this.valList[e]=null,this.free.push(e)),this.head=this.next[e],this.keyMap.delete(r),this.size--,e}has(t,{updateAgeOnHas:e=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return void 0!==r&&!this.isStale(r)&&(e&&this.updateItemAge(r),!0)}peek(t,{allowStale:e=this.allowStale}={}){const r=this.keyMap.get(t);if(void 0!==r&&(e||!this.isStale(r)))return this.valList[r]}backgroundFetch(t,e,r,n){const i=void 0===e?void 0:this.valList[e];if(this.isBackgroundFetch(i))return i;const s=new o,a={signal:s.signal,options:r,context:n},u=new Promise((e=>e(this.fetchMethod(t,i,a)))).then((e=>(s.signal.aborted||this.set(t,e,a.options),e)),(n=>{if(this.valList[e]===u&&(r.noDeleteOnFetchRejection&&void 0!==u.__staleWhileFetching?this.valList[e]=u.__staleWhileFetching:this.delete(t)),u.__returned===u)throw n}));return u.__abortController=s,u.__staleWhileFetching=i,u.__returned=null,void 0===e?(this.set(t,u,a.options),e=this.keyMap.get(t)):this.valList[e]=u,u}isBackgroundFetch(t){return t&&"object"==typeof t&&"function"==typeof t.then&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||null===t.__returned)}async fetch(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext}={}){if(!this.fetchMethod)return this.get(t,{allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n});const l={allowStale:e,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:i,noDisposeOnSet:o,size:s,sizeCalculation:a,noUpdateTTL:u,noDeleteOnFetchRejection:c};let h=this.keyMap.get(t);if(void 0===h){const e=this.backgroundFetch(t,h,l,f);return e.__returned=e}{const n=this.valList[h];if(this.isBackgroundFetch(n))return e&&void 0!==n.__staleWhileFetching?n.__staleWhileFetching:n.__returned=n;if(!this.isStale(h))return this.moveToTail(h),r&&this.updateItemAge(h),n;const i=this.backgroundFetch(t,h,l,f);return e&&void 0!==i.__staleWhileFetching?i.__staleWhileFetching:i.__returned=i}}get(t,{allowStale:e=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet}={}){const i=this.keyMap.get(t);if(void 0!==i){const o=this.valList[i],s=this.isBackgroundFetch(o);if(this.isStale(i))return s?e?o.__staleWhileFetching:void 0:(n||this.delete(t),e?o:void 0);if(s)return;return this.moveToTail(i),r&&this.updateItemAge(i),o}}connect(t,e){this.prev[e]=t,this.next[t]=e}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return l("del","delete"),this.delete}delete(t){let e=!1;if(0!==this.size){const r=this.keyMap.get(t);if(void 0!==r)if(e=!0,1===this.size)this.clear();else{this.removeItemSize(r);const e=this.valList[r];this.isBackgroundFetch(e)?e.__abortController.abort():(this.dispose(e,t,"delete"),this.disposeAfter&&this.disposed.push([e,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return e}clear(){for(const t of this.rindexes({allowStale:!0})){const e=this.valList[t];if(this.isBackgroundFetch(e))e.__abortController.abort();else{const r=this.keyList[t];this.dispose(e,r,"delete"),this.disposeAfter&&this.disposed.push([e,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l("reset","clear"),this.clear}get length(){return((t,e)=>{const r="LRU_CACHE_PROPERTY_length";if(p(r)){const{prototype:e}=v,{get:n}=Object.getOwnPropertyDescriptor(e,t);d(r,"length property","cache.size",n)}})("length"),this.size}static get AbortController(){return o}static get AbortSignal(){return u}}t.exports=v},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},f=e.upperBoundInclusive=function(t){return!o(t,"lt")},l=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!f(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?f(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):f(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&l(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},6349: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)},4155: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,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var o=r(9481),s=r(4229);r(5717)(f,o);for(var a=i(s.prototype),u=0;u{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},f=r(4616);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=r(2553).s),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):x(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):P(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function L(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(j,t,e))}function j(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function D(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function B(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function z(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):L(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&B(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var f=!1;function l(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==z(n.pipes,t))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(C,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(C,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{"use strict";t.exports=f;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,f=r.g.Uint8Array||function(){},l=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(I,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),I(t,e))}(t,r,n,e,o);else{var s=R(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),n?i.nextTick(x,t,r,s,o):x(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=R(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(L,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[l]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,f,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[l]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[l]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,u,c,f=!0;function l(t){function e(){r&&r(t,i),r=null}f?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)l(r);else if(!u&&c{"use strict";var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var 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)=>t.term[0]>e.term[0]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],f=!0;return function t(l){var h=r?i(l):l,p={},d=!0,y={node:h,node_:l,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){f=!1},block:function(){d=!1}};if(!f)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=a(Object.prototype.toString),l=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===f(t)}function m(t){return"[object Set]"===f(t)}function v(t){return"[object WeakMap]"===f(t)}function w(t){return"[object WeakSet]"===f(t)}function E(t){return"[object ArrayBuffer]"===f(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===f(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===f(t)}function x(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function k(t){return g(t,l)}function R(t){return g(t,h)}function L(t){return g(t,p)}function I(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===f(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===f(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===f(t)},e.isGeneratorObject=function(t){return"[object Generator]"===f(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===f(t)},e.isNumberObject=k,e.isStringObject=R,e.isBooleanObject=L,e.isBigIntObject=I,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return k(t)||R(t)||L(t)||I(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function l(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,f="",l=!1,_=["{","}"];return y(r)&&(l=!0,_=["[","]"]),A(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(f=" "+RegExp.prototype.toString.call(r)),S(r)&&(f=" "+Date.prototype.toUTCString.call(r)),T(r)&&(f=" "+p(r)),0!==s.length||l&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=l?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,f,_)):_[0]+f+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),L(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),k[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",R(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),f=o("String.prototype.slice"),l={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}l[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(l,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(s(t),8,-1))}},1861:t=>{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return null===n?o(JSON.stringify([null,"1.00"])):(s=n)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o(JSON.stringify([[],"1.00"])):Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(n)?o((a=n,new Promise((async e=>{const n={};for(const e in a)n[e]=await r(a[e],e,t);return e(n)})))):(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(n);var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o({max:1e3}),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),f=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:f.PAGE,_SCORE:f.SCORE,_SEARCH:f.SEARCH,_SORT:f.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:f.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:f.DICTIONARY,DISTINCT:f.DISTINCT,DOCUMENTS:f.DOCUMENTS,DOCUMENT_COUNT:f.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:f.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:f.QUERY,SEARCH:f.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenAppend:"#",tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:i.tokenizer},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),f=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},l=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>l((t=>i(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>l(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>l(f(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>l(((t,e)=>f({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),{ngraminator:i}=r(6349),o=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([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,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},f=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(f).then(l).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=f,e.SCORE_TERM_FREQUENCY=l},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.clear(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.clear();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.clear();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.clear(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.clear(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{"use strict";r.r(e),r.d(e,{AbortError:()=>W,default:()=>G});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const s=t=>void 0===globalThis.DOMException?new o(t):new DOMException(t),a=t=>{const e=void 0===t.reason?s("This operation was aborted."):t.reason;return e instanceof Error?e:s(e)};var u,c=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};class f{constructor(){u.set(this,[])}enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&c(this,u,"f")[this.size-1].priority>=e.priority)return void c(this,u,"f").push(r);const n=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(c(this,u,"f"),r);c(this,u,"f").splice(n,0,r)}dequeue(){const t=c(this,u,"f").shift();return null==t?void 0:t.run}filter(t){return c(this,u,"f").filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return c(this,u,"f").length}}u=new WeakMap;var l,h,p,d,y,g,b,m,v,w,E,_,S,T,A,O,x,k,R,L,I,P,j,C,U,D,N,M,B=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},F=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const z=()=>{},V=new i;class W extends Error{}class G extends n{constructor(t){var e,r,n,i;if(super(),l.add(this),h.set(this,void 0),p.set(this,void 0),d.set(this,0),y.set(this,void 0),g.set(this,void 0),b.set(this,0),m.set(this,void 0),v.set(this,void 0),w.set(this,void 0),E.set(this,void 0),_.set(this,0),S.set(this,void 0),T.set(this,void 0),A.set(this,z),O.set(this,z),x.set(this,void 0),k.set(this,void 0),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:f,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);B(this,h,t.carryoverConcurrencyCount,"f"),B(this,p,t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,"f"),B(this,y,t.intervalCap,"f"),B(this,g,t.interval,"f"),B(this,w,new t.queueClass,"f"),B(this,E,t.queueClass,"f"),this.concurrency=t.concurrency,B(this,x,t.timeout,"f"),B(this,k,!0===t.throwOnTimeout,"f"),B(this,T,!1===t.autoStart,"f")}get concurrency(){return F(this,S,"f")}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})`);B(this,S,t,"f"),F(this,l,"m",M).call(this)}async add(t,e={}){return new Promise(((r,n)=>{F(this,w,"f").enqueue((async()=>{var i,o,s;B(this,_,(o=F(this,_,"f"),++o),"f"),B(this,d,(s=F(this,d,"f"),++s),"f");try{if(null===(i=e.signal)||void 0===i?void 0:i.aborted)return void n(new W("The task was aborted."));const o=void 0===F(this,x,"f")&&void 0===e.timeout?t({signal:e.signal}):function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e!==Number.POSITIVE_INFINITY){if((n={customTimers:{setTimeout,clearTimeout},...n}).signal){const{signal:t}=n;t.aborted&&s(a(t)),t.addEventListener("abort",(()=>{s(a(t))}))}i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()}else o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t({signal:e.signal})),void 0===e.timeout?F(this,x,"f"):e.timeout,(()=>{(void 0===e.throwOnTimeout?F(this,k,"f"):e.throwOnTimeout)&&n(V)})),s=await o;r(s),this.emit("completed",s)}catch(t){n(t),this.emit("error",t)}F(this,l,"m",I).call(this)}),e),F(this,l,"m",U).call(this),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return F(this,T,"f")?(B(this,T,!1,"f"),F(this,l,"m",M).call(this),this):this}pause(){B(this,T,!0,"f")}clear(){B(this,w,new(F(this,E,"f")),"f")}async onEmpty(){if(0!==F(this,w,"f").size)return new Promise((t=>{const e=F(this,A,"f");B(this,A,(()=>{e(),t()}),"f")}))}async onSizeLessThan(t){if(!(F(this,w,"f").size{const r=()=>{F(this,w,"f").size{const e=F(this,O,"f");B(this,O,(()=>{e(),t()}),"f")}))}get size(){return F(this,w,"f").size}sizeBy(t){return F(this,w,"f").filter(t).length}get pending(){return F(this,_,"f")}get isPaused(){return F(this,T,"f")}get timeout(){return F(this,x,"f")}set timeout(t){B(this,x,t,"f")}}h=new WeakMap,p=new WeakMap,d=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,m=new WeakMap,v=new WeakMap,w=new WeakMap,E=new WeakMap,_=new WeakMap,S=new WeakMap,T=new WeakMap,A=new WeakMap,O=new WeakMap,x=new WeakMap,k=new WeakMap,l=new WeakSet,R=function(){return F(this,p,"f")||F(this,d,"f"){F(this,l,"m",j).call(this)}),e),"f"),!0;B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f")}return!1},U=function(){if(0===F(this,w,"f").size)return F(this,m,"f")&&clearInterval(F(this,m,"f")),B(this,m,void 0,"f"),F(this,l,"m",P).call(this),!1;if(!F(this,T,"f")){const t=!F(this,l,"m",C).call(this);if(F(this,l,"a",R)&&F(this,l,"a",L)){const e=F(this,w,"f").dequeue();return!!e&&(this.emit("active"),e(),t&&F(this,l,"m",D).call(this),!0)}}return!1},D=function(){F(this,p,"f")||void 0!==F(this,m,"f")||(B(this,m,setInterval((()=>{F(this,l,"m",N).call(this)}),F(this,g,"f")),"f"),B(this,b,Date.now()+F(this,g,"f"),"f"))},N=function(){0===F(this,d,"f")&&0===F(this,_,"f")&&F(this,m,"f")&&(clearInterval(F(this,m,"f")),B(this,m,void 0,"f")),B(this,d,F(this,h,"f")?F(this,_,"f"):0,"f"),F(this,l,"m",M).call(this)},M=function(){for(;F(this,l,"m",U).call(this););}},4147:t=>{"use strict";t.exports=JSON.parse('{"name":"search-index","version":"3.1.3","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.2.0","fuzzyset":"1.0.5","http-server":"14.1.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^17.0.0","stemmer":"^1.0.5","stopword":"^2.0.2","stream-browserify":"^3.0.0","tape":"^5.5.3","tape-run":"^10.0.0","webpack":"^5.72.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.6","level-js":"^6.1.0","leveldown":"^6.1.1","lru-cache":"^7.9.0","ngraminator":"^3.0.1","p-queue":"^7.2.0","term-vector":"^1.0.0"}}')}},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=r(2225);SearchIndex=n})(); \ No newline at end of file