@openhps/rdf 0.1.11 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.eslintrc.js +39 -0
  2. package/.prettierrc.js +8 -0
  3. package/commitlint.config.js +1 -0
  4. package/dist/cjs/index.serialization.d.ts +1 -0
  5. package/dist/cjs/index.serialization.js +14 -0
  6. package/dist/cjs/index.serialization.js.map +1 -1
  7. package/dist/cjs/rdf/InternalRDFSerializer.js +7 -1
  8. package/dist/cjs/rdf/InternalRDFSerializer.js.map +1 -1
  9. package/dist/esm/index.serialization.d.ts +1 -0
  10. package/dist/esm/index.serialization.js +2 -0
  11. package/dist/esm/index.serialization.js.map +1 -1
  12. package/dist/esm/rdf/InternalRDFSerializer.js +7 -1
  13. package/dist/esm/rdf/InternalRDFSerializer.js.map +1 -1
  14. package/dist/types/index.serialization.d.ts +1 -0
  15. package/dist/web/openhps-rdf.all.es.js +14 -2
  16. package/dist/web/openhps-rdf.all.es.js.map +1 -1
  17. package/dist/web/openhps-rdf.all.es.min.js +1 -1
  18. package/dist/web/openhps-rdf.all.es.min.js.map +1 -1
  19. package/dist/web/openhps-rdf.all.js +12 -1
  20. package/dist/web/openhps-rdf.all.js.map +1 -1
  21. package/dist/web/openhps-rdf.all.min.js +1 -1
  22. package/dist/web/openhps-rdf.all.min.js.map +1 -1
  23. package/dist/web/openhps-rdf.serialization.es.js +1816 -5
  24. package/dist/web/openhps-rdf.serialization.es.js.map +1 -1
  25. package/dist/web/openhps-rdf.serialization.es.min.js +1 -1
  26. package/dist/web/openhps-rdf.serialization.es.min.js.LICENSE.txt +2 -0
  27. package/dist/web/openhps-rdf.serialization.es.min.js.map +1 -1
  28. package/dist/web/openhps-rdf.serialization.js +1819 -4
  29. package/dist/web/openhps-rdf.serialization.js.map +1 -1
  30. package/dist/web/openhps-rdf.serialization.min.js +1 -1
  31. package/dist/web/openhps-rdf.serialization.min.js.LICENSE.txt +2 -0
  32. package/dist/web/openhps-rdf.serialization.min.js.map +1 -1
  33. package/dist/web/openhps-rdf.sparql.es.js +7 -1
  34. package/dist/web/openhps-rdf.sparql.es.js.map +1 -1
  35. package/dist/web/openhps-rdf.sparql.es.min.js +1 -1
  36. package/dist/web/openhps-rdf.sparql.es.min.js.map +1 -1
  37. package/dist/web/openhps-rdf.sparql.js +7 -1
  38. package/dist/web/openhps-rdf.sparql.js.map +1 -1
  39. package/dist/web/openhps-rdf.sparql.min.js +1 -1
  40. package/dist/web/openhps-rdf.sparql.min.js.map +1 -1
  41. package/package.json +4 -2
  42. package/serialization.d.ts +1 -0
  43. package/serialization.js +1 -0
  44. package/src/index.serialization.ts +1 -0
  45. package/src/rdf/InternalRDFSerializer.ts +8 -1
  46. package/vocab.d.ts +1 -0
  47. package/vocab.js +1 -0
  48. package/webpack.config.js +87 -0
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see openhps-rdf.serialization.es.min.js.LICENSE.txt */
2
- import*as e from"./openhps-core.es.min.js";var t={742:(e,t)=>{t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),f=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[f++]=t>>16&255,l[f++]=t>>8&255,l[f++]=255&t;2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[f++]=255&t);1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[f++]=t>>8&255,l[f++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(l(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},764:(e,t,r)=>{const n=r(742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?a(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return f(e),a(e<0?0:0|p(e))}function c(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function b(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return L(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return V(G(t,e.length-r),e,r,n)}function S(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return V(H(t),e,r,n)}function j(e,t,r,n){return V(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function R(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<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(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):b.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),f=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==f[e]){o=l[e],s=f[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return w(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return w(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,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 O=4096;function x(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function L(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function I(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function A(e,t,r,n,i){q(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function M(e,t,r,n,i){q(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function D(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=J((function(e){F(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=J((function(e,t=0){return A(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=J((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=J((function(e,t=0){return A(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=J((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const z={};function U(e,t,r){z[e]=class NodeError extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===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}`:`>= ${t}${n} and <= ${r}${n}`,new z.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){F(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Q(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new z.ERR_INVALID_ARG_TYPE(t,"number",e)}function Q(e,t,r){if(Math.floor(e)!==e)throw F(e,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function J(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},187:e=>{var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,s,l;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=s.length,l=f,console&&console.warn&&console.warn(l)}return e}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 h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function c(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var l=u.length,f=p(u,l);for(r=0;r<l;++r)n(f[r],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return c(this,e,!0)},o.prototype.rawListeners=function(e){return c(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,f=-7,h=r?i-1:0,c=r?-1:1,d=e[t+h];for(h+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+h],h+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+h],h+=c,f-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,f=(1<<l)-1,h=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?c/u:c*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+d]=255&s,d+=p,s/=256,l-=8);e[r+d-p]|=128*g}},717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},281:e=>{var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a;if("string"==typeof t&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(n(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" 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(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},753:(e,t,r)=>{var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var i=r(481),o=r(229);r(717)(l,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];l.prototype[u]||(l.prototype[u]=o.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||process.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},725:(e,t,r)=>{e.exports=i;var n=r(605);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(717)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},481:(e,t,r)=>{var n;e.exports=j,j.ReadableState=E;r(187).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(503),s=r(764).Buffer,a=r.g.Uint8Array||function(){};var u,l=r(616);u=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,c,d=r(327),p=r(195),g=r(457).getHighWaterMark,b=r(281).q,y=b.ERR_INVALID_ARG_TYPE,w=b.ERR_STREAM_PUSH_AFTER_EOF,m=b.ERR_METHOD_NOT_IMPLEMENTED,v=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(717)(j,o);var _=p.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(e,t,i){n=n||r(753),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(553).s),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function j(e){if(n=n||r(753),!(this instanceof j))return new j(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function R(e,t,r,n,i){u("readableAddChunk",t);var o,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?L(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,k(e)))}(e,l);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(l,t)),o)_(e,o);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)l.endEmitted?_(e,new v):T(e,l,t,!0);else if(l.ended)_(e,new w);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!r?(t=l.decoder.write(t),l.objectMode||0!==t.length?T(e,l,t,!1):I(e,l)):T(e,l,t,!1)}else n||(l.reading=!1,I(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function T(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&L(e)),I(e,t)}Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),j.prototype.destroy=p.destroy,j.prototype._undestroy=p.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),R(this,e,t,!1,r)},j.prototype.unshift=function(e){return R(this,e,null,!0,!1)},j.prototype.isPaused=function(){return!1===this._readableState.flowing},j.prototype.setEncoding=function(e){f||(f=r(553).s);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var O=1073741824;function x(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function L(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(k,e))}function k(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function I(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(B,e,t))}function B(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(u("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function A(e){u("readable nexttick read 0"),e.read(0)}function M(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function P(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(z,t,e))}function z(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}j.prototype.read=function(e){u("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):L(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return u("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&u("length less than watermark",i=!0),t.ended||t.reading?u("reading or ended",i=!1):i&&(u("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=x(r,t))),null===(n=e>0?C(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},j.prototype._read=function(e){_(this,new m("_read()"))},j.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?a:g;function s(t,i){u("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",c),e.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",g),r.removeListener("data",h),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function a(){u("onend"),e.end()}n.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",l);var f=!1;function h(t){u("ondata");var i=e.write(t);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){u("onerror",t),g(),e.removeListener("error",c),0===i(e,"error")&&_(e,t)}function d(){e.removeListener("finish",p),g()}function p(){u("onfinish"),e.removeListener("close",d),g()}function g(){u("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},j.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=U(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},j.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?L(this):n.reading||process.nextTick(A,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(N,this),r},j.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(N,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(M,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<S.length;o++)e.on(S[o],this.emit.bind(this,S[o]));return this._read=function(t){u("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(j.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(850)),h(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),j._fromList=C,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(j.from=function(e,t){return void 0===c&&(c=r(167)),c(j,e,t)})},605:(e,t,r)=>{e.exports=f;var n=r(281).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(753);function l(e,t){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!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush((function(t,r){c(e,t,r)}))}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(717)(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},229:(e,t,r)=>{function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=j,j.WritableState=E;var o={deprecate:r(927)},s=r(503),a=r(764).Buffer,u=r.g.Uint8Array||function(){};var l,f=r(195),h=r(457).getHighWaterMark,c=r(281).q,d=c.ERR_INVALID_ARG_TYPE,p=c.ERR_METHOD_NOT_IMPLEMENTED,g=c.ERR_MULTIPLE_CALLBACK,b=c.ERR_STREAM_CANNOT_PIPE,y=c.ERR_STREAM_DESTROYED,w=c.ERR_STREAM_NULL_VALUES,m=c.ERR_STREAM_WRITE_AFTER_END,v=c.ERR_UNKNOWN_ENCODING,_=f.errorOrDestroy;function S(){}function E(e,t,o){i=i||r(753),e=e||{},"boolean"!=typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(k,e,t),e._writableState.errorEmitted=!0,_(e,n)):(i(n),e._writableState.errorEmitted=!0,_(e,n),k(e,t))}(e,r,n,t,i);else{var o=x(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||O(e,r),n?process.nextTick(T,e,r,o,i):T(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function j(e){var t=this instanceof(i=i||r(753));if(!t&&!l.call(j,this))return new j(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function R(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function T(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,o=new Array(i),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,R(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,f=r.encoding,h=r.callback;if(R(e,t,!1,t.objectMode?1:l.length,l,f,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function L(e,t){e._final((function(r){t.pendingcb--,r&&_(e,r),t.prefinished=!0,e.emit("prefinish"),k(e,t)}))}function k(e,t){var r=x(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(L,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(717)(j,s),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===j&&(e&&e._writableState instanceof E)}})):l=function(e){return e instanceof this},j.prototype.pipe=function(){_(this,new b)},j.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,a.isBuffer(n)||n instanceof u);return s&&!a.isBuffer(e)&&(e=function(e){return a.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(e,t){var r=new m;_(e,r),process.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new w:"string"==typeof r||t.objectMode||(i=new d("chunk",["string","Buffer"],r)),!i||(_(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var u=t.objectMode?1:n.length;t.length+=u;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else R(e,t,!1,u,n,i,o);return l}(this,i,s,e,t,r)),o},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,r){r(new p("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),j.prototype.destroy=f.destroy,j.prototype._undestroy=f.undestroy,j.prototype._destroy=function(e,t){t(e)}},850:(e,t,r)=>{var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(610),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),c=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var r=e[c].read();null!==r&&(e[f]=null,e[s]=null,e[a]=null,t(d(r,!1)))}}function g(e){process.nextTick(p,e)}var b=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[c]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(d(void 0,!0));if(this[c].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[u]?r(e[u]):t(d(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(d(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[c].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),b);e.exports=function(e){var t,r=Object.create(y,(i(t={},c,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,l,{value:e._readableState.endEmitted,writable:!0}),i(t,h,{value:function(e,t){var n=r[c].read();n?(r[f]=null,r[s]=null,r[a]=null,e(d(n,!1))):(r[s]=e,r[a]=t)},writable:!0}),t));return r[f]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[f]=null,r[s]=null,r[a]=null,t(e)),void(r[u]=e)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[l]=!0})),e.on("readable",g.bind(null,r)),r}},327:(e,t,r)=>{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=r(764).Buffer,a=r(361).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,l;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=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,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),l&&o(t,l),e}()},195:e=>{function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,e)):process.nextTick(n,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(t,o,e)):process.nextTick(t,o,e):i?(process.nextTick(r,o),i(e)):process.nextTick(r,o)})),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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},610:(e,t,r)=>{var n=r(281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},l=t._writableState&&t._writableState.finished,f=function(){a=!1,l=!0,s||o.call(t)},h=t._readableState&&t._readableState.endEmitted,c=function(){s=!1,h=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!h?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},g=function(){t.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",f),t.on("abort",p),t.req?g():t.on("request",g)),t.on("end",c),t.on("finish",f),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",c),t.removeListener("error",d),t.removeListener("close",p)}}},167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},946:(e,t,r)=>{var n;var i=r(281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(610)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}function l(e){e()}function f(e,t){return e.pipe(t)}function h(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=h(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var s=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&s.forEach(l),o||(s.forEach(l),i(n))}))}));return t.reduce(f)}},457:(e,t,r)=>{var n=r(281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,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 e.objectMode?16:16384}}},503:(e,t,r)=>{e.exports=r(187).EventEmitter},473:(e,t,r)=>{(t=e.exports=r(481)).Stream=t,t.Readable=t,t.Writable=r(229),t.Duplex=r(753),t.Transform=r(605),t.PassThrough=r(725),t.finished=r(610),t.pipeline=r(946)},509:(e,t,r)=>{var n=r(764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},553:(e,t,r)=>{var n=r(509).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=f,this.end=h,t=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},361:()=>{},616:()=>{}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{n.d(i,{HW:()=>RDFSerializer,OD:()=>fe,eF:()=>E});var t={};n.r(t),n.d(t,{Alt:()=>z,Bag:()=>C,CompoundLiteral:()=>$,HTML:()=>q,JSON__workaround:()=>G,List:()=>U,PlainLiteral:()=>Q,Property:()=>M,Seq:()=>P,Statement:()=>D,XMLLiteral:()=>W,direction:()=>A,first:()=>I,langString:()=>F,language:()=>N,nil:()=>H,object:()=>L,predicate:()=>x,rest:()=>B,subject:()=>O,type:()=>T,value:()=>k});const r=(e=>{var t={};return n.d(t,e),t})({DataSerializer:()=>e.DataSerializer,Deserializer:()=>e.Deserializer,SerializableObject:()=>e.SerializableObject,Serializer:()=>e.Serializer}),o="http://www.w3.org/1999/02/22-rdf-syntax-ns#",s="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/",u={xsd:{decimal:`${s}decimal`,boolean:`${s}boolean`,double:`${s}double`,integer:`${s}integer`,string:`${s}string`},rdf:{type:`${o}type`,nil:`${o}nil`,first:`${o}first`,rest:`${o}rest`,langString:`${o}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${a}reify#forSome`,forAll:`${a}reify#forAll`},log:{implies:`${a}log#implies`}};function l(e){return!!e&&"DefaultGraph"===e.termType}const{rdf:f,xsd:h}=u;let c,d=0;const p=/^"(.*".*)(?="[^"]*$)/,g=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,b={namedNode:function(e){return new NamedNode(e)},blankNode:function(e){return new BlankNode(e||"n3-"+d++)},variable:function(e){return new Variable(e)},literal:function(e,t){if("string"==typeof t)return new Literal(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";""===r&&("boolean"==typeof e?r=h.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?h.integer:h.double:(r=h.double,Number.isNaN(e)||(e=e>0?"INF":"-INF"))));return""===r||r===h.string?new Literal(`"${e}"`):new Literal(`"${e}"^^${r}`)},defaultGraph:function(){return c},quad:S,triple:S},y=b;class Term{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Term?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class NamedNode extends Term{get termType(){return"NamedNode"}}class Literal extends Term{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new NamedNode(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?h.string:f.langString}equals(e){return e instanceof Literal?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class BlankNode extends Term{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Variable extends Term{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}function w(e,t){if(t=t||b,!e)return t.defaultGraph();switch(e[0]){case"?":return t.variable(e.substr(1));case"_":return t.blankNode(e.substr(2));case'"':if(t===b)return new Literal(e);if('"'===e[e.length-1])return t.literal(e.substr(1,e.length-2));const r=e.lastIndexOf('"',e.length-1);return t.literal(e.substr(1,r-1),"@"===e[r+1]?e.substr(r+2):t.namedNode(e.substr(r+3)));case"<":const n=g.exec(e);return t.quad(w(_(n[1]),t),w(_(n[2]),t),w(_(n[3]),t),n[4]&&w(_(n[4]),t));default:return t.namedNode(e)}}function m(e){if("string"==typeof e)return e;if(e instanceof Term&&"Quad"!==e.termType)return e.id;if(!e)return c.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==h.string?`^^${e.datatype.value}`:""}`;case"Quad":return`<<${v(m(e.subject))} ${v(m(e.predicate))} ${v(m(e.object))}${l(e.graph)?"":` ${m(e.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}}c=new class DefaultGraph extends Term{constructor(){return super(""),c||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class Quad extends Term{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||c}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function v(e){return e.replace(p,((e,t)=>`"${t.replace(/"/g,'""')}`))}function _(e){return e.replace(p,((e,t)=>`"${t.replace(/""/g,'"')}`))}function S(e,t,r,n){return new Quad(e,t,r,n)}const E={boolean:"http://www.w3.org/2001/XMLSchema#boolean",dateTime:"http://www.w3.org/2001/XMLSchema#dateTime",date:"http://www.w3.org/2001/XMLSchema#date",time:"http://www.w3.org/2001/XMLSchema#time",decimal:"http://www.w3.org/2001/XMLSchema#decimal",anyURI:"http://www.w3.org/2001/XMLSchema#anyURI",integer:"http://www.w3.org/2001/XMLSchema#integer",string:"http://www.w3.org/2001/XMLSchema#string",double:"http://www.w3.org/2001/XMLSchema#double",langString:"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"};function j(e,t){const r=Object.assign({},e);return R(e)&&R(t)&&Object.keys(t).forEach((n=>{Array.isArray(t[n])?(r[n]=t[n],r[n].push(...e[n]||[])):R(t[n])?n in e?r[n]=j(e[n],t[n]):Object.assign(r,{[n]:t[n]}):Object.assign(r,{[n]:t[n]})})),r}function R(e){return e&&"object"==typeof e&&!Array.isArray(e)}class InternalRDFSerializer extends r.Serializer{constructor(){super(...arguments),this.serializationStrategy=new Map([[Number,this.serializeLiteral.bind(this)],[String,this.serializeLiteral.bind(this)],[Boolean,this.serializeLiteral.bind(this)],[Date,this.serializeDate.bind(this)],[Array,this.serializeArray.bind(this)],[Map,this.serializeMap.bind(this)],[Set,this.serializeSet.bind(this)]])}convertSingleValue(e,t,r,n,i){if(this.retrievePreserveNull(n)&&null===e)return null;if(null==e)return;if(n&&n.options&&n.options.rdf&&n.options.rdf.serializer)return n.options.rdf.serializer(e);const o=this.serializationStrategy.get(t.ctor);if(void 0!==o)return o(e,t,r,this,n,i);if("object"==typeof e)return this.serializeObject(e,t,r,this,n,i);let s=`Could not serialize '${r}'; don't know how to serialize type`;t.hasFriendlyName()&&(s+=` '${t.ctor.name}'`),this.errorHandler(new TypeError(`${s}.`))}serializeObject(e,t,n,i,o,s){let a;const u=r.DataSerializer.getRootMetadata(e.constructor);a=e.constructor!==t.ctor&&e instanceof t.ctor?r.DataSerializer.getMetadata(e.constructor):r.DataSerializer.getMetadata(t.ctor);const l=a.options&&a.options.rdf?a.options.rdf:u.options&&u.options.rdf?u.options.rdf:void 0;if(!l)return;const f=Array.from(a.dataMembers.values()).filter((e=>e&&e.options&&e.options.rdf&&e.options.rdf.identifier))[0];let h;if(f){const t=f.options.rdf;h=t.serializer?t.serializer(e[f.key],e.constructor):e[f.key]}h=h&&!h.startsWith("http")&&s.rdf.baseUri?s.rdf.baseUri+h:y.blankNode(h).value;let c={value:h,predicates:l.predicates?Object.entries(l.predicates).map((([e,t])=>({[e]:t.map(y.namedNode)}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t))):{}};return l.serializer&&(c=j(c,l.serializer(e,s.rdf.baseUri))),c.termType=c.value.startsWith("http")?"NamedNode":"BlankNode",a.dataMembers.forEach((t=>{const r=u.dataMembers.get(t.key),n=t.options&&t.options.rdf?t:r&&r.options&&r.options.rdf?r:void 0;if(!n||!n.options.rdf.predicate)return;const o=i.convertSingleValue(e[n.key],n.type(),`${n.name}`,n,s);if(o){const e=n.options.rdf.predicate;[...Array.isArray(e)?e:[e]].forEach((e=>{const t=c.predicates[e]||[];t.push(...(Array.isArray(o)?o:[o]).filter((e=>e))),c.predicates[e]=t}))}})),c}serializeArray(e,t,r,n,i,o){return e.map((e=>this.convertSingleValue(e,t.elementType,r,i,o)))}serializeMap(e,t,r,n,i,o){return Array.from(e.values()).map((e=>this.convertSingleValue(e,t.valueType,r,i,o)))}serializeSet(e,t,r,n,i,o){return Array.from(e.values()).map((e=>this.convertSingleValue(e,t.valueType,r,i,o)))}serializeLiteral(e,t,r,n,i){var o;let s;const a=i.options.rdf;if(a&&a.datatype)switch(s=a.datatype,a.datatype){case E.date:case E.dateTime:return this.serializeDate(e,t,r,n,i)}else switch(typeof e){case"bigint":case"number":s=E.decimal;break;case"boolean":s=E.boolean;break;default:s=E.string}const u=this.iriToNode(s);return y.literal(e,a&&null!==(o=a.language)&&void 0!==o?o:u)}serializeDate(e,t,r,n,i){var o;const s=i.options.rdf,a=E.dateTime,u=new Date(e).toISOString(),l=this.iriToNode(a);return y.literal(u,s&&null!==(o=s.language)&&void 0!==o?o:l)}iriToNode(e){return y.namedNode(e)}}const T="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",O="http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",x="http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",L="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",k="http://www.w3.org/1999/02/22-rdf-syntax-ns#value",I="http://www.w3.org/1999/02/22-rdf-syntax-ns#first",B="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",N="http://www.w3.org/1999/02/22-rdf-syntax-ns#language",A="http://www.w3.org/1999/02/22-rdf-syntax-ns#direction",M="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",D="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement",C="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag",P="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq",z="http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt",U="http://www.w3.org/1999/02/22-rdf-syntax-ns#List",$="http://www.w3.org/1999/02/22-rdf-syntax-ns#CompoundLiteral",q="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",F="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",Q="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",W="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",G="http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON",H="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",V=t;class InternalRDFDeserializer extends r.Deserializer{constructor(){super(...arguments),this.deserializationStrategy=new Map([[Number,this.deserializeLiteral.bind(this)],[String,this.deserializeLiteral.bind(this)],[Boolean,this.deserializeLiteral.bind(this)],[Date,this.deserializeLiteral.bind(this)],[Array,this.deserializeArray.bind(this)],[Map,this.deserializeMap.bind(this)],[Set,this.deserializeSet.bind(this)]])}rdfTypeResolver(e,t,r){if(void 0!==e.predicates){const n=Object.entries(e.predicates).filter((([e,t])=>e===V.type)).map((([e,t])=>t)).flat().map((e=>e.value)).map((e=>r.get(e))).flat().map((e=>t.get(e)));return n[0]}return Object}convertSingleValue(e,t,r,n="object",i,o){if(this.retrievePreserveNull(i)&&null===e)return null;if(null==e)return;const s=this.deserializationStrategy.get(t.ctor);if(void 0!==s)return s(e,t,r,n,this,i,o);if("object"==typeof e)return this.deserializeObject(e,t,r,n,this,o);let a=`Could not deserialize '${n}'; don't know how to deserialize type`;t.hasFriendlyName()&&(a+=` '${t.ctor.name}'`),this.errorHandler(new TypeError(`${a}.`))}deserializeObject(e,t,n,i,o,s){const a=t.ctor,u=this.rdfTypeResolver(e,n,s.rdf.knownTypes)||a,l=r.DataSerializer.getMetadata(u),f=r.DataSerializer.getRootMetadata(u);if(!l&&!f)return;const h=l.options&&l.options.rdf?l.options.rdf:f.options&&f.options.rdf?f.options.rdf:void 0;if(!h)return;const c=h.deserializer?h.deserializer(e):this.instantiateType(u),d=Array.from(l.dataMembers.values()).filter((e=>e&&e.options&&e.options.rdf&&e.options.rdf.identifier))[0];if(d){const t=d.options.rdf;c[d.key]=t.deserializer?t.deserializer(e,u):e.value}return l.dataMembers.forEach((t=>{const r=f.dataMembers.get(t.key),i=t.options&&t.options.rdf?t:r&&r.options&&r.options.rdf?r:void 0;if(!i||!i.options.rdf.predicate)return;const a=i.options.rdf.predicate;[...Array.isArray(a)?a:[a]].forEach((t=>{e.predicates[t]&&(i.type().ctor===Array?c[i.key]=o.convertSingleValue(e.predicates[t],i.type(),n,i.name,i,s):c[i.key]=e.predicates[t].map((e=>o.convertSingleValue(e,i.type(),n,i.name,i,s))).filter((e=>this.isInstanceOf(e,i.type().ctor)))[0])}))})),c}deserializeLiteral(e,t,r,n,i,o,s){return e.datatype.value===E.dateTime?new Date(e.value).getTime():e.value}deserializeDate(e,t,r,n,i,o,s){return new Date(e.value)}deserializeArray(e,t,r,n,i,o,s){return e?e.map((e=>i.convertSingleValue(e,t.elementType,r,n,o,s))).filter((e=>this.isInstanceOf(e,t.elementType.ctor))):[]}isInstanceOf(e,t){return"number"==typeof e?t===Number:"string"==typeof e?t===String:"boolean"==typeof e?t===Boolean:"object"==typeof e&&e instanceof t}deserializeMap(e,t,r,n,i,o,s){}deserializeSet(e,t,r,n,i,o,s){}}var K=n(473);class N3Store{constructor(e,t){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,t||!e||e[0]||(t=e,e=null),t=t||{},this._factory=t.factory||y,e&&this.addQuads(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let r,n;for(const i in t)for(const o in r=t[i].subjects)for(const t in n=r[o])e+=Object.keys(n[t]).length;return this._size=e}_addToIndex(e,t,r,n){const i=e[t]||(e[t]={}),o=i[r]||(i[r]={}),s=n in o;return s||(o[n]=null),!s}_removeFromIndex(e,t,r,n){const i=e[t],o=i[r];delete o[n];for(const e in o)return;delete i[r];for(const e in i)return;delete e[t]}*_findInIndex(e,t,r,n,i,o,s,a){let u,l,f;const h=!t+!r+!n>1?Object.keys(this._ids):this._entities,c=w(a,this._factory);t&&((u=e,e={})[t]=u[t]);for(const t in e){const a=h[t];if(l=e[t]){r&&((u=l,l={})[r]=u[r]);for(const e in l){const t=h[e];if(f=l[e]){const e=n?n in f?[n]:[]:Object.keys(f);for(let r=0;r<e.length;r++){const n={subject:null,predicate:null,object:null};n[i]=w(a,this._factory),n[o]=w(t,this._factory),n[s]=w(h[e[r]],this._factory),yield this._factory.quad(n.subject,n.predicate,n.object,c)}}}}}}_loop(e,t){for(const r in e)t(r)}_loopByKey0(e,t,r){let n,i;if(n=e[t])for(i in n)r(i)}_loopByKey1(e,t,r){let n,i;for(n in e)i=e[n],i[t]&&r(n)}_loopBy2Keys(e,t,r,n){let i,o,s;if((i=e[t])&&(o=i[r]))for(s in o)n(s)}_countInIndex(e,t,r,n){let i,o,s,a=0;t&&((i=e,e={})[t]=i[t]);for(const t in e)if(o=e[t]){r&&((i=o,o={})[r]=i[r]);for(const e in o)(s=o[e])&&(n?n in s&&a++:a+=Object.keys(s).length)}return a}_getGraphs(e){if(!X(e))return this._graphs;const t={};return t[e]=this._graphs[e],t}_uniqueEntities(e){const t=Object.create(null);return r=>{r in t||(t[r]=!0,e(w(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,r,n){t||(n=e.graph,r=e.object,t=e.predicate,e=e.subject),e=m(e),t=m(t),r=m(r),n=m(n);let i=this._graphs[n];i||(i=this._graphs[n]={subjects:{},predicates:{},objects:{}},Object.freeze(i));const o=this._ids,s=this._entities;e=o[e]||(o[s[++this._id]=e]=this._id),t=o[t]||(o[s[++this._id]=t]=this._id),r=o[r]||(o[s[++this._id]=r]=this._id);const a=this._addToIndex(i.subjects,e,t,r);return this._addToIndex(i.predicates,t,r,e),this._addToIndex(i.objects,r,e,t),this._size=null,a}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,r,n){return e&&e.subject&&({subject:e,predicate:t,object:r,graph:n}=e),!this.readQuads(e,t,r,n).next().done}import(e){return e.on("data",(e=>{this.addQuad(e)})),e}removeQuad(e,t,r,n){t||(n=e.graph,r=e.object,t=e.predicate,e=e.subject),e=m(e),t=m(t),r=m(r),n=m(n);const i=this._ids,o=this._graphs;let s,a,u;if(!((e=i[e])&&(t=i[t])&&(r=i[r])&&(s=o[n])&&(a=s.subjects[e])&&(u=a[t])&&r in u))return!1;for(e in this._removeFromIndex(s.subjects,e,t,r),this._removeFromIndex(s.predicates,t,r,e),this._removeFromIndex(s.objects,r,e,t),null!==this._size&&this._size--,s.subjects)return!0;return delete o[n],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",(e=>{this.removeQuad(e)})),e}removeMatches(e,t,r,n){const i=new K.Readable({objectMode:!0});return i._read=()=>{for(const o of this.readQuads(e,t,r,n))i.push(o);i.push(null)},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,n){return[...this.readQuads(e,t,r,n)]}*readQuads(e,t,r,n){e=e&&m(e),t=t&&m(t),r=r&&m(r),n=n&&m(n);const i=this._getGraphs(n),o=this._ids;let s,a,u,l;if(!(X(e)&&!(a=o[e])||X(t)&&!(u=o[t])||X(r)&&!(l=o[r])))for(const e in i)(s=i[e])&&(a?l?yield*this._findInIndex(s.objects,l,a,u,"object","subject","predicate",e,null,!0):yield*this._findInIndex(s.subjects,a,u,null,"subject","predicate","object",e,null,!0):u?yield*this._findInIndex(s.predicates,u,l,null,"predicate","object","subject",e,null,!0):l?yield*this._findInIndex(s.objects,l,null,null,"object","subject","predicate",e,null,!0):yield*this._findInIndex(s.subjects,null,null,null,"subject","predicate","object",e,null,!0))}match(e,t,r,n){return new DatasetCoreAndReadableStream(this,e,t,r,n)}countQuads(e,t,r,n){e=e&&m(e),t=t&&m(t),r=r&&m(r),n=n&&m(n);const i=this._getGraphs(n),o=this._ids;let s,a,u,l,f=0;if(X(e)&&!(a=o[e])||X(t)&&!(u=o[t])||X(r)&&!(l=o[r]))return 0;for(const n in i)(s=i[n])&&(f+=e?r?this._countInIndex(s.objects,l,a,u):this._countInIndex(s.subjects,a,u,l):t?this._countInIndex(s.predicates,u,l,a):this._countInIndex(s.objects,l,a,u));return f}forEach(e,t,r,n,i){this.some((t=>(e(t),!1)),t,r,n,i)}every(e,t,r,n,i){let o=!1;const s=!this.some((t=>(o=!0,!e(t))),t,r,n,i);return o&&s}some(e,t,r,n,i){for(const o of this.readQuads(t,r,n,i))if(e(o))return!0;return!1}getSubjects(e,t,r){const n=[];return this.forSubjects((e=>{n.push(e)}),e,t,r),n}forSubjects(e,t,r,n){t=t&&m(t),r=r&&m(r),n=n&&m(n);const i=this._ids,o=this._getGraphs(n);let s,a,u;if(e=this._uniqueEntities(e),!(X(t)&&!(a=i[t])||X(r)&&!(u=i[r])))for(n in o)(s=o[n])&&(a?u?this._loopBy2Keys(s.predicates,a,u,e):this._loopByKey1(s.subjects,a,e):u?this._loopByKey0(s.objects,u,e):this._loop(s.subjects,e))}getPredicates(e,t,r){const n=[];return this.forPredicates((e=>{n.push(e)}),e,t,r),n}forPredicates(e,t,r,n){t=t&&m(t),r=r&&m(r),n=n&&m(n);const i=this._ids,o=this._getGraphs(n);let s,a,u;if(e=this._uniqueEntities(e),!(X(t)&&!(a=i[t])||X(r)&&!(u=i[r])))for(n in o)(s=o[n])&&(a?u?this._loopBy2Keys(s.objects,u,a,e):this._loopByKey0(s.subjects,a,e):u?this._loopByKey1(s.predicates,u,e):this._loop(s.predicates,e))}getObjects(e,t,r){const n=[];return this.forObjects((e=>{n.push(e)}),e,t,r),n}forObjects(e,t,r,n){t=t&&m(t),r=r&&m(r),n=n&&m(n);const i=this._ids,o=this._getGraphs(n);let s,a,u;if(e=this._uniqueEntities(e),!(X(t)&&!(a=i[t])||X(r)&&!(u=i[r])))for(n in o)(s=o[n])&&(a?u?this._loopBy2Keys(s.subjects,a,u,e):this._loopByKey1(s.objects,a,e):u?this._loopByKey0(s.predicates,u,e):this._loop(s.objects,e))}getGraphs(e,t,r){const n=[];return this.forGraphs((e=>{n.push(e)}),e,t,r),n}forGraphs(e,t,r,n){for(const i in this._graphs)this.some((t=>(e(t.graph),!0)),t,r,n,i)}createBlankNode(e){let t,r;if(e)for(t=e=`_:${e}`,r=1;this._ids[t];)t=e+r++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},n=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,u.rdf.rest,u.rdf.nil,null),o=e?[...i]:[];return i.forEach((t=>{const i=[];let s,a,l=!1;const f=t.graph;let h=t.subject;for(;h&&!l;){const e=this.getQuads(null,null,h,null),t=this.getQuads(h,null,null,null);let r,c=null,d=null,p=null;for(let i=0;i<t.length&&!l;i++)r=t[i],r.graph.equals(f)?s?l=n(h,"has non-list arcs out"):r.predicate.value===u.rdf.first?c?l=n(h,"has multiple rdf:first arcs"):o.push(c=r):r.predicate.value===u.rdf.rest?d?l=n(h,"has multiple rdf:rest arcs"):o.push(d=r):e.length?l=n(h,"can't be subject and object"):(s=r,a="subject"):l=n(h,"not confined to single graph");for(let t=0;t<e.length&&!l;++t)r=e[t],s?l=n(h,"can't have coreferences"):r.predicate.value===u.rdf.rest?p?l=n(h,"has incoming rdf:rest arcs"):p=r:(s=r,a="object");c?i.unshift(c.object):l=n(h,"has no list head"),h=p&&p.subject}l?e=!1:s&&(r[s[a].value]=i)})),e&&this.removeQuads(o),r}*[Symbol.iterator](){yield*this.readQuads()}}function X(e){return"string"==typeof e||e instanceof String}class DatasetCoreAndReadableStream extends K.Readable{constructor(e,t,r,n,i){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:n,graph:i})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:n,subject:i}=this,o=e.getQuads(i,n,r,t);this._filtered=new N3Store(o,{factory:e._factory})}return this._filtered}get size(){return this.filtered.size}_read(){for(const e of this)this.push(e);this.push(null)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,r,n){return new DatasetCoreAndReadableStream(this.filtered,e,t,r,n)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}const Y=y.defaultGraph(),{rdf:J,xsd:Z}=u,ee=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,te=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,re={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class SerializedTerm extends Term{equals(){return!1}}class N3Writer{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,r,n){e+=t,n&&n()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Y,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${ie(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return Y.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,i){try{n.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(Y.equals(n)?"":`${this._encodeIriOrBlank(n)} {\n`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,r,n,i){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),i)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .\n`:" .\n"}`}quadsToString(e){return e.map((e=>this.quadToString(e.subject,e.predicate,e.object,e.graph))).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),ee.test(t)&&(t=t.replace(te,ne));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(ee.test(t)&&(t=t.replace(te,ne)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Z.string)return`"${t}"`}else switch(e.datatype.value){case Z.string:return`"${t}"`;case Z.boolean:if("true"===t||"false"===t)return t;break;case Z.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Z.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Z.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===J.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:n}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${l(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,Y,n):this._writeQuad(e,t,r,n||Y,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,r){const n={};n[e]=t,this.addPrefixes(n,r)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let r=!1;for(let t in e){let n=e[t];"string"!=typeof n&&(n=n.value),r=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[n]=t+=":",this._write(`@prefix ${t} <${n}>.\n`)}if(r){let e="",t="";for(const r in this._prefixIRIs)e+=e?`|${r}`:r,t+=(t?"|":"")+this._prefixIRIs[r];e=ie(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new SerializedTerm("[]");case 1:if(r=i[0],!(r.object instanceof SerializedTerm))return new SerializedTerm(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let o=0;o<n;o++)r=i[o],r.predicate.equals(e)?t+=`, ${this._encodeObject(r.object)}`:(t+=`${(o?";\n ":"\n ")+this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)}`,e=r.predicate);return new SerializedTerm(`${t}\n]`)}}list(e){const t=e&&e.length||0,r=new Array(t);for(let n=0;n<t;n++)r[n]=this._encodeObject(e[n]);return new SerializedTerm(`(${r.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,n)=>{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function ne(e){let t=re[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function ie(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const oe={geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",schema:"http://schema.org/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",vcard:"http://www.w3.org/2006/vcard/ns#",owl:"http://www.w3.org/2002/07/owl#",time:"http://www.w3.org/2006/time#",dcterms:"http://purl.org/dc/terms/",dcmi:"http://purl.org/dc/terms/",dqm:"http://purl.org/dqm-vocabulary/v1/dqm#",foaf:"http://xmlns.com/foaf/0.1/",qudt:"http://qudt.org/schema/qudt/",qudt_unit:"http://qudt.org/vocab/unit/",quantitykind:"http://qudt.org/vocab/quantitykind/",sosa:"http://www.w3.org/ns/sosa/",ssn:"http://www.w3.org/ns/ssn/",ssns:"http://www.w3.org/ns/ssn/systems/",openhps:"http://openhps.org/terms#",ogc:"http://www.opengis.net/ont/geosparql#"};var se,ae=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,a)}u((n=n.apply(e,t||[])).next())}))};class RDFSerializer extends r.DataSerializer{static get options(){return{serializer:new InternalRDFSerializer,deserializer:new InternalRDFDeserializer}}static registerRDFType(e){const t=this.getMetadata(e);if(!t.options||!t.options.rdf)return;const r=t.options.rdf;r.predicates&&Object.entries(r.predicates).filter((([e,t])=>e===V.type)).map((([e,t])=>t.flat())).flat().forEach((t=>{var r;const n=null!==(r=this.knownRDFTypes.get(t))&&void 0!==r?r:[];n.push(e.name),this.knownRDFTypes.set(t,n)}))}static serialize(e,t){return super.serialize(e,Object.assign({rdf:{baseUri:t}},this.options))}static deserializeFromStore(e,t){const r=function e(t,r){return{termType:t.termType,value:t.value,predicates:Object.assign({},r.getPredicates(t,null,null).map((n=>({[n.value]:r.getObjects(t,n,null).map((t=>"BlankNode"===t.constructor.name||"NamedNode"===t.constructor.name?e(t,r):t))}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}))}}(e,t);return this.deserialize(r)}static serializeToSubjects(e,t){const r=RDFSerializer.serializeToQuads(e,t),n=new N3Store(r);function i(e){return n.getPredicates(e,null,null).map((t=>{const r=n.getObjects(e,t,null),o=r.filter((e=>e instanceof Literal)).filter((e=>""===e.language)).map((e=>({[e.datatype.value]:[e.value]}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}),s=r.filter((e=>e instanceof Literal)).filter((e=>""!==e.language)).map((e=>({[e.language]:[e.value]}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}),a=r.filter((e=>e instanceof NamedNode)).map((e=>e.value)),u=r.filter((e=>e instanceof BlankNode)).map((e=>i(y.blankNode(e.value))));return{[t.value]:{namedNodes:a,blankNodes:u,literals:o,langStrings:s}}})).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})}return n.getSubjects(null,null,null).filter((e=>e instanceof NamedNode)).map((e=>({type:"Subject",url:e.value,predicates:i(e)})))}static serializeToQuads(e,t){const r=void 0!==e.predicates?e:this.serialize(e,t),n="BlankNode"===r.termType?y.blankNode(r.value):y.namedNode(r.value);return Object.keys(r.predicates).map((e=>{const t=y.namedNode(e);return r.predicates[e].map((e=>void 0!==e.predicates?[y.quad(n,t,e),...this.serializeToQuads(e)]:[y.quad(n,t,e)]))})).flat().flat()}static stringify(e,t={}){return ae(this,void 0,void 0,(function*(){return new Promise(((r,n)=>{const i=this.serializeToQuads(e,t.baseUri),o=new N3Store(i),s=Object.assign({xsd:"http://www.w3.org/2001/XMLSchema#"},oe),a=Object.keys(s).map((e=>({[s[e]]:e}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t))),u={};i.map((e=>{[e.subject.value,e.predicate.value,"NamedNode"===e.object.termType?e.object.termType:"Literal"===e.object.termType?e.object.datatype.value:e.object.value].map((e=>{Object.keys(a).forEach((t=>{e.includes(t)&&(u[a[t]]=t)}))}))})),t.prefixes=Object.assign(Object.assign({},u),t.prefixes);const l=new N3Writer(t);t.prettyPrint?o.getSubjects(null,null,null).forEach((e=>{"BlankNode"!==e.termType&&o.getPredicates(e,null,null).forEach((t=>{o.getObjects(e,t,null).forEach((r=>{"BlankNode"===r.termType?l.addQuad(e,t,this.writeBlankNode(l,r,o)):l.addQuad(e,t,r)}))}))})):l.addQuads(i),l.end(((e,t)=>{if(e)return n(e);r(t)}))}))}))}static writeBlankNode(e,t,r){const n=r.getPredicates(t,null,null);return e.blank(n.map((n=>r.getObjects(t,n,null).map((t=>"BlankNode"===t.termType?{predicate:n,object:this.writeBlankNode(e,t,r)}:{predicate:n,object:t})))).flat())}static deserialize(e,t){if(void 0===e.predicates)return super.deserialize(e,t);const r=new InternalRDFDeserializer,n=null!=t?t:r.rdfTypeResolver(e,this.knownTypes,this.knownRDFTypes);return n===Object?e:r.convertSingleValue(e,this.ensureTypeDescriptor(n),this.knownTypes,void 0,void 0,{rdf:{knownTypes:this.knownRDFTypes}})}static getUriMetadata(e){const t=r.DataSerializer.getMetadata(e),n=r.DataSerializer.getRootMetadata(e);if(!(t.options&&t.options.rdf?t.options.rdf:n.options&&n.options.rdf?n.options.rdf:void 0))return;return Array.from(t.dataMembers.values()).filter((e=>e&&e.options&&e.options.rdf&&e.options.rdf.identifier))[0]}static normalizeUri(e,t,r){const n=this.getUriMetadata(e);let i;if(!n)return r;{const o=n.options.rdf;i=o.serializer?o.serializer(t,e):t,i=i&&!i.startsWith("http")&&r?r+i:y.blankNode(i).value}}}se=RDFSerializer,RDFSerializer.knownRDFTypes=new Map,se.eventEmitter.on("updateSerializableObject",((e,t)=>{if(t&&t.rdf&&t.rdf.type){t.rdf.predicates=t.rdf.predicates||{};const e=t.rdf.predicates[V.type]||[];e.push(t.rdf.type),t.rdf.predicates[V.type]=e}})),se.eventEmitter.on("registerType",(e=>{RDFSerializer.registerRDFType(e)}));var ue,le=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};let fe=ue=class SerializableNamedNode extends NamedNode{};fe=ue=le([(0,r.SerializableObject)({rdf:{serializer:e=>({value:e.value}),deserializer:e=>new ue(e.value)}})],fe)})();var o=i.HW,s=i.OD,a=i.eF;export{o as RDFSerializer,s as SerializableNamedNode,a as xsd};
2
+ import*as e from"./openhps-core.es.min.js";var t={742:(e,t)=>{t.byteLength=function(e){var t=u(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,s=u(e),a=s[0],o=s[1],l=new n(function(e,t,r){return 3*(t+r)/4-r}(0,a,o)),h=0,f=o>0?a-4:a;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;2===o&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t);1===o&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t);return l},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],a=16383,o=0,u=i-n;o<u;o+=a)s.push(l(e,o,o+a>u?u:o+a));1===n?(t=e[i-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=s.length;a<o;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,i){for(var n,s,a=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(r[(s=n)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},764:(e,t,r)=>{const i=r(742),n=r(645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|_(e,t);let i=o(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return u.from(i,t,r);const n=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?o(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),o(e<0?0:0|p(e))}function c(e){const t=e.length<0?0:0|p(e.length),r=o(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,u.prototype),i}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function _(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(n)return i?-1:W(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function y(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=u.from(t,i)),u.isBuffer(t))return 0===t.length?-1:w(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,i,n){let s,a=1,o=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,o/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){let i=-1;for(s=r;s<o;s++)if(l(e,s)===l(t,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===u)return i*a}else-1!==i&&(s-=s-i),i=-1}else for(r+u>o&&(r=o-u),s=r;s>=0;s--){let r=!0;for(let i=0;i<u;i++)if(l(e,s+i)!==l(t,i)){r=!1;break}if(r)return s}return-1}function m(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const s=t.length;let a;for(i>s/2&&(i=s/2),a=0;a<i;++a){const i=parseInt(t.substr(2*a,2),16);if(X(i))return a;e[r+a]=i}return a}function v(e,t,r,i){return V(W(t,e.length-r),e,r,i)}function S(e,t,r,i){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function x(e,t,r,i){return V(H(t),e,r,i)}function j(e,t,r,i){return V(function(e,t){let r,i,n;const s=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),i=r>>8,n=r%256,s.push(n),s.push(i);return s}(t,e.length-r),e,r,i)}function E(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let s=null,a=t>239?4:t>223?3:t>191?2:1;if(n+a<=r){let r,i,o,u;switch(a){case 1:t<128&&(s=t);break;case 2:r=e[n+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(s=u));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(u=(15&t)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:r=e[n+1],i=e[n+2],o=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&o)&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&o,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=a}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=k));return r}(i)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=u.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))n+t.length>i.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},u.byteLength=_,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?R(this,0,e):b.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(e,t,r,i,n){if(K(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0);const o=Math.min(s,a),l=this.slice(i,n),h=e.slice(t,r);for(let e=0;e<o;++e)if(l[e]!==h[e]){s=l[e],a=h[e];break}return s<a?-1:a<s?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function T(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function N(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function I(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=Y[e[i]];return n}function O(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,r,i,n,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function B(e,t,r,i,n){F(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function P(e,t,r,i,n){F(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function M(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(e,t,r,i,s){return t=+t,r>>>=0,s||M(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function D(e,t,r,i,s){return t=+t,r>>>=0,s||M(e,0,r,8),n.write(e,t,r,i,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,u.prototype),i},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return i},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let i=t,n=1,s=this[e+--i];for(;i>0&&(n*=256);)s+=this[e+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Z((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){A(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){A(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);A(this,e,t,r,i-1,-i)}let n=0,s=1,a=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/s>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);A(this,e,t,r,i-1,-i)}let n=r-1,s=1,a=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/s>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,i){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),n},u.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const s=u.isBuffer(e)?e:u.from(e,i),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=s[n%a]}return this};const U={};function z(e,t,r){U[e]=class NodeError extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,i,n,s){if(e>r||e<t){const i="bigint"==typeof t?"n":"";let n;throw n=s>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new U.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Q(t,e.length-(r+1))}(i,n,s)}function q(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function Q(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=$(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=$(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const i=e.length;let n=null;const s=[];for(let a=0;a<i;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function H(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function Z(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},187:e=>{var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}_(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&_(e,"error",t,r)}(e,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,i){var n,s,a,l;if(o(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),a=s[t]),void 0===a)a=s[t]=r,++e._eventsCount;else if("function"==typeof a?a=s[t]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),(n=u(e))>0&&a.length>n&&!a.warned){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,l=h,console&&console.warn&&console.warn(l)}return e}function h(){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 f(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function c(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):p(n,n.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function _(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(s){i.once&&e.removeEventListener(t,n),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var l=u.length,h=p(u,l);for(r=0;r<l;++r)i(h[r],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return o(t),this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,i,n,s,a;if(o(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){a=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return c(this,e,!0)},s.prototype.rawListeners=function(e){return c(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},645:(e,t)=>{t.read=function(e,t,r,i,n){var s,a,o=8*n-i-1,u=(1<<o)-1,l=u>>1,h=-7,f=r?n-1:0,c=r?-1:1,d=e[t+f];for(f+=c,s=d&(1<<-h)-1,d>>=-h,h+=o;h>0;s=256*s+e[t+f],f+=c,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=256*a+e[t+f],f+=c,h-=8);if(0===s)s=1-l;else{if(s===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),s-=l}return(d?-1:1)*a*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var a,o,u,l=8*s-n-1,h=(1<<l)-1,f=h>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,p=i?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?c/u:c*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=h?(o=0,a=h):a+f>=1?(o=(t*u-1)*Math.pow(2,n),a+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;e[r+d]=255&o,d+=p,o/=256,n-=8);for(a=a<<n|o,l+=n;l>0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*_}},717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},375:(e,t,r)=>{let i;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(i||(i=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},281:e=>{var t={};function r(e,r,i){i||(i=Error);var n=function(e){var t,i;function n(t,i,n){return e.call(this,function(e,t,i){return"string"==typeof r?r:r(e,t,i)}(t,i,n))||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=e,t[e]=n}function i(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,s,a,o;if("string"==typeof t&&(s="not ",t.substr(!a||a<0?0:+a,s.length)===s)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))o="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(i(t,"type"))}return o+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" 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(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},753:(e,t,r)=>{var i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var n=r(481),s=r(229);r(717)(l,n);for(var a=i(s.prototype),o=0;o<a.length;o++){var u=a[o];l.prototype[u]||(l.prototype[u]=s.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);n.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||process.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},725:(e,t,r)=>{e.exports=n;var i=r(605);function n(e){if(!(this instanceof n))return new n(e);i.call(this,e)}r(717)(n,i),n.prototype._transform=function(e,t,r){r(null,e)}},481:(e,t,r)=>{var i;e.exports=j,j.ReadableState=x;r(187).EventEmitter;var n=function(e,t){return e.listeners(t).length},s=r(503),a=r(764).Buffer,o=r.g.Uint8Array||function(){};var u,l=r(616);u=l&&l.debuglog?l.debuglog("stream"):function(){};var h,f,c,d=r(327),p=r(195),_=r(457).getHighWaterMark,b=r(281).q,g=b.ERR_INVALID_ARG_TYPE,y=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,m=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(717)(j,s);var v=p.errorOrDestroy,S=["error","close","destroy","pause","resume"];function x(e,t,n){i=i||r(753),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=_(this,e,"readableHighWaterMark",n),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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=r(553).s),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function j(e){if(i=i||r(753),!(this instanceof j))return new j(e);var t=this instanceof i;this._readableState=new x(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function E(e,t,r,i,n){u("readableAddChunk",t);var s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?N(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,l);else if(n||(s=function(e,t){var r;i=t,a.isBuffer(i)||i instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(l,t)),s)v(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),i)l.endEmitted?v(e,new m):R(e,l,t,!0);else if(l.ended)v(e,new y);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!r?(t=l.decoder.write(t),l.objectMode||0!==t.length?R(e,l,t,!1):O(e,l)):R(e,l,t,!1)}else i||(l.reading=!1,O(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function R(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&N(e)),O(e,t)}Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),j.prototype.destroy=p.destroy,j.prototype._undestroy=p.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=a.from(e,t),t=""),r=!0),E(this,e,t,!1,r)},j.prototype.unshift=function(e){return E(this,e,null,!0,!1)},j.prototype.isPaused=function(){return!1===this._readableState.flowing},j.prototype.setEncoding=function(e){h||(h=r(553).s);var t=new h(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=t.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var k=1073741824;function T(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(I,e))}function I(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,M(e)}function O(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(u("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function A(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function B(e){u("readable nexttick read 0"),e.read(0)}function P(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function D(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function z(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}j.prototype.read=function(e){u("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):N(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&D(this),null;var i,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&u("length less than watermark",n=!0),t.ended||t.reading?u("reading or ended",n=!1):n&&(u("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=T(r,t))),null===(i=e>0?C(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&D(this)),null!==i&&this.emit("data",i),i},j.prototype._read=function(e){v(this,new w("_read()"))},j.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,u("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?o:_;function a(t,n){u("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,u("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",l),e.removeListener("error",c),e.removeListener("unpipe",a),r.removeListener("end",o),r.removeListener("end",_),r.removeListener("data",f),h=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function o(){u("onend"),e.end()}i.endEmitted?process.nextTick(s):r.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&n(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var h=!1;function f(t){u("ondata");var n=e.write(t);u("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==z(i.pipes,e))&&!h&&(u("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function c(t){u("onerror",t),_(),e.removeListener("error",c),0===n(e,"error")&&v(e,t)}function d(){e.removeListener("finish",p),_()}function p(){u("onfinish"),e.removeListener("close",d),_()}function _(){u("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",d),e.once("finish",p),e.emit("pipe",r),i.flowing||(u("pipe resume"),r.resume()),e},j.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=z(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},j.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,u("on readable",i.length,i.reading),i.length?N(this):i.reading||process.nextTick(B,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(A,this),r},j.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(A,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(P,e,t))}(this,e)),e.paused=!1,this},j.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var s=0;s<S.length;s++)e.on(S[s],this.emit.bind(this,S[s]));return this._read=function(t){u("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(j.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(850)),f(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),j._fromList=C,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(j.from=function(e,t){return void 0===c&&(c=r(167)),c(j,e,t)})},605:(e,t,r)=>{e.exports=h;var i=r(281).q,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=i.ERR_TRANSFORM_WITH_LENGTH_0,u=r(753);function l(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function h(e){if(!(this instanceof h))return new h(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush((function(t,r){c(e,t,r)}))}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}r(717)(h,u),h.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},h.prototype._transform=function(e,t,r){r(new n("_transform()"))},h.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},h.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},h.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},229:(e,t,r)=>{function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}var n;e.exports=j,j.WritableState=x;var s={deprecate:r(927)},a=r(503),o=r(764).Buffer,u=r.g.Uint8Array||function(){};var l,h=r(195),f=r(457).getHighWaterMark,c=r(281).q,d=c.ERR_INVALID_ARG_TYPE,p=c.ERR_METHOD_NOT_IMPLEMENTED,_=c.ERR_MULTIPLE_CALLBACK,b=c.ERR_STREAM_CANNOT_PIPE,g=c.ERR_STREAM_DESTROYED,y=c.ERR_STREAM_NULL_VALUES,w=c.ERR_STREAM_WRITE_AFTER_END,m=c.ERR_UNKNOWN_ENCODING,v=h.errorOrDestroy;function S(){}function x(e,t,s){n=n||r(753),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new _;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,n){--t.pendingcb,r?(process.nextTick(n,i),process.nextTick(I,e,t),e._writableState.errorEmitted=!0,v(e,i)):(n(i),e._writableState.errorEmitted=!0,v(e,i),I(e,t))}(e,r,i,t,n);else{var s=T(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||k(e,r),i?process.nextTick(R,e,r,s,n):R(e,r,s,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function j(e){var t=this instanceof(n=n||r(753));if(!t&&!l.call(j,this))return new j(e);this._writableState=new x(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function E(e,t,r,i,n,s,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(n,t.onwrite):e._write(n,s,t.onwrite),t.sync=!1}function R(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),I(e,t)}function k(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,s=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,u=!0;r;)s[o]=r,r.isBuf||(u=!1),r=r.next,o+=1;s.allBuffers=u,E(e,t,!0,t.length,s,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,h=r.encoding,f=r.callback;if(E(e,t,!1,t.objectMode?1:l.length,l,h,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function T(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function N(e,t){e._final((function(r){t.pendingcb--,r&&v(e,r),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var r=T(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(N,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(717)(j,a),x.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(x.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===j&&(e&&e._writableState instanceof x)}})):l=function(e){return e instanceof this},j.prototype.pipe=function(){v(this,new b)},j.prototype.write=function(e,t,r){var i,n=this._writableState,s=!1,a=!n.objectMode&&(i=e,o.isBuffer(i)||i instanceof u);return a&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=S),n.ending?function(e,t){var r=new w;v(e,r),process.nextTick(t,r)}(this,r):(a||function(e,t,r,i){var n;return null===r?n=new y:"string"==typeof r||t.objectMode||(n=new d("chunk",["string","Buffer"],r)),!n||(v(e,n),process.nextTick(i,n),!1)}(this,n,e,r))&&(n.pendingcb++,s=function(e,t,r,i,n,s){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var u=t.objectMode?1:i.length;t.length+=u;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,u,i,n,s);return l}(this,n,a,e,t,r)),s},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||k(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new m(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,r){r(new p("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,I(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),j.prototype.destroy=h.destroy,j.prototype._undestroy=h.undestroy,j.prototype._destroy=function(e,t){t(e)}},850:(e,t,r)=>{var i;function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(610),a=Symbol("lastResolve"),o=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),c=Symbol("stream");function d(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[c].read();null!==r&&(e[h]=null,e[a]=null,e[o]=null,t(d(r,!1)))}}function _(e){process.nextTick(p,e)}var b=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((n(i={get stream(){return this[c]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(d(void 0,!0));if(this[c].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[u]?r(e[u]):t(d(void 0,!0))}))}));var r,i=this[h];if(i)r=new Promise(function(e,t){return function(r,i){e.then((function(){t[l]?r(d(void 0,!0)):t[f](r,i)}),i)}}(i,this));else{var n=this[c].read();if(null!==n)return Promise.resolve(d(n,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function(){var e=this;return new Promise((function(t,r){e[c].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),i),b);e.exports=function(e){var t,r=Object.create(g,(n(t={},c,{value:e,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,o,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,f,{value:function(e,t){var i=r[c].read();i?(r[h]=null,r[a]=null,r[o]=null,e(d(i,!1))):(r[a]=e,r[o]=t)},writable:!0}),t));return r[h]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[o];return null!==t&&(r[h]=null,r[a]=null,r[o]=null,t(e)),void(r[u]=e)}var i=r[a];null!==i&&(r[h]=null,r[a]=null,r[o]=null,i(d(void 0,!0))),r[l]=!0})),e.on("readable",_.bind(null,r)),r}},327:(e,t,r)=>{function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var a=r(764).Buffer,o=r(361).inspect,u=o&&o.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,l;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,i,n=a.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,r=n,i=o,a.prototype.copy.call(t,r,i),o+=s.data.length,s=s.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var n=t.data,s=e>n.length?n.length:e;if(s===n.length?i+=n:i+=n.slice(0,e),0==(e-=s)){s===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(s));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,s=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,s),0==(e-=s)){s===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(s));break}++i}return this.length-=i,t}},{key:u,value:function(e,t){return o(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&s(t.prototype,r),l&&s(t,l),e}()},195:e=>{function t(e,t){i(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,n){var s=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(n?n(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,e)):process.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!n&&e?s._writableState?s._writableState.errorEmitted?process.nextTick(r,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,e)):process.nextTick(t,s,e):n?(process.nextTick(r,s),n(e)):process.nextTick(r,s)})),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(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}},610:(e,t,r)=>{var i=r(281).q.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function e(t,r,s){if("function"==typeof r)return e(t,null,r);r||(r={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}(s||n);var a=r.readable||!1!==r.readable&&t.readable,o=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||h()},l=t._writableState&&t._writableState.finished,h=function(){o=!1,l=!0,a||s.call(t)},f=t._readableState&&t._readableState.endEmitted,c=function(){a=!1,f=!0,o||s.call(t)},d=function(e){s.call(t,e)},p=function(){var e;return a&&!f?(t._readableState&&t._readableState.ended||(e=new i),s.call(t,e)):o&&!l?(t._writableState&&t._writableState.ended||(e=new i),s.call(t,e)):void 0},_=function(){t.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?o&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",h),t.on("abort",p),t.req?_():t.on("request",_)),t.on("end",c),t.on("finish",h),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",h),t.removeListener("abort",p),t.removeListener("request",_),t.req&&t.req.removeListener("finish",h),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",h),t.removeListener("end",c),t.removeListener("error",d),t.removeListener("close",p)}}},167:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},946:(e,t,r)=>{var i;var n=r(281).q,s=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function u(e,t,n,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var o=!1;e.on("close",(function(){o=!0})),void 0===i&&(i=r(610)),i(e,{readable:t,writable:n},(function(e){if(e)return s(e);o=!0,s()}));var u=!1;return function(t){if(!o&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new a("pipe"))}}function l(e){e()}function h(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i,n=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var a=t.map((function(e,r){var s=r<t.length-1;return u(e,s,r>0,(function(e){i||(i=e),e&&a.forEach(l),s||(a.forEach(l),n(i))}))}));return t.reduce(h)}},457:(e,t,r)=>{var i=r(281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,n){var s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(n?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},503:(e,t,r)=>{e.exports=r(187).EventEmitter},473:(e,t,r)=>{(t=e.exports=r(481)).Stream=t,t.Readable=t,t.Writable=r(229),t.Duplex=r(753),t.Transform=r(605),t.PassThrough=r(725),t.finished=r(610),t.pipeline=r(946)},509:(e,t,r)=>{var i=r(764),n=i.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(s(i,t),t.Buffer=a),a.prototype=Object.create(n.prototype),s(n,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},553:(e,t,r)=>{var i=r(509).Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.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 s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=h,this.end=f,t=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function h(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(i<r)return 0;var n=a(t[i]);if(n>=0)return n>0&&(e.lastNeed=n-1),n;if(--i<r||-2===n)return 0;if((n=a(t[i]))>=0)return n>0&&(e.lastNeed=n-2),n;if(--i<r||-2===n)return 0;if((n=a(t[i]))>=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},927:(e,t,r)=>{function i(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},361:()=>{},616:()=>{}},r={};function i(e){var n=r[e];if(void 0!==n)return n.exports;var s=r[e]={exports:{}};return t[e](s,s.exports,i),s.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{i.d(n,{N3:()=>s,HW:()=>RDFSerializer,OD:()=>we,eF:()=>L});var t={};i.r(t),i.d(t,{inDefaultGraph:()=>b,isBlankNode:()=>c,isDefaultGraph:()=>_,isLiteral:()=>d,isNamedNode:()=>f,isVariable:()=>p,prefix:()=>g,prefixes:()=>y});var r={};i.r(r),i.d(r,{Alt:()=>V,Bag:()=>W,CompoundLiteral:()=>X,HTML:()=>Y,JSON__workaround:()=>te,List:()=>K,PlainLiteral:()=>J,Property:()=>Q,Seq:()=>H,Statement:()=>G,XMLLiteral:()=>ee,direction:()=>q,first:()=>z,langString:()=>Z,language:()=>F,nil:()=>re,object:()=>D,predicate:()=>C,rest:()=>$,subject:()=>M,type:()=>P,value:()=>U});var s={};i.r(s),i.d(s,{BlankNode:()=>BlankNode,DataFactory:()=>R,DefaultGraph:()=>DefaultGraph,Lexer:()=>N3Lexer,Literal:()=>Literal,NamedNode:()=>NamedNode,Parser:()=>N3Parser,Quad:()=>Quad,Store:()=>N3Store,StreamParser:()=>N3StreamParser,StreamWriter:()=>N3StreamWriter,Term:()=>Term,Triple:()=>Quad,Util:()=>t,Variable:()=>Variable,Writer:()=>N3Writer,default:()=>Oe,termFromId:()=>k,termToId:()=>T});const a=(e=>{var t={};return i.d(t,e),t})({DataSerializer:()=>e.DataSerializer,Deserializer:()=>e.Deserializer,SerializableObject:()=>e.SerializableObject,Serializer:()=>e.Serializer}),o="http://www.w3.org/1999/02/22-rdf-syntax-ns#",u="http://www.w3.org/2001/XMLSchema#",l="http://www.w3.org/2000/10/swap/",h={xsd:{decimal:`${u}decimal`,boolean:`${u}boolean`,double:`${u}double`,integer:`${u}integer`,string:`${u}string`},rdf:{type:`${o}type`,nil:`${o}nil`,first:`${o}first`,rest:`${o}rest`,langString:`${o}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${l}reify#forSome`,forAll:`${l}reify#forAll`},log:{implies:`${l}log#implies`}};function f(e){return!!e&&"NamedNode"===e.termType}function c(e){return!!e&&"BlankNode"===e.termType}function d(e){return!!e&&"Literal"===e.termType}function p(e){return!!e&&"Variable"===e.termType}function _(e){return!!e&&"DefaultGraph"===e.termType}function b(e){return _(e.graph)}function g(e,t){return y({"":e.value||e},t)("")}function y(e,t){const r=Object.create(null);for(const t in e)i(t,e[t]);function i(e,i){if("string"==typeof i){const n=Object.create(null);r[e]=e=>n[e]||(n[e]=t.namedNode(i+e))}else if(!(e in r))throw new Error(`Unknown prefix: ${e}`);return r[e]}return t=t||R,i}const{rdf:w,xsd:m}=h;let v,S=0;const x=/^"(.*".*)(?="[^"]*$)/,j=/^<<("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ("(?:""|[^"])*"[^ ]*|[^ ]+) ?("(?:""|[^"])*"[^ ]*|[^ ]+)?>>$/,E={namedNode:function(e){return new NamedNode(e)},blankNode:function(e){return new BlankNode(e||"n3-"+S++)},variable:function(e){return new Variable(e)},literal:function(e,t){if("string"==typeof t)return new Literal(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";""===r&&("boolean"==typeof e?r=m.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?m.integer:m.double:(r=m.double,Number.isNaN(e)||(e=e>0?"INF":"-INF"))));return""===r||r===m.string?new Literal(`"${e}"`):new Literal(`"${e}"^^${r}`)},defaultGraph:function(){return v},quad:O,triple:O},R=E;class Term{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Term?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class NamedNode extends Term{get termType(){return"NamedNode"}}class Literal extends Term{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new NamedNode(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?m.string:w.langString}equals(e){return e instanceof Literal?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class BlankNode extends Term{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Variable extends Term{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}class DefaultGraph extends Term{constructor(){return super(""),v||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}}function k(e,t){if(t=t||E,!e)return t.defaultGraph();switch(e[0]){case"?":return t.variable(e.substr(1));case"_":return t.blankNode(e.substr(2));case'"':if(t===E)return new Literal(e);if('"'===e[e.length-1])return t.literal(e.substr(1,e.length-2));const r=e.lastIndexOf('"',e.length-1);return t.literal(e.substr(1,r-1),"@"===e[r+1]?e.substr(r+2):t.namedNode(e.substr(r+3)));case"<":const i=j.exec(e);return t.quad(k(I(i[1]),t),k(I(i[2]),t),k(I(i[3]),t),i[4]&&k(I(i[4]),t));default:return t.namedNode(e)}}function T(e){if("string"==typeof e)return e;if(e instanceof Term&&"Quad"!==e.termType)return e.id;if(!e)return v.id;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==m.string?`^^${e.datatype.value}`:""}`;case"Quad":return`<<${N(T(e.subject))} ${N(T(e.predicate))} ${N(T(e.object))}${_(e.graph)?"":` ${T(e.graph)}`}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}}v=new DefaultGraph;class Quad extends Term{constructor(e,t,r,i){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=i||v}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function N(e){return e.replace(x,((e,t)=>`"${t.replace(/"/g,'""')}`))}function I(e){return e.replace(x,((e,t)=>`"${t.replace(/""/g,'"')}`))}function O(e,t,r,i){return new Quad(e,t,r,i)}const L={boolean:"http://www.w3.org/2001/XMLSchema#boolean",dateTime:"http://www.w3.org/2001/XMLSchema#dateTime",date:"http://www.w3.org/2001/XMLSchema#date",time:"http://www.w3.org/2001/XMLSchema#time",decimal:"http://www.w3.org/2001/XMLSchema#decimal",anyURI:"http://www.w3.org/2001/XMLSchema#anyURI",integer:"http://www.w3.org/2001/XMLSchema#integer",string:"http://www.w3.org/2001/XMLSchema#string",double:"http://www.w3.org/2001/XMLSchema#double",langString:"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"};function A(e,t){const r=Object.assign({},e);return B(e)&&B(t)&&Object.keys(t).forEach((i=>{Array.isArray(t[i])?(r[i]=t[i],r[i].push(...e[i]||[])):B(t[i])?i in e?r[i]=A(e[i],t[i]):Object.assign(r,{[i]:t[i]}):Object.assign(r,{[i]:t[i]})})),r}function B(e){return e&&"object"==typeof e&&!Array.isArray(e)}class InternalRDFSerializer extends a.Serializer{constructor(){super(...arguments),this.serializationStrategy=new Map([[Number,this.serializeLiteral.bind(this)],[String,this.serializeLiteral.bind(this)],[Boolean,this.serializeLiteral.bind(this)],[Date,this.serializeDate.bind(this)],[Array,this.serializeArray.bind(this)],[Map,this.serializeMap.bind(this)],[Set,this.serializeSet.bind(this)]])}convertSingleValue(e,t,r,i,n={}){if(this.retrievePreserveNull(i)&&null===e)return null;if(null==e)return;if(i&&i.options&&i.options.rdf&&i.options.rdf.serializer)return i.options.rdf.serializer(e);const s=this.serializationStrategy.get(t.ctor);if(void 0!==s)return s(e,t,r,this,i,n);if("object"==typeof e)return this.serializeObject(e,t,r,this,i,n);let a=`Could not serialize '${r}'; don't know how to serialize type`;t.hasFriendlyName()&&(a+=` '${t.ctor.name}'`),this.errorHandler(new TypeError(`${a}.`))}serializeObject(e,t,r,i,n,s){let o;const u=a.DataSerializer.getRootMetadata(e.constructor);o=e.constructor!==t.ctor&&e instanceof t.ctor?a.DataSerializer.getMetadata(e.constructor):a.DataSerializer.getMetadata(t.ctor);const l=o.options&&o.options.rdf?o.options.rdf:u.options&&u.options.rdf?u.options.rdf:void 0;if(!l)return;const h=Array.from(o.dataMembers.values()).filter((e=>e&&e.options&&e.options.rdf&&e.options.rdf.identifier))[0];let f;if(h){const t=h.options.rdf;f=t.serializer?t.serializer(e[h.key],e.constructor):e[h.key]}f=f&&!f.startsWith("http")&&s.rdf.baseUri?s.rdf.baseUri+f:R.blankNode(f).value;let c={value:f,predicates:l.predicates?Object.entries(l.predicates).map((([e,t])=>({[e]:t.map(R.namedNode)}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t))):{}};if(l.serializer&&(c=A(c,l.serializer(e,s.rdf.baseUri))),c.termType=c.value.startsWith("http")?"NamedNode":"BlankNode",void 0===s.root)s.root=c;else if(s.root.value===c.value)return;return o.dataMembers.forEach((t=>{const r=u.dataMembers.get(t.key),n=t.options&&t.options.rdf?t:r&&r.options&&r.options.rdf?r:void 0;if(!n||!n.options.rdf.predicate)return;const a=i.convertSingleValue(e[n.key],n.type(),`${n.name}`,n,s);if(a){const e=n.options.rdf.predicate;[...Array.isArray(e)?e:[e]].forEach((e=>{const t=c.predicates[e]||[];t.push(...(Array.isArray(a)?a:[a]).filter((e=>e))),c.predicates[e]=t}))}})),c}serializeArray(e,t,r,i,n,s){return e.map((e=>this.convertSingleValue(e,t.elementType,r,n,s)))}serializeMap(e,t,r,i,n,s){return Array.from(e.values()).map((e=>this.convertSingleValue(e,t.valueType,r,n,s)))}serializeSet(e,t,r,i,n,s){return Array.from(e.values()).map((e=>this.convertSingleValue(e,t.valueType,r,n,s)))}serializeLiteral(e,t,r,i,n){var s;let a;const o=n.options.rdf;if(o&&o.datatype)switch(a=o.datatype,o.datatype){case L.date:case L.dateTime:return this.serializeDate(e,t,r,i,n)}else switch(typeof e){case"bigint":case"number":a=L.decimal;break;case"boolean":a=L.boolean;break;default:a=L.string}const u=this.iriToNode(a);return R.literal(e,o&&null!==(s=o.language)&&void 0!==s?s:u)}serializeDate(e,t,r,i,n){var s;const a=n.options.rdf,o=L.dateTime,u=new Date(e).toISOString(),l=this.iriToNode(o);return R.literal(u,a&&null!==(s=a.language)&&void 0!==s?s:l)}iriToNode(e){return R.namedNode(e)}}const P="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",M="http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",C="http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",D="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",U="http://www.w3.org/1999/02/22-rdf-syntax-ns#value",z="http://www.w3.org/1999/02/22-rdf-syntax-ns#first",$="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",F="http://www.w3.org/1999/02/22-rdf-syntax-ns#language",q="http://www.w3.org/1999/02/22-rdf-syntax-ns#direction",Q="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property",G="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement",W="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag",H="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq",V="http://www.w3.org/1999/02/22-rdf-syntax-ns#Alt",K="http://www.w3.org/1999/02/22-rdf-syntax-ns#List",X="http://www.w3.org/1999/02/22-rdf-syntax-ns#CompoundLiteral",Y="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",Z="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",J="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",ee="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",te="http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON",re="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",ie=r;class InternalRDFDeserializer extends a.Deserializer{constructor(){super(...arguments),this.deserializationStrategy=new Map([[Number,this.deserializeLiteral.bind(this)],[String,this.deserializeLiteral.bind(this)],[Boolean,this.deserializeLiteral.bind(this)],[Date,this.deserializeLiteral.bind(this)],[Array,this.deserializeArray.bind(this)],[Map,this.deserializeMap.bind(this)],[Set,this.deserializeSet.bind(this)]])}rdfTypeResolver(e,t,r){if(void 0!==e.predicates){const i=Object.entries(e.predicates).filter((([e,t])=>e===ie.type)).map((([e,t])=>t)).flat().map((e=>e.value)).map((e=>r.get(e))).flat().map((e=>t.get(e)));return i[0]}return Object}convertSingleValue(e,t,r,i="object",n,s){if(this.retrievePreserveNull(n)&&null===e)return null;if(null==e)return;const a=this.deserializationStrategy.get(t.ctor);if(void 0!==a)return a(e,t,r,i,this,n,s);if("object"==typeof e)return this.deserializeObject(e,t,r,i,this,s);let o=`Could not deserialize '${i}'; don't know how to deserialize type`;t.hasFriendlyName()&&(o+=` '${t.ctor.name}'`),this.errorHandler(new TypeError(`${o}.`))}deserializeObject(e,t,r,i,n,s){const o=t.ctor,u=this.rdfTypeResolver(e,r,s.rdf.knownTypes)||o,l=a.DataSerializer.getMetadata(u),h=a.DataSerializer.getRootMetadata(u);if(!l&&!h)return;const f=l.options&&l.options.rdf?l.options.rdf:h.options&&h.options.rdf?h.options.rdf:void 0;if(!f)return;const c=f.deserializer?f.deserializer(e):this.instantiateType(u),d=Array.from(l.dataMembers.values()).filter((e=>e&&e.options&&e.options.rdf&&e.options.rdf.identifier))[0];if(d){const t=d.options.rdf;c[d.key]=t.deserializer?t.deserializer(e,u):e.value}return l.dataMembers.forEach((t=>{const i=h.dataMembers.get(t.key),a=t.options&&t.options.rdf?t:i&&i.options&&i.options.rdf?i:void 0;if(!a||!a.options.rdf.predicate)return;const o=a.options.rdf.predicate;[...Array.isArray(o)?o:[o]].forEach((t=>{e.predicates[t]&&(a.type().ctor===Array?c[a.key]=n.convertSingleValue(e.predicates[t],a.type(),r,a.name,a,s):c[a.key]=e.predicates[t].map((e=>n.convertSingleValue(e,a.type(),r,a.name,a,s))).filter((e=>this.isInstanceOf(e,a.type().ctor)))[0])}))})),c}deserializeLiteral(e,t,r,i,n,s,a){return e.datatype.value===L.dateTime?new Date(e.value).getTime():e.value}deserializeDate(e,t,r,i,n,s,a){return new Date(e.value)}deserializeArray(e,t,r,i,n,s,a){return e?e.map((e=>n.convertSingleValue(e,t.elementType,r,i,s,a))).filter((e=>this.isInstanceOf(e,t.elementType.ctor))):[]}isInstanceOf(e,t){return"number"==typeof e?t===Number:"string"==typeof e?t===String:"boolean"==typeof e?t===Boolean:"object"==typeof e&&e instanceof t}deserializeMap(e,t,r,i,n,s,a){}deserializeSet(e,t,r,i,n,s,a){}}var ne=i(473);class N3Store{constructor(e,t){this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,t||!e||e[0]||(t=e,e=null),t=t||{},this._factory=t.factory||R,e&&this.addQuads(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let r,i;for(const n in t)for(const s in r=t[n].subjects)for(const t in i=r[s])e+=Object.keys(i[t]).length;return this._size=e}_addToIndex(e,t,r,i){const n=e[t]||(e[t]={}),s=n[r]||(n[r]={}),a=i in s;return a||(s[i]=null),!a}_removeFromIndex(e,t,r,i){const n=e[t],s=n[r];delete s[i];for(const e in s)return;delete n[r];for(const e in n)return;delete e[t]}*_findInIndex(e,t,r,i,n,s,a,o){let u,l,h;const f=!t+!r+!i>1?Object.keys(this._ids):this._entities,c=k(o,this._factory);t&&((u=e,e={})[t]=u[t]);for(const t in e){const o=f[t];if(l=e[t]){r&&((u=l,l={})[r]=u[r]);for(const e in l){const t=f[e];if(h=l[e]){const e=i?i in h?[i]:[]:Object.keys(h);for(let r=0;r<e.length;r++){const i={subject:null,predicate:null,object:null};i[n]=k(o,this._factory),i[s]=k(t,this._factory),i[a]=k(f[e[r]],this._factory),yield this._factory.quad(i.subject,i.predicate,i.object,c)}}}}}}_loop(e,t){for(const r in e)t(r)}_loopByKey0(e,t,r){let i,n;if(i=e[t])for(n in i)r(n)}_loopByKey1(e,t,r){let i,n;for(i in e)n=e[i],n[t]&&r(i)}_loopBy2Keys(e,t,r,i){let n,s,a;if((n=e[t])&&(s=n[r]))for(a in s)i(a)}_countInIndex(e,t,r,i){let n,s,a,o=0;t&&((n=e,e={})[t]=n[t]);for(const t in e)if(s=e[t]){r&&((n=s,s={})[r]=n[r]);for(const e in s)(a=s[e])&&(i?i in a&&o++:o+=Object.keys(a).length)}return o}_getGraphs(e){if(!se(e))return this._graphs;const t={};return t[e]=this._graphs[e],t}_uniqueEntities(e){const t=Object.create(null);return r=>{r in t||(t[r]=!0,e(k(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,r,i){t||(i=e.graph,r=e.object,t=e.predicate,e=e.subject),e=T(e),t=T(t),r=T(r),i=T(i);let n=this._graphs[i];n||(n=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(n));const s=this._ids,a=this._entities;e=s[e]||(s[a[++this._id]=e]=this._id),t=s[t]||(s[a[++this._id]=t]=this._id),r=s[r]||(s[a[++this._id]=r]=this._id);const o=this._addToIndex(n.subjects,e,t,r);return this._addToIndex(n.predicates,t,r,e),this._addToIndex(n.objects,r,e,t),this._size=null,o}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,r,i){return e&&e.subject&&({subject:e,predicate:t,object:r,graph:i}=e),!this.readQuads(e,t,r,i).next().done}import(e){return e.on("data",(e=>{this.addQuad(e)})),e}removeQuad(e,t,r,i){t||(i=e.graph,r=e.object,t=e.predicate,e=e.subject),e=T(e),t=T(t),r=T(r),i=T(i);const n=this._ids,s=this._graphs;let a,o,u;if(!((e=n[e])&&(t=n[t])&&(r=n[r])&&(a=s[i])&&(o=a.subjects[e])&&(u=o[t])&&r in u))return!1;for(e in this._removeFromIndex(a.subjects,e,t,r),this._removeFromIndex(a.predicates,t,r,e),this._removeFromIndex(a.objects,r,e,t),null!==this._size&&this._size--,a.subjects)return!0;return delete s[i],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",(e=>{this.removeQuad(e)})),e}removeMatches(e,t,r,i){const n=new ne.Readable({objectMode:!0});return n._read=()=>{for(const s of this.readQuads(e,t,r,i))n.push(s);n.push(null)},this.remove(n)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,i){return[...this.readQuads(e,t,r,i)]}*readQuads(e,t,r,i){e=e&&T(e),t=t&&T(t),r=r&&T(r),i=i&&T(i);const n=this._getGraphs(i),s=this._ids;let a,o,u,l;if(!(se(e)&&!(o=s[e])||se(t)&&!(u=s[t])||se(r)&&!(l=s[r])))for(const e in n)(a=n[e])&&(o?l?yield*this._findInIndex(a.objects,l,o,u,"object","subject","predicate",e,null,!0):yield*this._findInIndex(a.subjects,o,u,null,"subject","predicate","object",e,null,!0):u?yield*this._findInIndex(a.predicates,u,l,null,"predicate","object","subject",e,null,!0):l?yield*this._findInIndex(a.objects,l,null,null,"object","subject","predicate",e,null,!0):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",e,null,!0))}match(e,t,r,i){return new DatasetCoreAndReadableStream(this,e,t,r,i)}countQuads(e,t,r,i){e=e&&T(e),t=t&&T(t),r=r&&T(r),i=i&&T(i);const n=this._getGraphs(i),s=this._ids;let a,o,u,l,h=0;if(se(e)&&!(o=s[e])||se(t)&&!(u=s[t])||se(r)&&!(l=s[r]))return 0;for(const i in n)(a=n[i])&&(h+=e?r?this._countInIndex(a.objects,l,o,u):this._countInIndex(a.subjects,o,u,l):t?this._countInIndex(a.predicates,u,l,o):this._countInIndex(a.objects,l,o,u));return h}forEach(e,t,r,i,n){this.some((t=>(e(t),!1)),t,r,i,n)}every(e,t,r,i,n){let s=!1;const a=!this.some((t=>(s=!0,!e(t))),t,r,i,n);return s&&a}some(e,t,r,i,n){for(const s of this.readQuads(t,r,i,n))if(e(s))return!0;return!1}getSubjects(e,t,r){const i=[];return this.forSubjects((e=>{i.push(e)}),e,t,r),i}forSubjects(e,t,r,i){t=t&&T(t),r=r&&T(r),i=i&&T(i);const n=this._ids,s=this._getGraphs(i);let a,o,u;if(e=this._uniqueEntities(e),!(se(t)&&!(o=n[t])||se(r)&&!(u=n[r])))for(i in s)(a=s[i])&&(o?u?this._loopBy2Keys(a.predicates,o,u,e):this._loopByKey1(a.subjects,o,e):u?this._loopByKey0(a.objects,u,e):this._loop(a.subjects,e))}getPredicates(e,t,r){const i=[];return this.forPredicates((e=>{i.push(e)}),e,t,r),i}forPredicates(e,t,r,i){t=t&&T(t),r=r&&T(r),i=i&&T(i);const n=this._ids,s=this._getGraphs(i);let a,o,u;if(e=this._uniqueEntities(e),!(se(t)&&!(o=n[t])||se(r)&&!(u=n[r])))for(i in s)(a=s[i])&&(o?u?this._loopBy2Keys(a.objects,u,o,e):this._loopByKey0(a.subjects,o,e):u?this._loopByKey1(a.predicates,u,e):this._loop(a.predicates,e))}getObjects(e,t,r){const i=[];return this.forObjects((e=>{i.push(e)}),e,t,r),i}forObjects(e,t,r,i){t=t&&T(t),r=r&&T(r),i=i&&T(i);const n=this._ids,s=this._getGraphs(i);let a,o,u;if(e=this._uniqueEntities(e),!(se(t)&&!(o=n[t])||se(r)&&!(u=n[r])))for(i in s)(a=s[i])&&(o?u?this._loopBy2Keys(a.subjects,o,u,e):this._loopByKey1(a.objects,o,e):u?this._loopByKey0(a.predicates,u,e):this._loop(a.objects,e))}getGraphs(e,t,r){const i=[];return this.forGraphs((e=>{i.push(e)}),e,t,r),i}forGraphs(e,t,r,i){for(const n in this._graphs)this.some((t=>(e(t.graph),!0)),t,r,i,n)}createBlankNode(e){let t,r;if(e)for(t=e=`_:${e}`,r=1;this._ids[t];)t=e+r++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},i=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},n=this.getQuads(null,h.rdf.rest,h.rdf.nil,null),s=e?[...n]:[];return n.forEach((t=>{const n=[];let a,o,u=!1;const l=t.graph;let f=t.subject;for(;f&&!u;){const e=this.getQuads(null,null,f,null),t=this.getQuads(f,null,null,null);let r,c=null,d=null,p=null;for(let n=0;n<t.length&&!u;n++)r=t[n],r.graph.equals(l)?a?u=i(f,"has non-list arcs out"):r.predicate.value===h.rdf.first?c?u=i(f,"has multiple rdf:first arcs"):s.push(c=r):r.predicate.value===h.rdf.rest?d?u=i(f,"has multiple rdf:rest arcs"):s.push(d=r):e.length?u=i(f,"can't be subject and object"):(a=r,o="subject"):u=i(f,"not confined to single graph");for(let t=0;t<e.length&&!u;++t)r=e[t],a?u=i(f,"can't have coreferences"):r.predicate.value===h.rdf.rest?p?u=i(f,"has incoming rdf:rest arcs"):p=r:(a=r,o="object");c?n.unshift(c.object):u=i(f,"has no list head"),f=p&&p.subject}u?e=!1:a&&(r[a[o].value]=n)})),e&&this.removeQuads(s),r}*[Symbol.iterator](){yield*this.readQuads()}}function se(e){return"string"==typeof e||e instanceof String}class DatasetCoreAndReadableStream extends ne.Readable{constructor(e,t,r,i,n){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:i,graph:n})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:i,subject:n}=this,s=e.getQuads(n,i,r,t);this._filtered=new N3Store(s,{factory:e._factory})}return this._filtered}get size(){return this.filtered.size}_read(){for(const e of this)this.push(e);this.push(null)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,r,i){return new DatasetCoreAndReadableStream(this.filtered,e,t,r,i)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}const ae=R.defaultGraph(),{rdf:oe,xsd:ue}=h,le=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,he=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,fe={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class SerializedTerm extends Term{equals(){return!1}}class N3Writer{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,r,i){e+=t,i&&i()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=ae,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${de(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return ae.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,i,n){try{i.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(ae.equals(i)?"":`${this._encodeIriOrBlank(i)} {\n`)),this._graph=i,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,n):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,n):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,n)}catch(e){n&&n(e)}}_writeQuadLine(e,t,r,i,n){delete this._prefixMatch,this._write(this.quadToString(e,t,r,i),n)}quadToString(e,t,r,i){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .\n`:" .\n"}`}quadsToString(e){return e.map((e=>this.quadToString(e.subject,e.predicate,e.object,e.graph))).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),le.test(t)&&(t=t.replace(he,ce));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(le.test(t)&&(t=t.replace(he,ce)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===ue.string)return`"${t}"`}else switch(e.datatype.value){case ue.string:return`"${t}"`;case ue.boolean:if("true"===t||"false"===t)return t;break;case ue.integer:if(/^[+-]?\d+$/.test(t))return t;break;case ue.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case ue.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===oe.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:i}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${_(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,i,n){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof i?this._writeQuad(e,t,r,ae,i):this._writeQuad(e,t,r,i||ae,n)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,r){const i={};i[e]=t,this.addPrefixes(i,r)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let r=!1;for(let t in e){let i=e[t];"string"!=typeof i&&(i=i.value),r=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[i]=t+=":",this._write(`@prefix ${t} <${i}>.\n`)}if(r){let e="",t="";for(const r in this._prefixIRIs)e+=e?`|${r}`:r,t+=(t?"|":"")+this._prefixIRIs[r];e=de(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,i,n=e;switch(void 0===e?n=[]:e.termType?n=[{predicate:e,object:t}]:"length"in e||(n=[e]),i=n.length){case 0:return new SerializedTerm("[]");case 1:if(r=n[0],!(r.object instanceof SerializedTerm))return new SerializedTerm(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let s=0;s<i;s++)r=n[s],r.predicate.equals(e)?t+=`, ${this._encodeObject(r.object)}`:(t+=`${(s?";\n ":"\n ")+this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)}`,e=r.predicate);return new SerializedTerm(`${t}\n]`)}}list(e){const t=e&&e.length||0,r=new Array(t);for(let i=0;i<t;i++)r[i]=this._encodeObject(e[i]);return new SerializedTerm(`(${r.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,i)=>{t=null,e(r,i)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function ce(e){let t=fe[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function de(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const pe={geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",schema:"http://schema.org/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",vcard:"http://www.w3.org/2006/vcard/ns#",owl:"http://www.w3.org/2002/07/owl#",time:"http://www.w3.org/2006/time#",dcterms:"http://purl.org/dc/terms/",dcmi:"http://purl.org/dc/terms/",dqm:"http://purl.org/dqm-vocabulary/v1/dqm#",foaf:"http://xmlns.com/foaf/0.1/",qudt:"http://qudt.org/schema/qudt/",qudt_unit:"http://qudt.org/vocab/unit/",quantitykind:"http://qudt.org/vocab/quantitykind/",sosa:"http://www.w3.org/ns/sosa/",ssn:"http://www.w3.org/ns/ssn/",ssns:"http://www.w3.org/ns/ssn/systems/",openhps:"http://openhps.org/terms#",ogc:"http://www.opengis.net/ont/geosparql#"};var _e,be=function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function a(e){try{u(i.next(e))}catch(e){s(e)}}function o(e){try{u(i.throw(e))}catch(e){s(e)}}function u(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,o)}u((i=i.apply(e,t||[])).next())}))};class RDFSerializer extends a.DataSerializer{static get options(){return{serializer:new InternalRDFSerializer,deserializer:new InternalRDFDeserializer}}static registerRDFType(e){const t=this.getMetadata(e);if(!t.options||!t.options.rdf)return;const r=t.options.rdf;r.predicates&&Object.entries(r.predicates).filter((([e,t])=>e===ie.type)).map((([e,t])=>t.flat())).flat().forEach((t=>{var r;const i=null!==(r=this.knownRDFTypes.get(t))&&void 0!==r?r:[];i.push(e.name),this.knownRDFTypes.set(t,i)}))}static serialize(e,t){return super.serialize(e,Object.assign({rdf:{baseUri:t}},this.options))}static deserializeFromStore(e,t){const r=function e(t,r){return{termType:t.termType,value:t.value,predicates:Object.assign({},r.getPredicates(t,null,null).map((i=>({[i.value]:r.getObjects(t,i,null).map((t=>"BlankNode"===t.constructor.name||"NamedNode"===t.constructor.name?e(t,r):t))}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}))}}(e,t);return this.deserialize(r)}static serializeToSubjects(e,t){const r=RDFSerializer.serializeToQuads(e,t),i=new N3Store(r);function n(e){return i.getPredicates(e,null,null).map((t=>{const r=i.getObjects(e,t,null),s=r.filter((e=>e instanceof Literal)).filter((e=>""===e.language)).map((e=>({[e.datatype.value]:[e.value]}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}),a=r.filter((e=>e instanceof Literal)).filter((e=>""!==e.language)).map((e=>({[e.language]:[e.value]}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}),o=r.filter((e=>e instanceof NamedNode)).map((e=>e.value)),u=r.filter((e=>e instanceof BlankNode)).map((e=>n(R.blankNode(e.value))));return{[t.value]:{namedNodes:o,blankNodes:u,literals:s,langStrings:a}}})).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})}return i.getSubjects(null,null,null).filter((e=>e instanceof NamedNode)).map((e=>({type:"Subject",url:e.value,predicates:n(e)})))}static serializeToQuads(e,t){const r=void 0!==e.predicates?e:this.serialize(e,t),i="BlankNode"===r.termType?R.blankNode(r.value):R.namedNode(r.value);return Object.keys(r.predicates).map((e=>{const t=R.namedNode(e);return r.predicates[e].map((e=>void 0!==e.predicates?[R.quad(i,t,e),...this.serializeToQuads(e)]:[R.quad(i,t,e)]))})).flat().flat()}static stringify(e,t={}){return be(this,void 0,void 0,(function*(){return new Promise(((r,i)=>{const n=this.serializeToQuads(e,t.baseUri),s=new N3Store(n),a=Object.assign({xsd:"http://www.w3.org/2001/XMLSchema#"},pe),o=Object.keys(a).map((e=>({[a[e]]:e}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t))),u={};n.map((e=>{[e.subject.value,e.predicate.value,"NamedNode"===e.object.termType?e.object.termType:"Literal"===e.object.termType?e.object.datatype.value:e.object.value].map((e=>{Object.keys(o).forEach((t=>{e.includes(t)&&(u[o[t]]=t)}))}))})),t.prefixes=Object.assign(Object.assign({},u),t.prefixes);const l=new N3Writer(t);t.prettyPrint?s.getSubjects(null,null,null).forEach((e=>{"BlankNode"!==e.termType&&s.getPredicates(e,null,null).forEach((t=>{s.getObjects(e,t,null).forEach((r=>{"BlankNode"===r.termType?l.addQuad(e,t,this.writeBlankNode(l,r,s)):l.addQuad(e,t,r)}))}))})):l.addQuads(n),l.end(((e,t)=>{if(e)return i(e);r(t)}))}))}))}static writeBlankNode(e,t,r){const i=r.getPredicates(t,null,null);return e.blank(i.map((i=>r.getObjects(t,i,null).map((t=>"BlankNode"===t.termType?{predicate:i,object:this.writeBlankNode(e,t,r)}:{predicate:i,object:t})))).flat())}static deserialize(e,t){if(void 0===e.predicates)return super.deserialize(e,t);const r=new InternalRDFDeserializer,i=null!=t?t:r.rdfTypeResolver(e,this.knownTypes,this.knownRDFTypes);return i===Object?e:r.convertSingleValue(e,this.ensureTypeDescriptor(i),this.knownTypes,void 0,void 0,{rdf:{knownTypes:this.knownRDFTypes}})}static getUriMetadata(e){const t=a.DataSerializer.getMetadata(e),r=a.DataSerializer.getRootMetadata(e);if(!(t.options&&t.options.rdf?t.options.rdf:r.options&&r.options.rdf?r.options.rdf:void 0))return;return Array.from(t.dataMembers.values()).filter((e=>e&&e.options&&e.options.rdf&&e.options.rdf.identifier))[0]}static normalizeUri(e,t,r){const i=this.getUriMetadata(e);let n;if(!i)return r;{const s=i.options.rdf;n=s.serializer?s.serializer(t,e):t,n=n&&!n.startsWith("http")&&r?r+n:R.blankNode(n).value}}}_e=RDFSerializer,RDFSerializer.knownRDFTypes=new Map,_e.eventEmitter.on("updateSerializableObject",((e,t)=>{if(t&&t.rdf&&t.rdf.type){t.rdf.predicates=t.rdf.predicates||{};const e=t.rdf.predicates[ie.type]||[];e.push(t.rdf.type),t.rdf.predicates[ie.type]=e}})),_e.eventEmitter.on("registerType",(e=>{RDFSerializer.registerRDFType(e)}));var ge,ye=function(e,t,r,i){var n,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,r,a):n(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a};let we=ge=class SerializableNamedNode extends NamedNode{};we=ge=ye([(0,a.SerializableObject)({rdf:{serializer:e=>({value:e.value}),deserializer:e=>new ge(e.value)}})],we);var me=i(375),ve=i.n(me);const{xsd:Se}=h,xe=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,je={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Ee=/[\x00-\x20<>\\"\{\}\|\^\`]/,Re={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},ke=/$0^/;class N3Lexer{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in Re)&&this[e]instanceof RegExp&&(this[e]=ke)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,i=r.length;for(;;){let e,a;for(;e=this._newline.exec(r);)this._comments&&(a=this._comment.exec(e[0]))&&n("comment",a[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),i=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(a=this._comment.exec(r))&&n("comment",a[1],"",this._line,r.length),r=null,n("eof","","",this._line,0)),this._input=r;const o=this._line,u=r[0];let l="",h="",f="",c=null,d=0,p=!1;switch(u){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(d=1,l="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){p=!0;break}case"<":if(c=this._unescapedIri.exec(r))l="IRI",h=c[1];else if(c=this._iri.exec(r)){if(h=this._unescape(c[1]),null===h||Ee.test(h))return s(this);l="IRI"}else r.length>1&&"<"===r[1]?(l="<<",d=2):this._n3Mode&&r.length>1&&"="===r[1]&&(l="inverse",d=2,h=">");break;case">":r.length>1&&">"===r[1]&&(l=">>",d=2);break;case"_":((c=this._blank.exec(r))||t&&(c=this._blank.exec(`${r} `)))&&(l="blank",f="_",h=c[1]);break;case'"':if(c=this._simpleQuotedString.exec(r))h=c[1];else if(({value:h,matchLength:d}=this._parseLiteral(r)),null===h)return s(this);null===c&&0===d||(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(c=this._simpleApostropheString.exec(r))h=c[1];else if(({value:h,matchLength:d}=this._parseLiteral(r)),null===h)return s(this);null===c&&0===d||(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(c=this._variable.exec(r))&&(l="var",h=c[0]);break;case"@":"literal"===this._previousMarker&&(c=this._langcode.exec(r))?(l="langcode",h=c[1]):(c=this._keyword.exec(r))&&(l=c[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){l=".",d=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(c=this._number.exec(r)||t&&(c=this._number.exec(`${r} `)))&&(l="literal",h=c[0],f="string"==typeof c[1]?Se.double:"string"==typeof c[2]?Se.decimal:Se.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(c=this._sparqlKeyword.exec(r))?l=c[0].toUpperCase():p=!0;break;case"f":case"t":(c=this._boolean.exec(r))?(l="literal",h=c[0],f=Se.boolean):p=!0;break;case"a":(c=this._shortPredicates.exec(r))?(l="abbreviation",h="a"):p=!0;break;case"=":this._n3Mode&&r.length>1&&(l="abbreviation",">"!==r[1]?(d=1,h="="):(d=2,h=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(d=1,l=u);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(c=this._prefix.exec(r))?((c=this._prefixed.exec(r))||t&&(c=this._prefixed.exec(`${r} `)))&&(l="prefixed",f=c[1]||"",h=this._unescape(c[2])):(l="prefix",h=c[1]||"")),"^^"===this._previousMarker)switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?s(this):this._input=r;const _=d||c[0].length,b=n(l,h,f,o,_);this.previousToken=b,this._previousMarker=l,r=r.substr(_,r.length)}function n(t,n,s,a,o){const u=r?i-r.length:i,l={type:t,value:n,prefix:s,line:a,start:u,end:u+o};return e(null,l),l}function s(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(xe,((e,r,i,n)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof i){let e=Number.parseInt(i,16);return e<=65535?String.fromCharCode(Number.parseInt(i,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return n in je?je[n]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let i=Math.max(this._literalClosingPos,r);for(;(i=e.indexOf(t,i))>0;){let t=0;for(;"\\"===e[i-t-1];)t++;if(t%2==0){const t=e.substring(r,i),n=t.split(/\r\n|\r|\n/).length-1,s=i+r;if(1===r&&0!==n||3===r&&this._lineMode)break;return this._line+=n,{value:this._unescape(t),matchLength:s}}i++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,i)=>r?t=r:e.push(i)),!0),t)throw t;return e}ve()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}let Te=0;class N3Parser{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Ie(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),i=/trig/.test(t),n=/triple/.test(t),s=/quad/.test(t),a=this._n3Mode=/n3/.test(t),o=n||s;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||i||n||a),this._supportsRDFStar=""===t||/star|\*$/.test(t),o&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new N3Lexer({lineMode:o,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Te=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,i,n){const s=this._n3Mode;this._contextStack.push({subject:r,predicate:i,object:n,graph:t,type:e,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const i=this._prefixes[e.prefix];if(void 0===i)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(i+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,i=this._readListItem;const n=this._subject,s=this._contextStack,a=s[s.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==s.length&&"list"===s[s.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===n?null===a.predicate?a.subject=r:a.object=r:this._emit(n,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return i}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const i=this._subject,n=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,n&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==i){const e=this._predicate,t=this._object;n?this._emit(t,e,i,r):this._emit(i,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const e=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const i=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=i):(t=this._object,this._object=i),this._emit(t,r,i,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,i;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(i=this._subject,this._subject=t):(i=this._object,this._object=t),this._emit(t,r,i,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,i){this._callback(null,this._quad(e,t,r,i||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Ne}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",i=-1,n=-1,s=0,a="/";for(;i<t;){switch(a){case":":if(n<0&&"/"===e[++i]&&"/"===e[++i])for(;(n=i+1)<t&&"/"!==e[n];)i=n;break;case"?":case"#":i=t;break;case"/":if("."===e[i+1])switch(a=e[1+ ++i],a){case"/":r+=e.substring(s,i-1),s=i+1;break;case void 0:case"?":case"#":return r+e.substring(s,i)+e.substr(i+1);case".":if(a=e[1+ ++i],void 0===a||"/"===a||"?"===a||"#"===a){if(r+=e.substring(s,i-2),(s=r.lastIndexOf("/"))>=n&&(r=r.substr(0,s)),"/"!==a)return`${r}/${e.substr(i+1)}`;s=i+1}}}a=e[++i]}return r+e.substring(s)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Te++}_`,this._prefixCallback=r||Ne,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,i)=>{e?r=e:i&&t.push(i)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=Ne):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function Ne(){}function Ie(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(h.rdf.first),e.RDF_REST=r(h.rdf.rest),e.RDF_NIL=r(h.rdf.nil),e.N3_FORALL=r(h.r.forAll),e.N3_FORSOME=r(h.r.forSome),e.ABBREVIATIONS={a:r(h.rdf.type),"=":r(h.owl.sameAs),">":r(h.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}Ie(N3Parser.prototype,R);class N3StreamParser extends ne.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;let t,r;new N3Parser(e).parse({on:(e,i)=>{switch(e){case"data":t=i;break;case"end":r=i}}},((e,t)=>{e&&this.emit("error",e)||t&&this.push(t)}),((e,t)=>{this.emit("prefix",e,t)})),this._transform=(e,r,i)=>{t(e),i()},this._flush=e=>{r(),e()}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),this}}class N3StreamWriter extends ne.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new N3Writer({write:(e,t,r)=>{this.push(e),r&&r()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,r,i)=>{t.addQuad(e,i)},this._flush=e=>{t.end(e)}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),e.on("prefix",((e,t)=>{this._writer.addPrefix(e,t)})),this}}const Oe={Lexer:N3Lexer,Parser:N3Parser,Writer:N3Writer,Store:N3Store,StreamParser:N3StreamParser,StreamWriter:N3StreamWriter,Util:t,DataFactory:R,Term,NamedNode,Literal,BlankNode,Variable,DefaultGraph,Quad,Triple:Quad,termFromId:k,termToId:T}})();var s=n.N3,a=n.HW,o=n.OD,u=n.eF;export{s as N3,a as RDFSerializer,o as SerializableNamedNode,u as xsd};
3
3
  //# sourceMappingURL=openhps-rdf.serialization.es.min.js.map