n3 2.7.10 → 2.7.12

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.
@@ -1,26 +1,26 @@
1
- var jl=Object.create;var rr=Object.defineProperty,Ll=Object.defineProperties,Fl=Object.getOwnPropertyDescriptor,Bl=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertyNames,Tn=Object.getOwnPropertySymbols,Dl=Object.getPrototypeOf,Nn=Object.prototype.hasOwnProperty,Ol=Object.prototype.propertyIsEnumerable;var st=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ml=t=>{throw TypeError(t)};var An=(t,e,r)=>e in t?rr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,B=(t,e)=>{for(var r in e||(e={}))Nn.call(e,r)&&An(t,r,e[r]);if(Tn)for(var r of Tn(e))Ol.call(e,r)&&An(t,r,e[r]);return t},ve=(t,e)=>Ll(t,Bl(e));var R=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},$l=(t,e)=>{for(var r in e)rr(t,r,{get:e[r],enumerable:!0})},kl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cl(e))!Nn.call(t,n)&&n!==r&&rr(t,n,{get:()=>e[n],enumerable:!(i=Fl(e,n))||i.enumerable});return t};var ir=(t,e,r)=>(r=t!=null?jl(Dl(t)):{},kl(e||!t||!t.__esModule?rr(r,"default",{value:t,enumerable:!0}):r,t));var M=function(t,e){this[0]=t,this[1]=e},Y=(t,e,r)=>{var i=(a,u,l,f)=>{try{var c=r[a](u),h=(u=c.value)instanceof M,d=c.done;Promise.resolve(h?u[0]:u).then(b=>h?i(a==="return"?a:"next",u[1]?{done:b.done,value:b.value}:b,l,f):l({value:b,done:d})).catch(b=>i("throw",b,l,f))}catch(b){f(b)}},n=(a,u,l,f)=>o[a]=c=>(u=new Promise((h,d,b)=>(b=()=>i(a,c,h,d),s?s.then(b):b())),f=()=>s===l&&(s=0),s=l=u.then(f,f),u),s,o={};return r=r.apply(t,e),o[st("asyncIterator")]=()=>o,n("next"),n("throw"),n("return"),o},re=t=>{var e=t[st("asyncIterator")],r=!1,i,n={};return e==null?(e=t[st("iterator")](),i=s=>n[s]=o=>e[s](o)):(e=e.call(t),i=s=>n[s]=o=>{if(r){if(r=!1,s==="throw")throw o;return o}return r=!0,{done:!1,value:new M(new Promise(a=>{var u=e[s](o);u instanceof Object||Ml("Object expected"),a(u)}),1)}}),n[st("iterator")]=()=>n,i("next"),"throw"in e?i("throw"):n.throw=s=>{throw s},"return"in e&&i("return"),n},V=(t,e,r)=>(e=t[st("asyncIterator")])?e.call(t):(t=t[st("iterator")](),e={},r=(i,n)=>(n=t[i])&&(e[i]=s=>new Promise((o,a,u)=>(s=n.call(t,s),u=s.done,Promise.resolve(s.value).then(l=>o({value:l,done:u}),a)))),r("next"),r("return"),e);var jn=R(nr=>{"use strict";nr.byteLength=Ul;nr.toByteArray=Gl;nr.fromByteArray=Hl;var ie=[],Z=[],ql=typeof Uint8Array!="undefined"?Uint8Array:Array,Hr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ke=0,vn=Hr.length;ke<vn;++ke)ie[ke]=Hr[ke],Z[Hr.charCodeAt(ke)]=ke;var ke,vn;Z[45]=62;Z[95]=63;function Pn(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function Ul(t){var e=Pn(t),r=e[0],i=e[1];return(r+i)*3/4-i}function Wl(t,e,r){return(e+r)*3/4-r}function Gl(t){var e,r=Pn(t),i=r[0],n=r[1],s=new ql(Wl(t,i,n)),o=0,a=n>0?i-4:i,u;for(u=0;u<a;u+=4)e=Z[t.charCodeAt(u)]<<18|Z[t.charCodeAt(u+1)]<<12|Z[t.charCodeAt(u+2)]<<6|Z[t.charCodeAt(u+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return n===2&&(e=Z[t.charCodeAt(u)]<<2|Z[t.charCodeAt(u+1)]>>4,s[o++]=e&255),n===1&&(e=Z[t.charCodeAt(u)]<<10|Z[t.charCodeAt(u+1)]<<4|Z[t.charCodeAt(u+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Vl(t){return ie[t>>18&63]+ie[t>>12&63]+ie[t>>6&63]+ie[t&63]}function Ql(t,e,r){for(var i,n=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(Vl(i));return n.join("")}function Hl(t){for(var e,r=t.length,i=r%3,n=[],s=16383,o=0,a=r-i;o<a;o+=s)n.push(Ql(t,o,o+s>a?a:o+s));return i===1?(e=t[r-1],n.push(ie[e>>2]+ie[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(ie[e>>10]+ie[e>>4&63]+ie[e<<2&63]+"=")),n.join("")}});var Ln=R(zr=>{zr.read=function(t,e,r,i,n){var s,o,a=n*8-i-1,u=(1<<a)-1,l=u>>1,f=-7,c=r?n-1:0,h=r?-1:1,d=t[e+c];for(c+=h,s=d&(1<<-f)-1,d>>=-f,f+=a;f>0;s=s*256+t[e+c],c+=h,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=i;f>0;o=o*256+t[e+c],c+=h,f-=8);if(s===0)s=1-l;else{if(s===u)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-l}return(d?-1:1)*o*Math.pow(2,s-i)};zr.write=function(t,e,r,i,n,s){var o,a,u,l=s*8-n-1,f=(1<<l)-1,c=f>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,b=i?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+c>=1?e+=h/u:e+=h*Math.pow(2,1-c),e*u>=2&&(o++,u/=2),o+c>=f?(a=0,o=f):o+c>=1?(a=(e*u-1)*Math.pow(2,n),o=o+c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=a&255,d+=b,a/=256,n-=8);for(o=o<<n|a,l+=n;l>0;t[r+d]=o&255,d+=b,o/=256,l-=8);t[r+d-b]|=p*128}});var se=R(ut=>{"use strict";var Kr=jn(),at=Ln(),Fn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ut.Buffer=_;ut.SlowBuffer=Jl;ut.INSPECT_MAX_BYTES=50;var sr=2147483647;ut.kMaxLength=sr;_.TYPED_ARRAY_SUPPORT=zl();!_.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&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.");function zl(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.buffer}});Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.byteOffset}});function ye(t){if(t>sr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,_.prototype),e}function _(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Jr(t)}return On(t,e,r)}_.poolSize=8192;function On(t,e,r){if(typeof t=="string")return Yl(t,e);if(ArrayBuffer.isView(t))return Zl(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(ne(t,ArrayBuffer)||t&&ne(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ne(t,SharedArrayBuffer)||t&&ne(t.buffer,SharedArrayBuffer)))return Zr(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return _.from(i,e,r);let n=Xl(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return _.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}_.from=function(t,e,r){return On(t,e,r)};Object.setPrototypeOf(_.prototype,Uint8Array.prototype);Object.setPrototypeOf(_,Uint8Array);function Mn(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Kl(t,e,r){return Mn(t),t<=0?ye(t):e!==void 0?typeof r=="string"?ye(t).fill(e,r):ye(t).fill(e):ye(t)}_.alloc=function(t,e,r){return Kl(t,e,r)};function Jr(t){return Mn(t),ye(t<0?0:ei(t)|0)}_.allocUnsafe=function(t){return Jr(t)};_.allocUnsafeSlow=function(t){return Jr(t)};function Yl(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!_.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=$n(t,e)|0,i=ye(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Yr(t){let e=t.length<0?0:ei(t.length)|0,r=ye(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function Zl(t){if(ne(t,Uint8Array)){let e=new Uint8Array(t);return Zr(e.buffer,e.byteOffset,e.byteLength)}return Yr(t)}function Zr(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,_.prototype),i}function Xl(t){if(_.isBuffer(t)){let e=ei(t.length)|0,r=ye(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||ri(t.length)?ye(0):Yr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Yr(t.data)}function ei(t){if(t>=sr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+sr.toString(16)+" bytes");return t|0}function Jl(t){return+t!=t&&(t=0),_.alloc(+t)}_.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==_.prototype};_.compare=function(e,r){if(ne(e,Uint8Array)&&(e=_.from(e,e.offset,e.byteLength)),ne(r,Uint8Array)&&(r=_.from(r,r.offset,r.byteLength)),!_.isBuffer(e)||!_.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,o=Math.min(i,n);s<o;++s)if(e[s]!==r[s]){i=e[s],n=r[s];break}return i<n?-1:n<i?1:0};_.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}};_.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return _.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=_.allocUnsafe(r),s=0;for(i=0;i<e.length;++i){let o=e[i];if(ne(o,Uint8Array))s+o.length>n.length?(_.isBuffer(o)||(o=_.from(o)),o.copy(n,s)):Uint8Array.prototype.set.call(n,o,s);else if(_.isBuffer(o))o.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return n};function $n(t,e){if(_.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||ne(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Xr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return zn(t).length;default:if(n)return i?-1:Xr(t).length;e=(""+e).toLowerCase(),n=!0}}_.byteLength=$n;function eu(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return fu(this,e,r);case"utf8":case"utf-8":return qn(this,e,r);case"ascii":return lu(this,e,r);case"latin1":case"binary":return uu(this,e,r);case"base64":return ou(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cu(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}_.prototype._isBuffer=!0;function qe(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}_.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)qe(this,r,r+1);return this};_.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)qe(this,r,r+3),qe(this,r+1,r+2);return this};_.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)qe(this,r,r+7),qe(this,r+1,r+6),qe(this,r+2,r+5),qe(this,r+3,r+4);return this};_.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?qn(this,0,e):eu.apply(this,arguments)};_.prototype.toLocaleString=_.prototype.toString;_.prototype.equals=function(e){if(!_.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:_.compare(this,e)===0};_.prototype.inspect=function(){let e="",r=ut.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Fn&&(_.prototype[Fn]=_.prototype.inspect);_.prototype.compare=function(e,r,i,n,s){if(ne(e,Uint8Array)&&(e=_.from(e,e.offset,e.byteLength)),!_.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let o=s-n,a=i-r,u=Math.min(o,a),l=this.slice(n,s),f=e.slice(r,i);for(let c=0;c<u;++c)if(l[c]!==f[c]){o=l[c],a=f[c];break}return o<a?-1:a<o?1:0};function kn(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ri(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=_.from(e,i)),_.isBuffer(e))return e.length===0?-1:Bn(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Bn(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Bn(t,e,r,i,n){let s=1,o=t.length,a=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function u(f,c){return s===1?f[c]:f.readUInt16BE(c*s)}let l;if(n){let f=-1;for(l=r;l<o;l++)if(u(t,l)===u(e,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===a)return f*s}else f!==-1&&(l-=l-f),f=-1}else for(r+a>o&&(r=o-a),l=r;l>=0;l--){let f=!0;for(let c=0;c<a;c++)if(u(t,l+c)!==u(e,c)){f=!1;break}if(f)return l}return-1}_.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};_.prototype.indexOf=function(e,r,i){return kn(this,e,r,i,!0)};_.prototype.lastIndexOf=function(e,r,i){return kn(this,e,r,i,!1)};function tu(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let o;for(o=0;o<i;++o){let a=parseInt(e.substr(o*2,2),16);if(ri(a))return o;t[r+o]=a}return o}function ru(t,e,r,i){return or(Xr(e,t.length-r),t,r,i)}function iu(t,e,r,i){return or(pu(e),t,r,i)}function nu(t,e,r,i){return or(zn(e),t,r,i)}function su(t,e,r,i){return or(bu(e,t.length-r),t,r,i)}_.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return tu(this,e,r,i);case"utf8":case"utf-8":return ru(this,e,r,i);case"ascii":case"latin1":case"binary":return iu(this,e,r,i);case"base64":return nu(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return su(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ou(t,e,r){return e===0&&r===t.length?Kr.fromByteArray(t):Kr.fromByteArray(t.slice(e,r))}function qn(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let s=t[n],o=null,a=s>239?4:s>223?3:s>191?2:1;if(n+a<=r){let u,l,f,c;switch(a){case 1:s<128&&(o=s);break;case 2:u=t[n+1],(u&192)===128&&(c=(s&31)<<6|u&63,c>127&&(o=c));break;case 3:u=t[n+1],l=t[n+2],(u&192)===128&&(l&192)===128&&(c=(s&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:u=t[n+1],l=t[n+2],f=t[n+3],(u&192)===128&&(l&192)===128&&(f&192)===128&&(c=(s&15)<<18|(u&63)<<12|(l&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=a}return au(i)}var Cn=4096;function au(t){let e=t.length;if(e<=Cn)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Cn));return r}function lu(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function uu(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function fu(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let s=e;s<r;++s)n+=yu[t[s]];return n}function cu(t,e,r){let i=t.slice(e,r),n="";for(let s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}_.prototype.slice=function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,_.prototype),n};function O(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||O(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return n};_.prototype.readUintBE=_.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||O(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};_.prototype.readUint8=_.prototype.readUInt8=function(e,r){return e=e>>>0,r||O(e,1,this.length),this[e]};_.prototype.readUint16LE=_.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||O(e,2,this.length),this[e]|this[e+1]<<8};_.prototype.readUint16BE=_.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||O(e,2,this.length),this[e]<<8|this[e+1]};_.prototype.readUint32LE=_.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};_.prototype.readUint32BE=_.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||O(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};_.prototype.readBigUInt64LE=Pe(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))});_.prototype.readBigUInt64BE=Pe(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(s)});_.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||O(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*r)),n};_.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||O(e,r,this.length);let n=r,s=1,o=this[e+--n];for(;n>0&&(s*=256);)o+=this[e+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};_.prototype.readInt8=function(e,r){return e=e>>>0,r||O(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};_.prototype.readInt16LE=function(e,r){e=e>>>0,r||O(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};_.prototype.readInt16BE=function(e,r){e=e>>>0,r||O(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};_.prototype.readInt32LE=function(e,r){return e=e>>>0,r||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};_.prototype.readInt32BE=function(e,r){return e=e>>>0,r||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};_.prototype.readBigInt64LE=Pe(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});_.prototype.readBigInt64BE=Pe(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});_.prototype.readFloatLE=function(e,r){return e=e>>>0,r||O(e,4,this.length),at.read(this,e,!0,23,4)};_.prototype.readFloatBE=function(e,r){return e=e>>>0,r||O(e,4,this.length),at.read(this,e,!1,23,4)};_.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||O(e,8,this.length),at.read(this,e,!0,52,8)};_.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||O(e,8,this.length),at.read(this,e,!1,52,8)};function Q(t,e,r,i,n,s){if(!_.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;Q(this,e,r,i,a,0)}let s=1,o=0;for(this[r]=e&255;++o<i&&(s*=256);)this[r+o]=e/s&255;return r+i};_.prototype.writeUintBE=_.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;Q(this,e,r,i,a,0)}let s=i-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+i};_.prototype.writeUint8=_.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,1,255,0),this[r]=e&255,r+1};_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Un(t,e,r,i,n){Hn(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function Wn(t,e,r,i,n){Hn(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}_.prototype.writeBigUInt64LE=Pe(function(e,r=0){return Un(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});_.prototype.writeBigUInt64BE=Pe(function(e,r=0){return Wn(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});_.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);Q(this,e,r,i,u-1,-u)}let s=0,o=1,a=0;for(this[r]=e&255;++s<i&&(o*=256);)e<0&&a===0&&this[r+s-1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};_.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let u=Math.pow(2,8*i-1);Q(this,e,r,i,u-1,-u)}let s=i-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};_.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};_.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};_.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};_.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};_.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||Q(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};_.prototype.writeBigInt64LE=Pe(function(e,r=0){return Un(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});_.prototype.writeBigInt64BE=Pe(function(e,r=0){return Wn(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Gn(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Vn(t,e,r,i,n){return e=+e,r=r>>>0,n||Gn(t,e,r,4,34028234663852886e22,-34028234663852886e22),at.write(t,e,r,i,23,4),r+4}_.prototype.writeFloatLE=function(e,r,i){return Vn(this,e,r,!0,i)};_.prototype.writeFloatBE=function(e,r,i){return Vn(this,e,r,!1,i)};function Qn(t,e,r,i,n){return e=+e,r=r>>>0,n||Gn(t,e,r,8,17976931348623157e292,-17976931348623157e292),at.write(t,e,r,i,52,8),r+8}_.prototype.writeDoubleLE=function(e,r,i){return Qn(this,e,r,!0,i)};_.prototype.writeDoubleBE=function(e,r,i){return Qn(this,e,r,!1,i)};_.prototype.copy=function(e,r,i,n){if(!_.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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-r<n-i&&(n=e.length-r+i);let s=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),s};_.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!_.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let o=e.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{let o=_.isBuffer(e)?e:_.from(e,n),a=o.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};var ot={};function ti(t,e,r){ot[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}ti("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);ti("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);ti("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Dn(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Dn(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Dn(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function du(t,e,r){lt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&jt(e,t.length-(r+1))}function Hn(t,e,r,i,n,s){if(t>r||t<e){let o=typeof e=="bigint"?"n":"",a;throw s>3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new ot.ERR_OUT_OF_RANGE("value",a,t)}du(i,n,s)}function lt(t,e){if(typeof t!="number")throw new ot.ERR_INVALID_ARG_TYPE(e,"number",t)}function jt(t,e,r){throw Math.floor(t)!==t?(lt(t,r),new ot.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new ot.ERR_BUFFER_OUT_OF_BOUNDS:new ot.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var hu=/[^+/0-9A-Za-z-_]/g;function _u(t){if(t=t.split("=")[0],t=t.trim().replace(hu,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Xr(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function pu(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function bu(t,e){let r,i,n,s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}function zn(t){return Kr.toByteArray(_u(t))}function or(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function ne(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function ri(t){return t!==t}var yu=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e})();function Pe(t){return typeof BigInt=="undefined"?gu:t}function gu(){throw new Error("BigInt not supported")}});var v=R((kp,_s)=>{"use strict";var ai=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
2
- `;super(r),this.name="AggregateError",this.errors=e}};_s.exports={AggregateError:ai,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var li=R((qp,ps)=>{"use strict";ps.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var k=R((Up,gs)=>{"use strict";var{format:$u,inspect:cr}=li(),{AggregateError:ku}=v(),qu=globalThis.AggregateError||ku,Uu=Symbol("kIsNodeError"),Wu=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Gu=/^([A-Z][a-z0-9]*)+$/,Vu="__node_internal_",dr={};function Qe(t,e){if(!t)throw new dr.ERR_INTERNAL_ASSERTION(e)}function bs(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Qu(t,e,r){if(typeof e=="function")return Qe(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return Qe(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:$u(e,...r)}function $(t,e,r){r||(r=Error);class i extends r{constructor(...s){super(Qu(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[Uu]=!0,dr[t]=i}function ys(t){let e=Vu+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Hu(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new qu([e,t],e.message);return r.code=e.code,r}return t||e}var ui=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new dr.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};$("ERR_ASSERTION","%s",Error);$("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Qe(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],s=[],o=[];for(let u of e)Qe(typeof u=="string","All expected entries have to be of type string"),Wu.includes(u)?n.push(u.toLowerCase()):Gu.test(u)?s.push(u):(Qe(u!=="object",'The value "object" should be written as "Object"'),o.push(u));if(s.length>0){let u=n.indexOf("object");u!==-1&&(n.splice(n,u,1),s.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let u=n.pop();i+=`one of type ${n.join(", ")}, or ${u}`}}(s.length>0||o.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let u=s.pop();i+=`an instance of ${s.join(", ")}, or ${u}`}}o.length>0&&(i+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(i+="an "),i+=`${o[0]}`;break;case 2:i+=`one of ${o[0]} or ${o[1]}`;break;default:{let u=o.pop();i+=`one of ${o.join(", ")}, or ${u}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let u=cr(r,{depth:-1});i+=`. Received ${u}`}}else{let u=cr(r,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),i+=`. Received type ${typeof r} (${u})`}return i},TypeError);$("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=cr(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);$("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);$("ERR_MISSING_ARGS",(...t)=>{Qe(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);$("ERR_OUT_OF_RANGE",(t,e,r)=>{Qe(e,'Missing "range" argument');let i;if(Number.isInteger(r)&&Math.abs(r)>2**32)i=bs(String(r));else if(typeof r=="bigint"){i=String(r);let n=BigInt(2)**BigInt(32);(r>n||r<-n)&&(i=bs(i)),i+="n"}else i=cr(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);$("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);$("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);$("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);$("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);$("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);$("ERR_STREAM_WRITE_AFTER_END","write after end",Error);$("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);gs.exports={AbortError:ui,aggregateTwoErrors:ys(Hu),hideStackFrames:ys,codes:dr}});var pt=R((Wp,hr)=>{"use strict";var{AbortController:ws,AbortSignal:zu}=typeof self!="undefined"?self:typeof window!="undefined"?window:void 0;hr.exports=ws;hr.exports.AbortSignal=zu;hr.exports.default=ws});var Mt=R((Gp,fi)=>{"use strict";var bt=typeof Reflect=="object"?Reflect:null,ms=bt&&typeof bt.apply=="function"?bt.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},_r;bt&&typeof bt.ownKeys=="function"?_r=bt.ownKeys:Object.getOwnPropertySymbols?_r=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:_r=function(e){return Object.getOwnPropertyNames(e)};function Ku(t){console&&console.warn&&console.warn(t)}var Es=Number.isNaN||function(e){return e!==e};function T(){T.init.call(this)}fi.exports=T;fi.exports.once=Ju;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var xs=10;function pr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return xs},set:function(t){if(typeof t!="number"||t<0||Es(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");xs=t}});T.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};T.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Es(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};function Ss(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}T.prototype.getMaxListeners=function(){return Ss(this)};T.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(u===void 0)return!1;if(typeof u=="function")ms(u,this,r);else for(var l=u.length,f=Ns(u,l),i=0;i<l;++i)ms(f[i],this,r);return!0};function Is(t,e,r,i){var n,s,o;if(pr(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),n=Ss(t),n>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,Ku(a)}return t}T.prototype.addListener=function(e,r){return Is(this,e,r,!1)};T.prototype.on=T.prototype.addListener;T.prototype.prependListener=function(e,r){return Is(this,e,r,!0)};function Yu(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Rs(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Yu.bind(i);return n.listener=r,i.wrapFn=n,n}T.prototype.once=function(e,r){return pr(r),this.on(e,Rs(this,e,r)),this};T.prototype.prependOnceListener=function(e,r){return pr(r),this.prependListener(e,Rs(this,e,r)),this};T.prototype.removeListener=function(e,r){var i,n,s,o,a;if(pr(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===r||i[o].listener===r){a=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():Zu(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),o;for(n=0;n<s.length;++n)o=s[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function Ts(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Xu(n):Ns(n,n.length)}T.prototype.listeners=function(e){return Ts(this,e,!0)};T.prototype.rawListeners=function(e){return Ts(this,e,!1)};T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):As.call(t,e)};T.prototype.listenerCount=As;function As(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}T.prototype.eventNames=function(){return this._eventsCount>0?_r(this._events):[]};function Ns(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function Zu(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Xu(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Ju(t,e){return new Promise(function(r,i){function n(o){t.removeListener(e,s),i(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}vs(t,e,s,{once:!0}),e!=="error"&&ef(t,n,{once:!0})})}function ef(t,e,r){typeof t.on=="function"&&vs(t,"error",e,r)}function vs(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var U=R((Vp,di)=>{"use strict";var tf=se(),{format:rf,inspect:nf}=li(),{codes:{ERR_INVALID_ARG_TYPE:ci}}=k(),{kResistStopPropagation:sf,AggregateError:of,SymbolDispose:af}=v(),lf=globalThis.AbortSignal||pt().AbortSignal,uf=globalThis.AbortController||pt().AbortController,ff=Object.getPrototypeOf(async function(){}).constructor,Ps=globalThis.Blob||tf.Blob,cf=typeof Ps!="undefined"?function(e){return e instanceof Ps}:function(e){return!1},js=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ci(e,"AbortSignal",t)},df=(t,e)=>{if(typeof t!="function")throw new ci(e,"Function",t)};di.exports={AggregateError:of,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format:rf,inspect:nf,types:{isAsyncFunction(t){return t instanceof ff},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:cf,deprecate(t,e){return t},addAbortListener:Mt().addAbortListener||function(e,r){if(e===void 0)throw new ci("signal","AbortSignal",e);js(e,"signal"),df(r,"listener");let i;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[sf]:!0}),i=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[af](){var n;(n=i)===null||n===void 0||n()}}},AbortSignalAny:lf.any||function(e){if(e.length===1)return e[0];let r=new uf,i=()=>r.abort();return e.forEach(n=>{js(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal}};di.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var gt=R((Qp,qs)=>{"use strict";var{ArrayIsArray:_i,ArrayPrototypeIncludes:Cs,ArrayPrototypeJoin:Ds,ArrayPrototypeMap:hf,NumberIsInteger:pi,NumberIsNaN:_f,NumberMAX_SAFE_INTEGER:pf,NumberMIN_SAFE_INTEGER:bf,NumberParseInt:yf,ObjectPrototypeHasOwnProperty:gf,RegExpPrototypeExec:Os,String:wf,StringPrototypeToUpperCase:mf,StringPrototypeTrim:xf}=v(),{hideStackFrames:X,codes:{ERR_SOCKET_BAD_PORT:Ef,ERR_INVALID_ARG_TYPE:q,ERR_INVALID_ARG_VALUE:yt,ERR_OUT_OF_RANGE:He,ERR_UNKNOWN_SIGNAL:Ls}}=k(),{normalizeEncoding:Sf}=U(),{isAsyncFunction:If,isArrayBufferView:Rf}=U().types,Fs={};function Tf(t){return t===(t|0)}function Af(t){return t===t>>>0}var Nf=/^[0-7]+$/,vf="must be a 32-bit unsigned integer or an octal string";function Pf(t,e,r){if(typeof t=="undefined"&&(t=r),typeof t=="string"){if(Os(Nf,t)===null)throw new yt(e,t,vf);t=yf(t,8)}return Ms(t,e),t}var jf=X((t,e,r=bf,i=pf)=>{if(typeof t!="number")throw new q(e,"number",t);if(!pi(t))throw new He(e,"an integer",t);if(t<r||t>i)throw new He(e,`>= ${r} && <= ${i}`,t)}),Lf=X((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new q(e,"number",t);if(!pi(t))throw new He(e,"an integer",t);if(t<r||t>i)throw new He(e,`>= ${r} && <= ${i}`,t)}),Ms=X((t,e,r=!1)=>{if(typeof t!="number")throw new q(e,"number",t);if(!pi(t))throw new He(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new He(e,`>= ${i} && <= ${n}`,t)});function bi(t,e){if(typeof t!="string")throw new q(e,"string",t)}function Ff(t,e,r=void 0,i){if(typeof t!="number")throw new q(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&_f(t))throw new He(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var Bf=X((t,e,r)=>{if(!Cs(r,t)){let n="must be one of: "+Ds(hf(r,s=>typeof s=="string"?`'${s}'`:wf(s)),", ");throw new yt(e,t,n)}});function $s(t,e){if(typeof t!="boolean")throw new q(e,"boolean",t)}function hi(t,e,r){return t==null||!gf(t,e)?r:t[e]}var Cf=X((t,e,r=null)=>{let i=hi(r,"allowArray",!1),n=hi(r,"allowFunction",!1);if(!hi(r,"nullable",!1)&&t===null||!i&&_i(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new q(e,"Object",t)}),Df=X((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new q(e,"a dictionary",t)}),br=X((t,e,r=0)=>{if(!_i(t))throw new q(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new yt(e,t,i)}});function Of(t,e){br(t,e);for(let r=0;r<t.length;r++)bi(t[r],`${e}[${r}]`)}function Mf(t,e){br(t,e);for(let r=0;r<t.length;r++)$s(t[r],`${e}[${r}]`)}function $f(t,e){br(t,e);for(let r=0;r<t.length;r++){let i=t[r],n=`${e}[${r}]`;if(i==null)throw new q(n,"AbortSignal",i);ks(i,n)}}function kf(t,e="signal"){if(bi(t,e),Fs[t]===void 0)throw Fs[mf(t)]!==void 0?new Ls(t+" (signals must use all capital letters)"):new Ls(t)}var qf=X((t,e="buffer")=>{if(!Rf(t))throw new q(e,["Buffer","TypedArray","DataView"],t)});function Uf(t,e){let r=Sf(e),i=t.length;if(r==="hex"&&i%2!==0)throw new yt("encoding",e,`is invalid for data of length ${i}`)}function Wf(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&xf(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Ef(e,t,r);return t|0}var ks=X((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new q(e,"AbortSignal",t)}),Gf=X((t,e)=>{if(typeof t!="function")throw new q(e,"Function",t)}),Vf=X((t,e)=>{if(typeof t!="function"||If(t))throw new q(e,"Function",t)}),Qf=X((t,e)=>{if(t!==void 0)throw new q(e,"undefined",t)});function Hf(t,e,r){if(!Cs(r,t))throw new q(e,`('${Ds(r,"|")}')`,t)}var zf=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Bs(t,e){if(typeof t=="undefined"||!Os(zf,t))throw new yt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Kf(t){if(typeof t=="string")return Bs(t,"hints"),t;if(_i(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];Bs(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new yt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}qs.exports={isInt32:Tf,isUint32:Af,parseFileMode:Pf,validateArray:br,validateStringArray:Of,validateBooleanArray:Mf,validateAbortSignalArray:$f,validateBoolean:$s,validateBuffer:qf,validateDictionary:Df,validateEncoding:Uf,validateFunction:Gf,validateInt32:Lf,validateInteger:jf,validateNumber:Ff,validateObject:Cf,validateOneOf:Bf,validatePlainFunction:Vf,validatePort:Wf,validateSignalName:kf,validateString:bi,validateUint32:Ms,validateUndefined:Qf,validateUnion:Hf,validateAbortSignal:ks,validateLinkHeaderValue:Kf}});var Be=R((Hp,Vs)=>{var L=Vs.exports={},ae,le;function yi(){throw new Error("setTimeout has not been defined")}function gi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ae=setTimeout:ae=yi}catch(t){ae=yi}try{typeof clearTimeout=="function"?le=clearTimeout:le=gi}catch(t){le=gi}})();function Us(t){if(ae===setTimeout)return setTimeout(t,0);if((ae===yi||!ae)&&setTimeout)return ae=setTimeout,setTimeout(t,0);try{return ae(t,0)}catch(e){try{return ae.call(null,t,0)}catch(r){return ae.call(this,t,0)}}}function Yf(t){if(le===clearTimeout)return clearTimeout(t);if((le===gi||!le)&&clearTimeout)return le=clearTimeout,clearTimeout(t);try{return le(t)}catch(e){try{return le.call(null,t)}catch(r){return le.call(this,t)}}}var Ee=[],wt=!1,ze,yr=-1;function Zf(){!wt||!ze||(wt=!1,ze.length?Ee=ze.concat(Ee):yr=-1,Ee.length&&Ws())}function Ws(){if(!wt){var t=Us(Zf);wt=!0;for(var e=Ee.length;e;){for(ze=Ee,Ee=[];++yr<e;)ze&&ze[yr].run();yr=-1,e=Ee.length}ze=null,wt=!1,Yf(t)}}L.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ee.push(new Gs(t,e)),Ee.length===1&&!wt&&Us(Ws)};function Gs(t,e){this.fun=t,this.array=e}Gs.prototype.run=function(){this.fun.apply(null,this.array)};L.title="browser";L.browser=!0;L.env={};L.argv=[];L.version="";L.versions={};function Se(){}L.on=Se;L.addListener=Se;L.once=Se;L.off=Se;L.removeListener=Se;L.removeAllListeners=Se;L.emit=Se;L.prependListener=Se;L.prependOnceListener=Se;L.listeners=function(t){return[]};L.binding=function(t){throw new Error("process.binding is not supported")};L.cwd=function(){return"/"};L.chdir=function(t){throw new Error("process.chdir is not supported")};L.umask=function(){return 0}});var fe=R((zp,oo)=>{"use strict";var{SymbolAsyncIterator:Qs,SymbolIterator:Hs,SymbolFor:Ke}=v(),zs=Ke("nodejs.stream.destroyed"),Ks=Ke("nodejs.stream.errored"),wi=Ke("nodejs.stream.readable"),mi=Ke("nodejs.stream.writable"),Ys=Ke("nodejs.stream.disturbed"),Xf=Ke("nodejs.webstream.isClosedPromise"),Jf=Ke("nodejs.webstream.controllerErrorFunction");function gr(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function wr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function ec(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function ue(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Zs(t){return!!(t&&!ue(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Xs(t){return!!(t&&!ue(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Js(t){return!!(t&&!ue(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function tc(t){return Zs(t)||Xs(t)||Js(t)}function rc(t,e){return t==null?!1:e===!0?typeof t[Qs]=="function":e===!1?typeof t[Hs]=="function":typeof t[Qs]=="function"||typeof t[Hs]=="function"}function mr(t){if(!ue(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[zs]||i!=null&&i.destroyed)}function eo(t){if(!wr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function ic(t,e){if(!wr(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function nc(t){if(!gr(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function to(t,e){if(!gr(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function ro(t){return t&&t[wi]!=null?t[wi]:typeof(t==null?void 0:t.readable)!="boolean"?null:mr(t)?!1:gr(t)&&t.readable&&!to(t)}function io(t){return t&&t[mi]!=null?t[mi]:typeof(t==null?void 0:t.writable)!="boolean"?null:mr(t)?!1:wr(t)&&t.writable&&!eo(t)}function sc(t,e){return ue(t)?mr(t)?!0:!((e==null?void 0:e.readable)!==!1&&ro(t)||(e==null?void 0:e.writable)!==!1&&io(t)):null}function oc(t){var e,r;return ue(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function ac(t){var e,r;return ue(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function lc(t){if(!ue(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(e==null?void 0:e.closed)||(r==null?void 0:r.closed):typeof t._closed=="boolean"&&no(t)?t._closed:null}function no(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function so(t){return typeof t._sent100=="boolean"&&no(t)}function uc(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function fc(t){if(!ue(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&so(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function cc(t){var e;return!!(t&&((e=t[Ys])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function dc(t){var e,r,i,n,s,o,a,u,l,f;return!!(t&&((e=(r=(i=(n=(s=(o=t[Ks])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errored)!==null&&e!==void 0?e:!((f=t._writableState)===null||f===void 0)&&f.errored))}oo.exports={isDestroyed:mr,kIsDestroyed:zs,isDisturbed:cc,kIsDisturbed:Ys,isErrored:dc,kIsErrored:Ks,isReadable:ro,kIsReadable:wi,kIsClosedPromise:Xf,kControllerErrorFunction:Jf,kIsWritable:mi,isClosed:lc,isDuplexNodeStream:ec,isFinished:sc,isIterable:rc,isReadableNodeStream:gr,isReadableStream:Zs,isReadableEnded:nc,isReadableFinished:to,isReadableErrored:ac,isNodeStream:ue,isWebStream:tc,isWritable:io,isWritableNodeStream:wr,isWritableStream:Xs,isWritableEnded:eo,isWritableFinished:ic,isWritableErrored:oc,isServerRequest:uc,isServerResponse:so,willEmitClose:fc,isTransformStream:Js}});var Ie=R((Kp,Ri)=>{"use strict";var Ce=Be(),{AbortError:bo,codes:hc}=k(),{ERR_INVALID_ARG_TYPE:_c,ERR_STREAM_PREMATURE_CLOSE:ao}=hc,{kEmptyObject:Ei,once:Si}=U(),{validateAbortSignal:pc,validateFunction:bc,validateObject:yc,validateBoolean:gc}=gt(),{Promise:wc,PromisePrototypeThen:mc,SymbolDispose:yo}=v(),{isClosed:xc,isReadable:lo,isReadableNodeStream:xi,isReadableStream:Ec,isReadableFinished:uo,isReadableErrored:fo,isWritable:co,isWritableNodeStream:ho,isWritableStream:Sc,isWritableFinished:_o,isWritableErrored:po,isNodeStream:Ic,willEmitClose:Rc,kIsClosedPromise:Tc}=fe(),mt;function Ac(t){return t.setHeader&&typeof t.abort=="function"}var Ii=()=>{};function go(t,e,r){var i,n;if(arguments.length===2?(r=e,e=Ei):e==null?e=Ei:yc(e,"options"),bc(r,"callback"),pc(e.signal,"options.signal"),r=Si(r),Ec(t)||Sc(t))return Nc(t,e,r);if(!Ic(t))throw new _c("stream",["ReadableStream","WritableStream","Stream"],t);let s=(i=e.readable)!==null&&i!==void 0?i:xi(t),o=(n=e.writable)!==null&&n!==void 0?n:ho(t),a=t._writableState,u=t._readableState,l=()=>{t.writable||h()},f=Rc(t)&&xi(t)===s&&ho(t)===o,c=_o(t,!1),h=()=>{c=!0,t.destroyed&&(f=!1),!(f&&(!t.readable||s))&&(!s||d)&&r.call(t)},d=uo(t,!1),b=()=>{d=!0,t.destroyed&&(f=!1),!(f&&(!t.writable||o))&&(!o||c)&&r.call(t)},p=I=>{r.call(t,I)},g=xc(t),w=()=>{g=!0;let I=po(t)||fo(t);if(I&&typeof I!="boolean")return r.call(t,I);if(s&&!d&&xi(t,!0)&&!uo(t,!1))return r.call(t,new ao);if(o&&!c&&!_o(t,!1))return r.call(t,new ao);r.call(t)},m=()=>{g=!0;let I=po(t)||fo(t);if(I&&typeof I!="boolean")return r.call(t,I);r.call(t)},E=()=>{t.req.on("finish",h)};Ac(t)?(t.on("complete",h),f||t.on("abort",w),t.req?E():t.on("request",E)):o&&!a&&(t.on("end",l),t.on("close",l)),!f&&typeof t.aborted=="boolean"&&t.on("aborted",w),t.on("end",b),t.on("finish",h),e.error!==!1&&t.on("error",p),t.on("close",w),g?Ce.nextTick(w):a!=null&&a.errorEmitted||u!=null&&u.errorEmitted?f||Ce.nextTick(m):(!s&&(!f||lo(t))&&(c||co(t)===!1)||!o&&(!f||co(t))&&(d||lo(t)===!1)||u&&t.req&&t.aborted)&&Ce.nextTick(m);let y=()=>{r=Ii,t.removeListener("aborted",w),t.removeListener("complete",h),t.removeListener("abort",w),t.removeListener("request",E),t.req&&t.req.removeListener("finish",h),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",h),t.removeListener("end",b),t.removeListener("error",p),t.removeListener("close",w)};if(e.signal&&!g){let I=()=>{let W=r;y(),W.call(t,new bo(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Ce.nextTick(I);else{mt=mt||U().addAbortListener;let W=mt(e.signal,I),K=r;r=Si((...nt)=>{W[yo](),K.apply(t,nt)})}}return y}function Nc(t,e,r){let i=!1,n=Ii;if(e.signal)if(n=()=>{i=!0,r.call(t,new bo(void 0,{cause:e.signal.reason}))},e.signal.aborted)Ce.nextTick(n);else{mt=mt||U().addAbortListener;let o=mt(e.signal,n),a=r;r=Si((...u)=>{o[yo](),a.apply(t,u)})}let s=(...o)=>{i||Ce.nextTick(()=>r.apply(t,o))};return mc(t[Tc].promise,s,s),Ii}function vc(t,e){var r;let i=!1;return e===null&&(e=Ei),(r=e)!==null&&r!==void 0&&r.cleanup&&(gc(e.cleanup,"cleanup"),i=e.cleanup),new wc((n,s)=>{let o=go(t,e,a=>{i&&o(),a?s(a):n()})})}Ri.exports=go;Ri.exports.finished=vc});var Ye=R((Yp,To)=>{"use strict";var ce=Be(),{aggregateTwoErrors:Pc,codes:{ERR_MULTIPLE_CALLBACK:jc},AbortError:Lc}=k(),{Symbol:xo}=v(),{kIsDestroyed:Fc,isDestroyed:Bc,isFinished:Cc,isServerRequest:Dc}=fe(),Eo=xo("kDestroy"),Ti=xo("kConstruct");function So(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Oc(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(So(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?wo(this,t,e):this.once(Eo,function(s){wo(this,Pc(s,t),e)}),this)}function wo(t,e,r){let i=!1;function n(s){if(i)return;i=!0;let o=t._readableState,a=t._writableState;So(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?ce.nextTick(Mc,t,s):ce.nextTick(Io,t)}try{t._destroy(e||null,n)}catch(s){n(s)}}function Mc(t,e){Ai(t,e),Io(t)}function Io(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function Ai(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function $c(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Ni(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?ce.nextTick(Ai,t,e):Ai(t,e))}function kc(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(Ti,e),!(t.listenerCount(Ti)>1)&&ce.nextTick(qc,t)}function qc(t){let e=!1;function r(i){if(e){Ni(t,i!=null?i:new jc);return}e=!0;let n=t._readableState,s=t._writableState,o=s||n;n&&(n.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(Eo,i):i?Ni(t,i,!0):ce.nextTick(Uc,t)}try{t._construct(i=>{ce.nextTick(r,i)})}catch(i){ce.nextTick(r,i)}}function Uc(t){t.emit(Ti)}function mo(t){return(t==null?void 0:t.setHeader)&&typeof t.abort=="function"}function Ro(t){t.emit("close")}function Wc(t,e){t.emit("error",e),ce.nextTick(Ro,t)}function Gc(t,e){!t||Bc(t)||(!e&&!Cc(t)&&(e=new Lc),Dc(t)?(t.socket=null,t.destroy(e)):mo(t)?t.abort():mo(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ce.nextTick(Wc,t,e):ce.nextTick(Ro,t),t.destroyed||(t[Fc]=!0))}To.exports={construct:kc,destroyer:Gc,destroy:Oc,undestroy:$c,errorOrDestroy:Ni}});var Sr=R((Zp,No)=>{"use strict";var{ArrayIsArray:Vc,ObjectSetPrototypeOf:Ao}=v(),{EventEmitter:xr}=Mt();function Er(t){xr.call(this,t)}Ao(Er.prototype,xr.prototype);Ao(Er,xr);Er.prototype.pipe=function(t,e){let r=this;function i(f){t.writable&&t.write(f)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function u(f){l(),xr.listenerCount(this,"error")===0&&this.emit("error",f)}vi(r,"error",u),vi(t,"error",u);function l(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t};function vi(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Vc(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}No.exports={Stream:Er,prependListener:vi}});var $t=R((Xp,Ir)=>{"use strict";var{SymbolDispose:Qc}=v(),{AbortError:vo,codes:Hc}=k(),{isNodeStream:Po,isWebStream:zc,kControllerErrorFunction:Kc}=fe(),Yc=Ie(),{ERR_INVALID_ARG_TYPE:jo}=Hc,Pi,Zc=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new jo(e,"AbortSignal",t)};Ir.exports.addAbortSignal=function(e,r){if(Zc(e,"signal"),!Po(r)&&!zc(r))throw new jo("stream",["ReadableStream","WritableStream","Stream"],r);return Ir.exports.addAbortSignalNoValidate(e,r)};Ir.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Po(e)?()=>{e.destroy(new vo(void 0,{cause:t.reason}))}:()=>{e[Kc](new vo(void 0,{cause:t.reason}))};if(t.aborted)r();else{Pi=Pi||U().addAbortListener;let i=Pi(t,r);Yc(e,i[Qc])}return e}});var Bo=R((eb,Fo)=>{"use strict";var{StringPrototypeSlice:Lo,SymbolIterator:Xc,TypedArrayPrototypeSet:Rr,Uint8Array:Jc}=v(),{Buffer:ji}=se(),{inspect:ed}=U();Fo.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return ji.alloc(0);let r=ji.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)Rr(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Xc](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let s=i.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=Lo(s,0,e),this.head=i,i.data=Lo(s,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=ji.allocUnsafe(e),i=e,n=this.head,s=0;do{let o=n.data;if(e>o.length)Rr(r,o,i-e),e-=o.length;else{e===o.length?(Rr(r,o,i-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(Rr(r,new Jc(o.buffer,o.byteOffset,e),i-e),this.head=n,n.data=o.slice(e));break}++s}while((n=n.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return ed(this,ve(B({},r),{depth:0,customInspect:!1}))}}});var kt=R((rb,Mo)=>{"use strict";var{MathFloor:td,NumberIsInteger:rd}=v(),{validateInteger:id}=gt(),{ERR_INVALID_ARG_VALUE:nd}=k().codes,Co=16*1024,Do=16;function sd(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Oo(t){return t?Do:Co}function od(t,e){id(e,"value",0),t?Do=e:Co=e}function ad(t,e,r,i){let n=sd(e,i,r);if(n!=null){if(!rd(n)||n<0){let s=i?`options.${r}`:"options.highWaterMark";throw new nd(s,n)}return td(n)}return Oo(t.objectMode)}Mo.exports={getHighWaterMark:ad,getDefaultHighWaterMark:Oo,setDefaultHighWaterMark:od}});var qo=R((Li,ko)=>{var Tr=se(),de=Tr.Buffer;function $o(t,e){for(var r in t)e[r]=t[r]}de.from&&de.alloc&&de.allocUnsafe&&de.allocUnsafeSlow?ko.exports=Tr:($o(Tr,Li),Li.Buffer=Ze);function Ze(t,e,r){return de(t,e,r)}Ze.prototype=Object.create(de.prototype);$o(de,Ze);Ze.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return de(t,e,r)};Ze.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=de(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Ze.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return de(t)};Ze.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Tr.SlowBuffer(t)}});var Go=R(Wo=>{"use strict";var Bi=qo().Buffer,Uo=Bi.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ld(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function ud(t){var e=ld(t);if(typeof e!="string"&&(Bi.isEncoding===Uo||!Uo(t)))throw new Error("Unknown encoding: "+t);return e||t}Wo.StringDecoder=qt;function qt(t){this.encoding=ud(t);var e;switch(this.encoding){case"utf16le":this.text=pd,this.end=bd,e=4;break;case"utf8":this.fillLast=dd,e=4;break;case"base64":this.text=yd,this.end=gd,e=3;break;default:this.write=wd,this.end=md;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bi.allocUnsafe(e)}qt.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};qt.prototype.end=_d;qt.prototype.text=hd;qt.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Fi(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function fd(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Fi(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Fi(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Fi(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function cd(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function dd(t){var e=this.lastTotal-this.lastNeed,r=cd(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function hd(t,e){var r=fd(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function _d(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function pd(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function bd(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function yd(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function gd(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function wd(t){return t.toString(this.encoding)}function md(t){return t&&t.length?this.write(t):""}});var Ci=R((nb,zo)=>{"use strict";var Vo=Be(),{PromisePrototypeThen:xd,SymbolAsyncIterator:Qo,SymbolIterator:Ho}=v(),{Buffer:Ed}=se(),{ERR_INVALID_ARG_TYPE:Sd,ERR_STREAM_NULL_VALUES:Id}=k().codes;function Rd(t,e,r){let i;if(typeof e=="string"||e instanceof Ed)return new t(ve(B({objectMode:!0},r),{read(){this.push(e),this.push(null)}}));let n;if(e&&e[Qo])n=!0,i=e[Qo]();else if(e&&e[Ho])n=!1,i=e[Ho]();else throw new Sd("iterable",["Iterable"],e);let s=new t(B({objectMode:!0,highWaterMark:1},r)),o=!1;s._read=function(){o||(o=!0,u())},s._destroy=function(l,f){xd(a(l),()=>Vo.nextTick(f,l),c=>Vo.nextTick(f,c||l))};async function a(l){let f=l!=null,c=typeof i.throw=="function";if(f&&c){let{value:h,done:d}=await i.throw(l);if(await h,d)return}if(typeof i.return=="function"){let{value:h}=await i.return();await h}}async function u(){for(;;){try{let{value:l,done:f}=n?await i.next():i.next();if(f)s.push(null);else{let c=l&&typeof l.then=="function"?await l:l;if(c===null)throw o=!1,new Id;if(s.push(c))continue;o=!1}}catch(l){s.destroy(l)}break}}return s}zo.exports=Rd});var Wt=R((ob,da)=>{"use strict";var ee=Be(),{ArrayPrototypeIndexOf:Td,NumberIsInteger:Ad,NumberIsNaN:Nd,NumberParseInt:vd,ObjectDefineProperties:Wi,ObjectKeys:Pd,ObjectSetPrototypeOf:Zo,Promise:Xo,SafeSet:jd,SymbolAsyncDispose:Ld,SymbolAsyncIterator:Fd,Symbol:Bd}=v();da.exports=x;x.ReadableState=Pr;var{EventEmitter:Cd}=Mt(),{Stream:De,prependListener:Dd}=Sr(),{Buffer:Di}=se(),{addAbortSignal:Od}=$t(),Jo=Ie(),S=U().debuglog("stream",t=>{S=t}),Md=Bo(),St=Ye(),{getHighWaterMark:$d,getDefaultHighWaterMark:kd}=kt(),{aggregateTwoErrors:Ko,codes:{ERR_INVALID_ARG_TYPE:qd,ERR_METHOD_NOT_IMPLEMENTED:Ud,ERR_OUT_OF_RANGE:Wd,ERR_STREAM_PUSH_AFTER_EOF:Gd,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Vd},AbortError:Qd}=k(),{validateObject:Hd}=gt(),Xe=Bd("kPaused"),{StringDecoder:ea}=Go(),zd=Ci();Zo(x.prototype,De.prototype);Zo(x,De);var Oi=()=>{},{errorOrDestroy:xt}=St,Et=1,Kd=2,ta=4,Ut=8,ra=16,Ar=32,Nr=64,ia=128,Yd=256,Zd=512,Xd=1024,qi=2048,Ui=4096,Jd=8192,eh=16384,th=32768,na=65536,rh=1<<17,ih=1<<18;function C(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}Wi(Pr.prototype,{objectMode:C(Et),ended:C(Kd),endEmitted:C(ta),reading:C(Ut),constructed:C(ra),sync:C(Ar),needReadable:C(Nr),emittedReadable:C(ia),readableListening:C(Yd),resumeScheduled:C(Zd),errorEmitted:C(Xd),emitClose:C(qi),autoDestroy:C(Ui),destroyed:C(Jd),closed:C(eh),closeEmitted:C(th),multiAwaitDrain:C(na),readingMore:C(rh),dataEmitted:C(ih)});function Pr(t,e,r){typeof r!="boolean"&&(r=e instanceof he()),this.state=qi|Ui|ra|Ar,t&&t.objectMode&&(this.state|=Et),r&&t&&t.readableObjectMode&&(this.state|=Et),this.highWaterMark=t?$d(this,t,"readableHighWaterMark",r):kd(!1),this.buffer=new Md,this.length=0,this.pipes=[],this.flowing=null,this[Xe]=null,t&&t.emitClose===!1&&(this.state&=~qi),t&&t.autoDestroy===!1&&(this.state&=~Ui),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new ea(t.encoding),this.encoding=t.encoding)}function x(t){if(!(this instanceof x))return new x(t);let e=this instanceof he();this._readableState=new Pr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Od(t.signal,this)),De.call(this,t),St.construct(this,()=>{this._readableState.needReadable&&vr(this,this._readableState)})}x.prototype.destroy=St.destroy;x.prototype._undestroy=St.undestroy;x.prototype._destroy=function(t,e){e(t)};x.prototype[Cd.captureRejectionSymbol]=function(t){this.destroy(t)};x.prototype[Ld]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Qd,this.destroy(t)),new Xo((e,r)=>Jo(this,i=>i&&i!==t?r(i):e(null)))};x.prototype.push=function(t,e){return sa(this,t,e,!1)};x.prototype.unshift=function(t,e){return sa(this,t,e,!0)};function sa(t,e,r,i){S("readableAddChunk",e);let n=t._readableState,s;if((n.state&Et)===0&&(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=Di.from(e,r).toString(n.encoding):(e=Di.from(e,r),r=""))):e instanceof Di?r="":De._isUint8Array(e)?(e=De._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new qd("chunk",["string","Buffer","Uint8Array"],e))),s)xt(t,s);else if(e===null)n.state&=~Ut,oh(t,n);else if((n.state&Et)!==0||e&&e.length>0)if(i)if((n.state&ta)!==0)xt(t,new Vd);else{if(n.destroyed||n.errored)return!1;Mi(t,n,e,!0)}else if(n.ended)xt(t,new Gd);else{if(n.destroyed||n.errored)return!1;n.state&=~Ut,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?Mi(t,n,e,!1):vr(t,n)):Mi(t,n,e,!1)}else i||(n.state&=~Ut,vr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function Mi(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&na)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),(e.state&Nr)!==0&&jr(t)),vr(t,e)}x.prototype.isPaused=function(){let t=this._readableState;return t[Xe]===!0||t.flowing===!1};x.prototype.setEncoding=function(t){let e=new ea(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var nh=1073741824;function sh(t){if(t>nh)throw new Wd("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Yo(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Et)!==0?1:Nd(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}x.prototype.read=function(t){S("read",t),t===void 0?t=NaN:Ad(t)||(t=vd(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=sh(t)),t!==0&&(e.state&=~ia),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return S("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?$i(this):jr(this),null;if(t=Yo(t,e),t===0&&e.ended)return e.length===0&&$i(this),null;let i=(e.state&Nr)!==0;if(S("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,S("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,S("reading, ended or constructing",i);else if(i){S("do read"),e.state|=Ut|Ar,e.length===0&&(e.state|=Nr);try{this._read(e.highWaterMark)}catch(s){xt(this,s)}e.state&=~Ar,e.reading||(t=Yo(r,e))}let n;return t>0?n=fa(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&$i(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function oh(t,e){if(S("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?jr(t):(e.needReadable=!1,e.emittedReadable=!0,oa(t))}}function jr(t){let e=t._readableState;S("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(S("emitReadable",e.flowing),e.emittedReadable=!0,ee.nextTick(oa,t))}function oa(t){let e=t._readableState;S("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,la(t)}function vr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ee.nextTick(ah,t,e))}function ah(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(S("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}x.prototype._read=function(t){throw new Ud("_read()")};x.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new jd(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),S("pipe count=%d opts=%j",i.pipes.length,e);let s=(!e||e.end!==!1)&&t!==ee.stdout&&t!==ee.stderr?a:g;i.endEmitted?ee.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(w,m){S("onunpipe"),w===r&&m&&m.hasUnpiped===!1&&(m.hasUnpiped=!0,f())}function a(){S("onend"),t.end()}let u,l=!1;function f(){S("cleanup"),t.removeListener("close",b),t.removeListener("finish",p),u&&t.removeListener("drain",u),t.removeListener("error",d),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",g),r.removeListener("data",h),l=!0,u&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&u()}function c(){l||(i.pipes.length===1&&i.pipes[0]===t?(S("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(S("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),u||(u=lh(r,t),t.on("drain",u))}r.on("data",h);function h(w){S("ondata");let m=t.write(w);S("dest.write",m),m===!1&&c()}function d(w){if(S("onerror",w),g(),t.removeListener("error",d),t.listenerCount("error")===0){let m=t._writableState||t._readableState;m&&!m.errorEmitted?xt(t,w):t.emit("error",w)}}Dd(t,"error",d);function b(){t.removeListener("finish",p),g()}t.once("close",b);function p(){S("onfinish"),t.removeListener("close",b),g()}t.once("finish",p);function g(){S("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?c():i.flowing||(S("pipe resume"),r.resume()),t};function lh(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(S("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(S("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}x.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let s=0;s<n.length;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}let i=Td(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};x.prototype.on=function(t,e){let r=De.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S("on readable",i.length,i.reading),i.length?jr(this):i.reading||ee.nextTick(uh,this)),r};x.prototype.addListener=x.prototype.on;x.prototype.removeListener=function(t,e){let r=De.prototype.removeListener.call(this,t,e);return t==="readable"&&ee.nextTick(aa,this),r};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(t){let e=De.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ee.nextTick(aa,this),e};function aa(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Xe]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function uh(t){S("readable nexttick read 0"),t.read(0)}x.prototype.resume=function(){let t=this._readableState;return t.flowing||(S("resume"),t.flowing=!t.readableListening,fh(this,t)),t[Xe]=!1,this};function fh(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ee.nextTick(ch,t,e))}function ch(t,e){S("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),la(t),e.flowing&&!e.reading&&t.read(0)}x.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Xe]=!0,this};function la(t){let e=t._readableState;for(S("flow",e.flowing);e.flowing&&t.read()!==null;);}x.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{xt(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Pd(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};x.prototype[Fd]=function(){return ua(this)};x.prototype.iterator=function(t){return t!==void 0&&Hd(t,"options"),ua(this,t)};function ua(t,e){typeof t.read!="function"&&(t=x.wrap(t,{objectMode:!0}));let r=dh(t,e);return r.stream=t,r}function dh(t,e){return Y(this,null,function*(){let r=Oi;function i(o){this===t?(r(),r=Oi):r=o}t.on("readable",i);let n,s=Jo(t,{writable:!1},o=>{n=o?Ko(n,o):null,r(),r=Oi});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(n)throw n;if(n===null)return;yield new M(new Xo(i))}}}catch(o){throw n=Ko(n,o),n}finally{(n||(e==null?void 0:e.destroyOnReturn)!==!1)&&(n===void 0||t._readableState.autoDestroy)?St.destroyer(t,null):(t.off("readable",i),s())}})}Wi(x.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Wi(Pr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Xe]!==!1},set(t){this[Xe]=!!t}}});x._fromList=fa;function fa(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function $i(t){let e=t._readableState;S("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ee.nextTick(hh,e,t))}function hh(t,e){if(S("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ee.nextTick(_h,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function _h(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}x.from=function(t,e){return zd(x,t,e)};var ki;function ca(){return ki===void 0&&(ki={}),ki}x.fromWeb=function(t,e){return ca().newStreamReadableFromReadableStream(t,e)};x.toWeb=function(t,e){return ca().newReadableStreamFromStreamReadable(t,e)};x.wrap=function(t,e){var r,i;return new x(ve(B({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0},e),{destroy(n,s){St.destroyer(t,n),s(n)}})).wrap(t)}});var Dr=R((lb,Ia)=>{"use strict";var Je=Be(),{ArrayPrototypeSlice:pa,Error:ph,FunctionPrototypeSymbolHasInstance:ba,ObjectDefineProperty:ya,ObjectDefineProperties:bh,ObjectSetPrototypeOf:ga,StringPrototypeToLowerCase:yh,Symbol:gh,SymbolHasInstance:wh}=v();Ia.exports=P;P.WritableState=Qt;var{EventEmitter:mh}=Mt(),Gt=Sr().Stream,{Buffer:Lr}=se(),Cr=Ye(),{addAbortSignal:xh}=$t(),{getHighWaterMark:Eh,getDefaultHighWaterMark:Sh}=kt(),{ERR_INVALID_ARG_TYPE:Ih,ERR_METHOD_NOT_IMPLEMENTED:Rh,ERR_MULTIPLE_CALLBACK:wa,ERR_STREAM_CANNOT_PIPE:Th,ERR_STREAM_DESTROYED:Vt,ERR_STREAM_ALREADY_FINISHED:Ah,ERR_STREAM_NULL_VALUES:Nh,ERR_STREAM_WRITE_AFTER_END:vh,ERR_UNKNOWN_ENCODING:ma}=k().codes,{errorOrDestroy:It}=Cr;ga(P.prototype,Gt.prototype);ga(P,Gt);function Qi(){}var Rt=gh("kOnFinished");function Qt(t,e,r){typeof r!="boolean"&&(r=e instanceof he()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Eh(this,t,"writableHighWaterMark",r):Sh(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=jh.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Br(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Rt]=[]}function Br(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Qt.prototype.getBuffer=function(){return pa(this.buffered,this.bufferedIndex)};ya(Qt.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(t){let e=this instanceof he();if(!e&&!ba(P,this))return new P(t);this._writableState=new Qt(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&xh(t.signal,this)),Gt.call(this,t),Cr.construct(this,()=>{let r=this._writableState;r.writing||zi(this,r),Ki(this,r)})}ya(P,wh,{__proto__:null,value:function(t){return ba(this,t)?!0:this!==P?!1:t&&t._writableState instanceof Qt}});P.prototype.pipe=function(){It(this,new Th)};function xa(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!Lr.isEncoding(r))throw new ma(r);typeof i!="function"&&(i=Qi)}if(e===null)throw new Nh;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=Lr.from(e,r),r="buffer");else if(e instanceof Lr)r="buffer";else if(Gt._isUint8Array(e))e=Gt._uint8ArrayToBuffer(e),r="buffer";else throw new Ih("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new vh:n.destroyed&&(s=new Vt("write")),s?(Je.nextTick(i,s),It(t,s,!0),s):(n.pendingcb++,Ph(t,n,e,r,i))}P.prototype.write=function(t,e,r){return xa(this,t,e,r)===!0};P.prototype.cork=function(){this._writableState.corked++};P.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||zi(this,t))};P.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=yh(e)),!Lr.isEncoding(e))throw new ma(e);return this._writableState.defaultEncoding=e,this};function Ph(t,e,r,i,n){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Qi&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function ha(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Vt("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function _a(t,e,r,i){--e.pendingcb,i(r),Hi(e),It(t,r)}function jh(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){It(t,new wa);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?Je.nextTick(_a,t,r,e,n):_a(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&zi(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},Je.nextTick(Lh,r.afterWriteTickInfo)):Ea(t,r,1,n))}function Lh({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,Ea(t,e,r,i)}function Ea(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&Hi(e),Ki(t,e)}function Hi(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:s,callback:o}=t.buffered[n],a=t.objectMode?1:s.length;t.length-=a,o((e=t.errored)!==null&&e!==void 0?e:new Vt("write"))}let r=t[Rt].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new Vt("end"))}Br(t)}function zi(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,s=r.length-i;if(!s)return;let o=i;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?Qi:l=>{for(let f=o;f<r.length;++f)r[f].callback(l)},u=e.allNoop&&o===0?r:pa(r,o);u.allBuffers=e.allBuffers,ha(t,e,!0,e.length,u,"",a),Br(e)}else{do{let{chunk:a,encoding:u,callback:l}=r[o];r[o++]=null;let f=n?1:a.length;ha(t,e,!1,f,a,u,l)}while(o<r.length&&!e.writing);o===r.length?Br(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}P.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Rh("_write()")};P.prototype._writev=null;P.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let s=xa(this,t,e);s instanceof ph&&(n=s)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,Ki(this,i,!0),i.ended=!0):i.finished?n=new Ah("end"):i.destroyed&&(n=new Vt("end"))),typeof r=="function"&&(n||i.finished?Je.nextTick(r,n):i[Rt].push(r)),this};function Fr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Fh(t,e){let r=!1;function i(n){if(r){It(t,n!=null?n:wa());return}if(r=!0,e.pendingcb--,n){let s=e[Rt].splice(0);for(let o=0;o<s.length;o++)s[o](n);It(t,n,e.sync)}else Fr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Je.nextTick(Vi,t,e))}e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}function Bh(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Fh(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Ki(t,e,r){Fr(e)&&(Bh(t,e),e.pendingcb===0&&(r?(e.pendingcb++,Je.nextTick((i,n)=>{Fr(n)?Vi(i,n):n.pendingcb--},t,e)):Fr(e)&&(e.pendingcb++,Vi(t,e))))}function Vi(t,e){e.pendingcb--,e.finished=!0;let r=e[Rt].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}bh(P.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Ch=Cr.destroy;P.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Rt].length)&&Je.nextTick(Hi,r),Ch.call(this,t,e),this};P.prototype._undestroy=Cr.undestroy;P.prototype._destroy=function(t,e){e(t)};P.prototype[mh.captureRejectionSymbol]=function(t){this.destroy(t)};var Gi;function Sa(){return Gi===void 0&&(Gi={}),Gi}P.fromWeb=function(t,e){return Sa().newStreamWritableFromWritableStream(t,e)};P.toWeb=function(t){return Sa().newWritableStreamFromStreamWritable(t)}});var $a=R((ub,Ma)=>{var Yi=Be(),Dh=se(),{isReadable:Oh,isWritable:Mh,isIterable:Ra,isNodeStream:$h,isReadableNodeStream:Ta,isWritableNodeStream:Aa,isDuplexNodeStream:kh,isReadableStream:Na,isWritableStream:va}=fe(),Pa=Ie(),{AbortError:Da,codes:{ERR_INVALID_ARG_TYPE:qh,ERR_INVALID_RETURN_VALUE:ja}}=k(),{destroyer:At}=Ye(),Uh=he(),Oa=Wt(),Wh=Dr(),{createDeferredPromise:La}=U(),Fa=Ci(),Ba=globalThis.Blob||Dh.Blob,Gh=typeof Ba!="undefined"?function(e){return e instanceof Ba}:function(e){return!1},Vh=globalThis.AbortController||pt().AbortController,{FunctionPrototypeCall:Ca}=v(),Oe=class extends Uh{constructor(e){super(e),(e==null?void 0:e.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(e==null?void 0:e.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Ma.exports=function t(e,r){if(kh(e))return e;if(Ta(e))return Tt({readable:e});if(Aa(e))return Tt({writable:e});if($h(e))return Tt({writable:!1,readable:!1});if(Na(e))return Tt({readable:Oa.fromWeb(e)});if(va(e))return Tt({writable:Wh.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:o,destroy:a}=Qh(e);if(Ra(n))return Fa(Oe,n,{objectMode:!0,write:s,final:o,destroy:a});let u=n==null?void 0:n.then;if(typeof u=="function"){let l,f=Ca(u,n,c=>{if(c!=null)throw new ja("nully","body",c)},c=>{At(l,c)});return l=new Oe({objectMode:!0,readable:!1,write:s,final(c){o(async()=>{try{await f,Yi.nextTick(c,null)}catch(h){Yi.nextTick(c,h)}})},destroy:a})}throw new ja("Iterable, AsyncIterable or AsyncFunction",r,n)}if(Gh(e))return t(e.arrayBuffer());if(Ra(e))return Fa(Oe,e,{objectMode:!0,writable:!1});if(Na(e==null?void 0:e.readable)&&va(e==null?void 0:e.writable))return Oe.fromWeb(e);if(typeof(e==null?void 0:e.writable)=="object"||typeof(e==null?void 0:e.readable)=="object"){let n=e!=null&&e.readable?Ta(e==null?void 0:e.readable)?e==null?void 0:e.readable:t(e.readable):void 0,s=e!=null&&e.writable?Aa(e==null?void 0:e.writable)?e==null?void 0:e.writable:t(e.writable):void 0;return Tt({readable:n,writable:s})}let i=e==null?void 0:e.then;if(typeof i=="function"){let n;return Ca(i,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{At(n,s)}),n=new Oe({objectMode:!0,writable:!1,read(){}})}throw new qh(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Qh(t){let{promise:e,resolve:r}=La(),i=new Vh,n=i.signal;return{value:t((function(){return Y(this,null,function*(){for(;;){let o=e;e=null;let{chunk:a,done:u,cb:l}=yield new M(o);if(Yi.nextTick(l),u)return;if(n.aborted)throw new Da(void 0,{cause:n.reason});({promise:e,resolve:r}=La()),yield a}})})(),{signal:n}),write(o,a,u){let l=r;r=null,l({chunk:o,done:!1,cb:u})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){i.abort(),a(o)}}}function Tt(t){let e=t.readable&&typeof t.readable.read!="function"?Oa.wrap(t.readable):t.readable,r=t.writable,i=!!Oh(e),n=!!Mh(r),s,o,a,u,l;function f(c){let h=u;u=null,h?h(c):c&&l.destroy(c)}return l=new Oe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(Pa(r,c=>{n=!1,c&&At(e,c),f(c)}),l._write=function(c,h,d){r.write(c,h)?d():s=d},l._final=function(c){r.end(),o=c},r.on("drain",function(){if(s){let c=s;s=null,c()}}),r.on("finish",function(){if(o){let c=o;o=null,c()}})),i&&(Pa(e,c=>{i=!1,c&&At(e,c),f(c)}),e.on("readable",function(){if(a){let c=a;a=null,c()}}),e.on("end",function(){l.push(null)}),l._read=function(){for(;;){let c=e.read();if(c===null){a=l._read;return}if(!l.push(c))return}}),l._destroy=function(c,h){!c&&u!==null&&(c=new Da),a=null,s=null,o=null,u===null?h(c):(u=h,At(r,c),At(e,c))},l}});var he=R((cb,Ua)=>{"use strict";var{ObjectDefineProperties:Hh,ObjectGetOwnPropertyDescriptor:Re,ObjectKeys:zh,ObjectSetPrototypeOf:ka}=v();Ua.exports=te;var Ji=Wt(),J=Dr();ka(te.prototype,Ji.prototype);ka(te,Ji);{let t=zh(J.prototype);for(let e=0;e<t.length;e++){let r=t[e];te.prototype[r]||(te.prototype[r]=J.prototype[r])}}function te(t){if(!(this instanceof te))return new te(t);Ji.call(this,t),J.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}Hh(te.prototype,{writable:B({__proto__:null},Re(J.prototype,"writable")),writableHighWaterMark:B({__proto__:null},Re(J.prototype,"writableHighWaterMark")),writableObjectMode:B({__proto__:null},Re(J.prototype,"writableObjectMode")),writableBuffer:B({__proto__:null},Re(J.prototype,"writableBuffer")),writableLength:B({__proto__:null},Re(J.prototype,"writableLength")),writableFinished:B({__proto__:null},Re(J.prototype,"writableFinished")),writableCorked:B({__proto__:null},Re(J.prototype,"writableCorked")),writableEnded:B({__proto__:null},Re(J.prototype,"writableEnded")),writableNeedDrain:B({__proto__:null},Re(J.prototype,"writableNeedDrain")),destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Zi;function qa(){return Zi===void 0&&(Zi={}),Zi}te.fromWeb=function(t,e){return qa().newStreamDuplexFromReadableWritablePair(t,e)};te.toWeb=function(t){return qa().newReadableWritablePairFromDuplex(t)};var Xi;te.from=function(t){return Xi||(Xi=$a()),Xi(t,"body")}});var rn=R((hb,Ga)=>{"use strict";var{ObjectSetPrototypeOf:Wa,Symbol:Kh}=v();Ga.exports=Te;var{ERR_METHOD_NOT_IMPLEMENTED:Yh}=k().codes,tn=he(),{getHighWaterMark:Zh}=kt();Wa(Te.prototype,tn.prototype);Wa(Te,tn);var Ht=Kh("kCallback");function Te(t){if(!(this instanceof Te))return new Te(t);let e=t?Zh(this,t,"readableHighWaterMark",!0):null;e===0&&(t=ve(B({},t),{highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0})),tn.call(this,t),this._readableState.sync=!1,this[Ht]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Xh)}function en(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function Xh(){this._final!==en&&en.call(this)}Te.prototype._final=en;Te.prototype._transform=function(t,e,r){throw new Yh("_transform()")};Te.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,s=i.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),n.ended||s===i.length||i.length<i.highWaterMark?r():this[Ht]=r})};Te.prototype._read=function(){if(this[Ht]){let t=this[Ht];this[Ht]=null,t()}}});var sn=R((pb,Qa)=>{"use strict";var{ObjectSetPrototypeOf:Va}=v();Qa.exports=Nt;var nn=rn();Va(Nt.prototype,nn.prototype);Va(Nt,nn);function Nt(t){if(!(this instanceof Nt))return new Nt(t);nn.call(this,t)}Nt.prototype._transform=function(t,e,r){r(null,t)}});var kr=R((bb,Za)=>{var zt=Be(),{ArrayIsArray:Jh,Promise:e_,SymbolAsyncIterator:t_,SymbolDispose:r_}=v(),$r=Ie(),{once:i_}=U(),n_=Ye(),Ha=he(),{aggregateTwoErrors:s_,codes:{ERR_INVALID_ARG_TYPE:_n,ERR_INVALID_RETURN_VALUE:on,ERR_MISSING_ARGS:o_,ERR_STREAM_DESTROYED:a_,ERR_STREAM_PREMATURE_CLOSE:l_},AbortError:u_}=k(),{validateFunction:f_,validateAbortSignal:c_}=gt(),{isIterable:et,isReadable:an,isReadableNodeStream:Mr,isNodeStream:za,isTransformStream:vt,isWebStream:d_,isReadableStream:ln,isReadableFinished:h_}=fe(),__=globalThis.AbortController||pt().AbortController,un,fn,cn;function Ka(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=$r(t,{readable:e,writable:r},s=>{i=!s});return{destroy:s=>{i||(i=!0,n_.destroyer(t,s||new a_("pipe")))},cleanup:n}}function p_(t){return f_(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function dn(t){if(et(t))return t;if(Mr(t))return b_(t);throw new _n("val",["Readable","Iterable","AsyncIterable"],t)}function b_(t){return Y(this,null,function*(){fn||(fn=Wt()),yield*re(fn.prototype[t_].call(t))})}async function Or(t,e,r,{end:i}){let n,s=null,o=d=>{if(d&&(n=d),s){let b=s;s=null,b()}},a=()=>new e_((d,b)=>{n?b(n):s=()=>{n?b(n):d()}});e.on("drain",o);let u=$r(e,{readable:!1},o);try{e.writableNeedDrain&&await a();try{for(var l=V(t),f,c,h;f=!(c=await l.next()).done;f=!1){let d=c.value;e.write(d)||await a()}}catch(c){h=[c]}finally{try{f&&(c=l.return)&&await c.call(l)}finally{if(h)throw h[0]}}i&&(e.end(),await a()),r()}catch(d){r(n!==d?s_(n,d):d)}finally{u(),e.off("drain",o)}}async function hn(t,e,r,{end:i}){vt(e)&&(e=e.writable);let n=e.getWriter();try{try{for(var s=V(t),o,a,u;o=!(a=await s.next()).done;o=!1){let l=a.value;await n.ready,n.write(l).catch(()=>{})}}catch(a){u=[a]}finally{try{o&&(a=s.return)&&await a.call(s)}finally{if(u)throw u[0]}}await n.ready,i&&await n.close(),r()}catch(l){try{await n.abort(l),r(l)}catch(f){r(f)}}}function y_(...t){return Ya(t,i_(p_(t)))}function Ya(t,e,r){if(t.length===1&&Jh(t[0])&&(t=t[0]),t.length<2)throw new o_("streams");let i=new __,n=i.signal,s=r==null?void 0:r.signal,o=[];c_(s,"options.signal");function a(){b(new u_)}cn=cn||U().addAbortListener;let u;s&&(u=cn(s,a));let l,f,c=[],h=0;function d(E){b(E,--h===0)}function b(E,y){var I;if(E&&(!l||l.code==="ERR_STREAM_PREMATURE_CLOSE")&&(l=E),!(!l&&!y)){for(;c.length;)c.shift()(l);(I=u)===null||I===void 0||I[r_](),i.abort(),y&&(l||o.forEach(W=>W()),zt.nextTick(e,l,f))}}let p;for(let E=0;E<t.length;E++){let y=t[E],I=E<t.length-1,W=E>0,K=I||(r==null?void 0:r.end)!==!1,nt=E===t.length-1;if(za(y)){let G=function(be){be&&be.name!=="AbortError"&&be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&d(be)};var m=G;if(K){let{destroy:be,cleanup:Qr}=Ka(y,I,W);c.push(be),an(y)&&nt&&o.push(Qr)}y.on("error",G),an(y)&&nt&&o.push(()=>{y.removeListener("error",G)})}if(E===0)if(typeof y=="function"){if(p=y({signal:n}),!et(p))throw new on("Iterable, AsyncIterable or Stream","source",p)}else et(y)||Mr(y)||vt(y)?p=y:p=Ha.from(y);else if(typeof y=="function"){if(vt(p)){var g;p=dn((g=p)===null||g===void 0?void 0:g.readable)}else p=dn(p);if(p=y(p,{signal:n}),I){if(!et(p,!0))throw new on("AsyncIterable",`transform[${E-1}]`,p)}else{var w;un||(un=sn());let G=new un({objectMode:!0}),be=(w=p)===null||w===void 0?void 0:w.then;if(typeof be=="function")h++,be.call(p,Ne=>{f=Ne,Ne!=null&&G.write(Ne),K&&G.end(),zt.nextTick(d)},Ne=>{G.destroy(Ne),zt.nextTick(d,Ne)});else if(et(p,!0))h++,Or(p,G,d,{end:K});else if(ln(p)||vt(p)){let Ne=p.readable||p;h++,Or(Ne,G,d,{end:K})}else throw new on("AsyncIterable or Promise","destination",p);p=G;let{destroy:Qr,cleanup:Pl}=Ka(p,!1,!0);c.push(Qr),nt&&o.push(Pl)}}else if(za(y)){if(Mr(p)){h+=2;let G=g_(p,y,d,{end:K});an(y)&&nt&&o.push(G)}else if(vt(p)||ln(p)){let G=p.readable||p;h++,Or(G,y,d,{end:K})}else if(et(p))h++,Or(p,y,d,{end:K});else throw new _n("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=y}else if(d_(y)){if(Mr(p))h++,hn(dn(p),y,d,{end:K});else if(ln(p)||et(p))h++,hn(p,y,d,{end:K});else if(vt(p))h++,hn(p.readable,y,d,{end:K});else throw new _n("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=y}else p=Ha.from(y)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&zt.nextTick(a),p}function g_(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new l_)}),t.pipe(e,{end:!1}),i){let o=function(){n=!0,e.end()};var s=o;h_(t)?zt.nextTick(o):t.once("end",o)}else r();return $r(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),$r(e,{readable:!1,writable:!0},r)}Za.exports={pipelineImpl:Ya,pipeline:y_}});var bn=R((gb,il)=>{"use strict";var{pipeline:w_}=kr(),qr=he(),{destroyer:m_}=Ye(),{isNodeStream:Ur,isReadable:Xa,isWritable:Ja,isWebStream:pn,isTransformStream:tt,isWritableStream:el,isReadableStream:tl}=fe(),{AbortError:x_,codes:{ERR_INVALID_ARG_VALUE:rl,ERR_MISSING_ARGS:E_}}=k(),S_=Ie();il.exports=function(...e){if(e.length===0)throw new E_("streams");if(e.length===1)return qr.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=qr.from(e[0])),typeof e[e.length-1]=="function"){let d=e.length-1;e[d]=qr.from(e[d])}for(let d=0;d<e.length;++d)if(!(!Ur(e[d])&&!pn(e[d]))){if(d<e.length-1&&!(Xa(e[d])||tl(e[d])||tt(e[d])))throw new rl(`streams[${d}]`,r[d],"must be readable");if(d>0&&!(Ja(e[d])||el(e[d])||tt(e[d])))throw new rl(`streams[${d}]`,r[d],"must be writable")}let i,n,s,o,a;function u(d){let b=o;o=null,b?b(d):d?a.destroy(d):!h&&!c&&a.destroy()}let l=e[0],f=w_(e,u),c=!!(Ja(l)||el(l)||tt(l)),h=!!(Xa(f)||tl(f)||tt(f));if(a=new qr({writableObjectMode:!!(l!=null&&l.writableObjectMode),readableObjectMode:!!(f!=null&&f.readableObjectMode),writable:c,readable:h}),c){if(Ur(l))a._write=function(b,p,g){l.write(b,p)?g():i=g},a._final=function(b){l.end(),n=b},l.on("drain",function(){if(i){let b=i;i=null,b()}});else if(pn(l)){let p=(tt(l)?l.writable:l).getWriter();a._write=async function(g,w,m){try{await p.ready,p.write(g).catch(()=>{}),m()}catch(E){m(E)}},a._final=async function(g){try{await p.ready,p.close().catch(()=>{}),n=g}catch(w){g(w)}}}let d=tt(f)?f.readable:f;S_(d,()=>{if(n){let b=n;n=null,b()}})}if(h){if(Ur(f))f.on("readable",function(){if(s){let d=s;s=null,d()}}),f.on("end",function(){a.push(null)}),a._read=function(){for(;;){let d=f.read();if(d===null){s=a._read;return}if(!a.push(d))return}};else if(pn(f)){let b=(tt(f)?f.readable:f).getReader();a._read=async function(){for(;;)try{let{value:p,done:g}=await b.read();if(!a.push(p))return;if(g){a.push(null);return}}catch(p){return}}}}return a._destroy=function(d,b){!d&&o!==null&&(d=new x_),s=null,i=null,n=null,o===null?b(d):(o=b,Ur(f)&&m_(f,d))},a}});var hl=R((wb,wn)=>{"use strict";var I_=globalThis.AbortController||pt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:R_,ERR_INVALID_ARG_TYPE:Kt,ERR_MISSING_ARGS:T_,ERR_OUT_OF_RANGE:A_},AbortError:_e}=k(),{validateAbortSignal:rt,validateInteger:nl,validateObject:it}=gt(),N_=v().Symbol("kWeak"),v_=v().Symbol("kResistStopPropagation"),{finished:P_}=Ie(),j_=bn(),{addAbortSignalNoValidate:L_}=$t(),{isWritable:F_,isNodeStream:B_}=fe(),{deprecate:C_}=U(),{ArrayPrototypePush:D_,Boolean:O_,MathFloor:sl,Number:M_,NumberIsNaN:$_,Promise:ol,PromiseReject:al,PromiseResolve:k_,PromisePrototypeThen:ll,Symbol:fl}=v(),Wr=fl("kEmpty"),ul=fl("kEof");function q_(t,e){if(e!=null&&it(e,"options"),(e==null?void 0:e.signal)!=null&&rt(e.signal,"options.signal"),B_(t)&&!F_(t))throw new R_("stream",t,"must be writable");let r=j_(this,t);return e!=null&&e.signal&&L_(e.signal,r),r}function Gr(t,e){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);e!=null&&it(e,"options"),(e==null?void 0:e.signal)!=null&&rt(e.signal,"options.signal");let r=1;(e==null?void 0:e.concurrency)!=null&&(r=sl(e.concurrency));let i=r-1;return(e==null?void 0:e.highWaterMark)!=null&&(i=sl(e.highWaterMark)),nl(r,"options.concurrency",1),nl(i,"options.highWaterMark",0),i+=r,function(){return Y(this,null,function*(){let s=U().AbortSignalAny([e==null?void 0:e.signal].filter(O_)),o=this,a=[],u={signal:s},l,f,c=!1,h=0;function d(){c=!0,b()}function b(){h-=1,p()}function p(){f&&!c&&h<r&&a.length<i&&(f(),f=null)}async function g(){try{try{for(var w=V(o),m,E,y;m=!(E=await w.next()).done;m=!1){let I=E.value;if(c)return;if(s.aborted)throw new _e;try{if(I=t(I,u),I===Wr)continue;I=k_(I)}catch(W){I=al(W)}h+=1,ll(I,b,d),a.push(I),l&&(l(),l=null),!c&&(a.length>=i||h>=r)&&await new ol(W=>{f=W})}}catch(E){y=[E]}finally{try{m&&(E=w.return)&&await E.call(w)}finally{if(y)throw y[0]}}a.push(ul)}catch(I){let W=al(I);ll(W,b,d),a.push(W)}finally{c=!0,l&&(l(),l=null)}}g();try{for(;;){for(;a.length>0;){let w=yield new M(a[0]);if(w===ul)return;if(s.aborted)throw new _e;w!==Wr&&(yield w),a.shift(),p()}yield new M(new ol(w=>{l=w}))}}finally{c=!0,f&&(f(),f=null)}})}.call(this)}function U_(t=void 0){return t!=null&&it(t,"options"),(t==null?void 0:t.signal)!=null&&rt(t.signal,"options.signal"),function(){return Y(this,null,function*(){let r=0;try{for(var n=V(this),s,o,a;s=!(o=yield new M(n.next())).done;s=!1){let u=o.value;var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new _e({cause:t.signal.reason});yield[r++,u]}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new M(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}async function cl(t,e=void 0){try{for(var r=V(gn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return!0}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}return!1}async function W_(t,e=void 0){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);return!await cl.call(this,async(...r)=>!await t(...r),e)}async function G_(t,e){try{for(var r=V(gn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return o}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}}async function V_(t,e){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);async function r(a,u){return await t(a,u),Wr}try{for(var i=V(Gr.call(this,r,e)),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;;}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}}function gn(t,e){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:Wr}return Gr.call(this,r,e)}var yn=class extends T_{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Q_(t,e,r){var i;if(typeof t!="function")throw new Kt("reducer",["Function","AsyncFunction"],t);r!=null&&it(r,"options"),(r==null?void 0:r.signal)!=null&&rt(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let d=new _e(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await P_(this.destroy(d)),d}let s=new I_,o=s.signal;if(r!=null&&r.signal){let d={once:!0,[N_]:this,[v_]:!0};r.signal.addEventListener("abort",()=>s.abort(),d)}let a=!1;try{try{for(var l=V(this),f,c,h;f=!(c=await l.next()).done;f=!1){let d=c.value;var u;if(a=!0,r!=null&&(u=r.signal)!==null&&u!==void 0&&u.aborted)throw new _e;n?e=await t(e,d,{signal:o}):(e=d,n=!0)}}catch(c){h=[c]}finally{try{f&&(c=l.return)&&await c.call(l)}finally{if(h)throw h[0]}}if(!a&&!n)throw new yn}finally{s.abort()}return e}async function H_(t){t!=null&&it(t,"options"),(t==null?void 0:t.signal)!=null&&rt(t.signal,"options.signal");let e=[];try{for(var i=V(this),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new _e(void 0,{cause:t.signal.reason});D_(e,a)}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}return e}function z_(t,e){let r=Gr.call(this,t,e);return function(){return Y(this,null,function*(){try{for(var n=V(r),s,o,a;s=!(o=yield new M(n.next())).done;s=!1){let u=o.value;yield*re(u)}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new M(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}function dl(t){if(t=M_(t),$_(t))return 0;if(t<0)throw new A_("number",">= 0",t);return t}function K_(t,e=void 0){return e!=null&&it(e,"options"),(e==null?void 0:e.signal)!=null&&rt(e.signal,"options.signal"),t=dl(t),function(){return Y(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new _e;try{for(var s=V(this),o,a,u;o=!(a=yield new M(s.next())).done;o=!1){let l=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new _e;t--<=0&&(yield l)}}catch(a){u=[a]}finally{try{o&&(a=s.return)&&(yield new M(a.call(s)))}finally{if(u)throw u[0]}}})}.call(this)}function Y_(t,e=void 0){return e!=null&&it(e,"options"),(e==null?void 0:e.signal)!=null&&rt(e.signal,"options.signal"),t=dl(t),function(){return Y(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new _e;try{for(var s=V(this),o,a,u;o=!(a=yield new M(s.next())).done;o=!1){let l=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new _e;if(t-- >0&&(yield l),t<=0)return}}catch(a){u=[a]}finally{try{o&&(a=s.return)&&(yield new M(a.call(s)))}finally{if(u)throw u[0]}}})}.call(this)}wn.exports.streamReturningOperators={asIndexedPairs:C_(U_,"readable.asIndexedPairs will be removed in a future version."),drop:K_,filter:gn,flatMap:z_,map:Gr,take:Y_,compose:q_};wn.exports.promiseReturningOperators={every:W_,forEach:V_,reduce:Q_,toArray:H_,some:cl,find:G_}});var mn=R((xb,_l)=>{"use strict";var{ArrayPrototypePop:Z_,Promise:X_}=v(),{isIterable:J_,isNodeStream:ep,isWebStream:tp}=fe(),{pipelineImpl:rp}=kr(),{finished:ip}=Ie();xn();function np(...t){return new X_((e,r)=>{let i,n,s=t[t.length-1];if(s&&typeof s=="object"&&!ep(s)&&!J_(s)&&!tp(s)){let o=Z_(t);i=o.signal,n=o.end}rp(t,(o,a)=>{o?r(o):e(a)},{signal:i,end:n})})}_l.exports={finished:ip,pipeline:np}});var xn=R((Eb,Sl)=>{"use strict";var{Buffer:sp}=se(),{ObjectDefineProperty:Ae,ObjectKeys:yl,ReflectApply:gl}=v(),{promisify:{custom:wl}}=U(),{streamReturningOperators:pl,promiseReturningOperators:bl}=hl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:ml}}=k(),op=bn(),{setDefaultHighWaterMark:ap,getDefaultHighWaterMark:lp}=kt(),{pipeline:xl}=kr(),{destroyer:up}=Ye(),El=Ie(),En=mn(),Yt=fe(),N=Sl.exports=Sr().Stream;N.isDestroyed=Yt.isDestroyed;N.isDisturbed=Yt.isDisturbed;N.isErrored=Yt.isErrored;N.isReadable=Yt.isReadable;N.isWritable=Yt.isWritable;N.Readable=Wt();for(let t of yl(pl)){let r=function(...i){if(new.target)throw ml();return N.Readable.from(gl(e,this,i))},e=pl[t];Ae(r,"name",{__proto__:null,value:e.name}),Ae(r,"length",{__proto__:null,value:e.length}),Ae(N.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of yl(bl)){let r=function(...i){if(new.target)throw ml();return gl(e,this,i)},e=bl[t];Ae(r,"name",{__proto__:null,value:e.name}),Ae(r,"length",{__proto__:null,value:e.length}),Ae(N.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}N.Writable=Dr();N.Duplex=he();N.Transform=rn();N.PassThrough=sn();N.pipeline=xl;var{addAbortSignal:fp}=$t();N.addAbortSignal=fp;N.finished=El;N.destroy=up;N.compose=op;N.setDefaultHighWaterMark=ap;N.getDefaultHighWaterMark=lp;Ae(N,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return En}});Ae(xl,wl,{__proto__:null,enumerable:!0,get(){return En.pipeline}});Ae(El,wl,{__proto__:null,enumerable:!0,get(){return En.finished}});N.Stream=N;N._isUint8Array=function(e){return e instanceof Uint8Array};N._uint8ArrayToBuffer=function(e){return sp.from(e.buffer,e.byteOffset,e.byteLength)}});var Vr=R((Sb,F)=>{"use strict";var D=xn(),cp=mn(),dp=D.Readable.destroy;F.exports=D.Readable;F.exports._uint8ArrayToBuffer=D._uint8ArrayToBuffer;F.exports._isUint8Array=D._isUint8Array;F.exports.isDisturbed=D.isDisturbed;F.exports.isErrored=D.isErrored;F.exports.isReadable=D.isReadable;F.exports.Readable=D.Readable;F.exports.Writable=D.Writable;F.exports.Duplex=D.Duplex;F.exports.Transform=D.Transform;F.exports.PassThrough=D.PassThrough;F.exports.addAbortSignal=D.addAbortSignal;F.exports.finished=D.finished;F.exports.destroy=D.destroy;F.exports.destroy=dp;F.exports.pipeline=D.pipeline;F.exports.compose=D.compose;Object.defineProperty(D,"promises",{configurable:!0,enumerable:!0,get(){return cp}});F.exports.Stream=D.Stream;F.exports.default=F.exports});var Jn=ir(se());var Ue="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ft="http://www.w3.org/2001/XMLSchema#",ar="http://www.w3.org/2000/10/swap/",A={xsd:{decimal:`${ft}decimal`,boolean:`${ft}boolean`,dateTime:`${ft}dateTime`,double:`${ft}double`,integer:`${ft}integer`,string:`${ft}string`},rdf:{type:`${Ue}type`,nil:`${Ue}nil`,first:`${Ue}first`,rest:`${Ue}rest`,langString:`${Ue}langString`,dirLangString:`${Ue}dirLangString`,reifies:`${Ue}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ar}reify#forSome`,forAll:`${ar}reify#forAll`},log:{implies:`${ar}log#implies`,isImpliedBy:`${ar}log#isImpliedBy`}};var{xsd:lr}=A,ur=32,fr=9,Kn=10,Yn=13,wu=35,mu=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Zn={"\\":"\\","'":"'",'"':'"',n:`
3
- `,r:"\r",t:" ",f:"\f",b:"\b"},xu={_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","'":"'","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Eu=/[\x00-\x20<>\\"\{\}\|\^\`]/;function Xn(t){return t<=1114111&&(t<55296||t>57343)}var Su={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_commentLine:!0,_whitespace:!0},Iu=/$0^/,We=class{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._atKeyword=/^@[a-z]+(?=[\s#<:])/i,this._keyword=/^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i,this._n3Verb=/^(?:has|is|of)(?=[\s#()\[\]\{\}"'<>?_+\-0-9])/,this._n3Id=/^id(?=[\s#<])/,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._commentLine=/^[ \t]*#([^\n\r]*)(?:\r\n|\n|\r)[ \t]*/,this._whitespace=/^[ \t]+/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in Su)&&this[r]instanceof RegExp&&(this[r]=Iu)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let i=this._input,n=i.length;for(;;){for(;;){let w=i.charCodeAt(0),m=0;if(w===ur||w===fr){let E=i.charCodeAt(1);m=E===ur||E===fr?this._whitespace.exec(i)[0].length:1,w=i.charCodeAt(m)}if(w===wu){let E=this._commentLine.exec(i);if(E)this.comments&&s("comment",E[1],"",this._line,E[0].length),i=i.slice(E[0].length),n=i.length,this._line++;else{if(i=i.slice(m),!r)return this._input=i;this.comments&&s("comment",i.slice(1),"",this._line,i.length),i="";break}}else if(w===Kn||w===Yn){m+=w===Yn&&i.charCodeAt(m+1)===Kn?2:1;let E=i.charCodeAt(m);if(E===ur||E===fr){let y=i.charCodeAt(m+1);m+=y===ur||y===fr?this._whitespace.exec(i.slice(m))[0].length:1}i=i.slice(m),n=i.length,this._line++}else{m!==0&&(i=i.slice(m));break}}if(i.length===0)return r&&(i=null,s("eof","","",this._line,0)),this._input=i;let a=this._line,u=i[0],l="",f="",c="",h=null,d=0,b=!1;switch(u){case"^":if(i.length<3)break;if(i[1]==="^"){if(this._previousMarker="^^",i=i.slice(2),i[0]!=="<"){b=!0;break}}else{this._n3Mode&&(d=1,l="^");break}case"<":if(h=this._unescapedIri.exec(i))l="IRI",f=h[1];else if(h=this._iri.exec(i)){if(f=this._unescape(h[1],Zn),f===null||Eu.test(f))return o(this);l="IRI"}else i.length>2&&i[1]==="<"&&i[2]==="("?(l="<<(",d=3):!this._lineMode&&i.length>(r?1:2)&&i[1]==="<"?(l="<<",d=2):this._n3Mode&&i.length>1&&i[1]==="="?(d=2,this._isImpliedBy?(l="abbreviation",f="<"):(l="inverse",f=">")):this._n3Mode&&i.length>1&&i[1]==="-"&&(l="inversePredicate",d=2);break;case">":i.length>1&&i[1]===">"&&(l=">>",d=2);break;case"_":((h=this._blank.exec(i))||r&&(h=this._blank.exec(`${i} `)))&&(l="blank",c="_",f=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(i))f=h[1];else if({value:f,matchLength:d}=this._parseLiteral(i),f===null)return o(this);(h!==null||d!==0)&&(l="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(i))f=h[1];else if({value:f,matchLength:d}=this._parseLiteral(i),f===null)return o(this);(h!==null||d!==0)&&(l="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(i))&&(l="var",f=h[0]);break;case"@":this._previousMarker==="literal"&&(h=this._langcode.exec(i))&&h[1]!=="version"?!r&&i[h[0].length]==="-"&&i[h[0].length+1]!=="-"?h=null:(l="langcode",f=h[1]):(h=this._atKeyword.exec(i))&&(l=h[0]);break;case".":if(i.length===1?r:i[1]<"0"||i[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"-":if(i[1]==="-"){this._previousMarker==="langcode"&&(i.startsWith("--ltr")?(l="dircode",f="ltr",d=5):i.startsWith("--rtl")&&(l="dircode",f="rtl",d=5));break}(h=this._number.exec(i)||r&&(h=this._number.exec(`${i} `)))&&(l="literal",f=h[0],c=typeof h[1]=="string"?lr.double:typeof h[2]=="string"?lr.decimal:lr.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":case"V":case"v":(h=this._keyword.exec(i))?l=h[0].toUpperCase():b=!0;break;case"f":case"t":(h=this._boolean.exec(i))?(l="literal",f=h[0],c=lr.boolean):b=!0;break;case"a":(h=this._shortPredicates.exec(i))?(l="abbreviation",f="a"):b=!0;break;case"h":case"o":this._n3Mode&&(h=this._matchN3Verb(i,r))?l=h[0]:b=!0;break;case"i":this._n3Mode&&(h=this._n3Id.exec(i))?l="id":this._n3Mode&&(h=this._matchN3Verb(i,r))?l=h[0]:b=!0;break;case"=":this._n3Mode&&i.length>1&&(l="abbreviation",i[1]!==">"?(d=1,f="="):(d=2,f=">"));break;case"!":if(!this._n3Mode)break;case")":if(!r&&(i.length===1||i.length===2&&i[1]===">"))break;if(i.length>2&&i[1]===">"&&i[2]===">"){l=")>>",d=3;break}case",":case";":case"[":case"]":case"(":case"}":case"~":this._lineMode||(d=1,l=u);break;case"{":!this._lineMode&&i.length>=2&&(i[1]==="|"?(l="{|",d=2):(l=u,d=1));break;case"|":i.length>=2&&i[1]==="}"&&(l="|}",d=2);break;default:b=!0}if(b&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(h=this._prefix.exec(i))?(l="prefix",f=h[1]||""):((h=this._prefixed.exec(i))||r&&(h=this._prefixed.exec(`${i} `)))&&(l="prefixed",c=h[1]||"",f=this._unescape(h[2],xu))),this._previousMarker==="^^")switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return r||!/^'''|^"""/.test(i)&&/\n|\r/.test(i)?o(this):this._input=i;let p=d||h[0].length,g=s(l,f,c,a,p);this.previousToken=g,this._previousMarker=l,i=i.slice(p)}function s(a,u,l,f,c){let h=i?n-i.length:n,d=h+c,b={type:a,value:u,prefix:l,line:f,start:h,end:d};return e(null,b),b}function o(a){e(a._syntaxError(/^\S*/.exec(i)[0]))}}_matchN3Verb(e,r){let i=this._n3Verb.exec(e);if(!i)return null;let n=e[i[0].length];return n!=="-"&&n!=="_"&&(n<"0"||n>"9")?i:this._prefixed.exec(e)||this._prefixed.exec(`${e} `)||!r&&this._prefix.exec(`${e}: `)?null:i}_unescape(e,r){if(e.indexOf("\\")<0)return e;let i=!1,n=e.replace(mu,(s,o,a,u)=>{if(typeof o=="string"){let l=Number.parseInt(o,16);return Xn(l)?String.fromCharCode(l):(i=!0,"")}if(typeof a=="string"){let l=Number.parseInt(a,16);return Xn(l)?l<=65535?String.fromCharCode(Number.parseInt(a,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023)):(i=!0,"")}return u in r?r[u]:(i=!0,"")});return i?null:n}_parseLiteral(e){if(e.length>=3){let r=e[0],i=e[1]===r&&e[2]===r?3:1,n=r;i===3&&(n=r==='"'?'"""':"'''");let s=Math.max(this._literalClosingPos,i);for(;(s=e.indexOf(n,s))>0;){let o=0;for(;e[s-o-1]==="\\";)o++;if(o%2===0){let a=e.substring(i,s),u=a.split(/\r\n|\r|\n/).length-1,l=s+i;if(i===1&&u!==0||i===3&&this._lineMode)break;return this._line+=u,{value:this._unescape(a,Zn),matchLength:l}}s++}this._literalClosingPos=e.length-i+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;let r=new Error(`Unexpected "${e}" on line ${this._line}.`);return r.context={token:void 0,line:this._line,previousToken:this.previousToken},r}_readStartingBom(e){return e.startsWith("\uFEFF")?e.slice(1):e}tokenize(e,r){let i=this._tokenization={};if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")queueMicrotask(()=>{this._tokenization===i&&this._tokenizeToEnd(r,!0)});else{let n=[],s;if(this._tokenizeToEnd((o,a)=>o?s=o:n.push(a),!0),s)throw s;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._tokenization===i&&this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=Jn.Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input=="undefined"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(r,!1)))}),e.on("end",()=>{this._tokenization===i&&typeof this._input=="string"&&this._tokenizeToEnd(r,!0)}),e.on("error",n=>{this._tokenization===i&&r(n)})}};var{rdf:es,xsd:je}=A,dt,Ru=0;var ii={namedNode:ts,blankNode:rs,variable:ns,literal:is,defaultGraph:Tu,quad:ni,triple:ni,fromTerm:Lt,fromQuad:ss},z=ii,H=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},ct=class extends H{constructor(e){super(e)}get termType(){return"NamedNode"}},ge=class t extends H{constructor(e){super(e)}get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1,i=e.lastIndexOf("--");return r<e.length&&e[r++]==="@"?(i>r?e.substr(0,i):e).substr(r).toLowerCase():""}get direction(){let e=this.id,r=e.lastIndexOf('"'),i=e.lastIndexOf("--");return i>r&&i+2<e.length?e.substr(i+2).toLowerCase():""}get datatype(){return new ct(this.datatypeString)}get datatypeString(){let e=this.id,r=e.lastIndexOf('"')+1,i=r<e.length?e[r]:"";return i==="^"?e.substr(r+2):i!=="@"?je.string:e.indexOf("--",r)>0?es.dirLangString:es.langString}equals(e){return e instanceof t?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(this.direction===e.direction||this.direction===""&&!e.direction)&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:"NamedNode",value:this.datatypeString}}}},Ft=class extends H{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Bt=class extends H{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},Ct=class extends H{constructor(){return super(""),dt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};dt=new Ct;function Le(t,e,r){if(e=e||ii,!t)return e.defaultGraph();switch(t[0]){case"?":return e.variable(t.substr(1));case"_":return e.blankNode(t.substr(2));case'"':if(e===ii)return new ge(t);if(t[t.length-1]==='"')return e.literal(t.substr(1,t.length-2));let i=t.lastIndexOf('"',t.length-1),n;if(t[i+1]==="@"){n=t.substr(i+2);let s=n.lastIndexOf("--");s>0&&s<n.length&&(n={language:n.substr(0,s),direction:n.substr(s+2)})}else n=e.namedNode(t.substr(i+3));return e.literal(t.substr(1,i-1),n);case"[":t=JSON.parse(t);break;default:if(!r||!Array.isArray(t))return e.namedNode(t)}return e.quad(Le(t[0],e,!0),Le(t[1],e,!0),Le(t[2],e,!0),t[3]&&Le(t[3],e,!0))}function we(t,e){if(typeof t=="string")return t;if(t instanceof H&&t.termType!=="Quad")return t.id;if(!t)return dt.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}${t.direction?`--${t.direction}`:""}`:t.datatype&&t.datatype.value!==je.string?`^^${t.datatype.value}`:""}`;case"Quad":let r=[we(t.subject,!0),we(t.predicate,!0),we(t.object,!0)];return t.graph&&t.graph.termType!=="DefaultGraph"&&r.push(we(t.graph,!0)),e?r:JSON.stringify(r);default:throw new Error(`Unexpected termType: ${t.termType}`)}}var Fe=class extends H{constructor(e,r,i,n){super(""),this._subject=e,this._predicate=r,this._object=i,this._graph=n||dt}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 ts(t){return new ct(t)}function rs(t){return new Ft(t||`n3-${Ru++}`)}function is(t,e){if(typeof e=="string")return new ge(`"${t}"@${e.toLowerCase()}`);if(e!==void 0&&!("termType"in e))return new ge(`"${t}"@${e.language.toLowerCase()}${e.direction?`--${e.direction.toLowerCase()}`:""}`);let r=e?e.value:"";return r===""&&(typeof t=="boolean"?r=je.boolean:typeof t=="number"?Number.isFinite(t)?r=Number.isInteger(t)?je.integer:je.double:(r=je.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")):t instanceof Date&&!Number.isNaN(t.getTime())&&(r=je.dateTime,t=t.toISOString())),r===""||r===je.string?new ge(`"${t}"`):new ge(`"${t}"^^${r}`)}function ns(t){return new Bt(t)}function Tu(){return dt}function ni(t,e,r,i){return new Fe(t,e,r,i)}function Lt(t){if(t instanceof H)return t;switch(t.termType){case"NamedNode":return ts(t.value);case"BlankNode":return rs(t.value);case"Variable":return ns(t.value);case"DefaultGraph":return dt;case"Literal":return is(t.value,t.language||t.datatype);case"Quad":return ss(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function ss(t){if(t instanceof Fe)return t;if(t.termType!=="Quad")throw new Error(`Unexpected termType: ${t.termType}`);return ni(Lt(t.subject),Lt(t.predicate),Lt(t.object),Lt(t.graph))}var os=0,me=class t{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&as(this,e.factory);let r=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(r),n=/trig/.test(r),s=/triple/.test(r),o=/quad/.test(r),a=this._n3Mode=/n3/.test(r),u=s||o;this._emitCurrent=this._emit,a&&(this._createQuad=this._createQuadInDirection,this._emit=this._emitInDirection,this._emitCurrent=this._emitCurrentInDirection),(this._supportsNamedGraphs=!(i||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||n||s||a),this._isImpliedBy=e.isImpliedBy,this._implicitEmptyPrefix=!!e.implicitEmptyPrefix,this._emptyFormulaAsTrue=!!e.emptyFormulaAsTrue,u&&(this._resolveRelativeIRI=l=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new We({lineMode:u,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version}static _resetBlankNodePrefix(){os=0}_setBase(e){if(!e)this._base="",this._basePath="";else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),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]}}_saveContext(e,r,i,n,s){if(!this._n3Mode){this._contextStack.push({type:e,subject:i,predicate:n,object:s,graph:r});return}let o={type:e,subject:i,predicate:n,object:s,graph:r,inverse:this._inversePredicate,expectOf:this._expectOf,blankPrefix:this._prefixes._,quantified:this._quantified,emptyFormula:this._emptyFormula};e==="formula"&&(o.prefixes=this._prefixes,o.base=[this._base,this._basePath,this._baseRoot,this._baseScheme],this._prefixes=Object.create(this._prefixes)),this._contextStack.push(o),this._inversePredicate=!1,this._expectOf=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified),e==="formula"&&(this._subject=null,this._emptyFormula=!0)}_restoreContext(e,r){let i=this._contextStack.pop();if(!i||i.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=i.subject,this._predicate=i.predicate,this._object=i.object,this._graph=i.graph,this._n3Mode&&(this._inversePredicate=i.inverse,this._expectOf=i.expectOf,e==="formula"?(this._prefixes=i.prefixes,[this._base,this._basePath,this._baseRoot,this._baseScheme]=i.base):this._prefixes._=i.blankPrefix,this._quantified=i.quantified,this._emptyFormula=i.emptyFormula)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?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"VERSION":this._sparqlStyle=!0;case"@version":return this._readVersion;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)}}_readInFormulaContext(e){switch(e.type){case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;default:return this._readSubject(e)}}_getStatementReader(){let e=this._contextStack[this._contextStack.length-1];return e&&e.type==="formula"?this._readInFormulaContext:this._readInTopContext}_readEntity(e,r){let i;switch(e.type){case"IRI":case"typeIRI":let n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);i=this._factory.namedNode(n);break;case"type":case"prefixed":let s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);i=this._factory.namedNode(s+e.value);break;case"blank":i=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":i=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&i.id in this._quantified&&(i=this._quantified[i.id]),i}_readList(e,r,i,n){let s=this._contextStack;return(s.length&&s[s.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,r,i,n),this._subject=null,this._readListItem)}_readSubject(e){switch(this._predicate=null,e.type!=="}"&&(this._emptyFormula=!1),e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._readList(e,this.RDF_NIL,null,null);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readInFormulaContext):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="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":return this._n3Mode?e.prefix.length===0?(this._literalValue=e.value,this._completeSubjectLiteral):(this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._getPathReader(this._readPredicateOrNamedGraph)):this._error("Unexpected literal",e);case"<<(":return this._n3Mode?(this._saveContext("<<(",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Disallowed triple term as subject",e);case"<<":return this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject;default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type,i=!1;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case"has":return this._readPredicateAfterVerb;case"is":return this._inversePredicate=!0,this._expectOf=!0,this._readPredicateAfterVerb;case"inversePredicate":return this._inversePredicate=!0,this._readPredicateAfterVerb;case".":case"]":case"}":case"|}":return this._predicate===null&&!this._n3Mode?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completePredicateLiteral;this._predicate=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=!0;break;case"(":return this._n3Mode?this._readList(e,this._subject,this.RDF_NIL,null):this._error(`Expected entity but got ${r}`,e);case"[":return this._n3Mode?(this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead):this._error("Disallowed blank node as predicate",e);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._graph=this._factory.blankNode(),null),this._readSubject):this._readEntity(e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return;i=this._n3Mode}return this._validAnnotation=!0,i?this._getPathReader(this._readObject,"predicate"):this._readObject}_readPredicateAfterVerb(e){return e.type==="has"||e.type==="is"||e.type==="of"||e.type==="inversePredicate"?this._error(`Expected expression but got ${e.type}`,e):this._readPredicate(e)}_readObject(e){if(this._expectOf)return e.type!=="of"?this._error(`Expected of but got ${e.type}`,e):(this._expectOf=!1,this._readObject);switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;if(this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._n3Mode)return this._getPathReader(this._getContextEndReader());break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._readList(e,this._subject,this._predicate,this.RDF_NIL);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":return this._saveContext("<<(",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;case"<<":return this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;default:if((this._object=this._readEntity(e))===void 0)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){if(e.type==="]")return this._subject=null,this._readBlankNodeTail(e);{let r=this._contextStack;return(r.length>1&&r[r.length-2]).type==="<<"?this._error("Unexpected compound blank node expression in reified triple",e):e.type==="id"?this._readIriPropertyListId:(this._predicate=null,this._readPredicate(e))}}_readIriPropertyListId(e){let r=this._readEntity(e);if(r===void 0)return;if(r.termType!=="NamedNode")return this._error(`Expected IRI after id but got ${e.type}`,e);let i=this._subject;this._subject=r;let n=this._contextStack[this._contextStack.length-1];return n.subject===i&&(n.subject=r),n.predicate===i&&(n.predicate=r),n.object===i&&(n.object=r),this._predicate=null,this._readIriPropertyListPredicate}_readIriPropertyListPredicate(e){return e.type===";"||e.type==="]"||e.type==="."||e.type==="}"?this._error(`Expected predicate but got ${e.type}`,e):this._readPredicate(e)}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._getPathReader(this._readObject,"predicate"):r?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 r=null,i=null,n=this._readListItem,s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this._subject=r=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"){if(this._n3Mode)return s!==null&&this._emit(s,this.RDF_REST,this.RDF_NIL,this._graph),this._saveContext("item",this._graph,this._subject,this._predicate,this._object),this._subject=this._object,this._predicate=null,this._getPathReader(this._readListItem);this._emit(this._subject,this._predicate,this._object,this._graph)}if(this._predicate===null){if(n=this._n3Mode?this._getPathReader(this._readPredicate):this._readPredicate,this._subject===this.RDF_NIL)return n}else if(this._object===null){if(n=this._getPathReader(this._readObject,"predicate"),this._predicate===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._n3Mode&&(n=this._getPathReader(n)),this._object===this.RDF_NIL)return n;i=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(r=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(i=this._factory.blankNode(),r=this._factory.blankNode(),s===null?a.predicate===null?a.subject=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),this._emit(i,this.RDF_FIRST,r,this._graph),this._saveContext("formula",this._graph,i,this.RDF_FIRST,this._graph=r),this._subject=null,this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":this._saveContext("<<(",this._graph,null,null,null),this._graph=null,n=this._readSubject;break;case"<<":this._saveContext("<<",this._graph,null,null,null),this._graph=null,n=this._readSubject;break;default:if((r=this._readEntity(e))===void 0)return}if(i===null&&(this._subject=i=this._factory.blankNode()),(e.type==="<<"||e.type==="<<(")&&(o[o.length-1].subject=this._subject),s===null?a.predicate===null?a.subject=i:a.object===null?a.predicate=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"||e.type==="var"||e.type==="blank"||e.type==="literal"))return this._saveContext("item",this._graph,i,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(i,this.RDF_FIRST,r,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,r){let i,n=!1;switch(e.type){case"type":case"typeIRI":let s=this._readEntity(e);if(s===void 0)return;if(s.value===A.rdf.langString||s.value===A.rdf.dirLangString)return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype",e);i=this._factory.literal(this._literalValue,s),e=null;break;case"langcode":if(e.value.split("-").some(o=>o.length>8))return this._error("Detected language tag with subtag longer than 8 characters",e);i=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,this._literalComponent=r,n=!0;break;default:i=this._factory.literal(this._literalValue)}return{token:e,literal:i,readCb:n}}_readDirCode(e){let r=this._literalComponent,i=this._literalListItem;if(e.type==="dircode"){let n=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:e.value});r==="subject"?this._subject=n:r==="predicate"?this._predicate=n:this._object=n,this._literalLanguage=void 0,e=null}if(r==="subject"||r==="predicate"){let n=r==="subject"?this._readPredicateOrNamedGraph:this._readObject;return this._getPathEndReader(e,n,r)||n.call(this,e)}return this._completeObjectLiteralPost(e,i)}_completeTermLiteral(e,r){let i=this._completeLiteral(e,r);if(!i)return;let n;if(r==="subject"?(this._subject=i.literal,n=this._readPredicateOrNamedGraph):(this._predicate=i.literal,this._validAnnotation=!0,n=this._readObject),i.readCb)return this._literalListItem=!1,this._readDirCode;let s=this._getPathEndReader(i.token,n,r);return s||n.call(this,i.token)}_completeSubjectLiteral(e){return this._completeTermLiteral(e,"subject")}_completePredicateLiteral(e){return this._completeTermLiteral(e,"predicate")}_completeObjectLiteral(e,r){let i=this._completeLiteral(e,"object");if(i)return this._object=i.literal,i.readCb?(this._literalListItem=r,this._readDirCode):this._completeObjectLiteralPost(i.token,r)}_completeObjectLiteralPost(e,r){return this._n3Mode&&(e===null||e.type==="!"||e.type==="^")?r?(this._saveContext("item",this._graph,this._subject,this.RDF_FIRST,this._object),this._subject=this._object,this._predicate=null,this._getPathEndReader(e,this._readListItem)):this._getPathEndReader(e,this._getContextEndReader()):(r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),e===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e)))}_readFormulaTail(e){if(e.type!=="}")return this._readPunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._graph,i=this._emptyFormula;return this._restoreContext("formula",e),i&&this._emptyFormulaAsTrue&&(this._subject===r?this._subject=this.N3_TRUE:this._predicate===r?this._predicate=this.N3_TRUE:this._object=this.N3_TRUE),this._object!==null?this._getPathReader(this._getContextEndReader(),"object"):this._predicate!==null?this._getPathReader(this._readObject,"predicate"):this._getPathReader(this._readPredicate,"subject")}_readPunctuation(e){let r,i=this._graph,n=!1,s=this._subject,o=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,this._tripleTerm=null,r=this._getStatementReader(),o&&(this._inversePredicate=!1);break;case";":o&&(this._inversePredicate=!1),r=this._readPredicate;break;case",":r=this._readObject;break;case"~":s!==null&&(this._tripleTerm=null),r=this._readReifierInAnnotation,n=!0;break;case"{|":s!==null&&(this._tripleTerm=null),this._subject=this._readTripleTerm(),this._inversePredicate=!1,this._validAnnotation=!1,n=!0,r=this._readPredicate;break;case"|}":if(!this._annotation)return this._error("Unexpected annotation syntax closing",e);if(!this._validAnnotation)return this._error("Annotation block can not be empty",e);this._subject=null,this._annotation=!1,this._inversePredicate=!1,r=this._getContextEndReader();break;default:if(this._supportsQuads&&this._graph===null&&(i=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(s!==null&&(!n||n&&!this._annotation)){let a=this._predicate,u=this._object;this._emit(s,a,u,i,o)}return n&&(this._annotation=!0),r}_readBlankNodePunctuation(e){let r,i=!1;switch(e.type){case";":i=this._inversePredicate,r=this._readPredicate;break;case",":r=this._readObject;break;case"~":case"{|":case"|}":return this._readPunctuation(e);default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._subject===null?this._error("Expected ] to follow annotation",e):(this._emitCurrent(this._subject,this._predicate,this._object,this._graph),i&&(this._inversePredicate=!1),r)}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let r=this._readEntity(e);return this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_isValidVersion(e){return this._parseUnsupportedVersions||t.SUPPORTED_VERSIONS.includes(e)}_readVersion(e){return e.type!=="literal"?this._error("Expected literal to follow version declaration",e):e.end-e.start!==e.value.length+2?this._error("Version declarations must use single quotes",e):(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,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._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._getStatementReader().call(this,e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._getStatementReader()}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,r,this.QUANTIFIERS_GRAPH)):this._quantified[r.id]=this._factory[this._quantifier](this._factory.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,r){return this._afterPath=e,this._pathPosition=r||(this._predicate===null?"subject":"object"),this._readPath}_getPathEndReader(e,r,i){if(e!==null&&e.type!=="!"&&e.type!=="^")return null;let n=this._getPathReader(r,i);return e===null?n:n.call(this,e)}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._afterPath,i=this._contextStack,n=i.length&&i[i.length-1];if(n&&n.type==="item"){let s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath=null,this._pathPosition=null,r.call(this,e)}}_readForwardPath(e){let r,i,n=this._factory.blankNode();if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(r=this._subject,this._subject=n):this._pathPosition==="predicate"?(r=this._predicate,this._predicate=n):(r=this._object,this._object=n),this._emit(r,i,n,this._graph),this._readPath}_readBackwardPath(e){let r=this._factory.blankNode(),i,n;if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(n=this._subject,this._subject=r):this._pathPosition==="predicate"?(n=this._predicate,this._predicate=r):(n=this._object,this._object=r),this._emit(r,i,n,this._graph),this._readPath}_readTripleTermTail(e){if(e.type!==")>>")return this._error(`Expected )>> but got ${e.type}`,e);let r=this._createQuad(this._subject,this._predicate,this._object,this._graph,this._inversePredicate);this._restoreContext("<<(",e);let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return e.type==="~"?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;let r=this._readTripleTerm();this._restoreContext("<<",e);let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicateOrReifierTripleEnd):(this._object=r,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return e.type==="."?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return this._reifier=this._readEntity(e),this._readReifiedTripleTail}_readReifierInAnnotation(e){return e.type==="IRI"||e.type==="typeIRI"||e.type==="type"||e.type==="prefixed"||e.type==="blank"||e.type==="var"?(this._reifier=this._readEntity(e),this._readAnnotationBlockOrPunctuation):(this._readTripleTerm(),this._subject=null,this._getContextEndReader().call(this,e))}_readAnnotationBlockOrPunctuation(e){if(e.type==="{|")return this._readPunctuation(e);switch(this._readTripleTerm(),this._annotation=!1,this._tripleTerm=null,e.type){case";":return this._inversePredicate=!1,this._readPredicate;case",":return this._readObject;default:return this._subject=null,this._getContextEndReader().call(this,e)}}_readTripleTerm(){let e=this._contextStack,r=e.length&&e[e.length-1],i=r?r.graph:void 0,n=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._createQuad(this._subject,this._predicate,this._object,null,this._inversePredicate),this._emit(n,this.RDF_REIFIES,this._tripleTerm,i||this._graph||this.DEFAULTGRAPH),n}_getContextEndReader(){let 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._readTripleTermTail;case"<<":return this._readReifiedTripleTailOrReifier}}_createQuad(e,r,i,n){return this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_createQuadInDirection(e,r,i,n,s){return s?this._factory.quad(i,r,e,n||this.DEFAULTGRAPH):this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_emitInDirection(e,r,i,n,s){this._callback(null,this._createQuad(e,r,i,n,s))}_emitCurrentInDirection(e,r,i,n){this._callback(null,this._createQuad(e,r,i,n,this._inversePredicate))}_emit(e,r,i,n){this._callback(null,this._factory.quad(e,r,i,n||this.DEFAULTGRAPH))}_error(e,r){let i=` on line ${r.line}.`;e.length+i.length>200&&(e=`${e.slice(0,199-i.length)}\u2026`);let n=new Error(`${e}${i}`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Dt}_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;let r=e.length,i="",n=-1,s=-1,o=0,a="/";for(;n<r;){switch(a){case":":if(s<0&&e[++n]==="/"&&e[++n]==="/")for(;(s=n+1)<r&&e[s]!=="/";)n=s;break;case"?":case"#":n=r;break;case"/":if(e[n+1]===".")switch(a=e[++n+1],a){case"/":i+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return i+e.substring(o,n)+e.substr(n+1);case".":if(a=e[++n+1],a===void 0||a==="/"||a==="?"||a==="#"){if(i+=e.substring(o,n-2),(o=i.lastIndexOf("/"))>=s&&(i=i.substr(0,o)),a!=="/")return`${i}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return i+e.substring(o)}parse(e,r,i,n){let s,o,a,u;if(r&&(r.onQuad||r.onPrefix||r.onComment||r.onVersion)?(s=r.onQuad,o=r.onPrefix,a=r.onComment,u=r.onVersion):(s=r,o=i,u=n),this._readCallback=this._readBeforeTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${os++}_`,this._n3Mode&&this._implicitEmptyPrefix&&this._base&&(this._prefixes[""]=this._resolveIRI("#")),this._prefixCallback=o||Dt,this._versionCallback=u||Dt,this._inversePredicate=!1,this._expectOf=!1,this._quantified=Object.create(null),this._emptyFormula=!1,!s){let f=[],c;if(this._callback=(h,d)=>{h?c=h:d&&f.push(d)},this._lexer.tokenize(e).every(h=>this._readCallback=this._readCallback(h)),c)throw c;return f}let l=(f,c)=>{f!==null?(this._callback(f),this._callback=Dt):this._readCallback&&(this._readCallback=this._readCallback(c))};a&&(this._lexer.comments=!0,l=(f,c)=>{f!==null?(this._callback(f),this._callback=Dt):this._readCallback&&(c.type==="comment"?a(c.value):this._readCallback=this._readCallback(c))}),this._callback=s,this._lexer.tokenize(e,l)}};function Dt(){}function as(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(A.rdf.first),t.RDF_REST=e.namedNode(A.rdf.rest),t.RDF_NIL=e.namedNode(A.rdf.nil),t.RDF_REIFIES=e.namedNode(A.rdf.reifies),t.N3_FORALL=e.namedNode(A.r.forAll),t.N3_FORSOME=e.namedNode(A.r.forSome),t.N3_TRUE=e.literal("true",e.namedNode(A.xsd.boolean)),t.ABBREVIATIONS={a:e.namedNode(A.rdf.type),"=":e.namedNode(A.owl.sameAs),">":e.namedNode(A.log.implies),"<":e.namedNode(A.log.isImpliedBy)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}me.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];as(me.prototype,z);var si={};$l(si,{inDefaultGraph:()=>Lu,isBlankNode:()=>Nu,isDefaultGraph:()=>xe,isLiteral:()=>vu,isNamedNode:()=>Au,isQuad:()=>ju,isVariable:()=>Pu,prefix:()=>Fu,prefixes:()=>ls});function Au(t){return!!t&&t.termType==="NamedNode"}function Nu(t){return!!t&&t.termType==="BlankNode"}function vu(t){return!!t&&t.termType==="Literal"}function Pu(t){return!!t&&t.termType==="Variable"}function ju(t){return!!t&&t.termType==="Quad"}function xe(t){return!!t&&t.termType==="DefaultGraph"}function Lu(t){return xe(t.graph)}function Fu(t,e){return ls({"":t.value||t},e)("")}function ls(t,e){let r=Object.create(null);for(let n in t)i(n,t[n]);e=e||z;function i(n,s){if(typeof s=="string"){let o=Object.create(null);r[n]=a=>o[a]||(o[a]=e.namedNode(s+a))}else if(!(n in r))throw new Error(`Unknown prefix: ${n}`);return r[n]}return i}function ht(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}var Bu=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Cu=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,us="./",Du="../",oi="?",fs="#",Ge=class t{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Bu.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!t.supports(this.base))return this._baseMatcher=/.^/;let e=/^[^:]*:\/*/.exec(this.base)[0],r=["^",ht(e)],i=[],n=[],s=/[^/?#]*([/?#])/y,o,a=0,u=0,l=s.lastIndex=e.length;for(;!a&&!u&&(o=s.exec(this.base));)o[1]===fs?u=s.lastIndex-1:(r.push(ht(o[0]),"(?:"),i.push(")?"),o[1]!==oi?n.push(l=s.lastIndex):(a=l=s.lastIndex,u=this.base.indexOf(fs,a),this._pathReplacements[a]=oi));for(let f=0;f<n.length;f++)this._pathReplacements[n[f]]=Du.repeat(n.length-f-1);return this._pathReplacements[n[n.length-1]]=us,this._baseLength=u>0?u:this.base.length,r.push(ht(this.base.substring(l,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...r,...i].join(""))}toRelative(e){let r=this._getBaseMatcher().exec(e);if(!r)return e;let i=r[0].length;if(i===this._baseLength&&i===e.length)return"";let n=this._pathReplacements[i];if(n){let s=e.substring(i);return n!==oi&&!Cu.test(s)?e:n===us&&/^[^?#]/.test(s)?s:n+s}return e.substring(i-1)}};var Ot=z.defaultGraph(),{rdf:Ou,xsd:_t}=A,cs=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ds=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Mu={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},Ve=class extends H{equals(e){return e===this}},oe=class{constructor(e,r){if(this._prefixRegex=/$0^/,this._hasPrefixes=!1,e&&typeof e.write!="function"&&(r=e,e=null),r=r||{},this._lists=r.lists,e)this._outputStream=e,this._endStream=r.end===void 0?!0:!!r.end;else{let i="";this._outputStream={write(n,s,o){i+=n,o&&o()},end:n=>{n&&n(null,i)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(r.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Ot,this._prefixIRIs=Object.create(null),r.baseIRI&&(this._baseIri=new Ge(r.baseIRI),r.writeBase&&this._write(`@base <${r.baseIRI}>.
1
+ var jl=Object.create;var rr=Object.defineProperty,Ll=Object.defineProperties,Fl=Object.getOwnPropertyDescriptor,Bl=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertyNames,An=Object.getOwnPropertySymbols,Dl=Object.getPrototypeOf,vn=Object.prototype.hasOwnProperty,Ol=Object.prototype.propertyIsEnumerable;var st=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ml=t=>{throw TypeError(t)};var Nn=(t,e,r)=>e in t?rr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,D=(t,e)=>{for(var r in e||(e={}))vn.call(e,r)&&Nn(t,r,e[r]);if(An)for(var r of An(e))Ol.call(e,r)&&Nn(t,r,e[r]);return t},Pe=(t,e)=>Ll(t,Bl(e));var I=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},$l=(t,e)=>{for(var r in e)rr(t,r,{get:e[r],enumerable:!0})},kl=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cl(e))!vn.call(t,n)&&n!==r&&rr(t,n,{get:()=>e[n],enumerable:!(i=Fl(e,n))||i.enumerable});return t};var ir=(t,e,r)=>(r=t!=null?jl(Dl(t)):{},kl(e||!t||!t.__esModule?rr(r,"default",{value:t,enumerable:!0}):r,t));var k=function(t,e){this[0]=t,this[1]=e},Y=(t,e,r)=>{var i=(a,l,u,f)=>{try{var c=r[a](l),b=(l=c.value)instanceof k,d=c.done;Promise.resolve(b?l[0]:l).then(_=>b?i(a==="return"?a:"next",l[1]?{done:_.done,value:_.value}:_,u,f):u({value:_,done:d})).catch(_=>i("throw",_,u,f))}catch(_){f(_)}},n=(a,l,u,f)=>o[a]=c=>(l=new Promise((b,d,_)=>(_=()=>i(a,c,b,d),s?s.then(_):_())),f=()=>s===u&&(s=0),s=u=l.then(f,f),l),s,o={};return r=r.apply(t,e),o[st("asyncIterator")]=()=>o,n("next"),n("throw"),n("return"),o},re=t=>{var e=t[st("asyncIterator")],r=!1,i,n={};return e==null?(e=t[st("iterator")](),i=s=>n[s]=o=>e[s](o)):(e=e.call(t),i=s=>n[s]=o=>{if(r){if(r=!1,s==="throw")throw o;return o}return r=!0,{done:!1,value:new k(new Promise(a=>{var l=e[s](o);l instanceof Object||Ml("Object expected"),a(l)}),1)}}),n[st("iterator")]=()=>n,i("next"),"throw"in e?i("throw"):n.throw=s=>{throw s},"return"in e&&i("return"),n},Q=(t,e,r)=>(e=t[st("asyncIterator")])?e.call(t):(t=t[st("iterator")](),e={},r=(i,n)=>(n=t[i])&&(e[i]=s=>new Promise((o,a,l)=>(s=n.call(t,s),l=s.done,Promise.resolve(s.value).then(u=>o({value:u,done:l}),a)))),r("next"),r("return"),e);var Ln=I(nr=>{"use strict";nr.byteLength=Ul;nr.toByteArray=Gl;nr.fromByteArray=Hl;var ie=[],Z=[],ql=typeof Uint8Array!="undefined"?Uint8Array:Array,zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(qe=0,Pn=zr.length;qe<Pn;++qe)ie[qe]=zr[qe],Z[zr.charCodeAt(qe)]=qe;var qe,Pn;Z[45]=62;Z[95]=63;function jn(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function Ul(t){var e=jn(t),r=e[0],i=e[1];return(r+i)*3/4-i}function Wl(t,e,r){return(e+r)*3/4-r}function Gl(t){var e,r=jn(t),i=r[0],n=r[1],s=new ql(Wl(t,i,n)),o=0,a=n>0?i-4:i,l;for(l=0;l<a;l+=4)e=Z[t.charCodeAt(l)]<<18|Z[t.charCodeAt(l+1)]<<12|Z[t.charCodeAt(l+2)]<<6|Z[t.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return n===2&&(e=Z[t.charCodeAt(l)]<<2|Z[t.charCodeAt(l+1)]>>4,s[o++]=e&255),n===1&&(e=Z[t.charCodeAt(l)]<<10|Z[t.charCodeAt(l+1)]<<4|Z[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Vl(t){return ie[t>>18&63]+ie[t>>12&63]+ie[t>>6&63]+ie[t&63]}function Ql(t,e,r){for(var i,n=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(Vl(i));return n.join("")}function Hl(t){for(var e,r=t.length,i=r%3,n=[],s=16383,o=0,a=r-i;o<a;o+=s)n.push(Ql(t,o,o+s>a?a:o+s));return i===1?(e=t[r-1],n.push(ie[e>>2]+ie[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(ie[e>>10]+ie[e>>4&63]+ie[e<<2&63]+"=")),n.join("")}});var Fn=I(Kr=>{Kr.read=function(t,e,r,i,n){var s,o,a=n*8-i-1,l=(1<<a)-1,u=l>>1,f=-7,c=r?n-1:0,b=r?-1:1,d=t[e+c];for(c+=b,s=d&(1<<-f)-1,d>>=-f,f+=a;f>0;s=s*256+t[e+c],c+=b,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=i;f>0;o=o*256+t[e+c],c+=b,f-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-u}return(d?-1:1)*o*Math.pow(2,s-i)};Kr.write=function(t,e,r,i,n,s){var o,a,l,u=s*8-n-1,f=(1<<u)-1,c=f>>1,b=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,_=i?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?e+=b/l:e+=b*Math.pow(2,1-c),e*l>=2&&(o++,l/=2),o+c>=f?(a=0,o=f):o+c>=1?(a=(e*l-1)*Math.pow(2,n),o=o+c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=a&255,d+=_,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;t[r+d]=o&255,d+=_,o/=256,u-=8);t[r+d-_]|=p*128}});var se=I(ut=>{"use strict";var Yr=Ln(),at=Fn(),Bn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ut.Buffer=h;ut.SlowBuffer=Jl;ut.INSPECT_MAX_BYTES=50;var sr=2147483647;ut.kMaxLength=sr;h.TYPED_ARRAY_SUPPORT=zl();!h.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&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.");function zl(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function ye(t){if(t>sr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,h.prototype),e}function h(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ei(t)}return Mn(t,e,r)}h.poolSize=8192;function Mn(t,e,r){if(typeof t=="string")return Yl(t,e);if(ArrayBuffer.isView(t))return Zl(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(ne(t,ArrayBuffer)||t&&ne(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ne(t,SharedArrayBuffer)||t&&ne(t.buffer,SharedArrayBuffer)))return Xr(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return h.from(i,e,r);let n=Xl(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}h.from=function(t,e,r){return Mn(t,e,r)};Object.setPrototypeOf(h.prototype,Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function $n(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Kl(t,e,r){return $n(t),t<=0?ye(t):e!==void 0?typeof r=="string"?ye(t).fill(e,r):ye(t).fill(e):ye(t)}h.alloc=function(t,e,r){return Kl(t,e,r)};function ei(t){return $n(t),ye(t<0?0:ti(t)|0)}h.allocUnsafe=function(t){return ei(t)};h.allocUnsafeSlow=function(t){return ei(t)};function Yl(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=kn(t,e)|0,i=ye(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Zr(t){let e=t.length<0?0:ti(t.length)|0,r=ye(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function Zl(t){if(ne(t,Uint8Array)){let e=new Uint8Array(t);return Xr(e.buffer,e.byteOffset,e.byteLength)}return Zr(t)}function Xr(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,h.prototype),i}function Xl(t){if(h.isBuffer(t)){let e=ti(t.length)|0,r=ye(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||ii(t.length)?ye(0):Zr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Zr(t.data)}function ti(t){if(t>=sr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+sr.toString(16)+" bytes");return t|0}function Jl(t){return+t!=t&&(t=0),h.alloc(+t)}h.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==h.prototype};h.compare=function(e,r){if(ne(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),ne(r,Uint8Array)&&(r=h.from(r,r.offset,r.byteLength)),!h.isBuffer(e)||!h.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,o=Math.min(i,n);s<o;++s)if(e[s]!==r[s]){i=e[s],n=r[s];break}return i<n?-1:n<i?1:0};h.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}};h.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return h.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=h.allocUnsafe(r),s=0;for(i=0;i<e.length;++i){let o=e[i];if(ne(o,Uint8Array))s+o.length>n.length?(h.isBuffer(o)||(o=h.from(o)),o.copy(n,s)):Uint8Array.prototype.set.call(n,o,s);else if(h.isBuffer(o))o.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return n};function kn(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||ne(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Jr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Kn(t).length;default:if(n)return i?-1:Jr(t).length;e=(""+e).toLowerCase(),n=!0}}h.byteLength=kn;function eu(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return fu(this,e,r);case"utf8":case"utf-8":return Un(this,e,r);case"ascii":return lu(this,e,r);case"latin1":case"binary":return uu(this,e,r);case"base64":return ou(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cu(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}h.prototype._isBuffer=!0;function Ue(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}h.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)Ue(this,r,r+1);return this};h.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)Ue(this,r,r+3),Ue(this,r+1,r+2);return this};h.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)Ue(this,r,r+7),Ue(this,r+1,r+6),Ue(this,r+2,r+5),Ue(this,r+3,r+4);return this};h.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Un(this,0,e):eu.apply(this,arguments)};h.prototype.toLocaleString=h.prototype.toString;h.prototype.equals=function(e){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:h.compare(this,e)===0};h.prototype.inspect=function(){let e="",r=ut.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Bn&&(h.prototype[Bn]=h.prototype.inspect);h.prototype.compare=function(e,r,i,n,s){if(ne(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let o=s-n,a=i-r,l=Math.min(o,a),u=this.slice(n,s),f=e.slice(r,i);for(let c=0;c<l;++c)if(u[c]!==f[c]){o=u[c],a=f[c];break}return o<a?-1:a<o?1:0};function qn(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ii(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=h.from(e,i)),h.isBuffer(e))return e.length===0?-1:Cn(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Cn(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Cn(t,e,r,i,n){let s=1,o=t.length,a=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function l(f,c){return s===1?f[c]:f.readUInt16BE(c*s)}let u;if(n){let f=-1;for(u=r;u<o;u++)if(l(t,u)===l(e,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===a)return f*s}else f!==-1&&(u-=u-f),f=-1}else for(r+a>o&&(r=o-a),u=r;u>=0;u--){let f=!0;for(let c=0;c<a;c++)if(l(t,u+c)!==l(e,c)){f=!1;break}if(f)return u}return-1}h.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};h.prototype.indexOf=function(e,r,i){return qn(this,e,r,i,!0)};h.prototype.lastIndexOf=function(e,r,i){return qn(this,e,r,i,!1)};function tu(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let o;for(o=0;o<i;++o){let a=parseInt(e.substr(o*2,2),16);if(ii(a))return o;t[r+o]=a}return o}function ru(t,e,r,i){return or(Jr(e,t.length-r),t,r,i)}function iu(t,e,r,i){return or(pu(e),t,r,i)}function nu(t,e,r,i){return or(Kn(e),t,r,i)}function su(t,e,r,i){return or(bu(e,t.length-r),t,r,i)}h.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return tu(this,e,r,i);case"utf8":case"utf-8":return ru(this,e,r,i);case"ascii":case"latin1":case"binary":return iu(this,e,r,i);case"base64":return nu(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return su(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ou(t,e,r){return e===0&&r===t.length?Yr.fromByteArray(t):Yr.fromByteArray(t.slice(e,r))}function Un(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let s=t[n],o=null,a=s>239?4:s>223?3:s>191?2:1;if(n+a<=r){let l,u,f,c;switch(a){case 1:s<128&&(o=s);break;case 2:l=t[n+1],(l&192)===128&&(c=(s&31)<<6|l&63,c>127&&(o=c));break;case 3:l=t[n+1],u=t[n+2],(l&192)===128&&(u&192)===128&&(c=(s&15)<<12|(l&63)<<6|u&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:l=t[n+1],u=t[n+2],f=t[n+3],(l&192)===128&&(u&192)===128&&(f&192)===128&&(c=(s&15)<<18|(l&63)<<12|(u&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=a}return au(i)}var Dn=4096;function au(t){let e=t.length;if(e<=Dn)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Dn));return r}function lu(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function uu(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function fu(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let s=e;s<r;++s)n+=gu[t[s]];return n}function cu(t,e,r){let i=t.slice(e,r),n="";for(let s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}h.prototype.slice=function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,h.prototype),n};function $(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||$(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return n};h.prototype.readUintBE=h.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||$(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};h.prototype.readUint8=h.prototype.readUInt8=function(e,r){return e=e>>>0,r||$(e,1,this.length),this[e]};h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||$(e,2,this.length),this[e]|this[e+1]<<8};h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||$(e,2,this.length),this[e]<<8|this[e+1]};h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||$(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||$(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};h.prototype.readBigUInt64LE=je(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))});h.prototype.readBigUInt64BE=je(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(s)});h.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||$(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*r)),n};h.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||$(e,r,this.length);let n=r,s=1,o=this[e+--n];for(;n>0&&(s*=256);)o+=this[e+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};h.prototype.readInt8=function(e,r){return e=e>>>0,r||$(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};h.prototype.readInt16LE=function(e,r){e=e>>>0,r||$(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};h.prototype.readInt16BE=function(e,r){e=e>>>0,r||$(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};h.prototype.readInt32LE=function(e,r){return e=e>>>0,r||$(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};h.prototype.readInt32BE=function(e,r){return e=e>>>0,r||$(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};h.prototype.readBigInt64LE=je(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});h.prototype.readBigInt64BE=je(function(e){e=e>>>0,lt(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&jt(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});h.prototype.readFloatLE=function(e,r){return e=e>>>0,r||$(e,4,this.length),at.read(this,e,!0,23,4)};h.prototype.readFloatBE=function(e,r){return e=e>>>0,r||$(e,4,this.length),at.read(this,e,!1,23,4)};h.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||$(e,8,this.length),at.read(this,e,!0,52,8)};h.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||$(e,8,this.length),at.read(this,e,!1,52,8)};function H(t,e,r,i,n,s){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;H(this,e,r,i,a,0)}let s=1,o=0;for(this[r]=e&255;++o<i&&(s*=256);)this[r+o]=e/s&255;return r+i};h.prototype.writeUintBE=h.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;H(this,e,r,i,a,0)}let s=i-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+i};h.prototype.writeUint8=h.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,1,255,0),this[r]=e&255,r+1};h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Wn(t,e,r,i,n){zn(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function Gn(t,e,r,i,n){zn(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}h.prototype.writeBigUInt64LE=je(function(e,r=0){return Wn(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeBigUInt64BE=je(function(e,r=0){return Gn(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);H(this,e,r,i,l-1,-l)}let s=0,o=1,a=0;for(this[r]=e&255;++s<i&&(o*=256);)e<0&&a===0&&this[r+s-1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};h.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);H(this,e,r,i,l-1,-l)}let s=i-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};h.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};h.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};h.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};h.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};h.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||H(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};h.prototype.writeBigInt64LE=je(function(e,r=0){return Wn(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});h.prototype.writeBigInt64BE=je(function(e,r=0){return Gn(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Vn(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Qn(t,e,r,i,n){return e=+e,r=r>>>0,n||Vn(t,e,r,4,34028234663852886e22,-34028234663852886e22),at.write(t,e,r,i,23,4),r+4}h.prototype.writeFloatLE=function(e,r,i){return Qn(this,e,r,!0,i)};h.prototype.writeFloatBE=function(e,r,i){return Qn(this,e,r,!1,i)};function Hn(t,e,r,i,n){return e=+e,r=r>>>0,n||Vn(t,e,r,8,17976931348623157e292,-17976931348623157e292),at.write(t,e,r,i,52,8),r+8}h.prototype.writeDoubleLE=function(e,r,i){return Hn(this,e,r,!0,i)};h.prototype.writeDoubleBE=function(e,r,i){return Hn(this,e,r,!1,i)};h.prototype.copy=function(e,r,i,n){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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-r<n-i&&(n=e.length-r+i);let s=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),s};h.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let o=e.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{let o=h.isBuffer(e)?e:h.from(e,n),a=o.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};var ot={};function ri(t,e,r){ot[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}ri("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);ri("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);ri("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=On(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=On(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function On(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function du(t,e,r){lt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&jt(e,t.length-(r+1))}function zn(t,e,r,i,n,s){if(t>r||t<e){let o=typeof e=="bigint"?"n":"",a;throw s>3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new ot.ERR_OUT_OF_RANGE("value",a,t)}du(i,n,s)}function lt(t,e){if(typeof t!="number")throw new ot.ERR_INVALID_ARG_TYPE(e,"number",t)}function jt(t,e,r){throw Math.floor(t)!==t?(lt(t,r),new ot.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new ot.ERR_BUFFER_OUT_OF_BOUNDS:new ot.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var hu=/[^+/0-9A-Za-z-_]/g;function _u(t){if(t=t.split("=")[0],t=t.trim().replace(hu,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Jr(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function pu(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function bu(t,e){let r,i,n,s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}function Kn(t){return Yr.toByteArray(_u(t))}function or(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function ne(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function ii(t){return t!==t}var gu=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e})();function je(t){return typeof BigInt=="undefined"?yu:t}function yu(){throw new Error("BigInt not supported")}});var P=I((kp,_s)=>{"use strict";var li=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
2
+ `;super(r),this.name="AggregateError",this.errors=e}};_s.exports={AggregateError:li,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var ui=I((qp,ps)=>{"use strict";ps.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var U=I((Up,ys)=>{"use strict";var{format:$u,inspect:dr}=ui(),{AggregateError:ku}=P(),qu=globalThis.AggregateError||ku,Uu=Symbol("kIsNodeError"),Wu=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Gu=/^([A-Z][a-z0-9]*)+$/,Vu="__node_internal_",hr={};function He(t,e){if(!t)throw new hr.ERR_INTERNAL_ASSERTION(e)}function bs(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Qu(t,e,r){if(typeof e=="function")return He(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return He(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:$u(e,...r)}function q(t,e,r){r||(r=Error);class i extends r{constructor(...s){super(Qu(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[Uu]=!0,hr[t]=i}function gs(t){let e=Vu+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Hu(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new qu([e,t],e.message);return r.code=e.code,r}return t||e}var fi=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new hr.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};q("ERR_ASSERTION","%s",Error);q("ERR_INVALID_ARG_TYPE",(t,e,r)=>{He(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],s=[],o=[];for(let l of e)He(typeof l=="string","All expected entries have to be of type string"),Wu.includes(l)?n.push(l.toLowerCase()):Gu.test(l)?s.push(l):(He(l!=="object",'The value "object" should be written as "Object"'),o.push(l));if(s.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),s.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();i+=`one of type ${n.join(", ")}, or ${l}`}}(s.length>0||o.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();i+=`an instance of ${s.join(", ")}, or ${l}`}}o.length>0&&(i+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(i+="an "),i+=`${o[0]}`;break;case 2:i+=`one of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();i+=`one of ${o.join(", ")}, or ${l}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let l=dr(r,{depth:-1});i+=`. Received ${l}`}}else{let l=dr(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),i+=`. Received type ${typeof r} (${l})`}return i},TypeError);q("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=dr(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);q("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);q("ERR_MISSING_ARGS",(...t)=>{He(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);q("ERR_OUT_OF_RANGE",(t,e,r)=>{He(e,'Missing "range" argument');let i;if(Number.isInteger(r)&&Math.abs(r)>2**32)i=bs(String(r));else if(typeof r=="bigint"){i=String(r);let n=BigInt(2)**BigInt(32);(r>n||r<-n)&&(i=bs(i)),i+="n"}else i=dr(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);ys.exports={AbortError:fi,aggregateTwoErrors:gs(Hu),hideStackFrames:gs,codes:hr}});var pt=I((Wp,_r)=>{"use strict";var{AbortController:ws,AbortSignal:zu}=typeof self!="undefined"?self:typeof window!="undefined"?window:void 0;_r.exports=ws;_r.exports.AbortSignal=zu;_r.exports.default=ws});var Mt=I((Gp,ci)=>{"use strict";var bt=typeof Reflect=="object"?Reflect:null,ms=bt&&typeof bt.apply=="function"?bt.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},pr;bt&&typeof bt.ownKeys=="function"?pr=bt.ownKeys:Object.getOwnPropertySymbols?pr=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:pr=function(e){return Object.getOwnPropertyNames(e)};function Ku(t){console&&console.warn&&console.warn(t)}var Es=Number.isNaN||function(e){return e!==e};function T(){T.init.call(this)}ci.exports=T;ci.exports.once=Ju;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var xs=10;function br(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return xs},set:function(t){if(typeof t!="number"||t<0||Es(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");xs=t}});T.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};T.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Es(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};function Ss(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}T.prototype.getMaxListeners=function(){return Ss(this)};T.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")ms(l,this,r);else for(var u=l.length,f=Ns(l,u),i=0;i<u;++i)ms(f[i],this,r);return!0};function Is(t,e,r,i){var n,s,o;if(br(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),n=Ss(t),n>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,Ku(a)}return t}T.prototype.addListener=function(e,r){return Is(this,e,r,!1)};T.prototype.on=T.prototype.addListener;T.prototype.prependListener=function(e,r){return Is(this,e,r,!0)};function Yu(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Rs(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Yu.bind(i);return n.listener=r,i.wrapFn=n,n}T.prototype.once=function(e,r){return br(r),this.on(e,Rs(this,e,r)),this};T.prototype.prependOnceListener=function(e,r){return br(r),this.prependListener(e,Rs(this,e,r)),this};T.prototype.removeListener=function(e,r){var i,n,s,o,a;if(br(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===r||i[o].listener===r){a=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():Zu(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),o;for(n=0;n<s.length;++n)o=s[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function Ts(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Xu(n):Ns(n,n.length)}T.prototype.listeners=function(e){return Ts(this,e,!0)};T.prototype.rawListeners=function(e){return Ts(this,e,!1)};T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):As.call(t,e)};T.prototype.listenerCount=As;function As(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}T.prototype.eventNames=function(){return this._eventsCount>0?pr(this._events):[]};function Ns(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function Zu(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Xu(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Ju(t,e){return new Promise(function(r,i){function n(o){t.removeListener(e,s),i(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}vs(t,e,s,{once:!0}),e!=="error"&&ef(t,n,{once:!0})})}function ef(t,e,r){typeof t.on=="function"&&vs(t,"error",e,r)}function vs(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var G=I((Vp,hi)=>{"use strict";var tf=se(),{format:rf,inspect:nf}=ui(),{codes:{ERR_INVALID_ARG_TYPE:di}}=U(),{kResistStopPropagation:sf,AggregateError:of,SymbolDispose:af}=P(),lf=globalThis.AbortSignal||pt().AbortSignal,uf=globalThis.AbortController||pt().AbortController,ff=Object.getPrototypeOf(async function(){}).constructor,Ps=globalThis.Blob||tf.Blob,cf=typeof Ps!="undefined"?function(e){return e instanceof Ps}:function(e){return!1},js=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new di(e,"AbortSignal",t)},df=(t,e)=>{if(typeof t!="function")throw new di(e,"Function",t)};hi.exports={AggregateError:of,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format:rf,inspect:nf,types:{isAsyncFunction(t){return t instanceof ff},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:cf,deprecate(t,e){return t},addAbortListener:Mt().addAbortListener||function(e,r){if(e===void 0)throw new di("signal","AbortSignal",e);js(e,"signal"),df(r,"listener");let i;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[sf]:!0}),i=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[af](){var n;(n=i)===null||n===void 0||n()}}},AbortSignalAny:lf.any||function(e){if(e.length===1)return e[0];let r=new uf,i=()=>r.abort();return e.forEach(n=>{js(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal}};hi.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var yt=I((Qp,qs)=>{"use strict";var{ArrayIsArray:pi,ArrayPrototypeIncludes:Cs,ArrayPrototypeJoin:Ds,ArrayPrototypeMap:hf,NumberIsInteger:bi,NumberIsNaN:_f,NumberMAX_SAFE_INTEGER:pf,NumberMIN_SAFE_INTEGER:bf,NumberParseInt:gf,ObjectPrototypeHasOwnProperty:yf,RegExpPrototypeExec:Os,String:wf,StringPrototypeToUpperCase:mf,StringPrototypeTrim:xf}=P(),{hideStackFrames:X,codes:{ERR_SOCKET_BAD_PORT:Ef,ERR_INVALID_ARG_TYPE:W,ERR_INVALID_ARG_VALUE:gt,ERR_OUT_OF_RANGE:ze,ERR_UNKNOWN_SIGNAL:Ls}}=U(),{normalizeEncoding:Sf}=G(),{isAsyncFunction:If,isArrayBufferView:Rf}=G().types,Fs={};function Tf(t){return t===(t|0)}function Af(t){return t===t>>>0}var Nf=/^[0-7]+$/,vf="must be a 32-bit unsigned integer or an octal string";function Pf(t,e,r){if(typeof t=="undefined"&&(t=r),typeof t=="string"){if(Os(Nf,t)===null)throw new gt(e,t,vf);t=gf(t,8)}return Ms(t,e),t}var jf=X((t,e,r=bf,i=pf)=>{if(typeof t!="number")throw new W(e,"number",t);if(!bi(t))throw new ze(e,"an integer",t);if(t<r||t>i)throw new ze(e,`>= ${r} && <= ${i}`,t)}),Lf=X((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new W(e,"number",t);if(!bi(t))throw new ze(e,"an integer",t);if(t<r||t>i)throw new ze(e,`>= ${r} && <= ${i}`,t)}),Ms=X((t,e,r=!1)=>{if(typeof t!="number")throw new W(e,"number",t);if(!bi(t))throw new ze(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new ze(e,`>= ${i} && <= ${n}`,t)});function gi(t,e){if(typeof t!="string")throw new W(e,"string",t)}function Ff(t,e,r=void 0,i){if(typeof t!="number")throw new W(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&_f(t))throw new ze(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var Bf=X((t,e,r)=>{if(!Cs(r,t)){let n="must be one of: "+Ds(hf(r,s=>typeof s=="string"?`'${s}'`:wf(s)),", ");throw new gt(e,t,n)}});function $s(t,e){if(typeof t!="boolean")throw new W(e,"boolean",t)}function _i(t,e,r){return t==null||!yf(t,e)?r:t[e]}var Cf=X((t,e,r=null)=>{let i=_i(r,"allowArray",!1),n=_i(r,"allowFunction",!1);if(!_i(r,"nullable",!1)&&t===null||!i&&pi(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new W(e,"Object",t)}),Df=X((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new W(e,"a dictionary",t)}),gr=X((t,e,r=0)=>{if(!pi(t))throw new W(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new gt(e,t,i)}});function Of(t,e){gr(t,e);for(let r=0;r<t.length;r++)gi(t[r],`${e}[${r}]`)}function Mf(t,e){gr(t,e);for(let r=0;r<t.length;r++)$s(t[r],`${e}[${r}]`)}function $f(t,e){gr(t,e);for(let r=0;r<t.length;r++){let i=t[r],n=`${e}[${r}]`;if(i==null)throw new W(n,"AbortSignal",i);ks(i,n)}}function kf(t,e="signal"){if(gi(t,e),Fs[t]===void 0)throw Fs[mf(t)]!==void 0?new Ls(t+" (signals must use all capital letters)"):new Ls(t)}var qf=X((t,e="buffer")=>{if(!Rf(t))throw new W(e,["Buffer","TypedArray","DataView"],t)});function Uf(t,e){let r=Sf(e),i=t.length;if(r==="hex"&&i%2!==0)throw new gt("encoding",e,`is invalid for data of length ${i}`)}function Wf(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&xf(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new Ef(e,t,r);return t|0}var ks=X((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new W(e,"AbortSignal",t)}),Gf=X((t,e)=>{if(typeof t!="function")throw new W(e,"Function",t)}),Vf=X((t,e)=>{if(typeof t!="function"||If(t))throw new W(e,"Function",t)}),Qf=X((t,e)=>{if(t!==void 0)throw new W(e,"undefined",t)});function Hf(t,e,r){if(!Cs(r,t))throw new W(e,`('${Ds(r,"|")}')`,t)}var zf=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Bs(t,e){if(typeof t=="undefined"||!Os(zf,t))throw new gt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Kf(t){if(typeof t=="string")return Bs(t,"hints"),t;if(pi(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];Bs(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new gt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}qs.exports={isInt32:Tf,isUint32:Af,parseFileMode:Pf,validateArray:gr,validateStringArray:Of,validateBooleanArray:Mf,validateAbortSignalArray:$f,validateBoolean:$s,validateBuffer:qf,validateDictionary:Df,validateEncoding:Uf,validateFunction:Gf,validateInt32:Lf,validateInteger:jf,validateNumber:Ff,validateObject:Cf,validateOneOf:Bf,validatePlainFunction:Vf,validatePort:Wf,validateSignalName:kf,validateString:gi,validateUint32:Ms,validateUndefined:Qf,validateUnion:Hf,validateAbortSignal:ks,validateLinkHeaderValue:Kf}});var Ce=I((Hp,Vs)=>{var F=Vs.exports={},ae,le;function yi(){throw new Error("setTimeout has not been defined")}function wi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ae=setTimeout:ae=yi}catch(t){ae=yi}try{typeof clearTimeout=="function"?le=clearTimeout:le=wi}catch(t){le=wi}})();function Us(t){if(ae===setTimeout)return setTimeout(t,0);if((ae===yi||!ae)&&setTimeout)return ae=setTimeout,setTimeout(t,0);try{return ae(t,0)}catch(e){try{return ae.call(null,t,0)}catch(r){return ae.call(this,t,0)}}}function Yf(t){if(le===clearTimeout)return clearTimeout(t);if((le===wi||!le)&&clearTimeout)return le=clearTimeout,clearTimeout(t);try{return le(t)}catch(e){try{return le.call(null,t)}catch(r){return le.call(this,t)}}}var Se=[],wt=!1,Ke,yr=-1;function Zf(){!wt||!Ke||(wt=!1,Ke.length?Se=Ke.concat(Se):yr=-1,Se.length&&Ws())}function Ws(){if(!wt){var t=Us(Zf);wt=!0;for(var e=Se.length;e;){for(Ke=Se,Se=[];++yr<e;)Ke&&Ke[yr].run();yr=-1,e=Se.length}Ke=null,wt=!1,Yf(t)}}F.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Se.push(new Gs(t,e)),Se.length===1&&!wt&&Us(Ws)};function Gs(t,e){this.fun=t,this.array=e}Gs.prototype.run=function(){this.fun.apply(null,this.array)};F.title="browser";F.browser=!0;F.env={};F.argv=[];F.version="";F.versions={};function Ie(){}F.on=Ie;F.addListener=Ie;F.once=Ie;F.off=Ie;F.removeListener=Ie;F.removeAllListeners=Ie;F.emit=Ie;F.prependListener=Ie;F.prependOnceListener=Ie;F.listeners=function(t){return[]};F.binding=function(t){throw new Error("process.binding is not supported")};F.cwd=function(){return"/"};F.chdir=function(t){throw new Error("process.chdir is not supported")};F.umask=function(){return 0}});var fe=I((zp,oo)=>{"use strict";var{SymbolAsyncIterator:Qs,SymbolIterator:Hs,SymbolFor:Ye}=P(),zs=Ye("nodejs.stream.destroyed"),Ks=Ye("nodejs.stream.errored"),mi=Ye("nodejs.stream.readable"),xi=Ye("nodejs.stream.writable"),Ys=Ye("nodejs.stream.disturbed"),Xf=Ye("nodejs.webstream.isClosedPromise"),Jf=Ye("nodejs.webstream.controllerErrorFunction");function wr(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function mr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function ec(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function ue(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function Zs(t){return!!(t&&!ue(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Xs(t){return!!(t&&!ue(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Js(t){return!!(t&&!ue(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function tc(t){return Zs(t)||Xs(t)||Js(t)}function rc(t,e){return t==null?!1:e===!0?typeof t[Qs]=="function":e===!1?typeof t[Hs]=="function":typeof t[Qs]=="function"||typeof t[Hs]=="function"}function xr(t){if(!ue(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[zs]||i!=null&&i.destroyed)}function eo(t){if(!mr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function ic(t,e){if(!mr(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function nc(t){if(!wr(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function to(t,e){if(!wr(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function ro(t){return t&&t[mi]!=null?t[mi]:typeof(t==null?void 0:t.readable)!="boolean"?null:xr(t)?!1:wr(t)&&t.readable&&!to(t)}function io(t){return t&&t[xi]!=null?t[xi]:typeof(t==null?void 0:t.writable)!="boolean"?null:xr(t)?!1:mr(t)&&t.writable&&!eo(t)}function sc(t,e){return ue(t)?xr(t)?!0:!((e==null?void 0:e.readable)!==!1&&ro(t)||(e==null?void 0:e.writable)!==!1&&io(t)):null}function oc(t){var e,r;return ue(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function ac(t){var e,r;return ue(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function lc(t){if(!ue(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(e==null?void 0:e.closed)||(r==null?void 0:r.closed):typeof t._closed=="boolean"&&no(t)?t._closed:null}function no(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function so(t){return typeof t._sent100=="boolean"&&no(t)}function uc(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function fc(t){if(!ue(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&so(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function cc(t){var e;return!!(t&&((e=t[Ys])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function dc(t){var e,r,i,n,s,o,a,l,u,f;return!!(t&&((e=(r=(i=(n=(s=(o=t[Ks])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((f=t._writableState)===null||f===void 0)&&f.errored))}oo.exports={isDestroyed:xr,kIsDestroyed:zs,isDisturbed:cc,kIsDisturbed:Ys,isErrored:dc,kIsErrored:Ks,isReadable:ro,kIsReadable:mi,kIsClosedPromise:Xf,kControllerErrorFunction:Jf,kIsWritable:xi,isClosed:lc,isDuplexNodeStream:ec,isFinished:sc,isIterable:rc,isReadableNodeStream:wr,isReadableStream:Zs,isReadableEnded:nc,isReadableFinished:to,isReadableErrored:ac,isNodeStream:ue,isWebStream:tc,isWritable:io,isWritableNodeStream:mr,isWritableStream:Xs,isWritableEnded:eo,isWritableFinished:ic,isWritableErrored:oc,isServerRequest:uc,isServerResponse:so,willEmitClose:fc,isTransformStream:Js}});var Re=I((Kp,Ti)=>{"use strict";var De=Ce(),{AbortError:bo,codes:hc}=U(),{ERR_INVALID_ARG_TYPE:_c,ERR_STREAM_PREMATURE_CLOSE:ao}=hc,{kEmptyObject:Si,once:Ii}=G(),{validateAbortSignal:pc,validateFunction:bc,validateObject:gc,validateBoolean:yc}=yt(),{Promise:wc,PromisePrototypeThen:mc,SymbolDispose:go}=P(),{isClosed:xc,isReadable:lo,isReadableNodeStream:Ei,isReadableStream:Ec,isReadableFinished:uo,isReadableErrored:fo,isWritable:co,isWritableNodeStream:ho,isWritableStream:Sc,isWritableFinished:_o,isWritableErrored:po,isNodeStream:Ic,willEmitClose:Rc,kIsClosedPromise:Tc}=fe(),mt;function Ac(t){return t.setHeader&&typeof t.abort=="function"}var Ri=()=>{};function yo(t,e,r){var i,n;if(arguments.length===2?(r=e,e=Si):e==null?e=Si:gc(e,"options"),bc(r,"callback"),pc(e.signal,"options.signal"),r=Ii(r),Ec(t)||Sc(t))return Nc(t,e,r);if(!Ic(t))throw new _c("stream",["ReadableStream","WritableStream","Stream"],t);let s=(i=e.readable)!==null&&i!==void 0?i:Ei(t),o=(n=e.writable)!==null&&n!==void 0?n:ho(t),a=t._writableState,l=t._readableState,u=()=>{t.writable||b()},f=Rc(t)&&Ei(t)===s&&ho(t)===o,c=_o(t,!1),b=()=>{c=!0,t.destroyed&&(f=!1),!(f&&(!t.readable||s))&&(!s||d)&&r.call(t)},d=uo(t,!1),_=()=>{d=!0,t.destroyed&&(f=!1),!(f&&(!t.writable||o))&&(!o||c)&&r.call(t)},p=w=>{r.call(t,w)},y=xc(t),m=()=>{y=!0;let w=po(t)||fo(t);if(w&&typeof w!="boolean")return r.call(t,w);if(s&&!d&&Ei(t,!0)&&!uo(t,!1))return r.call(t,new ao);if(o&&!c&&!_o(t,!1))return r.call(t,new ao);r.call(t)},R=()=>{y=!0;let w=po(t)||fo(t);if(w&&typeof w!="boolean")return r.call(t,w);r.call(t)},S=()=>{t.req.on("finish",b)};Ac(t)?(t.on("complete",b),f||t.on("abort",m),t.req?S():t.on("request",S)):o&&!a&&(t.on("end",u),t.on("close",u)),!f&&typeof t.aborted=="boolean"&&t.on("aborted",m),t.on("end",_),t.on("finish",b),e.error!==!1&&t.on("error",p),t.on("close",m),y?De.nextTick(m):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?f||De.nextTick(R):(!s&&(!f||lo(t))&&(c||co(t)===!1)||!o&&(!f||co(t))&&(d||lo(t)===!1)||l&&t.req&&t.aborted)&&De.nextTick(R);let g=()=>{r=Ri,t.removeListener("aborted",m),t.removeListener("complete",b),t.removeListener("abort",m),t.removeListener("request",S),t.req&&t.req.removeListener("finish",b),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",b),t.removeListener("end",_),t.removeListener("error",p),t.removeListener("close",m)};if(e.signal&&!y){let w=()=>{let A=r;g(),A.call(t,new bo(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)De.nextTick(w);else{mt=mt||G().addAbortListener;let A=mt(e.signal,w),C=r;r=Ii((...be)=>{A[go](),C.apply(t,be)})}}return g}function Nc(t,e,r){let i=!1,n=Ri;if(e.signal)if(n=()=>{i=!0,r.call(t,new bo(void 0,{cause:e.signal.reason}))},e.signal.aborted)De.nextTick(n);else{mt=mt||G().addAbortListener;let o=mt(e.signal,n),a=r;r=Ii((...l)=>{o[go](),a.apply(t,l)})}let s=(...o)=>{i||De.nextTick(()=>r.apply(t,o))};return mc(t[Tc].promise,s,s),Ri}function vc(t,e){var r;let i=!1;return e===null&&(e=Si),(r=e)!==null&&r!==void 0&&r.cleanup&&(yc(e.cleanup,"cleanup"),i=e.cleanup),new wc((n,s)=>{let o=yo(t,e,a=>{i&&o(),a?s(a):n()})})}Ti.exports=yo;Ti.exports.finished=vc});var Ze=I((Yp,To)=>{"use strict";var ce=Ce(),{aggregateTwoErrors:Pc,codes:{ERR_MULTIPLE_CALLBACK:jc},AbortError:Lc}=U(),{Symbol:xo}=P(),{kIsDestroyed:Fc,isDestroyed:Bc,isFinished:Cc,isServerRequest:Dc}=fe(),Eo=xo("kDestroy"),Ai=xo("kConstruct");function So(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Oc(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(So(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?wo(this,t,e):this.once(Eo,function(s){wo(this,Pc(s,t),e)}),this)}function wo(t,e,r){let i=!1;function n(s){if(i)return;i=!0;let o=t._readableState,a=t._writableState;So(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?ce.nextTick(Mc,t,s):ce.nextTick(Io,t)}try{t._destroy(e||null,n)}catch(s){n(s)}}function Mc(t,e){Ni(t,e),Io(t)}function Io(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function Ni(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function $c(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function vi(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?ce.nextTick(Ni,t,e):Ni(t,e))}function kc(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(Ai,e),!(t.listenerCount(Ai)>1)&&ce.nextTick(qc,t)}function qc(t){let e=!1;function r(i){if(e){vi(t,i!=null?i:new jc);return}e=!0;let n=t._readableState,s=t._writableState,o=s||n;n&&(n.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(Eo,i):i?vi(t,i,!0):ce.nextTick(Uc,t)}try{t._construct(i=>{ce.nextTick(r,i)})}catch(i){ce.nextTick(r,i)}}function Uc(t){t.emit(Ai)}function mo(t){return(t==null?void 0:t.setHeader)&&typeof t.abort=="function"}function Ro(t){t.emit("close")}function Wc(t,e){t.emit("error",e),ce.nextTick(Ro,t)}function Gc(t,e){!t||Bc(t)||(!e&&!Cc(t)&&(e=new Lc),Dc(t)?(t.socket=null,t.destroy(e)):mo(t)?t.abort():mo(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ce.nextTick(Wc,t,e):ce.nextTick(Ro,t),t.destroyed||(t[Fc]=!0))}To.exports={construct:kc,destroyer:Gc,destroy:Oc,undestroy:$c,errorOrDestroy:vi}});var Ir=I((Zp,No)=>{"use strict";var{ArrayIsArray:Vc,ObjectSetPrototypeOf:Ao}=P(),{EventEmitter:Er}=Mt();function Sr(t){Er.call(this,t)}Ao(Sr.prototype,Er.prototype);Ao(Sr,Er);Sr.prototype.pipe=function(t,e){let r=this;function i(f){t.writable&&t.write(f)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(f){u(),Er.listenerCount(this,"error")===0&&this.emit("error",f)}Pi(r,"error",l),Pi(t,"error",l);function u(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t};function Pi(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Vc(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}No.exports={Stream:Sr,prependListener:Pi}});var $t=I((Xp,Rr)=>{"use strict";var{SymbolDispose:Qc}=P(),{AbortError:vo,codes:Hc}=U(),{isNodeStream:Po,isWebStream:zc,kControllerErrorFunction:Kc}=fe(),Yc=Re(),{ERR_INVALID_ARG_TYPE:jo}=Hc,ji,Zc=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new jo(e,"AbortSignal",t)};Rr.exports.addAbortSignal=function(e,r){if(Zc(e,"signal"),!Po(r)&&!zc(r))throw new jo("stream",["ReadableStream","WritableStream","Stream"],r);return Rr.exports.addAbortSignalNoValidate(e,r)};Rr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=Po(e)?()=>{e.destroy(new vo(void 0,{cause:t.reason}))}:()=>{e[Kc](new vo(void 0,{cause:t.reason}))};if(t.aborted)r();else{ji=ji||G().addAbortListener;let i=ji(t,r);Yc(e,i[Qc])}return e}});var Bo=I((eb,Fo)=>{"use strict";var{StringPrototypeSlice:Lo,SymbolIterator:Xc,TypedArrayPrototypeSet:Tr,Uint8Array:Jc}=P(),{Buffer:Li}=se(),{inspect:ed}=G();Fo.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return Li.alloc(0);let r=Li.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)Tr(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Xc](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let s=i.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=Lo(s,0,e),this.head=i,i.data=Lo(s,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=Li.allocUnsafe(e),i=e,n=this.head,s=0;do{let o=n.data;if(e>o.length)Tr(r,o,i-e),e-=o.length;else{e===o.length?(Tr(r,o,i-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(Tr(r,new Jc(o.buffer,o.byteOffset,e),i-e),this.head=n,n.data=o.slice(e));break}++s}while((n=n.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return ed(this,Pe(D({},r),{depth:0,customInspect:!1}))}}});var kt=I((rb,Mo)=>{"use strict";var{MathFloor:td,NumberIsInteger:rd}=P(),{validateInteger:id}=yt(),{ERR_INVALID_ARG_VALUE:nd}=U().codes,Co=16*1024,Do=16;function sd(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Oo(t){return t?Do:Co}function od(t,e){id(e,"value",0),t?Do=e:Co=e}function ad(t,e,r,i){let n=sd(e,i,r);if(n!=null){if(!rd(n)||n<0){let s=i?`options.${r}`:"options.highWaterMark";throw new nd(s,n)}return td(n)}return Oo(t.objectMode)}Mo.exports={getHighWaterMark:ad,getDefaultHighWaterMark:Oo,setDefaultHighWaterMark:od}});var qo=I((Fi,ko)=>{var Ar=se(),de=Ar.Buffer;function $o(t,e){for(var r in t)e[r]=t[r]}de.from&&de.alloc&&de.allocUnsafe&&de.allocUnsafeSlow?ko.exports=Ar:($o(Ar,Fi),Fi.Buffer=Xe);function Xe(t,e,r){return de(t,e,r)}Xe.prototype=Object.create(de.prototype);$o(de,Xe);Xe.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return de(t,e,r)};Xe.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=de(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Xe.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return de(t)};Xe.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ar.SlowBuffer(t)}});var Go=I(Wo=>{"use strict";var Ci=qo().Buffer,Uo=Ci.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ld(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function ud(t){var e=ld(t);if(typeof e!="string"&&(Ci.isEncoding===Uo||!Uo(t)))throw new Error("Unknown encoding: "+t);return e||t}Wo.StringDecoder=qt;function qt(t){this.encoding=ud(t);var e;switch(this.encoding){case"utf16le":this.text=pd,this.end=bd,e=4;break;case"utf8":this.fillLast=dd,e=4;break;case"base64":this.text=gd,this.end=yd,e=3;break;default:this.write=wd,this.end=md;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ci.allocUnsafe(e)}qt.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};qt.prototype.end=_d;qt.prototype.text=hd;qt.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Bi(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function fd(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Bi(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Bi(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Bi(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function cd(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function dd(t){var e=this.lastTotal-this.lastNeed,r=cd(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function hd(t,e){var r=fd(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function _d(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function pd(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function bd(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function gd(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function yd(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function wd(t){return t.toString(this.encoding)}function md(t){return t&&t.length?this.write(t):""}});var Di=I((nb,zo)=>{"use strict";var Vo=Ce(),{PromisePrototypeThen:xd,SymbolAsyncIterator:Qo,SymbolIterator:Ho}=P(),{Buffer:Ed}=se(),{ERR_INVALID_ARG_TYPE:Sd,ERR_STREAM_NULL_VALUES:Id}=U().codes;function Rd(t,e,r){let i;if(typeof e=="string"||e instanceof Ed)return new t(Pe(D({objectMode:!0},r),{read(){this.push(e),this.push(null)}}));let n;if(e&&e[Qo])n=!0,i=e[Qo]();else if(e&&e[Ho])n=!1,i=e[Ho]();else throw new Sd("iterable",["Iterable"],e);let s=new t(D({objectMode:!0,highWaterMark:1},r)),o=!1;s._read=function(){o||(o=!0,l())},s._destroy=function(u,f){xd(a(u),()=>Vo.nextTick(f,u),c=>Vo.nextTick(f,c||u))};async function a(u){let f=u!=null,c=typeof i.throw=="function";if(f&&c){let{value:b,done:d}=await i.throw(u);if(await b,d)return}if(typeof i.return=="function"){let{value:b}=await i.return();await b}}async function l(){for(;;){try{let{value:u,done:f}=n?await i.next():i.next();if(f)s.push(null);else{let c=u&&typeof u.then=="function"?await u:u;if(c===null)throw o=!1,new Id;if(s.push(c))continue;o=!1}}catch(u){s.destroy(u)}break}}return s}zo.exports=Rd});var Wt=I((ob,da)=>{"use strict";var ee=Ce(),{ArrayPrototypeIndexOf:Td,NumberIsInteger:Ad,NumberIsNaN:Nd,NumberParseInt:vd,ObjectDefineProperties:Gi,ObjectKeys:Pd,ObjectSetPrototypeOf:Zo,Promise:Xo,SafeSet:jd,SymbolAsyncDispose:Ld,SymbolAsyncIterator:Fd,Symbol:Bd}=P();da.exports=x;x.ReadableState=jr;var{EventEmitter:Cd}=Mt(),{Stream:Oe,prependListener:Dd}=Ir(),{Buffer:Oi}=se(),{addAbortSignal:Od}=$t(),Jo=Re(),E=G().debuglog("stream",t=>{E=t}),Md=Bo(),St=Ze(),{getHighWaterMark:$d,getDefaultHighWaterMark:kd}=kt(),{aggregateTwoErrors:Ko,codes:{ERR_INVALID_ARG_TYPE:qd,ERR_METHOD_NOT_IMPLEMENTED:Ud,ERR_OUT_OF_RANGE:Wd,ERR_STREAM_PUSH_AFTER_EOF:Gd,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Vd},AbortError:Qd}=U(),{validateObject:Hd}=yt(),Je=Bd("kPaused"),{StringDecoder:ea}=Go(),zd=Di();Zo(x.prototype,Oe.prototype);Zo(x,Oe);var Mi=()=>{},{errorOrDestroy:xt}=St,Et=1,Kd=2,ta=4,Ut=8,ra=16,Nr=32,vr=64,ia=128,Yd=256,Zd=512,Xd=1024,Ui=2048,Wi=4096,Jd=8192,eh=16384,th=32768,na=65536,rh=1<<17,ih=1<<18;function O(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}Gi(jr.prototype,{objectMode:O(Et),ended:O(Kd),endEmitted:O(ta),reading:O(Ut),constructed:O(ra),sync:O(Nr),needReadable:O(vr),emittedReadable:O(ia),readableListening:O(Yd),resumeScheduled:O(Zd),errorEmitted:O(Xd),emitClose:O(Ui),autoDestroy:O(Wi),destroyed:O(Jd),closed:O(eh),closeEmitted:O(th),multiAwaitDrain:O(na),readingMore:O(rh),dataEmitted:O(ih)});function jr(t,e,r){typeof r!="boolean"&&(r=e instanceof he()),this.state=Ui|Wi|ra|Nr,t&&t.objectMode&&(this.state|=Et),r&&t&&t.readableObjectMode&&(this.state|=Et),this.highWaterMark=t?$d(this,t,"readableHighWaterMark",r):kd(!1),this.buffer=new Md,this.length=0,this.pipes=[],this.flowing=null,this[Je]=null,t&&t.emitClose===!1&&(this.state&=~Ui),t&&t.autoDestroy===!1&&(this.state&=~Wi),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new ea(t.encoding),this.encoding=t.encoding)}function x(t){if(!(this instanceof x))return new x(t);let e=this instanceof he();this._readableState=new jr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Od(t.signal,this)),Oe.call(this,t),St.construct(this,()=>{this._readableState.needReadable&&Pr(this,this._readableState)})}x.prototype.destroy=St.destroy;x.prototype._undestroy=St.undestroy;x.prototype._destroy=function(t,e){e(t)};x.prototype[Cd.captureRejectionSymbol]=function(t){this.destroy(t)};x.prototype[Ld]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Qd,this.destroy(t)),new Xo((e,r)=>Jo(this,i=>i&&i!==t?r(i):e(null)))};x.prototype.push=function(t,e){return sa(this,t,e,!1)};x.prototype.unshift=function(t,e){return sa(this,t,e,!0)};function sa(t,e,r,i){E("readableAddChunk",e);let n=t._readableState,s;if((n.state&Et)===0&&(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=Oi.from(e,r).toString(n.encoding):(e=Oi.from(e,r),r=""))):e instanceof Oi?r="":Oe._isUint8Array(e)?(e=Oe._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new qd("chunk",["string","Buffer","Uint8Array"],e))),s)xt(t,s);else if(e===null)n.state&=~Ut,oh(t,n);else if((n.state&Et)!==0||e&&e.length>0)if(i)if((n.state&ta)!==0)xt(t,new Vd);else{if(n.destroyed||n.errored)return!1;$i(t,n,e,!0)}else if(n.ended)xt(t,new Gd);else{if(n.destroyed||n.errored)return!1;n.state&=~Ut,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?$i(t,n,e,!1):Pr(t,n)):$i(t,n,e,!1)}else i||(n.state&=~Ut,Pr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function $i(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&na)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),(e.state&vr)!==0&&Lr(t)),Pr(t,e)}x.prototype.isPaused=function(){let t=this._readableState;return t[Je]===!0||t.flowing===!1};x.prototype.setEncoding=function(t){let e=new ea(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var nh=1073741824;function sh(t){if(t>nh)throw new Wd("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Yo(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Et)!==0?1:Nd(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}x.prototype.read=function(t){E("read",t),t===void 0?t=NaN:Ad(t)||(t=vd(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=sh(t)),t!==0&&(e.state&=~ia),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return E("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ki(this):Lr(this),null;if(t=Yo(t,e),t===0&&e.ended)return e.length===0&&ki(this),null;let i=(e.state&vr)!==0;if(E("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,E("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,E("reading, ended or constructing",i);else if(i){E("do read"),e.state|=Ut|Nr,e.length===0&&(e.state|=vr);try{this._read(e.highWaterMark)}catch(s){xt(this,s)}e.state&=~Nr,e.reading||(t=Yo(r,e))}let n;return t>0?n=fa(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ki(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function oh(t,e){if(E("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Lr(t):(e.needReadable=!1,e.emittedReadable=!0,oa(t))}}function Lr(t){let e=t._readableState;E("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(E("emitReadable",e.flowing),e.emittedReadable=!0,ee.nextTick(oa,t))}function oa(t){let e=t._readableState;E("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,la(t)}function Pr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ee.nextTick(ah,t,e))}function ah(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(E("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}x.prototype._read=function(t){throw new Ud("_read()")};x.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new jd(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),E("pipe count=%d opts=%j",i.pipes.length,e);let s=(!e||e.end!==!1)&&t!==ee.stdout&&t!==ee.stderr?a:y;i.endEmitted?ee.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(m,R){E("onunpipe"),m===r&&R&&R.hasUnpiped===!1&&(R.hasUnpiped=!0,f())}function a(){E("onend"),t.end()}let l,u=!1;function f(){E("cleanup"),t.removeListener("close",_),t.removeListener("finish",p),l&&t.removeListener("drain",l),t.removeListener("error",d),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",b),u=!0,l&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function c(){u||(i.pipes.length===1&&i.pipes[0]===t?(E("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(E("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),l||(l=lh(r,t),t.on("drain",l))}r.on("data",b);function b(m){E("ondata");let R=t.write(m);E("dest.write",R),R===!1&&c()}function d(m){if(E("onerror",m),y(),t.removeListener("error",d),t.listenerCount("error")===0){let R=t._writableState||t._readableState;R&&!R.errorEmitted?xt(t,m):t.emit("error",m)}}Dd(t,"error",d);function _(){t.removeListener("finish",p),y()}t.once("close",_);function p(){E("onfinish"),t.removeListener("close",_),y()}t.once("finish",p);function y(){E("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?c():i.flowing||(E("pipe resume"),r.resume()),t};function lh(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(E("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(E("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}x.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let s=0;s<n.length;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}let i=Td(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};x.prototype.on=function(t,e){let r=Oe.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,E("on readable",i.length,i.reading),i.length?Lr(this):i.reading||ee.nextTick(uh,this)),r};x.prototype.addListener=x.prototype.on;x.prototype.removeListener=function(t,e){let r=Oe.prototype.removeListener.call(this,t,e);return t==="readable"&&ee.nextTick(aa,this),r};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(t){let e=Oe.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ee.nextTick(aa,this),e};function aa(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Je]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function uh(t){E("readable nexttick read 0"),t.read(0)}x.prototype.resume=function(){let t=this._readableState;return t.flowing||(E("resume"),t.flowing=!t.readableListening,fh(this,t)),t[Je]=!1,this};function fh(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ee.nextTick(ch,t,e))}function ch(t,e){E("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),la(t),e.flowing&&!e.reading&&t.read(0)}x.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Je]=!0,this};function la(t){let e=t._readableState;for(E("flow",e.flowing);e.flowing&&t.read()!==null;);}x.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{xt(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Pd(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};x.prototype[Fd]=function(){return ua(this)};x.prototype.iterator=function(t){return t!==void 0&&Hd(t,"options"),ua(this,t)};function ua(t,e){typeof t.read!="function"&&(t=x.wrap(t,{objectMode:!0}));let r=dh(t,e);return r.stream=t,r}function dh(t,e){return Y(this,null,function*(){let r=Mi;function i(o){this===t?(r(),r=Mi):r=o}t.on("readable",i);let n,s=Jo(t,{writable:!1},o=>{n=o?Ko(n,o):null,r(),r=Mi});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(n)throw n;if(n===null)return;yield new k(new Xo(i))}}}catch(o){throw n=Ko(n,o),n}finally{(n||(e==null?void 0:e.destroyOnReturn)!==!1)&&(n===void 0||t._readableState.autoDestroy)?St.destroyer(t,null):(t.off("readable",i),s())}})}Gi(x.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});Gi(jr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Je]!==!1},set(t){this[Je]=!!t}}});x._fromList=fa;function fa(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function ki(t){let e=t._readableState;E("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ee.nextTick(hh,e,t))}function hh(t,e){if(E("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ee.nextTick(_h,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function _h(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}x.from=function(t,e){return zd(x,t,e)};var qi;function ca(){return qi===void 0&&(qi={}),qi}x.fromWeb=function(t,e){return ca().newStreamReadableFromReadableStream(t,e)};x.toWeb=function(t,e){return ca().newReadableStreamFromStreamReadable(t,e)};x.wrap=function(t,e){var r,i;return new x(Pe(D({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0},e),{destroy(n,s){St.destroyer(t,n),s(n)}})).wrap(t)}});var Or=I((lb,Ia)=>{"use strict";var et=Ce(),{ArrayPrototypeSlice:pa,Error:ph,FunctionPrototypeSymbolHasInstance:ba,ObjectDefineProperty:ga,ObjectDefineProperties:bh,ObjectSetPrototypeOf:ya,StringPrototypeToLowerCase:gh,Symbol:yh,SymbolHasInstance:wh}=P();Ia.exports=j;j.WritableState=Qt;var{EventEmitter:mh}=Mt(),Gt=Ir().Stream,{Buffer:Fr}=se(),Dr=Ze(),{addAbortSignal:xh}=$t(),{getHighWaterMark:Eh,getDefaultHighWaterMark:Sh}=kt(),{ERR_INVALID_ARG_TYPE:Ih,ERR_METHOD_NOT_IMPLEMENTED:Rh,ERR_MULTIPLE_CALLBACK:wa,ERR_STREAM_CANNOT_PIPE:Th,ERR_STREAM_DESTROYED:Vt,ERR_STREAM_ALREADY_FINISHED:Ah,ERR_STREAM_NULL_VALUES:Nh,ERR_STREAM_WRITE_AFTER_END:vh,ERR_UNKNOWN_ENCODING:ma}=U().codes,{errorOrDestroy:It}=Dr;ya(j.prototype,Gt.prototype);ya(j,Gt);function Hi(){}var Rt=yh("kOnFinished");function Qt(t,e,r){typeof r!="boolean"&&(r=e instanceof he()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Eh(this,t,"writableHighWaterMark",r):Sh(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=jh.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Cr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Rt]=[]}function Cr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Qt.prototype.getBuffer=function(){return pa(this.buffered,this.bufferedIndex)};ga(Qt.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function j(t){let e=this instanceof he();if(!e&&!ba(j,this))return new j(t);this._writableState=new Qt(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&xh(t.signal,this)),Gt.call(this,t),Dr.construct(this,()=>{let r=this._writableState;r.writing||Ki(this,r),Yi(this,r)})}ga(j,wh,{__proto__:null,value:function(t){return ba(this,t)?!0:this!==j?!1:t&&t._writableState instanceof Qt}});j.prototype.pipe=function(){It(this,new Th)};function xa(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!Fr.isEncoding(r))throw new ma(r);typeof i!="function"&&(i=Hi)}if(e===null)throw new Nh;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=Fr.from(e,r),r="buffer");else if(e instanceof Fr)r="buffer";else if(Gt._isUint8Array(e))e=Gt._uint8ArrayToBuffer(e),r="buffer";else throw new Ih("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new vh:n.destroyed&&(s=new Vt("write")),s?(et.nextTick(i,s),It(t,s,!0),s):(n.pendingcb++,Ph(t,n,e,r,i))}j.prototype.write=function(t,e,r){return xa(this,t,e,r)===!0};j.prototype.cork=function(){this._writableState.corked++};j.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ki(this,t))};j.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=gh(e)),!Fr.isEncoding(e))throw new ma(e);return this._writableState.defaultEncoding=e,this};function Ph(t,e,r,i,n){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==Hi&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function ha(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Vt("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function _a(t,e,r,i){--e.pendingcb,i(r),zi(e),It(t,r)}function jh(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){It(t,new wa);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?et.nextTick(_a,t,r,e,n):_a(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&Ki(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},et.nextTick(Lh,r.afterWriteTickInfo)):Ea(t,r,1,n))}function Lh({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,Ea(t,e,r,i)}function Ea(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&zi(e),Yi(t,e)}function zi(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:s,callback:o}=t.buffered[n],a=t.objectMode?1:s.length;t.length-=a,o((e=t.errored)!==null&&e!==void 0?e:new Vt("write"))}let r=t[Rt].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new Vt("end"))}Cr(t)}function Ki(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,s=r.length-i;if(!s)return;let o=i;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?Hi:u=>{for(let f=o;f<r.length;++f)r[f].callback(u)},l=e.allNoop&&o===0?r:pa(r,o);l.allBuffers=e.allBuffers,ha(t,e,!0,e.length,l,"",a),Cr(e)}else{do{let{chunk:a,encoding:l,callback:u}=r[o];r[o++]=null;let f=n?1:a.length;ha(t,e,!1,f,a,l,u)}while(o<r.length&&!e.writing);o===r.length?Cr(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}j.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new Rh("_write()")};j.prototype._writev=null;j.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let s=xa(this,t,e);s instanceof ph&&(n=s)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,Yi(this,i,!0),i.ended=!0):i.finished?n=new Ah("end"):i.destroyed&&(n=new Vt("end"))),typeof r=="function"&&(n||i.finished?et.nextTick(r,n):i[Rt].push(r)),this};function Br(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function Fh(t,e){let r=!1;function i(n){if(r){It(t,n!=null?n:wa());return}if(r=!0,e.pendingcb--,n){let s=e[Rt].splice(0);for(let o=0;o<s.length;o++)s[o](n);It(t,n,e.sync)}else Br(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,et.nextTick(Qi,t,e))}e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}function Bh(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Fh(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Yi(t,e,r){Br(e)&&(Bh(t,e),e.pendingcb===0&&(r?(e.pendingcb++,et.nextTick((i,n)=>{Br(n)?Qi(i,n):n.pendingcb--},t,e)):Br(e)&&(e.pendingcb++,Qi(t,e))))}function Qi(t,e){e.pendingcb--,e.finished=!0;let r=e[Rt].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}bh(j.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Ch=Dr.destroy;j.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Rt].length)&&et.nextTick(zi,r),Ch.call(this,t,e),this};j.prototype._undestroy=Dr.undestroy;j.prototype._destroy=function(t,e){e(t)};j.prototype[mh.captureRejectionSymbol]=function(t){this.destroy(t)};var Vi;function Sa(){return Vi===void 0&&(Vi={}),Vi}j.fromWeb=function(t,e){return Sa().newStreamWritableFromWritableStream(t,e)};j.toWeb=function(t){return Sa().newWritableStreamFromStreamWritable(t)}});var $a=I((ub,Ma)=>{var Zi=Ce(),Dh=se(),{isReadable:Oh,isWritable:Mh,isIterable:Ra,isNodeStream:$h,isReadableNodeStream:Ta,isWritableNodeStream:Aa,isDuplexNodeStream:kh,isReadableStream:Na,isWritableStream:va}=fe(),Pa=Re(),{AbortError:Da,codes:{ERR_INVALID_ARG_TYPE:qh,ERR_INVALID_RETURN_VALUE:ja}}=U(),{destroyer:At}=Ze(),Uh=he(),Oa=Wt(),Wh=Or(),{createDeferredPromise:La}=G(),Fa=Di(),Ba=globalThis.Blob||Dh.Blob,Gh=typeof Ba!="undefined"?function(e){return e instanceof Ba}:function(e){return!1},Vh=globalThis.AbortController||pt().AbortController,{FunctionPrototypeCall:Ca}=P(),Me=class extends Uh{constructor(e){super(e),(e==null?void 0:e.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(e==null?void 0:e.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Ma.exports=function t(e,r){if(kh(e))return e;if(Ta(e))return Tt({readable:e});if(Aa(e))return Tt({writable:e});if($h(e))return Tt({writable:!1,readable:!1});if(Na(e))return Tt({readable:Oa.fromWeb(e)});if(va(e))return Tt({writable:Wh.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:o,destroy:a}=Qh(e);if(Ra(n))return Fa(Me,n,{objectMode:!0,write:s,final:o,destroy:a});let l=n==null?void 0:n.then;if(typeof l=="function"){let u,f=Ca(l,n,c=>{if(c!=null)throw new ja("nully","body",c)},c=>{At(u,c)});return u=new Me({objectMode:!0,readable:!1,write:s,final(c){o(async()=>{try{await f,Zi.nextTick(c,null)}catch(b){Zi.nextTick(c,b)}})},destroy:a})}throw new ja("Iterable, AsyncIterable or AsyncFunction",r,n)}if(Gh(e))return t(e.arrayBuffer());if(Ra(e))return Fa(Me,e,{objectMode:!0,writable:!1});if(Na(e==null?void 0:e.readable)&&va(e==null?void 0:e.writable))return Me.fromWeb(e);if(typeof(e==null?void 0:e.writable)=="object"||typeof(e==null?void 0:e.readable)=="object"){let n=e!=null&&e.readable?Ta(e==null?void 0:e.readable)?e==null?void 0:e.readable:t(e.readable):void 0,s=e!=null&&e.writable?Aa(e==null?void 0:e.writable)?e==null?void 0:e.writable:t(e.writable):void 0;return Tt({readable:n,writable:s})}let i=e==null?void 0:e.then;if(typeof i=="function"){let n;return Ca(i,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{At(n,s)}),n=new Me({objectMode:!0,writable:!1,read(){}})}throw new qh(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Qh(t){let{promise:e,resolve:r}=La(),i=new Vh,n=i.signal;return{value:t((function(){return Y(this,null,function*(){for(;;){let o=e;e=null;let{chunk:a,done:l,cb:u}=yield new k(o);if(Zi.nextTick(u),l)return;if(n.aborted)throw new Da(void 0,{cause:n.reason});({promise:e,resolve:r}=La()),yield a}})})(),{signal:n}),write(o,a,l){let u=r;r=null,u({chunk:o,done:!1,cb:l})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){i.abort(),a(o)}}}function Tt(t){let e=t.readable&&typeof t.readable.read!="function"?Oa.wrap(t.readable):t.readable,r=t.writable,i=!!Oh(e),n=!!Mh(r),s,o,a,l,u;function f(c){let b=l;l=null,b?b(c):c&&u.destroy(c)}return u=new Me({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(Pa(r,c=>{n=!1,c&&At(e,c),f(c)}),u._write=function(c,b,d){r.write(c,b)?d():s=d},u._final=function(c){r.end(),o=c},r.on("drain",function(){if(s){let c=s;s=null,c()}}),r.on("finish",function(){if(o){let c=o;o=null,c()}})),i&&(Pa(e,c=>{i=!1,c&&At(e,c),f(c)}),e.on("readable",function(){if(a){let c=a;a=null,c()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let c=e.read();if(c===null){a=u._read;return}if(!u.push(c))return}}),u._destroy=function(c,b){!c&&l!==null&&(c=new Da),a=null,s=null,o=null,l===null?b(c):(l=b,At(r,c),At(e,c))},u}});var he=I((cb,Ua)=>{"use strict";var{ObjectDefineProperties:Hh,ObjectGetOwnPropertyDescriptor:Te,ObjectKeys:zh,ObjectSetPrototypeOf:ka}=P();Ua.exports=te;var en=Wt(),J=Or();ka(te.prototype,en.prototype);ka(te,en);{let t=zh(J.prototype);for(let e=0;e<t.length;e++){let r=t[e];te.prototype[r]||(te.prototype[r]=J.prototype[r])}}function te(t){if(!(this instanceof te))return new te(t);en.call(this,t),J.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}Hh(te.prototype,{writable:D({__proto__:null},Te(J.prototype,"writable")),writableHighWaterMark:D({__proto__:null},Te(J.prototype,"writableHighWaterMark")),writableObjectMode:D({__proto__:null},Te(J.prototype,"writableObjectMode")),writableBuffer:D({__proto__:null},Te(J.prototype,"writableBuffer")),writableLength:D({__proto__:null},Te(J.prototype,"writableLength")),writableFinished:D({__proto__:null},Te(J.prototype,"writableFinished")),writableCorked:D({__proto__:null},Te(J.prototype,"writableCorked")),writableEnded:D({__proto__:null},Te(J.prototype,"writableEnded")),writableNeedDrain:D({__proto__:null},Te(J.prototype,"writableNeedDrain")),destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Xi;function qa(){return Xi===void 0&&(Xi={}),Xi}te.fromWeb=function(t,e){return qa().newStreamDuplexFromReadableWritablePair(t,e)};te.toWeb=function(t){return qa().newReadableWritablePairFromDuplex(t)};var Ji;te.from=function(t){return Ji||(Ji=$a()),Ji(t,"body")}});var nn=I((hb,Ga)=>{"use strict";var{ObjectSetPrototypeOf:Wa,Symbol:Kh}=P();Ga.exports=Ae;var{ERR_METHOD_NOT_IMPLEMENTED:Yh}=U().codes,rn=he(),{getHighWaterMark:Zh}=kt();Wa(Ae.prototype,rn.prototype);Wa(Ae,rn);var Ht=Kh("kCallback");function Ae(t){if(!(this instanceof Ae))return new Ae(t);let e=t?Zh(this,t,"readableHighWaterMark",!0):null;e===0&&(t=Pe(D({},t),{highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0})),rn.call(this,t),this._readableState.sync=!1,this[Ht]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Xh)}function tn(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function Xh(){this._final!==tn&&tn.call(this)}Ae.prototype._final=tn;Ae.prototype._transform=function(t,e,r){throw new Yh("_transform()")};Ae.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,s=i.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),n.ended||s===i.length||i.length<i.highWaterMark?r():this[Ht]=r})};Ae.prototype._read=function(){if(this[Ht]){let t=this[Ht];this[Ht]=null,t()}}});var on=I((pb,Qa)=>{"use strict";var{ObjectSetPrototypeOf:Va}=P();Qa.exports=Nt;var sn=nn();Va(Nt.prototype,sn.prototype);Va(Nt,sn);function Nt(t){if(!(this instanceof Nt))return new Nt(t);sn.call(this,t)}Nt.prototype._transform=function(t,e,r){r(null,t)}});var qr=I((bb,Za)=>{var zt=Ce(),{ArrayIsArray:Jh,Promise:e_,SymbolAsyncIterator:t_,SymbolDispose:r_}=P(),kr=Re(),{once:i_}=G(),n_=Ze(),Ha=he(),{aggregateTwoErrors:s_,codes:{ERR_INVALID_ARG_TYPE:pn,ERR_INVALID_RETURN_VALUE:an,ERR_MISSING_ARGS:o_,ERR_STREAM_DESTROYED:a_,ERR_STREAM_PREMATURE_CLOSE:l_},AbortError:u_}=U(),{validateFunction:f_,validateAbortSignal:c_}=yt(),{isIterable:tt,isReadable:ln,isReadableNodeStream:$r,isNodeStream:za,isTransformStream:vt,isWebStream:d_,isReadableStream:un,isReadableFinished:h_}=fe(),__=globalThis.AbortController||pt().AbortController,fn,cn,dn;function Ka(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=kr(t,{readable:e,writable:r},s=>{i=!s});return{destroy:s=>{i||(i=!0,n_.destroyer(t,s||new a_("pipe")))},cleanup:n}}function p_(t){return f_(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function hn(t){if(tt(t))return t;if($r(t))return b_(t);throw new pn("val",["Readable","Iterable","AsyncIterable"],t)}function b_(t){return Y(this,null,function*(){cn||(cn=Wt()),yield*re(cn.prototype[t_].call(t))})}async function Mr(t,e,r,{end:i}){let n,s=null,o=d=>{if(d&&(n=d),s){let _=s;s=null,_()}},a=()=>new e_((d,_)=>{n?_(n):s=()=>{n?_(n):d()}});e.on("drain",o);let l=kr(e,{readable:!1},o);try{e.writableNeedDrain&&await a();try{for(var u=Q(t),f,c,b;f=!(c=await u.next()).done;f=!1){let d=c.value;e.write(d)||await a()}}catch(c){b=[c]}finally{try{f&&(c=u.return)&&await c.call(u)}finally{if(b)throw b[0]}}i&&(e.end(),await a()),r()}catch(d){r(n!==d?s_(n,d):d)}finally{l(),e.off("drain",o)}}async function _n(t,e,r,{end:i}){vt(e)&&(e=e.writable);let n=e.getWriter();try{try{for(var s=Q(t),o,a,l;o=!(a=await s.next()).done;o=!1){let u=a.value;await n.ready,n.write(u).catch(()=>{})}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&await a.call(s)}finally{if(l)throw l[0]}}await n.ready,i&&await n.close(),r()}catch(u){try{await n.abort(u),r(u)}catch(f){r(f)}}}function g_(...t){return Ya(t,i_(p_(t)))}function Ya(t,e,r){if(t.length===1&&Jh(t[0])&&(t=t[0]),t.length<2)throw new o_("streams");let i=new __,n=i.signal,s=r==null?void 0:r.signal,o=[];c_(s,"options.signal");function a(){_(new u_)}dn=dn||G().addAbortListener;let l;s&&(l=dn(s,a));let u,f,c=[],b=0;function d(S){_(S,--b===0)}function _(S,g){var w;if(S&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=S),!(!u&&!g)){for(;c.length;)c.shift()(u);(w=l)===null||w===void 0||w[r_](),i.abort(),g&&(u||o.forEach(A=>A()),zt.nextTick(e,u,f))}}let p;for(let S=0;S<t.length;S++){let g=t[S],w=S<t.length-1,A=S>0,C=w||(r==null?void 0:r.end)!==!1,be=S===t.length-1;if(za(g)){let V=function(ge){ge&&ge.name!=="AbortError"&&ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&d(ge)};var R=V;if(C){let{destroy:ge,cleanup:Hr}=Ka(g,w,A);c.push(ge),ln(g)&&be&&o.push(Hr)}g.on("error",V),ln(g)&&be&&o.push(()=>{g.removeListener("error",V)})}if(S===0)if(typeof g=="function"){if(p=g({signal:n}),!tt(p))throw new an("Iterable, AsyncIterable or Stream","source",p)}else tt(g)||$r(g)||vt(g)?p=g:p=Ha.from(g);else if(typeof g=="function"){if(vt(p)){var y;p=hn((y=p)===null||y===void 0?void 0:y.readable)}else p=hn(p);if(p=g(p,{signal:n}),w){if(!tt(p,!0))throw new an("AsyncIterable",`transform[${S-1}]`,p)}else{var m;fn||(fn=on());let V=new fn({objectMode:!0}),ge=(m=p)===null||m===void 0?void 0:m.then;if(typeof ge=="function")b++,ge.call(p,ve=>{f=ve,ve!=null&&V.write(ve),C&&V.end(),zt.nextTick(d)},ve=>{V.destroy(ve),zt.nextTick(d,ve)});else if(tt(p,!0))b++,Mr(p,V,d,{end:C});else if(un(p)||vt(p)){let ve=p.readable||p;b++,Mr(ve,V,d,{end:C})}else throw new an("AsyncIterable or Promise","destination",p);p=V;let{destroy:Hr,cleanup:Pl}=Ka(p,!1,!0);c.push(Hr),be&&o.push(Pl)}}else if(za(g)){if($r(p)){b+=2;let V=y_(p,g,d,{end:C});ln(g)&&be&&o.push(V)}else if(vt(p)||un(p)){let V=p.readable||p;b++,Mr(V,g,d,{end:C})}else if(tt(p))b++,Mr(p,g,d,{end:C});else throw new pn("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=g}else if(d_(g)){if($r(p))b++,_n(hn(p),g,d,{end:C});else if(un(p)||tt(p))b++,_n(p,g,d,{end:C});else if(vt(p))b++,_n(p.readable,g,d,{end:C});else throw new pn("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],p);p=g}else p=Ha.from(g)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&zt.nextTick(a),p}function y_(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new l_)}),t.pipe(e,{end:!1}),i){let o=function(){n=!0,e.end()};var s=o;h_(t)?zt.nextTick(o):t.once("end",o)}else r();return kr(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),kr(e,{readable:!1,writable:!0},r)}Za.exports={pipelineImpl:Ya,pipeline:g_}});var gn=I((yb,il)=>{"use strict";var{pipeline:w_}=qr(),Ur=he(),{destroyer:m_}=Ze(),{isNodeStream:Wr,isReadable:Xa,isWritable:Ja,isWebStream:bn,isTransformStream:rt,isWritableStream:el,isReadableStream:tl}=fe(),{AbortError:x_,codes:{ERR_INVALID_ARG_VALUE:rl,ERR_MISSING_ARGS:E_}}=U(),S_=Re();il.exports=function(...e){if(e.length===0)throw new E_("streams");if(e.length===1)return Ur.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Ur.from(e[0])),typeof e[e.length-1]=="function"){let d=e.length-1;e[d]=Ur.from(e[d])}for(let d=0;d<e.length;++d)if(!(!Wr(e[d])&&!bn(e[d]))){if(d<e.length-1&&!(Xa(e[d])||tl(e[d])||rt(e[d])))throw new rl(`streams[${d}]`,r[d],"must be readable");if(d>0&&!(Ja(e[d])||el(e[d])||rt(e[d])))throw new rl(`streams[${d}]`,r[d],"must be writable")}let i,n,s,o,a;function l(d){let _=o;o=null,_?_(d):d?a.destroy(d):!b&&!c&&a.destroy()}let u=e[0],f=w_(e,l),c=!!(Ja(u)||el(u)||rt(u)),b=!!(Xa(f)||tl(f)||rt(f));if(a=new Ur({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(f!=null&&f.readableObjectMode),writable:c,readable:b}),c){if(Wr(u))a._write=function(_,p,y){u.write(_,p)?y():i=y},a._final=function(_){u.end(),n=_},u.on("drain",function(){if(i){let _=i;i=null,_()}});else if(bn(u)){let p=(rt(u)?u.writable:u).getWriter();a._write=async function(y,m,R){try{await p.ready,p.write(y).catch(()=>{}),R()}catch(S){R(S)}},a._final=async function(y){try{await p.ready,p.close().catch(()=>{}),n=y}catch(m){y(m)}}}let d=rt(f)?f.readable:f;S_(d,()=>{if(n){let _=n;n=null,_()}})}if(b){if(Wr(f))f.on("readable",function(){if(s){let d=s;s=null,d()}}),f.on("end",function(){a.push(null)}),a._read=function(){for(;;){let d=f.read();if(d===null){s=a._read;return}if(!a.push(d))return}};else if(bn(f)){let _=(rt(f)?f.readable:f).getReader();a._read=async function(){for(;;)try{let{value:p,done:y}=await _.read();if(!a.push(p))return;if(y){a.push(null);return}}catch(p){return}}}}return a._destroy=function(d,_){!d&&o!==null&&(d=new x_),s=null,i=null,n=null,o===null?_(d):(o=_,Wr(f)&&m_(f,d))},a}});var hl=I((wb,mn)=>{"use strict";var I_=globalThis.AbortController||pt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:R_,ERR_INVALID_ARG_TYPE:Kt,ERR_MISSING_ARGS:T_,ERR_OUT_OF_RANGE:A_},AbortError:_e}=U(),{validateAbortSignal:it,validateInteger:nl,validateObject:nt}=yt(),N_=P().Symbol("kWeak"),v_=P().Symbol("kResistStopPropagation"),{finished:P_}=Re(),j_=gn(),{addAbortSignalNoValidate:L_}=$t(),{isWritable:F_,isNodeStream:B_}=fe(),{deprecate:C_}=G(),{ArrayPrototypePush:D_,Boolean:O_,MathFloor:sl,Number:M_,NumberIsNaN:$_,Promise:ol,PromiseReject:al,PromiseResolve:k_,PromisePrototypeThen:ll,Symbol:fl}=P(),Gr=fl("kEmpty"),ul=fl("kEof");function q_(t,e){if(e!=null&&nt(e,"options"),(e==null?void 0:e.signal)!=null&&it(e.signal,"options.signal"),B_(t)&&!F_(t))throw new R_("stream",t,"must be writable");let r=j_(this,t);return e!=null&&e.signal&&L_(e.signal,r),r}function Vr(t,e){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);e!=null&&nt(e,"options"),(e==null?void 0:e.signal)!=null&&it(e.signal,"options.signal");let r=1;(e==null?void 0:e.concurrency)!=null&&(r=sl(e.concurrency));let i=r-1;return(e==null?void 0:e.highWaterMark)!=null&&(i=sl(e.highWaterMark)),nl(r,"options.concurrency",1),nl(i,"options.highWaterMark",0),i+=r,function(){return Y(this,null,function*(){let s=G().AbortSignalAny([e==null?void 0:e.signal].filter(O_)),o=this,a=[],l={signal:s},u,f,c=!1,b=0;function d(){c=!0,_()}function _(){b-=1,p()}function p(){f&&!c&&b<r&&a.length<i&&(f(),f=null)}async function y(){try{try{for(var m=Q(o),R,S,g;R=!(S=await m.next()).done;R=!1){let w=S.value;if(c)return;if(s.aborted)throw new _e;try{if(w=t(w,l),w===Gr)continue;w=k_(w)}catch(A){w=al(A)}b+=1,ll(w,_,d),a.push(w),u&&(u(),u=null),!c&&(a.length>=i||b>=r)&&await new ol(A=>{f=A})}}catch(S){g=[S]}finally{try{R&&(S=m.return)&&await S.call(m)}finally{if(g)throw g[0]}}a.push(ul)}catch(w){let A=al(w);ll(A,_,d),a.push(A)}finally{c=!0,u&&(u(),u=null)}}y();try{for(;;){for(;a.length>0;){let m=yield new k(a[0]);if(m===ul)return;if(s.aborted)throw new _e;m!==Gr&&(yield m),a.shift(),p()}yield new k(new ol(m=>{u=m}))}}finally{c=!0,f&&(f(),f=null)}})}.call(this)}function U_(t=void 0){return t!=null&&nt(t,"options"),(t==null?void 0:t.signal)!=null&&it(t.signal,"options.signal"),function(){return Y(this,null,function*(){let r=0;try{for(var n=Q(this),s,o,a;s=!(o=yield new k(n.next())).done;s=!1){let l=o.value;var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new _e({cause:t.signal.reason});yield[r++,l]}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new k(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}async function cl(t,e=void 0){try{for(var r=Q(wn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return!0}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}return!1}async function W_(t,e=void 0){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);return!await cl.call(this,async(...r)=>!await t(...r),e)}async function G_(t,e){try{for(var r=Q(wn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return o}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}}async function V_(t,e){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);async function r(a,l){return await t(a,l),Gr}try{for(var i=Q(Vr.call(this,r,e)),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;;}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}}function wn(t,e){if(typeof t!="function")throw new Kt("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:Gr}return Vr.call(this,r,e)}var yn=class extends T_{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Q_(t,e,r){var i;if(typeof t!="function")throw new Kt("reducer",["Function","AsyncFunction"],t);r!=null&&nt(r,"options"),(r==null?void 0:r.signal)!=null&&it(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let d=new _e(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await P_(this.destroy(d)),d}let s=new I_,o=s.signal;if(r!=null&&r.signal){let d={once:!0,[N_]:this,[v_]:!0};r.signal.addEventListener("abort",()=>s.abort(),d)}let a=!1;try{try{for(var u=Q(this),f,c,b;f=!(c=await u.next()).done;f=!1){let d=c.value;var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new _e;n?e=await t(e,d,{signal:o}):(e=d,n=!0)}}catch(c){b=[c]}finally{try{f&&(c=u.return)&&await c.call(u)}finally{if(b)throw b[0]}}if(!a&&!n)throw new yn}finally{s.abort()}return e}async function H_(t){t!=null&&nt(t,"options"),(t==null?void 0:t.signal)!=null&&it(t.signal,"options.signal");let e=[];try{for(var i=Q(this),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new _e(void 0,{cause:t.signal.reason});D_(e,a)}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}return e}function z_(t,e){let r=Vr.call(this,t,e);return function(){return Y(this,null,function*(){try{for(var n=Q(r),s,o,a;s=!(o=yield new k(n.next())).done;s=!1){let l=o.value;yield*re(l)}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new k(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}function dl(t){if(t=M_(t),$_(t))return 0;if(t<0)throw new A_("number",">= 0",t);return t}function K_(t,e=void 0){return e!=null&&nt(e,"options"),(e==null?void 0:e.signal)!=null&&it(e.signal,"options.signal"),t=dl(t),function(){return Y(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new _e;try{for(var s=Q(this),o,a,l;o=!(a=yield new k(s.next())).done;o=!1){let u=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new _e;t--<=0&&(yield u)}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&(yield new k(a.call(s)))}finally{if(l)throw l[0]}}})}.call(this)}function Y_(t,e=void 0){return e!=null&&nt(e,"options"),(e==null?void 0:e.signal)!=null&&it(e.signal,"options.signal"),t=dl(t),function(){return Y(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new _e;try{for(var s=Q(this),o,a,l;o=!(a=yield new k(s.next())).done;o=!1){let u=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new _e;if(t-- >0&&(yield u),t<=0)return}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&(yield new k(a.call(s)))}finally{if(l)throw l[0]}}})}.call(this)}mn.exports.streamReturningOperators={asIndexedPairs:C_(U_,"readable.asIndexedPairs will be removed in a future version."),drop:K_,filter:wn,flatMap:z_,map:Vr,take:Y_,compose:q_};mn.exports.promiseReturningOperators={every:W_,forEach:V_,reduce:Q_,toArray:H_,some:cl,find:G_}});var xn=I((xb,_l)=>{"use strict";var{ArrayPrototypePop:Z_,Promise:X_}=P(),{isIterable:J_,isNodeStream:ep,isWebStream:tp}=fe(),{pipelineImpl:rp}=qr(),{finished:ip}=Re();En();function np(...t){return new X_((e,r)=>{let i,n,s=t[t.length-1];if(s&&typeof s=="object"&&!ep(s)&&!J_(s)&&!tp(s)){let o=Z_(t);i=o.signal,n=o.end}rp(t,(o,a)=>{o?r(o):e(a)},{signal:i,end:n})})}_l.exports={finished:ip,pipeline:np}});var En=I((Eb,Sl)=>{"use strict";var{Buffer:sp}=se(),{ObjectDefineProperty:Ne,ObjectKeys:gl,ReflectApply:yl}=P(),{promisify:{custom:wl}}=G(),{streamReturningOperators:pl,promiseReturningOperators:bl}=hl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:ml}}=U(),op=gn(),{setDefaultHighWaterMark:ap,getDefaultHighWaterMark:lp}=kt(),{pipeline:xl}=qr(),{destroyer:up}=Ze(),El=Re(),Sn=xn(),Yt=fe(),v=Sl.exports=Ir().Stream;v.isDestroyed=Yt.isDestroyed;v.isDisturbed=Yt.isDisturbed;v.isErrored=Yt.isErrored;v.isReadable=Yt.isReadable;v.isWritable=Yt.isWritable;v.Readable=Wt();for(let t of gl(pl)){let r=function(...i){if(new.target)throw ml();return v.Readable.from(yl(e,this,i))},e=pl[t];Ne(r,"name",{__proto__:null,value:e.name}),Ne(r,"length",{__proto__:null,value:e.length}),Ne(v.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of gl(bl)){let r=function(...i){if(new.target)throw ml();return yl(e,this,i)},e=bl[t];Ne(r,"name",{__proto__:null,value:e.name}),Ne(r,"length",{__proto__:null,value:e.length}),Ne(v.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}v.Writable=Or();v.Duplex=he();v.Transform=nn();v.PassThrough=on();v.pipeline=xl;var{addAbortSignal:fp}=$t();v.addAbortSignal=fp;v.finished=El;v.destroy=up;v.compose=op;v.setDefaultHighWaterMark=ap;v.getDefaultHighWaterMark=lp;Ne(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Sn}});Ne(xl,wl,{__proto__:null,enumerable:!0,get(){return Sn.pipeline}});Ne(El,wl,{__proto__:null,enumerable:!0,get(){return Sn.finished}});v.Stream=v;v._isUint8Array=function(e){return e instanceof Uint8Array};v._uint8ArrayToBuffer=function(e){return sp.from(e.buffer,e.byteOffset,e.byteLength)}});var Qr=I((Sb,B)=>{"use strict";var M=En(),cp=xn(),dp=M.Readable.destroy;B.exports=M.Readable;B.exports._uint8ArrayToBuffer=M._uint8ArrayToBuffer;B.exports._isUint8Array=M._isUint8Array;B.exports.isDisturbed=M.isDisturbed;B.exports.isErrored=M.isErrored;B.exports.isReadable=M.isReadable;B.exports.Readable=M.Readable;B.exports.Writable=M.Writable;B.exports.Duplex=M.Duplex;B.exports.Transform=M.Transform;B.exports.PassThrough=M.PassThrough;B.exports.addAbortSignal=M.addAbortSignal;B.exports.finished=M.finished;B.exports.destroy=M.destroy;B.exports.destroy=dp;B.exports.pipeline=M.pipeline;B.exports.compose=M.compose;Object.defineProperty(M,"promises",{configurable:!0,enumerable:!0,get(){return cp}});B.exports.Stream=M.Stream;B.exports.default=B.exports});var Jn=ir(se());var We="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ft="http://www.w3.org/2001/XMLSchema#",ar="http://www.w3.org/2000/10/swap/",N={xsd:{decimal:`${ft}decimal`,boolean:`${ft}boolean`,dateTime:`${ft}dateTime`,double:`${ft}double`,integer:`${ft}integer`,string:`${ft}string`},rdf:{type:`${We}type`,nil:`${We}nil`,first:`${We}first`,rest:`${We}rest`,langString:`${We}langString`,dirLangString:`${We}dirLangString`,reifies:`${We}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ar}reify#forSome`,forAll:`${ar}reify#forAll`},log:{implies:`${ar}log#implies`,isImpliedBy:`${ar}log#isImpliedBy`}};var{xsd:lr}=N,ur=32,fr=9,Yn=10,cr=13,wu=35,mu=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Zn={"\\":"\\","'":"'",'"':'"',n:`
3
+ `,r:"\r",t:" ",f:"\f",b:"\b"},xu={_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","'":"'","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Eu=/[\x00-\x20<>\\"\{\}\|\^\`]/;function Xn(t){return t<=1114111&&(t<55296||t>57343)}var Su={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_commentLine:!0,_whitespace:!0},Iu=/$0^/,Ge=class{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._atKeyword=/^@[a-z]+(?=[\s#<:])/i,this._keyword=/^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i,this._n3Verb=/^(?:has|is|of)(?=[\s#()\[\]\{\}"'<>?_+\-0-9])/,this._n3Id=/^id(?=[\s#<])/,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._commentLine=/^[ \t]*#([^\n\r]*)(?:\r\n|\n|\r)([ \t]*)/,this._whitespace=/^[ \t]+/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in Su)&&this[r]instanceof RegExp&&(this[r]=Iu)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let i=this._input,n=this._linePosition+i.length;for(;;){for(;;){let g=i.charCodeAt(0),w=0;if(g===ur||g===fr){let A=i.charCodeAt(1);w=A===ur||A===fr?this._whitespace.exec(i)[0].length:1,g=i.charCodeAt(w)}if(g===wu){let A=this._commentLine.exec(i);if(A){let C=A[0].length;if(!r&&C===i.length&&i.charCodeAt(C-1)===cr)return this._linePosition=n-i.length,this._input=i;this.comments&&s(A[1],this._line,w),i=i.slice(C),n=i.length+A[2].length,this._line++}else{if(i=i.slice(w),!r)return this._linePosition=n-i.length,this._input=i;this.comments&&s(i.slice(1),this._line,0),i="";break}}else if(g===Yn||g===cr){if(!r&&g===cr&&w+1===i.length)return this._linePosition=n-i.length,this._input=i;w+=g===cr&&i.charCodeAt(w+1)===Yn?2:1;let A=0,C=i.charCodeAt(w);if(C===ur||C===fr){let be=i.charCodeAt(w+1);A=be===ur||be===fr?this._whitespace.exec(i.slice(w))[0].length:1}i=i.slice(w+A),n=i.length+A,this._line++}else{w!==0&&(i=i.slice(w));break}}if(i.length===0)return r&&(i=null,o("eof","","",this._line,0)),this._linePosition=n,this._input=i;let l=this._line,u=i[0],f="",c="",b="",d=null,_=0,p=0,y=0,m=!1;switch(u){case"^":if(i.length<3)break;if(i[1]==="^"){if(this._previousMarker="^^",i=i.slice(2),i[0]!=="<"){m=!0;break}}else{this._n3Mode&&(_=1,f="^");break}case"<":if(d=this._unescapedIri.exec(i))f="IRI",c=d[1],p=d[1].length+2;else if(d=this._iri.exec(i)){if(c=this._unescape(d[1],Zn),c===null||Eu.test(c))return a(this);f="IRI",p=d[1].length+2}else i.length>2&&i[1]==="<"&&i[2]==="("?(f="<<(",_=3):!this._lineMode&&i.length>(r?1:2)&&i[1]==="<"?(f="<<",_=2):this._n3Mode&&i.length>1&&i[1]==="="?(_=2,this._isImpliedBy?(f="abbreviation",c="<"):(f="inverse",c=">")):this._n3Mode&&i.length>1&&i[1]==="-"&&(f="inversePredicate",_=2);break;case">":i.length>1&&i[1]===">"&&(f=">>",_=2);break;case"_":((d=this._blank.exec(i))||r&&(d=this._blank.exec(`${i} `)))&&(f="blank",b="_",c=d[1],p=d[1].length+2);break;case'"':if(d=this._simpleQuotedString.exec(i))c=d[1];else if({value:c,matchLength:_,finalLineLength:y}=this._parseLiteral(i),c===null)return a(this);(d!==null||_!==0)&&(f="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(i))c=d[1];else if({value:c,matchLength:_,finalLineLength:y}=this._parseLiteral(i),c===null)return a(this);(d!==null||_!==0)&&(f="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(i))&&(f="var",c=d[0]);break;case"@":this._previousMarker==="literal"&&(d=this._langcode.exec(i))&&d[1]!=="version"?!r&&i[d[0].length]==="-"&&i[d[0].length+1]!=="-"?d=null:(f="langcode",c=d[1]):(d=this._atKeyword.exec(i))&&(f=d[0]);break;case".":if(i.length===1?r:i[1]<"0"||i[1]>"9"){f=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":if(i[1]==="-"){this._previousMarker==="langcode"&&(i.startsWith("--ltr")?(f="dircode",c="ltr",_=5):i.startsWith("--rtl")&&(f="dircode",c="rtl",_=5));break}(d=this._number.exec(i)||r&&(d=this._number.exec(`${i} `)))&&(f="literal",c=d[0],b=typeof d[1]=="string"?lr.double:typeof d[2]=="string"?lr.decimal:lr.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":case"V":case"v":(d=this._keyword.exec(i))?f=d[0].toUpperCase():m=!0;break;case"f":case"t":this._boolean.test(i)?(f="literal",c=u==="t"?"true":"false",b=lr.boolean,_=c.length):m=!0;break;case"a":this._shortPredicates.test(i)?(f="abbreviation",c="a",_=1):m=!0;break;case"h":case"o":this._n3Mode&&(d=this._matchN3Verb(i,r))?f=d[0]:m=!0;break;case"i":this._n3Mode&&this._n3Id.test(i)?(f="id",_=2):this._n3Mode&&(d=this._matchN3Verb(i,r))?f=d[0]:m=!0;break;case"=":this._n3Mode&&i.length>1&&(f="abbreviation",i[1]!==">"?(_=1,c="="):(_=2,c=">"));break;case"!":if(!this._n3Mode)break;case")":if(!r&&(i.length===1||i.length===2&&i[1]===">"))break;if(i.length>2&&i[1]===">"&&i[2]===">"){f=")>>",_=3;break}case",":case";":case"[":case"]":case"(":case"}":case"~":this._lineMode||(_=1,f=u);break;case"{":!this._lineMode&&i.length>=2&&(i[1]==="|"?(f="{|",_=2):(f=u,_=1));break;case"|":i.length>=2&&i[1]==="}"&&(f="|}",_=2);break;default:m=!0}if(m&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(d=this._prefix.exec(i))?(f="prefix",c=d[1]||""):((d=this._prefixed.exec(i))||r&&(d=this._prefixed.exec(`${i} `)))&&(f="prefixed",b=d[1]||"",c=this._unescape(d[2],xu),p=b.length+d[2].length+1)),this._previousMarker==="^^")switch(f){case"prefixed":f="type";break;case"IRI":f="typeIRI";break;default:f=""}if(!f)return r||!/^'''|^"""/.test(i)&&/\n|\r/.test(i)?a(this):(this._linePosition=n-i.length,this._input=i);let R=_||d[0].length,S;y?(S={type:f,value:c,prefix:b,line:l,start:n-i.length,end:y,endLine:this._line},e(null,S)):S=o(f,c,b,l,p||R),this.previousToken=S,this._previousMarker=f,i=i.slice(R),y&&(n=i.length+y)}function s(l,u,f){let c=n-i.length+f;e(null,{type:"comment",value:l,prefix:"",line:u,start:c,end:c+l.length+1})}function o(l,u,f,c,b){let d=i?n-i.length:n,_=d+b,p={type:l,value:u,prefix:f,line:c,start:d,end:_};return e(null,p),p}function a(l){e(l._syntaxError(/^\S*/.exec(i)[0]))}}_matchN3Verb(e,r){let i=this._n3Verb.exec(e);if(!i)return null;let n=e[i[0].length];return n!=="-"&&n!=="_"&&(n<"0"||n>"9")?i:this._prefixed.exec(e)||this._prefixed.exec(`${e} `)||!r&&this._prefix.exec(`${e}: `)?null:i}_unescape(e,r){if(e.indexOf("\\")<0)return e;let i=!1,n=e.replace(mu,(s,o,a,l)=>{if(typeof o=="string"){let u=Number.parseInt(o,16);return Xn(u)?String.fromCharCode(u):(i=!0,"")}if(typeof a=="string"){let u=Number.parseInt(a,16);return Xn(u)?u<=65535?String.fromCharCode(Number.parseInt(a,16)):String.fromCharCode(55296+((u-=65536)>>10),56320+(u&1023)):(i=!0,"")}return l in r?r[l]:(i=!0,"")});return i?null:n}_parseLiteral(e){if(e.length>=3){let r=e[0],i=e[1]===r&&e[2]===r?3:1,n=r;i===3&&(n=r==='"'?'"""':"'''");let s=Math.max(this._literalClosingPos,i);for(;(s=e.indexOf(n,s))>0;){let o=0;for(;e[s-o-1]==="\\";)o++;if(o%2===0){let a=e.substring(i,s),l=a.split(/\r\n|\r|\n/),u=l.length-1,f=s+i;if(i===1&&u!==0||i===3&&this._lineMode)break;this._line+=u;let c=u===0?0:l[l.length-1].length+i;return{value:this._unescape(a,Zn),matchLength:f,finalLineLength:c}}s++}this._literalClosingPos=e.length-i+1}return{value:"",matchLength:0,finalLineLength:0}}_syntaxError(e){this._input=null;let r=new Error(`Unexpected "${e}" on line ${this._line}.`);return r.context={token:void 0,line:this._line,previousToken:this.previousToken},r}_readStartingBom(e){return e.startsWith("\uFEFF")?(this._linePosition=1,e.slice(1)):e}tokenize(e,r){let i=this._tokenization={};if(this._line=1,this._linePosition=0,this._previousMarker=void 0,this.previousToken=void 0,this._literalClosingPos=0,this._input=void 0,typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")queueMicrotask(()=>{this._tokenization===i&&this._tokenizeToEnd(r,!0)});else{let n=[],s;if(this._tokenizeToEnd((o,a)=>o?s=o:n.push(a),!0),s)throw s;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._tokenization===i&&this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=Jn.Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input=="undefined"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(r,!1)))}),e.on("end",()=>{this._tokenization===i&&typeof this._input=="string"&&this._tokenizeToEnd(r,!0)}),e.on("error",n=>{this._tokenization===i&&r(n)})}};var{rdf:es,xsd:Le}=N,dt,Ru=0;var ni={namedNode:ts,blankNode:rs,variable:ns,literal:is,defaultGraph:Tu,quad:si,triple:si,fromTerm:Lt,fromQuad:ss},K=ni,z=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},ct=class extends z{constructor(e){super(e)}get termType(){return"NamedNode"}},we=class t extends z{constructor(e){super(e)}get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1,i=e.lastIndexOf("--");return r<e.length&&e[r++]==="@"?(i>r?e.substr(0,i):e).substr(r).toLowerCase():""}get direction(){let e=this.id,r=e.lastIndexOf('"'),i=e.lastIndexOf("--");return i>r&&i+2<e.length?e.substr(i+2).toLowerCase():""}get datatype(){return new ct(this.datatypeString)}get datatypeString(){let e=this.id,r=e.lastIndexOf('"')+1,i=r<e.length?e[r]:"";return i==="^"?e.substr(r+2):i!=="@"?Le.string:e.indexOf("--",r)>0?es.dirLangString:es.langString}equals(e){return e instanceof t?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(this.direction===e.direction||this.direction===""&&!e.direction)&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:"NamedNode",value:this.datatypeString}}}},Ft=class extends z{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Bt=class extends z{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},Ct=class extends z{constructor(){return super(""),dt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};dt=new Ct;function Fe(t,e,r){if(e=e||ni,!t)return e.defaultGraph();switch(t[0]){case"?":return e.variable(t.substr(1));case"_":return e.blankNode(t.substr(2));case'"':if(e===ni)return new we(t);if(t[t.length-1]==='"')return e.literal(t.substr(1,t.length-2));let i=t.lastIndexOf('"',t.length-1),n;if(t[i+1]==="@"){n=t.substr(i+2);let s=n.lastIndexOf("--");s>0&&s<n.length&&(n={language:n.substr(0,s),direction:n.substr(s+2)})}else n=e.namedNode(t.substr(i+3));return e.literal(t.substr(1,i-1),n);case"[":t=JSON.parse(t);break;default:if(!r||!Array.isArray(t))return e.namedNode(t)}return e.quad(Fe(t[0],e,!0),Fe(t[1],e,!0),Fe(t[2],e,!0),t[3]&&Fe(t[3],e,!0))}function me(t,e){if(typeof t=="string")return t;if(t instanceof z&&t.termType!=="Quad")return t.id;if(!t)return dt.id;switch(t.termType){case"NamedNode":return t.value;case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}${t.direction?`--${t.direction}`:""}`:t.datatype&&t.datatype.value!==Le.string?`^^${t.datatype.value}`:""}`;case"Quad":let r=[me(t.subject,!0),me(t.predicate,!0),me(t.object,!0)];return t.graph&&t.graph.termType!=="DefaultGraph"&&r.push(me(t.graph,!0)),e?r:JSON.stringify(r);default:throw new Error(`Unexpected termType: ${t.termType}`)}}var Be=class extends z{constructor(e,r,i,n){super(""),this._subject=e,this._predicate=r,this._object=i,this._graph=n||dt}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 ts(t){return new ct(t)}function rs(t){return new Ft(t||`n3-${Ru++}`)}function is(t,e){if(typeof e=="string")return new we(`"${t}"@${e.toLowerCase()}`);if(e!==void 0&&!("termType"in e))return new we(`"${t}"@${e.language.toLowerCase()}${e.direction?`--${e.direction.toLowerCase()}`:""}`);let r=e?e.value:"";return r===""&&(typeof t=="boolean"?r=Le.boolean:typeof t=="number"?Number.isFinite(t)?r=Number.isInteger(t)?Le.integer:Le.double:(r=Le.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")):t instanceof Date&&!Number.isNaN(t.getTime())&&(r=Le.dateTime,t=t.toISOString())),r===""||r===Le.string?new we(`"${t}"`):new we(`"${t}"^^${r}`)}function ns(t){return new Bt(t)}function Tu(){return dt}function si(t,e,r,i){return new Be(t,e,r,i)}function Lt(t){if(t instanceof z)return t;switch(t.termType){case"NamedNode":return ts(t.value);case"BlankNode":return rs(t.value);case"Variable":return ns(t.value);case"DefaultGraph":return dt;case"Literal":return is(t.value,t.language||t.datatype);case"Quad":return ss(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function ss(t){if(t instanceof Be)return t;if(t.termType!=="Quad")throw new Error(`Unexpected termType: ${t.termType}`);return si(Lt(t.subject),Lt(t.predicate),Lt(t.object),Lt(t.graph))}var os=0,xe=class t{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&as(this,e.factory);let r=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(r),n=/trig/.test(r),s=/triple/.test(r),o=/quad/.test(r),a=this._n3Mode=/n3/.test(r),l=s||o;this._emitCurrent=this._emit,a&&(this._createQuad=this._createQuadInDirection,this._emit=this._emitInDirection,this._emitCurrent=this._emitCurrentInDirection),(this._supportsNamedGraphs=!(i||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||n||s||a),this._isImpliedBy=e.isImpliedBy,this._implicitEmptyPrefix=!!e.implicitEmptyPrefix,this._emptyFormulaAsTrue=!!e.emptyFormulaAsTrue,l&&(this._resolveRelativeIRI=u=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Ge({lineMode:l,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version}static _resetBlankNodePrefix(){os=0}_setBase(e){if(!e)this._base="",this._basePath="";else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),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]}}_saveContext(e,r,i,n,s){if(!this._n3Mode){this._contextStack.push({type:e,subject:i,predicate:n,object:s,graph:r});return}let o={type:e,subject:i,predicate:n,object:s,graph:r,inverse:this._inversePredicate,expectOf:this._expectOf,blankPrefix:this._prefixes._,quantified:this._quantified,emptyFormula:this._emptyFormula};e==="formula"&&(o.prefixes=this._prefixes,o.base=[this._base,this._basePath,this._baseRoot,this._baseScheme],this._prefixes=Object.create(this._prefixes)),this._contextStack.push(o),this._inversePredicate=!1,this._expectOf=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified),e==="formula"&&(this._subject=null,this._emptyFormula=!0)}_restoreContext(e,r){let i=this._contextStack.pop();if(!i||i.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=i.subject,this._predicate=i.predicate,this._object=i.object,this._graph=i.graph,this._n3Mode&&(this._inversePredicate=i.inverse,this._expectOf=i.expectOf,e==="formula"?(this._prefixes=i.prefixes,[this._base,this._basePath,this._baseRoot,this._baseScheme]=i.base):this._prefixes._=i.blankPrefix,this._quantified=i.quantified,this._emptyFormula=i.emptyFormula)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?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"VERSION":this._sparqlStyle=!0;case"@version":return this._readVersion;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)}}_readInFormulaContext(e){switch(e.type){case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;default:return this._readSubject(e)}}_getStatementReader(){let e=this._contextStack[this._contextStack.length-1];return e&&e.type==="formula"?this._readInFormulaContext:this._readInTopContext}_readEntity(e,r){let i;switch(e.type){case"IRI":case"typeIRI":let n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);i=this._factory.namedNode(n);break;case"type":case"prefixed":let s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);i=this._factory.namedNode(s+e.value);break;case"blank":i=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":i=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&i.id in this._quantified&&(i=this._quantified[i.id]),i}_readList(e,r,i,n){let s=this._contextStack;return(s.length&&s[s.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,r,i,n),this._subject=null,this._readListItem)}_readSubject(e){switch(this._predicate=null,e.type!=="}"&&(this._emptyFormula=!1),e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._readList(e,this.RDF_NIL,null,null);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readInFormulaContext):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="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":return this._n3Mode?e.prefix.length===0?(this._literalValue=e.value,this._completeSubjectLiteral):(this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._getPathReader(this._readPredicateOrNamedGraph)):this._error("Unexpected literal",e);case"<<(":return this._n3Mode?(this._saveContext("<<(",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Disallowed triple term as subject",e);case"<<":return this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject;default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type,i=!1;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case"has":return this._readPredicateAfterVerb;case"is":return this._inversePredicate=!0,this._expectOf=!0,this._readPredicateAfterVerb;case"inversePredicate":return this._inversePredicate=!0,this._readPredicateAfterVerb;case".":case"]":case"}":case"|}":return this._predicate===null&&!this._n3Mode?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completePredicateLiteral;this._predicate=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=!0;break;case"(":return this._n3Mode?this._readList(e,this._subject,this.RDF_NIL,null):this._error(`Expected entity but got ${r}`,e);case"[":return this._n3Mode?(this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead):this._error("Disallowed blank node as predicate",e);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._graph=this._factory.blankNode(),null),this._readSubject):this._readEntity(e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return;i=this._n3Mode}return this._validAnnotation=!0,i?this._getPathReader(this._readObject,"predicate"):this._readObject}_readPredicateAfterVerb(e){return e.type==="has"||e.type==="is"||e.type==="of"||e.type==="inversePredicate"?this._error(`Expected expression but got ${e.type}`,e):this._readPredicate(e)}_readObject(e){if(this._expectOf)return e.type!=="of"?this._error(`Expected of but got ${e.type}`,e):(this._expectOf=!1,this._readObject);switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;if(this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._n3Mode)return this._getPathReader(this._getContextEndReader());break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._readList(e,this._subject,this._predicate,this.RDF_NIL);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":return this._saveContext("<<(",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;case"<<":return this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject;default:if((this._object=this._readEntity(e))===void 0)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){if(e.type==="]")return this._subject=null,this._readBlankNodeTail(e);{let r=this._contextStack;return(r.length>1&&r[r.length-2]).type==="<<"?this._error("Unexpected compound blank node expression in reified triple",e):e.type==="id"?this._readIriPropertyListId:(this._predicate=null,this._readPredicate(e))}}_readIriPropertyListId(e){let r=this._readEntity(e);if(r===void 0)return;if(r.termType!=="NamedNode")return this._error(`Expected IRI after id but got ${e.type}`,e);let i=this._subject;this._subject=r;let n=this._contextStack[this._contextStack.length-1];return n.subject===i&&(n.subject=r),n.predicate===i&&(n.predicate=r),n.object===i&&(n.object=r),this._predicate=null,this._readIriPropertyListPredicate}_readIriPropertyListPredicate(e){return e.type===";"||e.type==="]"||e.type==="."||e.type==="}"?this._error(`Expected predicate but got ${e.type}`,e):this._readPredicate(e)}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._getPathReader(this._readObject,"predicate"):r?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 r=null,i=null,n=this._readListItem,s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this._subject=r=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"){if(this._n3Mode)return s!==null&&this._emit(s,this.RDF_REST,this.RDF_NIL,this._graph),this._saveContext("item",this._graph,this._subject,this._predicate,this._object),this._subject=this._object,this._predicate=null,this._getPathReader(this._readListItem);this._emit(this._subject,this._predicate,this._object,this._graph)}if(this._predicate===null){if(n=this._n3Mode?this._getPathReader(this._readPredicate):this._readPredicate,this._subject===this.RDF_NIL)return n}else if(this._object===null){if(n=this._getPathReader(this._readObject,"predicate"),this._predicate===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._n3Mode&&(n=this._getPathReader(n)),this._object===this.RDF_NIL)return n;i=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(r=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(i=this._factory.blankNode(),r=this._factory.blankNode(),s===null?a.predicate===null?a.subject=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),this._emit(i,this.RDF_FIRST,r,this._graph),this._saveContext("formula",this._graph,i,this.RDF_FIRST,this._graph=r),this._subject=null,this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":this._saveContext("<<(",this._graph,null,null,null),this._graph=null,n=this._readSubject;break;case"<<":this._saveContext("<<",this._graph,null,null,null),this._graph=null,n=this._readSubject;break;default:if((r=this._readEntity(e))===void 0)return}if(i===null&&(this._subject=i=this._factory.blankNode()),(e.type==="<<"||e.type==="<<(")&&(o[o.length-1].subject=this._subject),s===null?a.predicate===null?a.subject=i:a.object===null?a.predicate=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"||e.type==="var"||e.type==="blank"||e.type==="literal"))return this._saveContext("item",this._graph,i,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(i,this.RDF_FIRST,r,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,r){let i,n=!1;switch(e.type){case"type":case"typeIRI":let s=this._readEntity(e);if(s===void 0)return;if(s.value===N.rdf.langString||s.value===N.rdf.dirLangString)return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype",e);i=this._factory.literal(this._literalValue,s),e=null;break;case"langcode":if(e.value.split("-").some(o=>o.length>8))return this._error("Detected language tag with subtag longer than 8 characters",e);i=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,this._literalComponent=r,n=!0;break;default:i=this._factory.literal(this._literalValue)}return{token:e,literal:i,readCb:n}}_readDirCode(e){let r=this._literalComponent,i=this._literalListItem;if(e.type==="dircode"){let n=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:e.value});r==="subject"?this._subject=n:r==="predicate"?this._predicate=n:this._object=n,this._literalLanguage=void 0,e=null}if(r==="subject"||r==="predicate"){let n=r==="subject"?this._readPredicateOrNamedGraph:this._readObject;return this._getPathEndReader(e,n,r)||n.call(this,e)}return this._completeObjectLiteralPost(e,i)}_completeTermLiteral(e,r){let i=this._completeLiteral(e,r);if(!i)return;let n;if(r==="subject"?(this._subject=i.literal,n=this._readPredicateOrNamedGraph):(this._predicate=i.literal,this._validAnnotation=!0,n=this._readObject),i.readCb)return this._literalListItem=!1,this._readDirCode;let s=this._getPathEndReader(i.token,n,r);return s||n.call(this,i.token)}_completeSubjectLiteral(e){return this._completeTermLiteral(e,"subject")}_completePredicateLiteral(e){return this._completeTermLiteral(e,"predicate")}_completeObjectLiteral(e,r){let i=this._completeLiteral(e,"object");if(i)return this._object=i.literal,i.readCb?(this._literalListItem=r,this._readDirCode):this._completeObjectLiteralPost(i.token,r)}_completeObjectLiteralPost(e,r){return this._n3Mode&&(e===null||e.type==="!"||e.type==="^")?r?(this._saveContext("item",this._graph,this._subject,this.RDF_FIRST,this._object),this._subject=this._object,this._predicate=null,this._getPathEndReader(e,this._readListItem)):this._getPathEndReader(e,this._getContextEndReader()):(r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),e===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e)))}_readFormulaTail(e){if(e.type!=="}")return this._readPunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._graph,i=this._emptyFormula;return this._restoreContext("formula",e),i&&this._emptyFormulaAsTrue&&(this._subject===r?this._subject=this.N3_TRUE:this._predicate===r?this._predicate=this.N3_TRUE:this._object=this.N3_TRUE),this._object!==null?this._getPathReader(this._getContextEndReader(),"object"):this._predicate!==null?this._getPathReader(this._readObject,"predicate"):this._getPathReader(this._readPredicate,"subject")}_readPunctuation(e){let r,i=this._graph,n=!1,s=this._subject,o=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,this._tripleTerm=null,r=this._getStatementReader(),o&&(this._inversePredicate=!1);break;case";":o&&(this._inversePredicate=!1),r=this._readPredicate;break;case",":r=this._readObject;break;case"~":s!==null&&(this._tripleTerm=null),r=this._readReifierInAnnotation,n=!0;break;case"{|":s!==null&&(this._tripleTerm=null),this._subject=this._readTripleTerm(),this._inversePredicate=!1,this._validAnnotation=!1,n=!0,r=this._readPredicate;break;case"|}":if(!this._annotation)return this._error("Unexpected annotation syntax closing",e);if(!this._validAnnotation)return this._error("Annotation block can not be empty",e);this._subject=null,this._annotation=!1,this._inversePredicate=!1,r=this._getContextEndReader();break;default:if(this._supportsQuads&&this._graph===null&&(i=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(s!==null&&(!n||n&&!this._annotation)){let a=this._predicate,l=this._object;this._emit(s,a,l,i,o)}return n&&(this._annotation=!0),r}_readBlankNodePunctuation(e){let r,i=!1;switch(e.type){case";":i=this._inversePredicate,r=this._readPredicate;break;case",":r=this._readObject;break;case"~":case"{|":case"|}":return this._readPunctuation(e);default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._subject===null?this._error("Expected ] to follow annotation",e):(this._emitCurrent(this._subject,this._predicate,this._object,this._graph),i&&(this._inversePredicate=!1),r)}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let r=this._readEntity(e);return this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_isValidVersion(e){return this._parseUnsupportedVersions||t.SUPPORTED_VERSIONS.includes(e)}_readVersion(e){return e.type!=="literal"?this._error("Expected literal to follow version declaration",e):e.end-e.start!==e.value.length+2?this._error("Version declarations must use single quotes",e):(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,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._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._getStatementReader().call(this,e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._getStatementReader()}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,r,this.QUANTIFIERS_GRAPH)):this._quantified[r.id]=this._factory[this._quantifier](this._factory.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,r){return this._afterPath=e,this._pathPosition=r||(this._predicate===null?"subject":"object"),this._readPath}_getPathEndReader(e,r,i){if(e!==null&&e.type!=="!"&&e.type!=="^")return null;let n=this._getPathReader(r,i);return e===null?n:n.call(this,e)}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._afterPath,i=this._contextStack,n=i.length&&i[i.length-1];if(n&&n.type==="item"){let s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath=null,this._pathPosition=null,r.call(this,e)}}_readForwardPath(e){let r,i,n=this._factory.blankNode();if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(r=this._subject,this._subject=n):this._pathPosition==="predicate"?(r=this._predicate,this._predicate=n):(r=this._object,this._object=n),this._emit(r,i,n,this._graph),this._readPath}_readBackwardPath(e){let r=this._factory.blankNode(),i,n;if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(n=this._subject,this._subject=r):this._pathPosition==="predicate"?(n=this._predicate,this._predicate=r):(n=this._object,this._object=r),this._emit(r,i,n,this._graph),this._readPath}_readTripleTermTail(e){if(e.type!==")>>")return this._error(`Expected )>> but got ${e.type}`,e);let r=this._createQuad(this._subject,this._predicate,this._object,this._graph,this._inversePredicate);this._restoreContext("<<(",e);let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return e.type==="~"?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;let r=this._readTripleTerm();this._restoreContext("<<",e);let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicateOrReifierTripleEnd):(this._object=r,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return e.type==="."?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return this._reifier=this._readEntity(e),this._readReifiedTripleTail}_readReifierInAnnotation(e){return e.type==="IRI"||e.type==="typeIRI"||e.type==="type"||e.type==="prefixed"||e.type==="blank"||e.type==="var"?(this._reifier=this._readEntity(e),this._readAnnotationBlockOrPunctuation):(this._readTripleTerm(),this._subject=null,this._getContextEndReader().call(this,e))}_readAnnotationBlockOrPunctuation(e){if(e.type==="{|")return this._readPunctuation(e);switch(this._readTripleTerm(),this._annotation=!1,this._tripleTerm=null,e.type){case";":return this._inversePredicate=!1,this._readPredicate;case",":return this._readObject;default:return this._subject=null,this._getContextEndReader().call(this,e)}}_readTripleTerm(){let e=this._contextStack,r=e.length&&e[e.length-1],i=r?r.graph:void 0,n=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._createQuad(this._subject,this._predicate,this._object,null,this._inversePredicate),this._emit(n,this.RDF_REIFIES,this._tripleTerm,i||this._graph||this.DEFAULTGRAPH),n}_getContextEndReader(){let 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._readTripleTermTail;case"<<":return this._readReifiedTripleTailOrReifier}}_createQuad(e,r,i,n){return this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_createQuadInDirection(e,r,i,n,s){return s?this._factory.quad(i,r,e,n||this.DEFAULTGRAPH):this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_emitInDirection(e,r,i,n,s){this._callback(null,this._createQuad(e,r,i,n,s))}_emitCurrentInDirection(e,r,i,n){this._callback(null,this._createQuad(e,r,i,n,this._inversePredicate))}_emit(e,r,i,n){this._callback(null,this._factory.quad(e,r,i,n||this.DEFAULTGRAPH))}_error(e,r){let i=` on line ${r.line}.`;e.length+i.length>200&&(e=`${e.slice(0,199-i.length)}\u2026`);let n=new Error(`${e}${i}`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Dt}_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;let r=e.length,i="",n=-1,s=-1,o=0,a="/";for(;n<r;){switch(a){case":":if(s<0&&e[++n]==="/"&&e[++n]==="/")for(;(s=n+1)<r&&e[s]!=="/";)n=s;break;case"?":case"#":n=r;break;case"/":if(e[n+1]===".")switch(a=e[++n+1],a){case"/":i+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return i+e.substring(o,n)+e.substr(n+1);case".":if(a=e[++n+1],a===void 0||a==="/"||a==="?"||a==="#"){if(i+=e.substring(o,n-2),(o=i.lastIndexOf("/"))>=s&&(i=i.substr(0,o)),a!=="/")return`${i}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return i+e.substring(o)}parse(e,r,i,n){let s,o,a,l;if(r&&(r.onQuad||r.onPrefix||r.onComment||r.onVersion)?(s=r.onQuad,o=r.onPrefix,a=r.onComment,l=r.onVersion):(s=r,o=i,l=n),this._readCallback=this._readBeforeTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${os++}_`,this._n3Mode&&this._implicitEmptyPrefix&&this._base&&(this._prefixes[""]=this._resolveIRI("#")),this._prefixCallback=o||Dt,this._versionCallback=l||Dt,this._inversePredicate=!1,this._expectOf=!1,this._quantified=Object.create(null),this._emptyFormula=!1,!s){let f=[],c;if(this._callback=(b,d)=>{b?c=b:d&&f.push(d)},this._lexer.tokenize(e).every(b=>this._readCallback=this._readCallback(b)),c)throw c;return f}let u=(f,c)=>{f!==null?(this._callback(f),this._callback=Dt):this._readCallback&&(this._readCallback=this._readCallback(c))};a&&(this._lexer.comments=!0,u=(f,c)=>{f!==null?(this._callback(f),this._callback=Dt):this._readCallback&&(c.type==="comment"?a(c.value):this._readCallback=this._readCallback(c))}),this._callback=s,this._lexer.tokenize(e,u)}};function Dt(){}function as(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(N.rdf.first),t.RDF_REST=e.namedNode(N.rdf.rest),t.RDF_NIL=e.namedNode(N.rdf.nil),t.RDF_REIFIES=e.namedNode(N.rdf.reifies),t.N3_FORALL=e.namedNode(N.r.forAll),t.N3_FORSOME=e.namedNode(N.r.forSome),t.N3_TRUE=e.literal("true",e.namedNode(N.xsd.boolean)),t.ABBREVIATIONS={a:e.namedNode(N.rdf.type),"=":e.namedNode(N.owl.sameAs),">":e.namedNode(N.log.implies),"<":e.namedNode(N.log.isImpliedBy)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}xe.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];as(xe.prototype,K);var oi={};$l(oi,{inDefaultGraph:()=>Lu,isBlankNode:()=>Nu,isDefaultGraph:()=>Ee,isLiteral:()=>vu,isNamedNode:()=>Au,isQuad:()=>ju,isVariable:()=>Pu,prefix:()=>Fu,prefixes:()=>ls});function Au(t){return!!t&&t.termType==="NamedNode"}function Nu(t){return!!t&&t.termType==="BlankNode"}function vu(t){return!!t&&t.termType==="Literal"}function Pu(t){return!!t&&t.termType==="Variable"}function ju(t){return!!t&&t.termType==="Quad"}function Ee(t){return!!t&&t.termType==="DefaultGraph"}function Lu(t){return Ee(t.graph)}function Fu(t,e){return ls({"":t.value||t},e)("")}function ls(t,e){let r=Object.create(null);for(let n in t)i(n,t[n]);e=e||K;function i(n,s){if(typeof s=="string"){let o=Object.create(null);r[n]=a=>o[a]||(o[a]=e.namedNode(s+a))}else if(!(n in r))throw new Error(`Unknown prefix: ${n}`);return r[n]}return i}function ht(t){return t.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}var Bu=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Cu=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,us="./",Du="../",ai="?",fs="#",Ve=class t{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Bu.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!t.supports(this.base))return this._baseMatcher=/.^/;let e=/^[^:]*:\/*/.exec(this.base)[0],r=["^",ht(e)],i=[],n=[],s=/[^/?#]*([/?#])/y,o,a=0,l=0,u=s.lastIndex=e.length;for(;!a&&!l&&(o=s.exec(this.base));)o[1]===fs?l=s.lastIndex-1:(r.push(ht(o[0]),"(?:"),i.push(")?"),o[1]!==ai?n.push(u=s.lastIndex):(a=u=s.lastIndex,l=this.base.indexOf(fs,a),this._pathReplacements[a]=ai));for(let f=0;f<n.length;f++)this._pathReplacements[n[f]]=Du.repeat(n.length-f-1);return this._pathReplacements[n[n.length-1]]=us,this._baseLength=l>0?l:this.base.length,r.push(ht(this.base.substring(u,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...r,...i].join(""))}toRelative(e){let r=this._getBaseMatcher().exec(e);if(!r)return e;let i=r[0].length;if(i===this._baseLength&&i===e.length)return"";let n=this._pathReplacements[i];if(n){let s=e.substring(i);return n!==ai&&!Cu.test(s)?e:n===us&&/^[^?#]/.test(s)?s:n+s}return e.substring(i-1)}};var Ot=K.defaultGraph(),{rdf:Ou,xsd:_t}=N,cs=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ds=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Mu={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},Qe=class extends z{equals(e){return e===this}},oe=class{constructor(e,r){if(this._prefixRegex=/$0^/,this._hasPrefixes=!1,e&&typeof e.write!="function"&&(r=e,e=null),r=r||{},this._lists=r.lists,e)this._outputStream=e,this._endStream=r.end===void 0?!0:!!r.end;else{let i="";this._outputStream={write(n,s,o){i+=n,o&&o()},end:n=>{n&&n(null,i)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(r.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Ot,this._prefixIRIs=Object.create(null),r.baseIRI&&(this._baseIri=new Ve(r.baseIRI),r.writeBase&&this._write(`@base <${r.baseIRI}>.
4
4
  `)),r.prefixes&&this.addPrefixes(r.prefixes))}get _inDefaultGraph(){return Ot.equals(this._graph)}_write(e,r){this._outputStream.write(e,"utf8",r)}_writeQuad(e,r,i,n,s){try{n!==this._graph&&(!n.equals(this._graph)||n.termType!==this._graph.termType)&&(this._write((this._subject===null?"":this._inDefaultGraph?`.
5
5
  `:`
6
6
  }
7
7
  `)+(Ot.equals(n)?"":`${this._encodeIriOrBlank(n)} {
8
8
  `)),this._graph=n,this._subject=null),e===this._subject||e.equals(this._subject)?r===this._predicate||r.equals(this._predicate)?this._write(`, ${this._encodeObject(i)}`,s):this._write(`;
9
9
  ${this._encodePredicate(this._predicate=r)} ${this._encodeObject(i)}`,s):this._write(`${(this._subject===null?"":`.
10
- `)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=r)} ${this._encodeObject(i)}`,s)}catch(o){s&&s(o)}}_writeQuadLine(e,r,i,n,s){delete this._prefixMatch,this._write(this.quadToString(e,r,i,n),s)}quadToString(e,r,i,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(r)} ${this._encodeObject(i)}${n&&!xe(n)?` ${this._encodeIriOrBlank(n)} .
10
+ `)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=r)} ${this._encodeObject(i)}`,s)}catch(o){s&&s(o)}}_writeQuadLine(e,r,i,n,s){delete this._prefixMatch,this._write(this.quadToString(e,r,i,n),s)}quadToString(e,r,i,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(r)} ${this._encodeObject(i)}${n&&!Ee(n)?` ${this._encodeIriOrBlank(n)} .
11
11
  `:` .
12
- `}`}quadsToString(e){let r="";for(let i of e)r+=this.quadToString(i.subject,i.predicate,i.object,i.graph);return r}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),e.termType==="Variable"?`?${e.value}`:"id"in e?e.id:`_:${e.value}`;let r=e.value;this._baseIri&&(r=this._baseIri.toRelative(r)),cs.test(r)&&(r=r.replace(ds,hs));let i=this._hasPrefixes?this._prefixRegex.exec(r):null;return i?i[1]?this._prefixIRIs[i[1]]+i[2]:r:`<${r}>`}_encodeLiteral(e){let r=e.value;cs.test(r)&&(r=r.replace(ds,hs));let i=e.language;if(i){let n=e.direction,s=n?`--${n}`:"";return`"${r}"@${i}${s}`}if(this._lineMode){if(e.datatype.value===_t.string)return`"${r}"`}else switch(e.datatype.value){case _t.string:return`"${r}"`;case _t.boolean:if(r==="true"||r==="false")return r;break;case _t.integer:if(/^[+-]?\d+$/.test(r))return r;break;case _t.decimal:if(/^[+-]?\d*\.\d+$/.test(r))return r;break;case _t.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(r))return r;break}return`"${r}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===Ou.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:r,object:i,graph:n}){return`<<(${this._encodeSubject(e)} ${this._encodePredicate(r)} ${this._encodeObject(i)}${xe(n)?"":` ${this._encodeIriOrBlank(n)}`})>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,r,i,n,s){i===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,r):typeof n=="function"?this._writeQuad(e,r,i,Ot,n):this._writeQuad(e,r,i,n||Ot,s)}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}addPrefix(e,r,i){let n={};n[e]=r,this.addPrefixes(n,i)}addPrefixes(e,r){if(!this._prefixIRIs)return r&&r();let i=!1;for(let n in e){let s=e[n];typeof s!="string"&&(s=s.value),i=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
12
+ `}`}quadsToString(e){let r="";for(let i of e)r+=this.quadToString(i.subject,i.predicate,i.object,i.graph);return r}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),e.termType==="Variable"?`?${e.value}`:"id"in e?e.id:`_:${e.value}`;let r=e.value;this._baseIri&&(r=this._baseIri.toRelative(r)),cs.test(r)&&(r=r.replace(ds,hs));let i=this._hasPrefixes?this._prefixRegex.exec(r):null;return i?i[1]?this._prefixIRIs[i[1]]+i[2]:r:`<${r}>`}_encodeLiteral(e){let r=e.value;cs.test(r)&&(r=r.replace(ds,hs));let i=e.language;if(i){let n=e.direction,s=n?`--${n}`:"";return`"${r}"@${i}${s}`}if(this._lineMode){if(e.datatype.value===_t.string)return`"${r}"`}else switch(e.datatype.value){case _t.string:return`"${r}"`;case _t.boolean:if(r==="true"||r==="false")return r;break;case _t.integer:if(/^[+-]?\d+$/.test(r))return r;break;case _t.decimal:if(/^[+-]?\d*\.\d+$/.test(r))return r;break;case _t.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(r))return r;break}return`"${r}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===Ou.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:r,object:i,graph:n}){return`<<(${this._encodeSubject(e)} ${this._encodePredicate(r)} ${this._encodeObject(i)}${Ee(n)?"":` ${this._encodeIriOrBlank(n)}`})>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,r,i,n,s){i===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,r):typeof n=="function"?this._writeQuad(e,r,i,Ot,n):this._writeQuad(e,r,i,n||Ot,s)}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}addPrefix(e,r,i){let n={};n[e]=r,this.addPrefixes(n,i)}addPrefixes(e,r){if(!this._prefixIRIs)return r&&r();let i=!1;for(let n in e){let s=e[n];typeof s!="string"&&(s=s.value),i=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
13
13
  `:`
14
14
  }
15
15
  `),this._subject=null,this._graph=""),this._prefixIRIs[s]=n+=":",this._write(`@prefix ${n} <${s}>.
16
16
  `)}if(i){this._hasPrefixes=!0;let n="",s="";for(let o in this._prefixIRIs)n+=n?`|${o}`:o,s+=(s?"|":"")+this._prefixIRIs[o];n=ht(n,/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp(`^(?:${s})[^/]*$|^(${n})([_a-zA-Z0-9](?:\\.?[\\-_a-zA-Z0-9])*)$`)}this._write(i?`
17
- `:"",r)}blank(e,r){let i=e,n,s;switch(e===void 0?i=[]:e.termType?i=[{predicate:e,object:r}]:"length"in e||(i=[e]),s=i.length){case 0:return new Ve("[]");case 1:if(n=i[0],!(n.object instanceof Ve))return new Ve(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let o="[";for(let a=0;a<s;a++)n=i[a],n.predicate.equals(e)?o+=`, ${this._encodeObject(n.object)}`:(o+=`${(a?`;
17
+ `:"",r)}blank(e,r){let i=e,n,s;switch(e===void 0?i=[]:e.termType?i=[{predicate:e,object:r}]:"length"in e||(i=[e]),s=i.length){case 0:return new Qe("[]");case 1:if(n=i[0],!(n.object instanceof Qe))return new Qe(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let o="[";for(let a=0;a<s;a++)n=i[a],n.predicate.equals(e)?o+=`, ${this._encodeObject(n.object)}`:(o+=`${(a?`;
18
18
  `:`
19
- `)+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new Ve(`${o}
20
- ]`)}}list(e){let r=e&&e.length||0,i=new Array(r);for(let n=0;n<r;n++)i[n]=this._encodeObject(e[n]);return new Ve(`(${i.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
19
+ `)+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new Qe(`${o}
20
+ ]`)}}list(e){let r=e&&e.length||0,i=new Array(r);for(let n=0;n<r;n++)i[n]=this._encodeObject(e[n]);return new Qe(`(${i.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
21
21
  `:`
22
22
  }
23
- `),this._subject=null),this._write=this._blockedWrite;let r=e&&((i,n)=>{r=null,e(i,n)});if(this._endStream)try{return this._outputStream.end(r)}catch(i){}r&&r()}};function hs(t){let e=Mu[t];return e===void 0&&(t.length===1?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((t.charCodeAt(0)-55296)*1024+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var In=ir(Vr());var Sn=Symbol("iter"),j=Symbol("size");function hp(t,e,r,i){let n=t&&t[e],s=n&&n[r];return!!s&&i in s}function Pt(t,e,r=4){let i=t[j]||0;for(let n in e)n in t?r!==0&&(t[n]=Pt(t[n],e[n],r-1)):(i++,t[n]=r===0?null:Pt(Object.create(null),e[n],r-1));return r<=2&&(t[j]=i),t}function Il(t,e,r=4){let i=!1,n=0;r<=2&&e[j]<t[j]&&([t,e]=[e,t]);for(let s in t)if(s in e){let o=r===0?null:Il(t[s],e[s],r-1);if(o!==!1)i=i||Object.create(null),i[s]=o,n++;else if(r===3)return!1}return r<=2&&i&&(i[j]=n),i}function Rl(t,e,r=4){let i=!1,n=0;for(let s in t)if(!(s in e))i=i||Object.create(null),i[s]=r===0?null:Pt({},t[s],r-1),n++;else if(r!==0){let o=Rl(t[s],e[s],r-1);if(o!==!1)i=i||Object.create(null),i[s]=o,n++;else if(r===3)return!1}return r<=2&&i&&(i[j]=n),i}var Zt=class{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||z}_termFromId(e){if(e[0]==="."){let r=this._entities,i=e.split(".");return this._factory.quad(this._termFromId(r[i[1]]),this._termFromId(r[i[2]]),this._termFromId(r[i[3]]),i[4]&&this._termFromId(r[i[4]]))}return Le(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){let r=this._termToNumericId(e.subject),i=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object),s;return r&&i&&n&&(xe(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${r}.${i}.${n}.${s}`:`.${r}.${i}.${n}`]}return this._ids[we(e)]}_termToNewNumericId(e){let r=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${xe(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:we(e);return this._ids[r]||(this._ids[this._entities[++this._id]=r]=this._id)}createBlankNode(e){let r,i;if(e)for(r=e=`_:${e}`,i=1;this._ids[r];)r=e+i++;else do r=`_:b${this._blankNodeIndex++}`;while(this._ids[r]);return this._ids[r]=++this._id,this._entities[this._id]=r,this._factory.blankNode(r.substr(2))}},$e=class t{constructor(e,r){this._size=0,this._graphs=Object.create(null),!r&&e&&!e[0]&&typeof e.match!="function"&&(r=e,e=null),r=r||{},this._factory=r.factory||z,this._entityIndex=r.entityIndex||new Zt({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;let r=this._graphs,i,n;for(let s in r)for(let o in i=r[s].subjects)for(let a in n=i[o])e+=n[a][j];return this._size=e}_addToIndex(e,r,i,n){let s=e[r];s||(e[r]=s={[j]:0},e[j]++);let o=s[i];o||(s[i]=o={[j]:0},s[j]++);let a=n in o;return a||(o[n]=null,o[j]++),!a}_removeFromIndex(e,r,i,n){let s=e[r],o=s[i];delete o[n],--o[j]===0&&(delete s[i],--s[j]===0&&(delete e[r],e[j]--))}*_findInIndex(e,r,i,n,s,o,a,u){let l=this._entities,f=this._termFromId(l[u]),c={subject:null,predicate:null,object:null};if(n){let d=e[r],b=d&&d[i];if(!b||!(n in b))return;c[s]=this._termFromId(l[r]),c[o]=this._termFromId(l[i]),c[a]=this._termFromId(l[n]),yield this._factory.quad(c.subject,c.predicate,c.object,f);return}if(r&&!(r in e))return;let h=r?null:Object.keys(e);for(let d=0,b=r||h[0];b;b=h&&h[++d]){let p=e[b];if(!p)continue;if(c[s]=this._termFromId(l[b]),i&&!(i in p))return;let g=i?null:Object.keys(p);for(let w=0,m=i||g[0];m;m=g&&g[++w]){let E=p[m];if(!E)continue;c[o]=this._termFromId(l[m]);let y=Object.keys(E);for(let I=0;I<y.length;I++)c[a]=this._termFromId(l[y[I]]),yield this._factory.quad(c.subject,c.predicate,c.object,f)}}}_loop(e,r){for(let i in e)r(i)}_loopByKey0(e,r,i){let n,s;if(n=e[r])for(s in n)i(s)}_loopByKey1(e,r,i){let n,s;for(n in e)s=e[n],s[r]&&i(n)}_loopBy2Keys(e,r,i,n){let s,o,a;if((s=e[r])&&(o=s[i]))for(a in o)n(a)}_loopByKey0Deep(e,r,i){let n,s,o,a;if(n=e[r])for(o in n){s=n[o];for(a in s)i(a)}}_countInIndex(e,r,i,n){let s=0,o,a;if(r){if(!(o=e[r]))return 0;if(i)return(a=o[i])?n?n in a?1:0:a[j]:0;for(let u in o)s+=o[u][j];return s}for(let u in e){o=e[u];for(let l in o)s+=o[l][j]}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){let r=Object.create(null);return i=>{i in r||(r[i]=!0,e(this._termFromId(this._entities[i],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,r,i,n){r||(n=e.graph,i=e.object,r=e.predicate,e=e.subject),n=n?this._termToNewNumericId(n):1;let s=this._graphs[n];return s||(s=this._graphs[n]={subjects:{[j]:0},predicates:{[j]:0},objects:{[j]:0}},Object.freeze(s)),e=this._termToNewNumericId(e),r=this._termToNewNumericId(r),i=this._termToNewNumericId(i),this._addToIndex(s.subjects,e,r,i)?(this._addToIndex(s.predicates,r,i,e),this._addToIndex(s.objects,i,e,r),this._size=null,!0):!1}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}delete(e){return this.removeQuad(e),this}has(e,r,i,n){if(e&&e.subject&&({subject:e,predicate:r,object:i,graph:n}=e),e&&r&&i&&n!==void 0&&n!==null){let s=this._termToNumericId(e),o=this._termToNumericId(r),a=this._termToNumericId(i),u=n===""||xe(n)?1:this._termToNumericId(n),l=u&&this._graphs[u];return!!s&&!!o&&!!a&&!!l&&hp(l.subjects,s,o,a)}return!this.readQuads(e,r,i,n).next().done}import(e){return e.on("data",r=>{this.addQuad(r)}),e}removeQuad(e,r,i,n){r||({subject:e,predicate:r,object:i,graph:n}=e),n=n?this._termToNumericId(n):1;let s=this._graphs,o,a,u;return!(e=e&&this._termToNumericId(e))||!(r=r&&this._termToNumericId(r))||!(i=i&&this._termToNumericId(i))||!(o=s[n])||!(a=o.subjects[e])||!(u=a[r])||!(i in u)?!1:(this._removeFromIndex(o.subjects,e,r,i),this._removeFromIndex(o.predicates,r,i,e),this._removeFromIndex(o.objects,i,e,r),this._size!==null&&this._size--,o.subjects[j]===0&&delete s[n],!0)}removeQuads(e){for(let r=0;r<e.length;r++)this.removeQuad(e[r])}remove(e){return e.on("data",r=>{this.removeQuad(r)}),e}removeMatches(e,r,i,n){let s=new In.Readable({objectMode:!0}),o=this.readQuads(e,r,i,n);return s._read=a=>{for(;--a>=0;){let{done:u,value:l}=o.next();if(u){s.push(null);return}s.push(l)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,r,i,n){return[...this.readQuads(e,r,i,n)]}*readQuads(e,r,i,n){let s=this._getGraphs(n),o,a,u,l;if(!(e&&!(a=this._termToNumericId(e))||r&&!(u=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(let f in s)(o=s[f])&&(a?l?yield*re(this._findInIndex(o.objects,l,a,u,"object","subject","predicate",f)):yield*re(this._findInIndex(o.subjects,a,u,null,"subject","predicate","object",f)):u?yield*re(this._findInIndex(o.predicates,u,l,null,"predicate","object","subject",f)):l?yield*re(this._findInIndex(o.objects,l,null,null,"object","subject","predicate",f)):yield*re(this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",f)))}match(e,r,i,n){return new Me(this,e,r,i,n,{entityIndex:this._entityIndex})}countQuads(e,r,i,n){let s=this._getGraphs(n),o=0,a,u,l,f;if(e&&!(u=this._termToNumericId(e))||r&&!(l=this._termToNumericId(r))||i&&!(f=this._termToNumericId(i)))return 0;for(let c in s)(a=s[c])&&(e?i?o+=this._countInIndex(a.objects,f,u,l):o+=this._countInIndex(a.subjects,u,l,f):r?o+=this._countInIndex(a.predicates,l,f,u):o+=this._countInIndex(a.objects,f,u,l));return o}forEach(e,r,i,n,s){this.some(o=>(e(o,this),!1),r,i,n,s)}every(e,r,i,n,s){return!this.some(o=>!e(o,this),r,i,n,s)}some(e,r,i,n,s){for(let o of this.readQuads(r,i,n,s))if(e(o,this))return!0;return!1}getSubjects(e,r,i){let n=[];return this.forSubjects(s=>{n.push(s)},e,r,i),n}forSubjects(e,r,i,n){let s=this._getGraphs(n),o,a,u;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(u=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?u?this._loopBy2Keys(o.predicates,a,u,e):this._loopByKey1(o.subjects,a,e):u?this._loopByKey0(o.objects,u,e):this._loop(o.subjects,e))}getPredicates(e,r,i){let n=[];return this.forPredicates(s=>{n.push(s)},e,r,i),n}forPredicates(e,r,i,n){let s=this._getGraphs(n),o,a,u;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(u=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?u?this._loopBy2Keys(o.objects,u,a,e):this._loopByKey0(o.subjects,a,e):u?this._loopByKey1(o.predicates,u,e):this._loop(o.predicates,e))}getObjects(e,r,i){let n=[];return this.forObjects(s=>{n.push(s)},e,r,i),n}forObjects(e,r,i,n){let s=this._getGraphs(n),o,a,u;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(u=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?u?this._loopBy2Keys(o.subjects,a,u,e):this._loopByKey0Deep(o.subjects,a,e):u?this._loopByKey0(o.predicates,u,e):this._loop(o.objects,e))}getGraphs(e,r,i){let n=[];return this.forGraphs(s=>{n.push(s)},e,r,i),n}forGraphs(e,r,i,n){for(let s in this._graphs)this.some(o=>(e(o.graph),!0),r,i,n,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:r=!1}={}){let i=Object.create(null),n=r?(()=>!0):((a,u)=>{throw new Error(`${a.value} ${u}`)}),s=this.getQuads(null,A.rdf.rest,A.rdf.nil,null),o=e?[...s]:[];return s.forEach(a=>{let u=[],l=!1,f,c,h=a.graph,d=a.subject;for(;d&&!l;){let b=this.getQuads(null,null,d,null),p=this.getQuads(d,null,null,null),g,w=null,m=null,E=null;for(let y=0;y<p.length&&!l;y++)g=p[y],g.graph.equals(h)?f?l=n(d,"has non-list arcs out"):g.predicate.value===A.rdf.first?w?l=n(d,"has multiple rdf:first arcs"):o.push(w=g):g.predicate.value===A.rdf.rest?m?l=n(d,"has multiple rdf:rest arcs"):o.push(m=g):b.length?l=n(d,"can't be subject and object"):(f=g,c="subject"):l=n(d,"not confined to single graph");for(let y=0;y<b.length&&!l;++y)g=b[y],f?l=n(d,"can't have coreferences"):g.predicate.value===A.rdf.rest?E?l=n(d,"has incoming rdf:rest arcs"):E=g:(f=g,c="object");w?u.unshift(w.object):l=n(d,"has no list head"),d=E&&E.subject}l?e=!1:f&&(i[f[c].value]=u)}),e&&this.removeQuads(o),i}addAll(e){if(e instanceof Me&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof t&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=Pt(this._graphs,e._graphs),this._size=null);else for(let r of e)this.add(r);return this}contains(e){if(e instanceof Me&&(e=e.filtered),e===this)return!0;if(!(e instanceof t)||this._entityIndex!==e._entityIndex)return e.every(l=>this.has(l));let r=this._graphs,i=e._graphs,n,s,o,a,u;for(let l in i){if(!(n=r[l]))return!1;n=n.subjects;for(let f in s=i[l].subjects){if(!(o=n[f]))return!1;for(let c in a=s[f]){if(!(u=o[c]))return!1;for(let h in a[c])if(!(h in u))return!1}}}return!0}deleteMatches(e,r,i,n){for(let s of this.match(e,r,i,n))this.removeQuad(s);return this}difference(e){if(e&&e instanceof Me&&(e=e.filtered),e===this)return new t({entityIndex:this._entityIndex});if(e instanceof t&&e._entityIndex===this._entityIndex){let r=new t({entityIndex:this._entityIndex}),i=Rl(this._graphs,e._graphs);return i&&(r._graphs=i,r._size=null),r}return this.filter(r=>!e.has(r))}equals(e){return e instanceof Me&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)e(i,this)&&r.add(i);return r}intersection(e){if(e instanceof Me&&(e=e.filtered),e===this){let r=new t({entityIndex:this._entityIndex});return r._graphs=Pt(Object.create(null),this._graphs),r._size=this._size,r}else if(e instanceof t&&this._entityIndex===e._entityIndex){let r=new t({entityIndex:this._entityIndex}),i=Il(e._graphs,this._graphs);return i&&(r._graphs=i,r._size=null),r}return this.filter(r=>e.has(r))}map(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)r.add(e(i,this));return r}reduce(e,r){let i=this.readQuads(),n=r===void 0?i.next().value:r;for(let s of i)n=e(n,s,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new oe().quadsToString(this)}union(e){let r=new t({entityIndex:this._entityIndex});return r._graphs=Pt(Object.create(null),this._graphs),r._size=this._size,r.addAll(e),r}[Symbol.iterator](){return this.readQuads()}};function pe(t,e,r=0){let i=e[r];if(i&&!(i in t))return!1;let n=!1,s=0;for(let o in i?{[i]:t[i]}:t){let a=r===2?null:pe(t[o],e,r+1);a!==!1&&(n=n||Object.create(null),n[o]=a,s++)}return n&&(n[j]=s),n}var Me=class t extends In.Readable{constructor(e,r,i,n,s,o){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:r,predicate:i,object:n,graph:s,options:o})}get filtered(){if(!this._filtered){let{n3Store:e,graph:r,object:i,predicate:n,subject:s}=this,o=this._filtered=new $e({factory:e._factory,entityIndex:this.options.entityIndex}),a,u,l;if(s&&!(a=o._termToNumericId(s))||n&&!(u=o._termToNumericId(n))||i&&!(l=o._termToNumericId(i)))return o;let f=e._getGraphs(r);for(let c in f){let h,d,b,p;(p=f[c])&&(!a&&u?(d=pe(p.predicates,[u,l,a]))&&(h=pe(p.subjects,[a,u,l]),b=pe(p.objects,[l,a,u])):l?(b=pe(p.objects,[l,a,u]))&&(h=pe(p.subjects,[a,u,l]),d=pe(p.predicates,[u,l,a])):(h=pe(p.subjects,[a,u,l]))&&(d=pe(p.predicates,[u,l,a]),b=pe(p.objects,[l,a,u])),h&&(o._graphs[c]={subjects:h,predicates:d,objects:b}))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Sn]&&(this[Sn]=this[Symbol.iterator]());let r=this[Sn];for(;--e>=0;){let{done:i,value:n}=r.next();if(i){this.push(null);return}this.push(n)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,r,i,n){return this.filtered.deleteMatches(e,r,i,n)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,r,i,n,s){return this.filtered.every(e,r,i,n,s)}filter(e){return this.filtered.filter(e)}forEach(e,r,i,n,s){return this.filtered.forEach(e,r,i,n,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,r,i,n,s){return this.filtered.some(e,r,i,n,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,r){return this.filtered.reduce(e,r)}toString(){return new oe().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,r,i,n){return new t(this.filtered,e,r,i,n,this.options)}[Symbol.iterator](){return this._filtered?this._filtered[Symbol.iterator]():this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}};var Xt=class{dataset(e){return new $e(e)}};function Al(t){let e=[];for(let{subject:r,object:i}of t.match(null,z.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,z.defaultGraph())){let n=[...t.match(null,null,null,r)],s=[...t.match(null,null,null,i)];e.push({premise:n,conclusion:s})}return e}var Jt=class{constructor(e,r={}){this._store=e,this._maxDerivations=r.maxDerivations===void 0?1/0:r.maxDerivations,this._maxPremiseDepth=r.maxPremiseDepth===void 0?1/0:r.maxPremiseDepth}_add(e,r,i,n,s,o){if(this._store._addToIndex(n.subjects,e,r,i)){if(this._store._addToIndex(n.predicates,r,i,e),this._store._addToIndex(n.objects,i,e,r),++this._derivations>this._maxDerivations)throw new Error(`Reasoning exceeded the maximum of ${this._maxDerivations} derivations`);o(s)}}_emit(e,r,i){let n=e.conclusion;for(let s=0;s<n.length;s++){let o=n[s];this._add(o.subject.value,o.predicate.value,o.object.value,r,o,i)}}_evaluatePremise(e,r,i,n=0){let s,o,[a,u,l]=e.premise[n].value,f=r[e.premise[n].content],c=n===e.premise.length-1;if(!(s=a.value)){for(s in f)o=f[s],a.value=Number(s),this._evaluateLevel1(e,r,i,n,c,u,l,o);a.value=null}else(o=f[s])&&this._evaluateLevel1(e,r,i,n,c,u,l,o)}_evaluateLevel1(e,r,i,n,s,o,a,u){let l,f;if(!(l=o.value)){for(l in u)f=u[l],o.value=Number(l),this._evaluateLevel2(e,r,i,n,s,a,f);o.value=null}else(f=u[l])&&this._evaluateLevel2(e,r,i,n,s,a,f)}_evaluateLevel2(e,r,i,n,s,o,a){let u;if(!(u=o.value)){for(u in a)o.value=Number(u),s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1);o.value=null}else s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1)}_evaluateRules(e,r,i){for(let n=0;n<e.length;n++)this._evaluatePremise(e[n],r,i)}_reasonGraphNaive(e,r){let i=[];function n(a){a.next&&a.next.forEach(u=>{i.push([a.subject.value,a.predicate.value,a.object.value,u])})}let s=a=>{for(let u=0;u<a.length;u++){let l=a[u];this._add(l.subject.value,l.predicate.value,l.object.value,r,l,n)}};this._evaluateRules(e,r,n);let o;for(;(o=i.pop())!==void 0;){let[a,u,l,f]=o,c=f.basePremise.subject.value;c||(f.basePremise.subject.value=a);let h=f.basePremise.predicate.value;h||(f.basePremise.predicate.value=u);let d=f.basePremise.object.value;d||(f.basePremise.object.value=l),f.premise.length===0?s(f.conclusion):this._evaluatePremise(f,r,n),c||(f.basePremise.subject.value=null),h||(f.basePremise.predicate.value=null),d||(f.basePremise.object.value=null)}}_createRule({premise:e,conclusion:r}){let i={},n=o=>o.termType==="Variable"?i[o.value]=i[o.value]||{}:{value:this._store._termToNewNumericId(o)},s=o=>({subject:n(o.subject),predicate:n(o.predicate),object:n(o.object)});return{premise:e.map(o=>s(o)),conclusion:r.map(o=>s(o)),variables:Object.values(i)}}reason(e){this._derivations=0,Array.isArray(e)||(e=Al(e)),e=e.map(i=>this._createRule(i));for(let i of e)if(i.premise.length>this._maxPremiseDepth)throw new Error(`Reasoning rule exceeds the maximum premise depth of ${this._maxPremiseDepth}`);for(let i of e)for(let n of e)for(let s=0;s<n.premise.length;s++){let o=n.premise[s];for(let a of i.conclusion){if(Rn(o.subject,a.subject)&&Rn(o.predicate,a.predicate)&&Rn(o.object,a.object)){let u=new Set,l=[];o.subject.value=o.subject.value||1,o.object.value=o.object.value||1,o.predicate.value=o.predicate.value||1;for(let f=0;f<n.premise.length;f++)f!==s&&l.push(Tl(n.premise[f],u));(a.next=a.next||[]).push({premise:l,conclusion:n.conclusion,basePremise:o})}for(let u=0;u<n.variables.length;u++)n.variables[u].value=null}}for(let i of e){let n=new Set;i.premise=i.premise.map(s=>Tl(s,n))}let r=this._store._getGraphs();try{for(let i in r)this._reasonGraphNaive(e,r[i])}finally{this._store._size=null}}};function Tl({subject:t,predicate:e,object:r},i){let n=t.value||i.has(t)||(i.add(t),!1),s=e.value||i.has(e)||(i.add(e),!1),o=r.value||i.has(r)||(i.add(r),!1);return!n&&s?{content:"predicates",value:[e,r,t]}:o?{content:"objects",value:[r,t,e]}:{content:"subjects",value:[t,e,r]}}function Rn(t,e){return t.value===null&&(t.value=e.value),t.value===e.value}var Nl=ir(Vr());var er=class extends Nl.Transform{constructor(e){super({decodeStrings:!0,readableObjectMode:!0});let r=new me(e),i,n,s={onQuad:(o,a)=>{o&&this.emit("error",o)||a&&this.push(a)},onPrefix:(o,a)=>{this.emit("prefix",o,a)}};e&&e.comments&&(s.onComment=o=>{this.emit("comment",o)}),r.parse({on:(o,a)=>{switch(o){case"data":i=a;break;case"end":n=a;break}}},s),this._transform=(o,a,u)=>{i(o),u()},this._flush=o=>{n(),o()}}import(e){return e.on("error",r=>{this.emit("error",r)}),typeof e.pipe=="function"?e.pipe(this):(e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()})),this}};var vl=ir(Vr());var _p=16*1024,pp=20,tr=class extends vl.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0}),this._buffer="",this._flushTimer=null,this._flushDelay=e&&e.flushDelay!==void 0?e.flushDelay:pp;let r=this._writer=new oe({write:(s,o,a)=>{this._buffer+=s,this._buffer.length>=_p?this._pushBuffer():this._flushTimer===null&&this._armFlushTimer(),a&&a()},end:s=>{this._pushBuffer(),this.push(null),s&&s()}},e),i=null,n=s=>{let o=i;i=null,s&&this._pushBuffer(),o(s)};this._transform=(s,o,a)=>{i=a,r.addQuad(s,n)},this._flush=s=>{r.end(s)}}_pushBuffer(){this._clearFlushTimer(),this._buffer!==""&&(this.push(this._buffer),this._buffer="")}_armFlushTimer(){this._flushTimer=setTimeout(()=>{this._flushTimer=null,this._pushBuffer()},this._flushDelay),this._flushTimer.unref&&this._flushTimer.unref()}_clearFlushTimer(){this._flushTimer!==null&&(clearTimeout(this._flushTimer),this._flushTimer=null)}_destroy(e,r){this._clearFlushTimer(),super._destroy(e,r)}import(e){return e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()}),e.on("error",r=>{this._pushBuffer(),this.emit("error",r)}),e.on("prefix",(r,i)=>{this._writer.addPrefix(r,i)}),this}};var zb={Lexer:We,Parser:me,Writer:oe,Store:$e,StoreFactory:Xt,EntityIndex:Zt,StreamParser:er,StreamWriter:tr,Util:si,Reasoner:Jt,BaseIRI:Ge,DataFactory:z,Term:H,NamedNode:ct,Literal:ge,BlankNode:Ft,Variable:Bt,DefaultGraph:Ct,Quad:Fe,Triple:Fe,termFromId:Le,termToId:we};export{Ge as BaseIRI,Ft as BlankNode,z as DataFactory,Ct as DefaultGraph,Zt as EntityIndex,We as Lexer,ge as Literal,ct as NamedNode,me as Parser,Fe as Quad,Jt as Reasoner,$e as Store,Xt as StoreFactory,er as StreamParser,tr as StreamWriter,H as Term,Fe as Triple,si as Util,Bt as Variable,oe as Writer,zb as default,Al as getRulesFromDataset,Le as termFromId,we as termToId};
23
+ `),this._subject=null),this._write=this._blockedWrite;let r=e&&((i,n)=>{r=null,e(i,n)});if(this._endStream)try{return this._outputStream.end(r)}catch(i){}r&&r()}};function hs(t){let e=Mu[t];return e===void 0&&(t.length===1?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((t.charCodeAt(0)-55296)*1024+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var Rn=ir(Qr());var In=Symbol("iter"),L=Symbol("size");function hp(t,e,r,i){let n=t&&t[e],s=n&&n[r];return!!s&&i in s}function Pt(t,e,r=4){let i=t[L]||0;for(let n in e)n in t?r!==0&&(t[n]=Pt(t[n],e[n],r-1)):(i++,t[n]=r===0?null:Pt(Object.create(null),e[n],r-1));return r<=2&&(t[L]=i),t}function Il(t,e,r=4){let i=!1,n=0;r<=2&&e[L]<t[L]&&([t,e]=[e,t]);for(let s in t)if(s in e){let o=r===0?null:Il(t[s],e[s],r-1);if(o!==!1)i=i||Object.create(null),i[s]=o,n++;else if(r===3)return!1}return r<=2&&i&&(i[L]=n),i}function Rl(t,e,r=4){let i=!1,n=0;for(let s in t)if(!(s in e))i=i||Object.create(null),i[s]=r===0?null:Pt({},t[s],r-1),n++;else if(r!==0){let o=Rl(t[s],e[s],r-1);if(o!==!1)i=i||Object.create(null),i[s]=o,n++;else if(r===3)return!1}return r<=2&&i&&(i[L]=n),i}var Zt=class{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||K}_termFromId(e){if(e[0]==="."){let r=this._entities,i=e.split(".");return this._factory.quad(this._termFromId(r[i[1]]),this._termFromId(r[i[2]]),this._termFromId(r[i[3]]),i[4]&&this._termFromId(r[i[4]]))}return Fe(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){let r=this._termToNumericId(e.subject),i=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object),s;return r&&i&&n&&(Ee(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${r}.${i}.${n}.${s}`:`.${r}.${i}.${n}`]}return this._ids[me(e)]}_termToNewNumericId(e){let r=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Ee(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:me(e);return this._ids[r]||(this._ids[this._entities[++this._id]=r]=this._id)}createBlankNode(e){let r,i;if(e)for(r=e=`_:${e}`,i=1;this._ids[r];)r=e+i++;else do r=`_:b${this._blankNodeIndex++}`;while(this._ids[r]);return this._ids[r]=++this._id,this._entities[this._id]=r,this._factory.blankNode(r.substr(2))}},ke=class t{constructor(e,r){this._size=0,this._graphs=Object.create(null),!r&&e&&!e[0]&&typeof e.match!="function"&&(r=e,e=null),r=r||{},this._factory=r.factory||K,this._entityIndex=r.entityIndex||new Zt({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;let r=this._graphs,i,n;for(let s in r)for(let o in i=r[s].subjects)for(let a in n=i[o])e+=n[a][L];return this._size=e}_addToIndex(e,r,i,n){let s=e[r];s||(e[r]=s={[L]:0},e[L]++);let o=s[i];o||(s[i]=o={[L]:0},s[L]++);let a=n in o;return a||(o[n]=null,o[L]++),!a}_removeFromIndex(e,r,i,n){let s=e[r],o=s[i];delete o[n],--o[L]===0&&(delete s[i],--s[L]===0&&(delete e[r],e[L]--))}*_findInIndex(e,r,i,n,s,o,a,l){let u=this._entities,f=this._termFromId(u[l]),c={subject:null,predicate:null,object:null};if(n){let d=e[r],_=d&&d[i];if(!_||!(n in _))return;c[s]=this._termFromId(u[r]),c[o]=this._termFromId(u[i]),c[a]=this._termFromId(u[n]),yield this._factory.quad(c.subject,c.predicate,c.object,f);return}if(r&&!(r in e))return;let b=r?null:Object.keys(e);for(let d=0,_=r||b[0];_;_=b&&b[++d]){let p=e[_];if(!p)continue;if(c[s]=this._termFromId(u[_]),i&&!(i in p))return;let y=i?null:Object.keys(p);for(let m=0,R=i||y[0];R;R=y&&y[++m]){let S=p[R];if(!S)continue;c[o]=this._termFromId(u[R]);let g=Object.keys(S);for(let w=0;w<g.length;w++)c[a]=this._termFromId(u[g[w]]),yield this._factory.quad(c.subject,c.predicate,c.object,f)}}}_loop(e,r){for(let i in e)r(i)}_loopByKey0(e,r,i){let n,s;if(n=e[r])for(s in n)i(s)}_loopByKey1(e,r,i){let n,s;for(n in e)s=e[n],s[r]&&i(n)}_loopBy2Keys(e,r,i,n){let s,o,a;if((s=e[r])&&(o=s[i]))for(a in o)n(a)}_loopByKey0Deep(e,r,i){let n,s,o,a;if(n=e[r])for(o in n){s=n[o];for(a in s)i(a)}}_countInIndex(e,r,i,n){let s=0,o,a;if(r){if(!(o=e[r]))return 0;if(i)return(a=o[i])?n?n in a?1:0:a[L]:0;for(let l in o)s+=o[l][L];return s}for(let l in e){o=e[l];for(let u in o)s+=o[u][L]}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){let r=Object.create(null);return i=>{i in r||(r[i]=!0,e(this._termFromId(this._entities[i],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,r,i,n){r||(n=e.graph,i=e.object,r=e.predicate,e=e.subject),n=n?this._termToNewNumericId(n):1;let s=this._graphs[n];return s||(s=this._graphs[n]={subjects:{[L]:0},predicates:{[L]:0},objects:{[L]:0}},Object.freeze(s)),e=this._termToNewNumericId(e),r=this._termToNewNumericId(r),i=this._termToNewNumericId(i),this._addToIndex(s.subjects,e,r,i)?(this._addToIndex(s.predicates,r,i,e),this._addToIndex(s.objects,i,e,r),this._size=null,!0):!1}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}delete(e){return this.removeQuad(e),this}has(e,r,i,n){if(e&&e.subject&&({subject:e,predicate:r,object:i,graph:n}=e),e&&r&&i&&n!==void 0&&n!==null){let s=this._termToNumericId(e),o=this._termToNumericId(r),a=this._termToNumericId(i),l=n===""||Ee(n)?1:this._termToNumericId(n),u=l&&this._graphs[l];return!!s&&!!o&&!!a&&!!u&&hp(u.subjects,s,o,a)}return!this.readQuads(e,r,i,n).next().done}import(e){return e.on("data",r=>{this.addQuad(r)}),e}removeQuad(e,r,i,n){r||({subject:e,predicate:r,object:i,graph:n}=e),n=n?this._termToNumericId(n):1;let s=this._graphs,o,a,l;return!(e=e&&this._termToNumericId(e))||!(r=r&&this._termToNumericId(r))||!(i=i&&this._termToNumericId(i))||!(o=s[n])||!(a=o.subjects[e])||!(l=a[r])||!(i in l)?!1:(this._removeFromIndex(o.subjects,e,r,i),this._removeFromIndex(o.predicates,r,i,e),this._removeFromIndex(o.objects,i,e,r),this._size!==null&&this._size--,o.subjects[L]===0&&delete s[n],!0)}removeQuads(e){for(let r=0;r<e.length;r++)this.removeQuad(e[r])}remove(e){return e.on("data",r=>{this.removeQuad(r)}),e}removeMatches(e,r,i,n){let s=new Rn.Readable({objectMode:!0}),o=this.readQuads(e,r,i,n);return s._read=a=>{for(;--a>=0;){let{done:l,value:u}=o.next();if(l){s.push(null);return}s.push(u)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,r,i,n){return[...this.readQuads(e,r,i,n)]}*readQuads(e,r,i,n){let s=this._getGraphs(n),o,a,l,u;if(!(e&&!(a=this._termToNumericId(e))||r&&!(l=this._termToNumericId(r))||i&&!(u=this._termToNumericId(i))))for(let f in s)(o=s[f])&&(a?u?yield*re(this._findInIndex(o.objects,u,a,l,"object","subject","predicate",f)):yield*re(this._findInIndex(o.subjects,a,l,null,"subject","predicate","object",f)):l?yield*re(this._findInIndex(o.predicates,l,u,null,"predicate","object","subject",f)):u?yield*re(this._findInIndex(o.objects,u,null,null,"object","subject","predicate",f)):yield*re(this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",f)))}match(e,r,i,n){return new $e(this,e,r,i,n,{entityIndex:this._entityIndex})}countQuads(e,r,i,n){let s=this._getGraphs(n),o=0,a,l,u,f;if(e&&!(l=this._termToNumericId(e))||r&&!(u=this._termToNumericId(r))||i&&!(f=this._termToNumericId(i)))return 0;for(let c in s)(a=s[c])&&(e?i?o+=this._countInIndex(a.objects,f,l,u):o+=this._countInIndex(a.subjects,l,u,f):r?o+=this._countInIndex(a.predicates,u,f,l):o+=this._countInIndex(a.objects,f,l,u));return o}forEach(e,r,i,n,s){this.some(o=>(e(o,this),!1),r,i,n,s)}every(e,r,i,n,s){return!this.some(o=>!e(o,this),r,i,n,s)}some(e,r,i,n,s){for(let o of this.readQuads(r,i,n,s))if(e(o,this))return!0;return!1}getSubjects(e,r,i){let n=[];return this.forSubjects(s=>{n.push(s)},e,r,i),n}forSubjects(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.predicates,a,l,e):this._loopByKey1(o.subjects,a,e):l?this._loopByKey0(o.objects,l,e):this._loop(o.subjects,e))}getPredicates(e,r,i){let n=[];return this.forPredicates(s=>{n.push(s)},e,r,i),n}forPredicates(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.objects,l,a,e):this._loopByKey0(o.subjects,a,e):l?this._loopByKey1(o.predicates,l,e):this._loop(o.predicates,e))}getObjects(e,r,i){let n=[];return this.forObjects(s=>{n.push(s)},e,r,i),n}forObjects(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.subjects,a,l,e):this._loopByKey0Deep(o.subjects,a,e):l?this._loopByKey0(o.predicates,l,e):this._loop(o.objects,e))}getGraphs(e,r,i){let n=[];return this.forGraphs(s=>{n.push(s)},e,r,i),n}forGraphs(e,r,i,n){for(let s in this._graphs)this.some(o=>(e(o.graph),!0),r,i,n,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:r=!1}={}){let i=Object.create(null),n=r?(()=>!0):((a,l)=>{throw new Error(`${a.value} ${l}`)}),s=this.getQuads(null,N.rdf.rest,N.rdf.nil,null),o=e?[...s]:[];return s.forEach(a=>{let l=[],u=!1,f,c,b=a.graph,d=a.subject;for(;d&&!u;){let _=this.getQuads(null,null,d,null),p=this.getQuads(d,null,null,null),y,m=null,R=null,S=null;for(let g=0;g<p.length&&!u;g++)y=p[g],y.graph.equals(b)?f?u=n(d,"has non-list arcs out"):y.predicate.value===N.rdf.first?m?u=n(d,"has multiple rdf:first arcs"):o.push(m=y):y.predicate.value===N.rdf.rest?R?u=n(d,"has multiple rdf:rest arcs"):o.push(R=y):_.length?u=n(d,"can't be subject and object"):(f=y,c="subject"):u=n(d,"not confined to single graph");for(let g=0;g<_.length&&!u;++g)y=_[g],f?u=n(d,"can't have coreferences"):y.predicate.value===N.rdf.rest?S?u=n(d,"has incoming rdf:rest arcs"):S=y:(f=y,c="object");m?l.unshift(m.object):u=n(d,"has no list head"),d=S&&S.subject}u?e=!1:f&&(i[f[c].value]=l)}),e&&this.removeQuads(o),i}addAll(e){if(e instanceof $e&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof t&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=Pt(this._graphs,e._graphs),this._size=null);else for(let r of e)this.add(r);return this}contains(e){if(e instanceof $e&&(e=e.filtered),e===this)return!0;if(!(e instanceof t)||this._entityIndex!==e._entityIndex)return e.every(u=>this.has(u));let r=this._graphs,i=e._graphs,n,s,o,a,l;for(let u in i){if(!(n=r[u]))return!1;n=n.subjects;for(let f in s=i[u].subjects){if(!(o=n[f]))return!1;for(let c in a=s[f]){if(!(l=o[c]))return!1;for(let b in a[c])if(!(b in l))return!1}}}return!0}deleteMatches(e,r,i,n){for(let s of this.match(e,r,i,n))this.removeQuad(s);return this}difference(e){if(e&&e instanceof $e&&(e=e.filtered),e===this)return new t({entityIndex:this._entityIndex});if(e instanceof t&&e._entityIndex===this._entityIndex){let r=new t({entityIndex:this._entityIndex}),i=Rl(this._graphs,e._graphs);return i&&(r._graphs=i,r._size=null),r}return this.filter(r=>!e.has(r))}equals(e){return e instanceof $e&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)e(i,this)&&r.add(i);return r}intersection(e){if(e instanceof $e&&(e=e.filtered),e===this){let r=new t({entityIndex:this._entityIndex});return r._graphs=Pt(Object.create(null),this._graphs),r._size=this._size,r}else if(e instanceof t&&this._entityIndex===e._entityIndex){let r=new t({entityIndex:this._entityIndex}),i=Il(e._graphs,this._graphs);return i&&(r._graphs=i,r._size=null),r}return this.filter(r=>e.has(r))}map(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)r.add(e(i,this));return r}reduce(e,r){let i=this.readQuads(),n=r===void 0?i.next().value:r;for(let s of i)n=e(n,s,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new oe().quadsToString(this)}union(e){let r=new t({entityIndex:this._entityIndex});return r._graphs=Pt(Object.create(null),this._graphs),r._size=this._size,r.addAll(e),r}[Symbol.iterator](){return this.readQuads()}};function pe(t,e,r=0){let i=e[r];if(i&&!(i in t))return!1;let n=!1,s=0;for(let o in i?{[i]:t[i]}:t){let a=r===2?null:pe(t[o],e,r+1);a!==!1&&(n=n||Object.create(null),n[o]=a,s++)}return n&&(n[L]=s),n}var $e=class t extends Rn.Readable{constructor(e,r,i,n,s,o){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:r,predicate:i,object:n,graph:s,options:o})}get filtered(){if(!this._filtered){let{n3Store:e,graph:r,object:i,predicate:n,subject:s}=this,o=this._filtered=new ke({factory:e._factory,entityIndex:this.options.entityIndex}),a,l,u;if(s&&!(a=o._termToNumericId(s))||n&&!(l=o._termToNumericId(n))||i&&!(u=o._termToNumericId(i)))return o;let f=e._getGraphs(r);for(let c in f){let b,d,_,p;(p=f[c])&&(!a&&l?(d=pe(p.predicates,[l,u,a]))&&(b=pe(p.subjects,[a,l,u]),_=pe(p.objects,[u,a,l])):u?(_=pe(p.objects,[u,a,l]))&&(b=pe(p.subjects,[a,l,u]),d=pe(p.predicates,[l,u,a])):(b=pe(p.subjects,[a,l,u]))&&(d=pe(p.predicates,[l,u,a]),_=pe(p.objects,[u,a,l])),b&&(o._graphs[c]={subjects:b,predicates:d,objects:_}))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[In]&&(this[In]=this[Symbol.iterator]());let r=this[In];for(;--e>=0;){let{done:i,value:n}=r.next();if(i){this.push(null);return}this.push(n)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,r,i,n){return this.filtered.deleteMatches(e,r,i,n)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,r,i,n,s){return this.filtered.every(e,r,i,n,s)}filter(e){return this.filtered.filter(e)}forEach(e,r,i,n,s){return this.filtered.forEach(e,r,i,n,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,r,i,n,s){return this.filtered.some(e,r,i,n,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,r){return this.filtered.reduce(e,r)}toString(){return new oe().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,r,i,n){return new t(this.filtered,e,r,i,n,this.options)}[Symbol.iterator](){return this._filtered?this._filtered[Symbol.iterator]():this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}};var Xt=class{dataset(e){return new ke(e)}};function Al(t){let e=[];for(let{subject:r,object:i}of t.match(null,K.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,K.defaultGraph())){let n=[...t.match(null,null,null,r)],s=[...t.match(null,null,null,i)];e.push({premise:n,conclusion:s})}return e}var Jt=class{constructor(e,r={}){this._store=e,this._maxDerivations=r.maxDerivations===void 0?1/0:r.maxDerivations,this._maxPremiseDepth=r.maxPremiseDepth===void 0?1/0:r.maxPremiseDepth}_add(e,r,i,n,s,o){if(this._store._addToIndex(n.subjects,e,r,i)){if(this._store._addToIndex(n.predicates,r,i,e),this._store._addToIndex(n.objects,i,e,r),++this._derivations>this._maxDerivations)throw new Error(`Reasoning exceeded the maximum of ${this._maxDerivations} derivations`);o(s)}}_emit(e,r,i){let n=e.conclusion;for(let s=0;s<n.length;s++){let o=n[s];this._add(o.subject.value,o.predicate.value,o.object.value,r,o,i)}}_evaluatePremise(e,r,i,n=0){let s,o,[a,l,u]=e.premise[n].value,f=r[e.premise[n].content],c=n===e.premise.length-1;if(!(s=a.value)){for(s in f)o=f[s],a.value=Number(s),this._evaluateLevel1(e,r,i,n,c,l,u,o);a.value=null}else(o=f[s])&&this._evaluateLevel1(e,r,i,n,c,l,u,o)}_evaluateLevel1(e,r,i,n,s,o,a,l){let u,f;if(!(u=o.value)){for(u in l)f=l[u],o.value=Number(u),this._evaluateLevel2(e,r,i,n,s,a,f);o.value=null}else(f=l[u])&&this._evaluateLevel2(e,r,i,n,s,a,f)}_evaluateLevel2(e,r,i,n,s,o,a){let l;if(!(l=o.value)){for(l in a)o.value=Number(l),s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1);o.value=null}else s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1)}_evaluateRules(e,r,i){for(let n=0;n<e.length;n++)this._evaluatePremise(e[n],r,i)}_reasonGraphNaive(e,r){let i=[];function n(a){a.next&&a.next.forEach(l=>{i.push([a.subject.value,a.predicate.value,a.object.value,l])})}let s=a=>{for(let l=0;l<a.length;l++){let u=a[l];this._add(u.subject.value,u.predicate.value,u.object.value,r,u,n)}};this._evaluateRules(e,r,n);let o;for(;(o=i.pop())!==void 0;){let[a,l,u,f]=o,c=f.basePremise.subject.value;c||(f.basePremise.subject.value=a);let b=f.basePremise.predicate.value;b||(f.basePremise.predicate.value=l);let d=f.basePremise.object.value;d||(f.basePremise.object.value=u),f.premise.length===0?s(f.conclusion):this._evaluatePremise(f,r,n),c||(f.basePremise.subject.value=null),b||(f.basePremise.predicate.value=null),d||(f.basePremise.object.value=null)}}_createRule({premise:e,conclusion:r}){let i={},n=o=>o.termType==="Variable"?i[o.value]=i[o.value]||{}:{value:this._store._termToNewNumericId(o)},s=o=>({subject:n(o.subject),predicate:n(o.predicate),object:n(o.object)});return{premise:e.map(o=>s(o)),conclusion:r.map(o=>s(o)),variables:Object.values(i)}}reason(e){this._derivations=0,Array.isArray(e)||(e=Al(e)),e=e.map(i=>this._createRule(i));for(let i of e)if(i.premise.length>this._maxPremiseDepth)throw new Error(`Reasoning rule exceeds the maximum premise depth of ${this._maxPremiseDepth}`);for(let i of e)for(let n of e)for(let s=0;s<n.premise.length;s++){let o=n.premise[s];for(let a of i.conclusion){if(Tn(o.subject,a.subject)&&Tn(o.predicate,a.predicate)&&Tn(o.object,a.object)){let l=new Set,u=[];o.subject.value=o.subject.value||1,o.object.value=o.object.value||1,o.predicate.value=o.predicate.value||1;for(let f=0;f<n.premise.length;f++)f!==s&&u.push(Tl(n.premise[f],l));(a.next=a.next||[]).push({premise:u,conclusion:n.conclusion,basePremise:o})}for(let l=0;l<n.variables.length;l++)n.variables[l].value=null}}for(let i of e){let n=new Set;i.premise=i.premise.map(s=>Tl(s,n))}let r=this._store._getGraphs();try{for(let i in r)this._reasonGraphNaive(e,r[i])}finally{this._store._size=null}}};function Tl({subject:t,predicate:e,object:r},i){let n=t.value||i.has(t)||(i.add(t),!1),s=e.value||i.has(e)||(i.add(e),!1),o=r.value||i.has(r)||(i.add(r),!1);return!n&&s?{content:"predicates",value:[e,r,t]}:o?{content:"objects",value:[r,t,e]}:{content:"subjects",value:[t,e,r]}}function Tn(t,e){return t.value===null&&(t.value=e.value),t.value===e.value}var Nl=ir(Qr());var er=class extends Nl.Transform{constructor(e){super({decodeStrings:!0,readableObjectMode:!0});let r=new xe(e),i,n,s={onQuad:(o,a)=>{o&&this.emit("error",o)||a&&this.push(a)},onPrefix:(o,a)=>{this.emit("prefix",o,a)}};e&&e.comments&&(s.onComment=o=>{this.emit("comment",o)}),r.parse({on:(o,a)=>{switch(o){case"data":i=a;break;case"end":n=a;break}}},s),this._transform=(o,a,l)=>{i(o),l()},this._flush=o=>{n(),o()}}import(e){return e.on("error",r=>{this.emit("error",r)}),typeof e.pipe=="function"?e.pipe(this):(e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()})),this}};var vl=ir(Qr());var _p=16*1024,pp=20,tr=class extends vl.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0}),this._buffer="",this._flushTimer=null,this._flushDelay=e&&e.flushDelay!==void 0?e.flushDelay:pp;let r=this._writer=new oe({write:(s,o,a)=>{this._buffer+=s,this._buffer.length>=_p?this._pushBuffer():this._flushTimer===null&&this._armFlushTimer(),a&&a()},end:s=>{this._pushBuffer(),this.push(null),s&&s()}},e),i=null,n=s=>{let o=i;i=null,s&&this._pushBuffer(),o(s)};this._transform=(s,o,a)=>{i=a,r.addQuad(s,n)},this._flush=s=>{r.end(s)}}_pushBuffer(){this._clearFlushTimer(),this._buffer!==""&&(this.push(this._buffer),this._buffer="")}_armFlushTimer(){this._flushTimer=setTimeout(()=>{this._flushTimer=null,this._pushBuffer()},this._flushDelay),this._flushTimer.unref&&this._flushTimer.unref()}_clearFlushTimer(){this._flushTimer!==null&&(clearTimeout(this._flushTimer),this._flushTimer=null)}_destroy(e,r){this._clearFlushTimer(),super._destroy(e,r)}import(e){return e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()}),e.on("error",r=>{this._pushBuffer(),this.emit("error",r)}),e.on("prefix",(r,i)=>{this._writer.addPrefix(r,i)}),this}};var zb={Lexer:Ge,Parser:xe,Writer:oe,Store:ke,StoreFactory:Xt,EntityIndex:Zt,StreamParser:er,StreamWriter:tr,Util:oi,Reasoner:Jt,BaseIRI:Ve,DataFactory:K,Term:z,NamedNode:ct,Literal:we,BlankNode:Ft,Variable:Bt,DefaultGraph:Ct,Quad:Be,Triple:Be,termFromId:Fe,termToId:me};export{Ve as BaseIRI,Ft as BlankNode,K as DataFactory,Ct as DefaultGraph,Zt as EntityIndex,Ge as Lexer,we as Literal,ct as NamedNode,xe as Parser,Be as Quad,Jt as Reasoner,ke as Store,Xt as StoreFactory,er as StreamParser,tr as StreamWriter,z as Term,Be as Triple,oi as Util,Bt as Variable,oe as Writer,zb as default,Al as getRulesFromDataset,Fe as termFromId,me as termToId};
24
24
  /*! Bundled license information:
25
25
 
26
26
  ieee754/index.js: