node-mock-http
Advanced tools
@@ -1,1 +0,1 @@ | ||
| "use strict";const a$1=[],l=[],x$1=typeof Uint8Array>"u"?Array:Uint8Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=i.length;t<e;++t)a$1[t]=i[t],l[i.charCodeAt(t)]=t;l[45]=62,l[95]=63;function d$1(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");n===-1&&(n=e);const r=n===e?0:4-n%4;return[n,r]}function p(t,e,n){return(e+n)*3/4-n}function toByteArray(t){let e;const n=d$1(t),r=n[0],o=n[1],f=new x$1(p(t,r,o));let h=0;const E=o>0?r-4:r;let U;for(U=0;U<E;U+=4)e=l[t.charCodeAt(U)]<<18|l[t.charCodeAt(U+1)]<<12|l[t.charCodeAt(U+2)]<<6|l[t.charCodeAt(U+3)],f[h++]=e>>16&255,f[h++]=e>>8&255,f[h++]=e&255;return o===2&&(e=l[t.charCodeAt(U)]<<2|l[t.charCodeAt(U+1)]>>4,f[h++]=e&255),o===1&&(e=l[t.charCodeAt(U)]<<10|l[t.charCodeAt(U+1)]<<4|l[t.charCodeAt(U+2)]>>2,f[h++]=e>>8&255,f[h++]=e&255),f}function u(t){return a$1[t>>18&63]+a$1[t>>12&63]+a$1[t>>6&63]+a$1[t&63]}function A$1(t,e,n){let r;const o=[];for(let f=e;f<n;f+=3)r=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(t[f+2]&255),o.push(u(r));return o.join("")}function fromByteArray(t){let e;const n=t.length,r=n%3,o=[],f=16383;for(let h=0,E=n-r;h<E;h+=f)o.push(A$1(t,h,h+f>E?E:h+f));return r===1?(e=t[n-1],o.push(a$1[e>>2]+a$1[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],o.push(a$1[e>>10]+a$1[e>>4&63]+a$1[e<<2&63]+"=")),o.join("")}/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function read(t,e,n,r,o){let f,h;const E=o*8-r-1,U=(1<<E)-1,et=U>>1;let c=-7,tt=n?o-1:0;const rt=n?-1:1;let nt=t[e+tt];for(tt+=rt,f=nt&(1<<-c)-1,nt>>=-c,c+=E;c>0;)f=f*256+t[e+tt],tt+=rt,c-=8;for(h=f&(1<<-c)-1,f>>=-c,c+=r;c>0;)h=h*256+t[e+tt],tt+=rt,c-=8;if(f===0)f=1-et;else{if(f===U)return h?Number.NaN:(nt?-1:1)*Number.POSITIVE_INFINITY;h=h+Math.pow(2,r),f=f-et}return(nt?-1:1)*h*Math.pow(2,f-r)}function write(t,e,n,r,o,f){let h,E,U,et=f*8-o-1;const c=(1<<et)-1,tt=c>>1,rt=o===23?Math.pow(2,-24)-Math.pow(2,-77):0;let nt=r?0:f-1;const ot=r?1:-1,ft=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),Number.isNaN(e)||e===Number.POSITIVE_INFINITY?(E=Number.isNaN(e)?1:0,h=c):(h=Math.floor(Math.log2(e)),e*(U=Math.pow(2,-h))<1&&(h--,U*=2),e+=h+tt>=1?rt/U:rt*Math.pow(2,1-tt),e*U>=2&&(h++,U/=2),h+tt>=c?(E=0,h=c):h+tt>=1?(E=(e*U-1)*Math.pow(2,o),h=h+tt):(E=e*Math.pow(2,tt-1)*Math.pow(2,o),h=0));o>=8;)t[n+nt]=E&255,nt+=ot,E/=256,o-=8;for(h=h<<o|E,et+=o;et>0;)t[n+nt]=h&255,nt+=ot,h/=256,et-=8;t[n+nt-ot]|=ft*128}const $=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,INSPECT_MAX_BYTES=50,I=2147483647;Buffer.TYPED_ARRAY_SUPPORT=J(),!Buffer.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This environment lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function J(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}});function w(t){if(t>I)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(t)}return k(t,e,n)}Buffer.poolSize=8192;function k(t,e,n){if(typeof t=="string")return K(t,e);if(ArrayBuffer.isView(t))return Q(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(a(t,ArrayBuffer)||t&&a(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(a(t,SharedArrayBuffer)||t&&a(t.buffer,SharedArrayBuffer)))return T(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return Buffer.from(r,e,n);const o=Z(t);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return Buffer.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Buffer.from=function(t,e,n){return k(t,e,n)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array);function C(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 z(t,e,n){return C(t),t<=0?w(t):e!==void 0?typeof n=="string"?w(t).fill(e,n):w(t).fill(e):w(t)}Buffer.alloc=function(t,e,n){return z(t,e,n)};function A(t){return C(t),w(t<0?0:b(t)|0)}Buffer.allocUnsafe=function(t){return A(t)},Buffer.allocUnsafeSlow=function(t){return A(t)};function K(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=P(t,e)|0;let r=w(n);const o=r.write(t,e);return o!==n&&(r=r.slice(0,o)),r}function R(t){const e=t.length<0?0:b(t.length)|0,n=w(e);for(let r=0;r<e;r+=1)n[r]=t[r]&255;return n}function Q(t){if(a(t,Uint8Array)){const e=new Uint8Array(t);return T(e.buffer,e.byteOffset,e.byteLength)}return R(t)}function T(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&n===void 0?r=new Uint8Array(t):n===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,n),Object.setPrototypeOf(r,Buffer.prototype),r}function Z(t){if(Buffer.isBuffer(t)){const e=b(t.length)|0,n=w(e);return n.length===0||t.copy(n,0,0,e),n}if(t.length!==void 0)return typeof t.length!="number"||N(t.length)?w(0):R(t);if(t.type==="Buffer"&&Array.isArray(t.data))return R(t.data)}function b(t){if(t>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return t|0}Buffer.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==Buffer.prototype},Buffer.compare=function(t,e){if(a(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),a(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let o=0,f=Math.min(n,r);o<f;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return Buffer.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=Buffer.allocUnsafe(e);let o=0;for(n=0;n<t.length;++n){let f=t[n];if(a(f,Uint8Array))o+f.length>r.length?(Buffer.isBuffer(f)||(f=Buffer.from(f.buffer,f.byteOffset,f.byteLength)),f.copy(r,o)):Uint8Array.prototype.set.call(r,f,o);else if(Buffer.isBuffer(f))f.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=f.length}return r};function P(t,e){if(Buffer.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||a(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);const n=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return H(t).length;default:{if(o)return r?-1:L(t).length;e=(""+e).toLowerCase(),o=!0}}}Buffer.byteLength=P;function v(t,e,n){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return cr(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return fr(this,e,n);case"latin1":case"binary":return hr(this,e,n);case"base64":return or(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,e,n);default:{if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}}Buffer.prototype._isBuffer=!0;function B(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}Buffer.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)B(this,e,e+1);return this},Buffer.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)B(this,e,e+3),B(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)B(this,e,e+7),B(this,e+1,e+6),B(this,e+2,e+5),B(this,e+3,e+4);return this},Buffer.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?O(this,0,t):Reflect.apply(v,this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(t){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:Buffer.compare(this,t)===0},Buffer.prototype.inspect=function(){let t="";const e=INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},$&&(Buffer.prototype[$]=Buffer.prototype.inspect),Buffer.prototype.compare=function(t,e,n,r,o){if(a(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let f=o-r,h=n-e;const E=Math.min(f,h),U=this.slice(r,o),et=t.slice(e,n);for(let c=0;c<E;++c)if(U[c]!==et[c]){f=U[c],h=et[c];break}return f<h?-1:h<f?1:0};function M(t,e,n,r,o){if(t.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,N(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0)if(o)n=0;else return-1;if(typeof e=="string"&&(e=Buffer.from(e,r)),Buffer.isBuffer(e))return e.length===0?-1:F(t,e,n,r,o);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):F(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function F(t,e,n,r,o){let f=1,h=t.length,E=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;f=2,h/=2,E/=2,n/=2}function U(c,tt){return f===1?c[tt]:c.readUInt16BE(tt*f)}let et;if(o){let c=-1;for(et=n;et<h;et++)if(U(t,et)===U(e,c===-1?0:et-c)){if(c===-1&&(c=et),et-c+1===E)return c*f}else c!==-1&&(et-=et-c),c=-1}else for(n+E>h&&(n=h-E),et=n;et>=0;et--){let c=!0;for(let tt=0;tt<E;tt++)if(U(t,et+tt)!==U(e,tt)){c=!1;break}if(c)return et}return-1}Buffer.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},Buffer.prototype.indexOf=function(t,e,n){return M(this,t,e,n,!0)},Buffer.prototype.lastIndexOf=function(t,e,n){return M(this,t,e,n,!1)};function rr(t,e,n,r){n=Number(n)||0;const o=t.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;const f=e.length;r>f/2&&(r=f/2);let h;for(h=0;h<r;++h){const E=Number.parseInt(e.slice(h*2,h*2+2),16);if(N(E))return h;t[n+h]=E}return h}function tr(t,e,n,r){return d(L(e,t.length-n),t,n,r)}function ir(t,e,n,r){return d(ar(e),t,n,r)}function nr(t,e,n,r){return d(H(e),t,n,r)}function er(t,e,n,r){return d(wr(e,t.length-n),t,n,r)}Buffer.prototype.write=function(t,e,n,r){if(e===void 0)r="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")r=e,n=this.length,e=0;else if(Number.isFinite(e))e=e>>>0,Number.isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new TypeError("Buffer.write(string, encoding, offset[, length]) is no longer supported");const o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let f=!1;for(;;)switch(r){case"hex":return rr(this,t,e,n);case"utf8":case"utf-8":return tr(this,t,e,n);case"ascii":case"latin1":case"binary":return ir(this,t,e,n);case"base64":return nr(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return er(this,t,e,n);default:{if(f)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),f=!0}}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function or(t,e,n){return e===0&&n===t.length?fromByteArray(t):fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);const r=[];let o=e;for(;o<n;){const f=t[o];let h=null,E=f>239?4:f>223?3:f>191?2:1;if(o+E<=n){let U,et,c,tt;switch(E){case 1:{f<128&&(h=f);break}case 2:{U=t[o+1],(U&192)===128&&(tt=(f&31)<<6|U&63,tt>127&&(h=tt));break}case 3:{U=t[o+1],et=t[o+2],(U&192)===128&&(et&192)===128&&(tt=(f&15)<<12|(U&63)<<6|et&63,tt>2047&&(tt<55296||tt>57343)&&(h=tt));break}case 4:U=t[o+1],et=t[o+2],c=t[o+3],(U&192)===128&&(et&192)===128&&(c&192)===128&&(tt=(f&15)<<18|(U&63)<<12|(et&63)<<6|c&63,tt>65535&&tt<1114112&&(h=tt))}}h===null?(h=65533,E=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|h&1023),r.push(h),o+=E}return ur(r)}const D=4096;function ur(t){const e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=D));return n}function fr(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]&127);return r}function hr(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function cr(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let o="";for(let f=e;f<n;++f)o+=xr[t[f]];return o}function pr(t,e,n){const r=t.slice(e,n);let o="";for(let f=0;f<r.length-1;f+=2)o+=String.fromCharCode(r[f]+r[f+1]*256);return o}Buffer.prototype.slice=function(t,e){const n=this.length;t=Math.trunc(t),e=e===void 0?n:Math.trunc(e),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,Buffer.prototype),r};function s(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let r=this[t],o=1,f=0;for(;++f<e&&(o*=256);)r+=this[t+f]*o;return r},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let r=this[t+--e],o=1;for(;e>0&&(o*=256);)r+=this[t+--e]*o;return r},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(t,e){return t=t>>>0,e||s(t,1,this.length),this[t]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||s(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||s(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||s(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||s(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readBigUInt64LE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const r=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),Buffer.prototype.readBigUInt64BE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const r=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),Buffer.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let r=this[t],o=1,f=0;for(;++f<e&&(o*=256);)r+=this[t+f]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},Buffer.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let r=e,o=1,f=this[t+--r];for(;r>0&&(o*=256);)f+=this[t+--r]*o;return o*=128,f>=o&&(f-=Math.pow(2,8*e)),f},Buffer.prototype.readInt8=function(t,e){return t=t>>>0,e||s(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},Buffer.prototype.readInt16LE=function(t,e){t=t>>>0,e||s(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt16BE=function(t,e){t=t>>>0,e||s(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt32LE=function(t,e){return t=t>>>0,e||s(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return t=t>>>0,e||s(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readBigInt64LE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),Buffer.prototype.readBigInt64BE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const r=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),Buffer.prototype.readFloatLE=function(t,e){return t=t>>>0,e||s(t,4,this.length),read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return t=t>>>0,e||s(t,4,this.length),read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||s(t,8,this.length),read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||s(t,8,this.length),read(this,t,!1,52,8)};function y(t,e,n,r,o,f){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<f)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){const h=Math.pow(2,8*n)-1;y(this,t,e,n,h,0)}let o=1,f=0;for(this[e]=t&255;++f<n&&(o*=256);)this[e+f]=t/o&255;return e+n},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){const h=Math.pow(2,8*n)-1;y(this,t,e,n,h,0)}let o=n-1,f=1;for(this[e+o]=t&255;--o>=0&&(f*=256);)this[e+o]=t/f&255;return e+n},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,1,255,0),this[e]=t&255,e+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function G(t,e,n,r,o){X(e,r,o,t,n,7);let f=Number(e&BigInt(4294967295));t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f;let h=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=h,h=h>>8,t[n++]=h,h=h>>8,t[n++]=h,h=h>>8,t[n++]=h,n}function Y(t,e,n,r,o){X(e,r,o,t,n,7);let f=Number(e&BigInt(4294967295));t[n+7]=f,f=f>>8,t[n+6]=f,f=f>>8,t[n+5]=f,f=f>>8,t[n+4]=f;let h=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=h,h=h>>8,t[n+2]=h,h=h>>8,t[n+1]=h,h=h>>8,t[n]=h,n+8}Buffer.prototype.writeBigUInt64LE=x(function(t,e=0){return G(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeBigUInt64BE=x(function(t,e=0){return Y(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){const E=Math.pow(2,8*n-1);y(this,t,e,n,E-1,-E)}let o=0,f=1,h=0;for(this[e]=t&255;++o<n&&(f*=256);)t<0&&h===0&&this[e+o-1]!==0&&(h=1),this[e+o]=Math.trunc(t/f)-h&255;return e+n},Buffer.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){const E=Math.pow(2,8*n-1);y(this,t,e,n,E-1,-E)}let o=n-1,f=1,h=0;for(this[e+o]=t&255;--o>=0&&(f*=256);)t<0&&h===0&&this[e+o+1]!==0&&(h=1),this[e+o]=Math.trunc(t/f)-h&255;return e+n},Buffer.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},Buffer.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},Buffer.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},Buffer.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},Buffer.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},Buffer.prototype.writeBigInt64LE=x(function(t,e=0){return G(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Buffer.prototype.writeBigInt64BE=x(function(t,e=0){return Y(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function W(t,e,n,r,o,f){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(t,e,n,r,o){return e=+e,n=n>>>0,o||W(t,e,n,4),write(t,e,n,r,23,4),n+4}Buffer.prototype.writeFloatLE=function(t,e,n){return q(this,t,e,!0,n)},Buffer.prototype.writeFloatBE=function(t,e,n){return q(this,t,e,!1,n)};function V(t,e,n,r,o){return e=+e,n=n>>>0,o||W(t,e,n,8),write(t,e,n,r,52,8),n+8}Buffer.prototype.writeDoubleLE=function(t,e,n){return V(this,t,e,!0,n)},Buffer.prototype.writeDoubleBE=function(t,e,n){return V(this,t,e,!1,n)},Buffer.prototype.copy=function(t,e,n,r){if(!Buffer.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),o},Buffer.prototype.fill=function(t,e,n,r){if(typeof t=="string"){if(typeof e=="string"?(r=e,e=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!Buffer.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){const f=t.charCodeAt(0);(r==="utf8"&&f<128||r==="latin1")&&(t=f)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{const f=Buffer.isBuffer(t)?t:Buffer.from(t,r),h=f.length;if(h===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=f[o%h]}return this};const _={};function S(t,e,n){_[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:Reflect.apply(e,this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}S("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),S("ERR_OUT_OF_RANGE",function(t,e,n){let r=`The value of "${t}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=j(String(n)):typeof n=="bigint"&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=j(o)),o+="n"),r+=` It must be ${e}. Received ${o}`,r},RangeError);function j(t){let e="",n=t.length;const r=t[0]==="-"?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function lr(t,e,n){m(e,"offset"),(t[e]===void 0||t[e+n]===void 0)&&g(e,t.length-(n+1))}function X(t,e,n,r,o,f){if(t>n||t<e){const h=typeof e=="bigint"?"n":"";let E;throw E=e===0||e===BigInt(0)?`>= 0${h} and < 2${h} ** ${(f+1)*8}${h}`:`>= -(2${h} ** ${(f+1)*8-1}${h}) and < 2 ** ${(f+1)*8-1}${h}`,new _.ERR_OUT_OF_RANGE("value",E,t)}lr(r,o,f)}function m(t,e){if(typeof t!="number")throw new _.ERR_INVALID_ARG_TYPE(e,"number",t)}function g(t,e,n){throw Math.floor(t)!==t?(m(t,n),new _.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new _.ERR_BUFFER_OUT_OF_BOUNDS:new _.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}const sr=/[^\w+/-]/g;function yr(t){if(t=t.split("=")[0],t=t.trim().replace(sr,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function L(t,e){e=e||Number.POSITIVE_INFINITY;let n;const r=t.length;let o=null;const f=[];for(let h=0;h<r;++h){if(n=t.charCodeAt(h),n>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&f.push(239,191,189);continue}else if(h+1===r){(e-=3)>-1&&f.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&f.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&f.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;f.push(n)}else if(n<2048){if((e-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function ar(t){const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n)&255);return e}function wr(t,e){let n,r,o;const f=[];for(let h=0;h<t.length&&!((e-=2)<0);++h)n=t.charCodeAt(h),r=n>>8,o=n%256,f.push(o,r);return f}function H(t){return toByteArray(yr(t))}function d(t,e,n,r){let o;for(o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function a(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function N(t){return t!==t}const xr=function(){const t="0123456789abcdef",e=Array.from({length:256});for(let n=0;n<16;++n){const r=n*16;for(let o=0;o<16;++o)e[r+o]=t[n]+t[o]}return e}();function x(t){return typeof BigInt>"u"?Br:t}function Br(){throw new Error("BigInt not supported")}exports.Buffer=Buffer; | ||
| "use strict";const a$1=[],l=[],x$1=typeof Uint8Array>"u"?Array:Uint8Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=i.length;t<e;++t)a$1[t]=i[t],l[i.charCodeAt(t)]=t;l[45]=62,l[95]=63;function d$1(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");n===-1&&(n=e);const o=n===e?0:4-n%4;return[n,o]}function p(t,e,n){return(e+n)*3/4-n}function toByteArray(t){let e;const n=d$1(t),o=n[0],r=n[1],f=new x$1(p(t,o,r));let h=0;const E=r>0?o-4:o;let U;for(U=0;U<E;U+=4)e=l[t.charCodeAt(U)]<<18|l[t.charCodeAt(U+1)]<<12|l[t.charCodeAt(U+2)]<<6|l[t.charCodeAt(U+3)],f[h++]=e>>16&255,f[h++]=e>>8&255,f[h++]=e&255;return r===2&&(e=l[t.charCodeAt(U)]<<2|l[t.charCodeAt(U+1)]>>4,f[h++]=e&255),r===1&&(e=l[t.charCodeAt(U)]<<10|l[t.charCodeAt(U+1)]<<4|l[t.charCodeAt(U+2)]>>2,f[h++]=e>>8&255,f[h++]=e&255),f}function u(t){return a$1[t>>18&63]+a$1[t>>12&63]+a$1[t>>6&63]+a$1[t&63]}function A$1(t,e,n){let o;const r=[];for(let f=e;f<n;f+=3)o=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(t[f+2]&255),r.push(u(o));return r.join("")}function fromByteArray(t){let e;const n=t.length,o=n%3,r=[],f=16383;for(let h=0,E=n-o;h<E;h+=f)r.push(A$1(t,h,h+f>E?E:h+f));return o===1?(e=t[n-1],r.push(a$1[e>>2]+a$1[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],r.push(a$1[e>>10]+a$1[e>>4&63]+a$1[e<<2&63]+"=")),r.join("")}/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function read(t,e,n,o,r){let f,h;const E=r*8-o-1,U=(1<<E)-1,et=U>>1;let c=-7,tt=n?r-1:0;const ot=n?-1:1;let nt=t[e+tt];for(tt+=ot,f=nt&(1<<-c)-1,nt>>=-c,c+=E;c>0;)f=f*256+t[e+tt],tt+=ot,c-=8;for(h=f&(1<<-c)-1,f>>=-c,c+=o;c>0;)h=h*256+t[e+tt],tt+=ot,c-=8;if(f===0)f=1-et;else{if(f===U)return h?Number.NaN:(nt?-1:1)*Number.POSITIVE_INFINITY;h=h+Math.pow(2,o),f=f-et}return(nt?-1:1)*h*Math.pow(2,f-o)}function write(t,e,n,o,r,f){let h,E,U,et=f*8-r-1;const c=(1<<et)-1,tt=c>>1,ot=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;let nt=o?0:f-1;const rt=o?1:-1,it=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),Number.isNaN(e)||e===Number.POSITIVE_INFINITY?(E=Number.isNaN(e)?1:0,h=c):(h=Math.floor(Math.log2(e)),e*(U=Math.pow(2,-h))<1&&(h--,U*=2),e+=h+tt>=1?ot/U:ot*Math.pow(2,1-tt),e*U>=2&&(h++,U/=2),h+tt>=c?(E=0,h=c):h+tt>=1?(E=(e*U-1)*Math.pow(2,r),h=h+tt):(E=e*Math.pow(2,tt-1)*Math.pow(2,r),h=0));r>=8;)t[n+nt]=E&255,nt+=rt,E/=256,r-=8;for(h=h<<r|E,et+=r;et>0;)t[n+nt]=h&255,nt+=rt,h/=256,et-=8;t[n+nt-rt]|=it*128}const $=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,INSPECT_MAX_BYTES=50,I=2147483647;Buffer.TYPED_ARRAY_SUPPORT=J(),!Buffer.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This environment lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function J(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}});function w(t){if(t>I)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(t)}return k(t,e,n)}Buffer.poolSize=8192;function k(t,e,n){if(typeof t=="string")return K(t,e);if(ArrayBuffer.isView(t))return Q(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(a(t,ArrayBuffer)||t&&a(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(a(t,SharedArrayBuffer)||t&&a(t.buffer,SharedArrayBuffer)))return T(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(o!=null&&o!==t)return Buffer.from(o,e,n);const r=Z(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return Buffer.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Buffer.from=function(t,e,n){return k(t,e,n)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array);function C(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 z(t,e,n){return C(t),t<=0?w(t):e!==void 0?typeof n=="string"?w(t).fill(e,n):w(t).fill(e):w(t)}Buffer.alloc=function(t,e,n){return z(t,e,n)};function A(t){return C(t),w(t<0?0:b(t)|0)}Buffer.allocUnsafe=function(t){return A(t)},Buffer.allocUnsafeSlow=function(t){return A(t)};function K(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=P(t,e)|0;let o=w(n);const r=o.write(t,e);return r!==n&&(o=o.slice(0,r)),o}function R(t){const e=t.length<0?0:b(t.length)|0,n=w(e);for(let o=0;o<e;o+=1)n[o]=t[o]&255;return n}function Q(t){if(a(t,Uint8Array)){const e=new Uint8Array(t);return T(e.buffer,e.byteOffset,e.byteLength)}return R(t)}function T(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return e===void 0&&n===void 0?o=new Uint8Array(t):n===void 0?o=new Uint8Array(t,e):o=new Uint8Array(t,e,n),Object.setPrototypeOf(o,Buffer.prototype),o}function Z(t){if(Buffer.isBuffer(t)){const e=b(t.length)|0,n=w(e);return n.length===0||t.copy(n,0,0,e),n}if(t.length!==void 0)return typeof t.length!="number"||N(t.length)?w(0):R(t);if(t.type==="Buffer"&&Array.isArray(t.data))return R(t.data)}function b(t){if(t>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return t|0}Buffer.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==Buffer.prototype},Buffer.compare=function(t,e){if(a(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),a(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,o=e.length;for(let r=0,f=Math.min(n,o);r<f;++r)if(t[r]!==e[r]){n=t[r],o=e[r];break}return n<o?-1:o<n?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return Buffer.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const o=Buffer.allocUnsafe(e);let r=0;for(n=0;n<t.length;++n){let f=t[n];if(a(f,Uint8Array))r+f.length>o.length?(Buffer.isBuffer(f)||(f=Buffer.from(f.buffer,f.byteOffset,f.byteLength)),f.copy(o,r)):Uint8Array.prototype.set.call(o,f,r);else if(Buffer.isBuffer(f))f.copy(o,r);else throw new TypeError('"list" argument must be an Array of Buffers');r+=f.length}return o};function P(t,e){if(Buffer.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||a(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);const n=t.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&n===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return H(t).length;default:{if(r)return o?-1:L(t).length;e=(""+e).toLowerCase(),r=!0}}}Buffer.byteLength=P;function v(t,e,n){let o=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return cr(this,e,n);case"utf8":case"utf-8":return O(this,e,n);case"ascii":return fr(this,e,n);case"latin1":case"binary":return hr(this,e,n);case"base64":return or(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,e,n);default:{if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}}Buffer.prototype._isBuffer=!0;function B(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}Buffer.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)B(this,e,e+1);return this},Buffer.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)B(this,e,e+3),B(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)B(this,e,e+7),B(this,e+1,e+6),B(this,e+2,e+5),B(this,e+3,e+4);return this},Buffer.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?O(this,0,t):Reflect.apply(v,this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(t){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:Buffer.compare(this,t)===0},Buffer.prototype.inspect=function(){let t="";const e=INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},$&&(Buffer.prototype[$]=Buffer.prototype.inspect),Buffer.prototype.compare=function(t,e,n,o,r){if(a(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),r===void 0&&(r=this.length),e<0||n>t.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&e>=n)return 0;if(o>=r)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,r>>>=0,this===t)return 0;let f=r-o,h=n-e;const E=Math.min(f,h),U=this.slice(o,r),et=t.slice(e,n);for(let c=0;c<E;++c)if(U[c]!==et[c]){f=U[c],h=et[c];break}return f<h?-1:h<f?1:0};function M(t,e,n,o,r){if(t.length===0)return-1;if(typeof n=="string"?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,N(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0)if(r)n=0;else return-1;if(typeof e=="string"&&(e=Buffer.from(e,o)),Buffer.isBuffer(e))return e.length===0?-1:F(t,e,n,o,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):F(t,[e],n,o,r);throw new TypeError("val must be string, number or Buffer")}function F(t,e,n,o,r){let f=1,h=t.length,E=e.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(t.length<2||e.length<2)return-1;f=2,h/=2,E/=2,n/=2}function U(c,tt){return f===1?c[tt]:c.readUInt16BE(tt*f)}let et;if(r){let c=-1;for(et=n;et<h;et++)if(U(t,et)===U(e,c===-1?0:et-c)){if(c===-1&&(c=et),et-c+1===E)return c*f}else c!==-1&&(et-=et-c),c=-1}else for(n+E>h&&(n=h-E),et=n;et>=0;et--){let c=!0;for(let tt=0;tt<E;tt++)if(U(t,et+tt)!==U(e,tt)){c=!1;break}if(c)return et}return-1}Buffer.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},Buffer.prototype.indexOf=function(t,e,n){return M(this,t,e,n,!0)},Buffer.prototype.lastIndexOf=function(t,e,n){return M(this,t,e,n,!1)};function rr(t,e,n,o){n=Number(n)||0;const r=t.length-n;o?(o=Number(o),o>r&&(o=r)):o=r;const f=e.length;o>f/2&&(o=f/2);let h;for(h=0;h<o;++h){const E=Number.parseInt(e.slice(h*2,h*2+2),16);if(N(E))return h;t[n+h]=E}return h}function tr(t,e,n,o){return d(L(e,t.length-n),t,n,o)}function ir(t,e,n,o){return d(ar(e),t,n,o)}function nr(t,e,n,o){return d(H(e),t,n,o)}function er(t,e,n,o){return d(wr(e,t.length-n),t,n,o)}Buffer.prototype.write=function(t,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(Number.isFinite(e))e=e>>>0,Number.isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new TypeError("Buffer.write(string, encoding, offset[, length]) is no longer supported");const r=this.length-e;if((n===void 0||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let f=!1;for(;;)switch(o){case"hex":return rr(this,t,e,n);case"utf8":case"utf-8":return tr(this,t,e,n);case"ascii":case"latin1":case"binary":return ir(this,t,e,n);case"base64":return nr(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return er(this,t,e,n);default:{if(f)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),f=!0}}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function or(t,e,n){return e===0&&n===t.length?fromByteArray(t):fromByteArray(t.slice(e,n))}function O(t,e,n){n=Math.min(t.length,n);const o=[];let r=e;for(;r<n;){const f=t[r];let h=null,E=f>239?4:f>223?3:f>191?2:1;if(r+E<=n){let U,et,c,tt;switch(E){case 1:{f<128&&(h=f);break}case 2:{U=t[r+1],(U&192)===128&&(tt=(f&31)<<6|U&63,tt>127&&(h=tt));break}case 3:{U=t[r+1],et=t[r+2],(U&192)===128&&(et&192)===128&&(tt=(f&15)<<12|(U&63)<<6|et&63,tt>2047&&(tt<55296||tt>57343)&&(h=tt));break}case 4:U=t[r+1],et=t[r+2],c=t[r+3],(U&192)===128&&(et&192)===128&&(c&192)===128&&(tt=(f&15)<<18|(U&63)<<12|(et&63)<<6|c&63,tt>65535&&tt<1114112&&(h=tt))}}h===null?(h=65533,E=1):h>65535&&(h-=65536,o.push(h>>>10&1023|55296),h=56320|h&1023),o.push(h),r+=E}return ur(o)}const D=4096;function ur(t){const e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);let n="",o=0;for(;o<e;)n+=String.fromCharCode.apply(String,t.slice(o,o+=D));return n}function fr(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(t[r]&127);return o}function hr(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(t[r]);return o}function cr(t,e,n){const o=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>o)&&(n=o);let r="";for(let f=e;f<n;++f)r+=xr[t[f]];return r}function pr(t,e,n){const o=t.slice(e,n);let r="";for(let f=0;f<o.length-1;f+=2)r+=String.fromCharCode(o[f]+o[f+1]*256);return r}Buffer.prototype.slice=function(t,e){const n=this.length;t=Math.trunc(t),e=e===void 0?n:Math.trunc(e),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);const o=this.subarray(t,e);return Object.setPrototypeOf(o,Buffer.prototype),o};function s(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let o=this[t],r=1,f=0;for(;++f<e&&(r*=256);)o+=this[t+f]*r;return o},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let o=this[t+--e],r=1;for(;e>0&&(r*=256);)o+=this[t+--e]*r;return o},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(t,e){return t=t>>>0,e||s(t,1,this.length),this[t]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||s(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||s(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||s(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||s(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readBigUInt64LE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const o=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,r=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(r)<<BigInt(32))}),Buffer.prototype.readBigUInt64BE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const o=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],r=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<<BigInt(32))+BigInt(r)}),Buffer.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let o=this[t],r=1,f=0;for(;++f<e&&(r*=256);)o+=this[t+f]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*e)),o},Buffer.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||s(t,e,this.length);let o=e,r=1,f=this[t+--o];for(;o>0&&(r*=256);)f+=this[t+--o]*r;return r*=128,f>=r&&(f-=Math.pow(2,8*e)),f},Buffer.prototype.readInt8=function(t,e){return t=t>>>0,e||s(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},Buffer.prototype.readInt16LE=function(t,e){t=t>>>0,e||s(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt16BE=function(t,e){t=t>>>0,e||s(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt32LE=function(t,e){return t=t>>>0,e||s(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return t=t>>>0,e||s(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readBigInt64LE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),Buffer.prototype.readBigInt64BE=x(function(t){t=t>>>0,m(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&g(t,this.length-8);const o=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),Buffer.prototype.readFloatLE=function(t,e){return t=t>>>0,e||s(t,4,this.length),read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return t=t>>>0,e||s(t,4,this.length),read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||s(t,8,this.length),read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||s(t,8,this.length),read(this,t,!1,52,8)};function y(t,e,n,o,r,f){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<f)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){const h=Math.pow(2,8*n)-1;y(this,t,e,n,h,0)}let r=1,f=0;for(this[e]=t&255;++f<n&&(r*=256);)this[e+f]=t/r&255;return e+n},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){const h=Math.pow(2,8*n)-1;y(this,t,e,n,h,0)}let r=n-1,f=1;for(this[e+r]=t&255;--r>=0&&(f*=256);)this[e+r]=t/f&255;return e+n},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,1,255,0),this[e]=t&255,e+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function G(t,e,n,o,r){X(e,o,r,t,n,7);let f=Number(e&BigInt(4294967295));t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f;let h=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=h,h=h>>8,t[n++]=h,h=h>>8,t[n++]=h,h=h>>8,t[n++]=h,n}function Y(t,e,n,o,r){X(e,o,r,t,n,7);let f=Number(e&BigInt(4294967295));t[n+7]=f,f=f>>8,t[n+6]=f,f=f>>8,t[n+5]=f,f=f>>8,t[n+4]=f;let h=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=h,h=h>>8,t[n+2]=h,h=h>>8,t[n+1]=h,h=h>>8,t[n]=h,n+8}Buffer.prototype.writeBigUInt64LE=x(function(t,e=0){return G(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeBigUInt64BE=x(function(t,e=0){return Y(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),Buffer.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){const E=Math.pow(2,8*n-1);y(this,t,e,n,E-1,-E)}let r=0,f=1,h=0;for(this[e]=t&255;++r<n&&(f*=256);)t<0&&h===0&&this[e+r-1]!==0&&(h=1),this[e+r]=Math.trunc(t/f)-h&255;return e+n},Buffer.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){const E=Math.pow(2,8*n-1);y(this,t,e,n,E-1,-E)}let r=n-1,f=1,h=0;for(this[e+r]=t&255;--r>=0&&(f*=256);)t<0&&h===0&&this[e+r+1]!==0&&(h=1),this[e+r]=Math.trunc(t/f)-h&255;return e+n},Buffer.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},Buffer.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},Buffer.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},Buffer.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},Buffer.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||y(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},Buffer.prototype.writeBigInt64LE=x(function(t,e=0){return G(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),Buffer.prototype.writeBigInt64BE=x(function(t,e=0){return Y(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function W(t,e,n,o,r,f){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(t,e,n,o,r){return e=+e,n=n>>>0,r||W(t,e,n,4),write(t,e,n,o,23,4),n+4}Buffer.prototype.writeFloatLE=function(t,e,n){return q(this,t,e,!0,n)},Buffer.prototype.writeFloatBE=function(t,e,n){return q(this,t,e,!1,n)};function V(t,e,n,o,r){return e=+e,n=n>>>0,r||W(t,e,n,8),write(t,e,n,o,52,8),n+8}Buffer.prototype.writeDoubleLE=function(t,e,n){return V(this,t,e,!0,n)},Buffer.prototype.writeDoubleBE=function(t,e,n){return V(this,t,e,!1,n)},Buffer.prototype.copy=function(t,e,n,o){if(!Buffer.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o<n&&(o=n),o===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e<o-n&&(o=t.length-e+n);const r=o-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),e),r},Buffer.prototype.fill=function(t,e,n,o){if(typeof t=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!Buffer.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(t.length===1){const f=t.charCodeAt(0);(o==="utf8"&&f<128||o==="latin1")&&(t=f)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let r;if(typeof t=="number")for(r=e;r<n;++r)this[r]=t;else{const f=Buffer.isBuffer(t)?t:Buffer.from(t,o),h=f.length;if(h===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(r=0;r<n-e;++r)this[r+e]=f[r%h]}return this};const _={};function S(t,e,n){_[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:Reflect.apply(e,this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}S("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),S("ERR_OUT_OF_RANGE",function(t,e,n){let o=`The value of "${t}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=j(String(n)):typeof n=="bigint"&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=j(r)),r+="n"),o+=` It must be ${e}. Received ${r}`,o},RangeError);function j(t){let e="",n=t.length;const o=t[0]==="-"?1:0;for(;n>=o+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function lr(t,e,n){m(e,"offset"),(t[e]===void 0||t[e+n]===void 0)&&g(e,t.length-(n+1))}function X(t,e,n,o,r,f){if(t>n||t<e){const h=typeof e=="bigint"?"n":"";let E;throw E=e===0||e===BigInt(0)?`>= 0${h} and < 2${h} ** ${(f+1)*8}${h}`:`>= -(2${h} ** ${(f+1)*8-1}${h}) and < 2 ** ${(f+1)*8-1}${h}`,new _.ERR_OUT_OF_RANGE("value",E,t)}lr(o,r,f)}function m(t,e){if(typeof t!="number")throw new _.ERR_INVALID_ARG_TYPE(e,"number",t)}function g(t,e,n){throw Math.floor(t)!==t?(m(t,n),new _.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new _.ERR_BUFFER_OUT_OF_BOUNDS:new _.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}const sr=/[^\w+/-]/g;function yr(t){if(t=t.split("=")[0],t=t.trim().replace(sr,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function L(t,e){e=e||Number.POSITIVE_INFINITY;let n;const o=t.length;let r=null;const f=[];for(let h=0;h<o;++h){if(n=t.charCodeAt(h),n>55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&f.push(239,191,189);continue}else if(h+1===o){(e-=3)>-1&&f.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&f.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(e-=3)>-1&&f.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;f.push(n)}else if(n<2048){if((e-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function ar(t){const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n)&255);return e}function wr(t,e){let n,o,r;const f=[];for(let h=0;h<t.length&&!((e-=2)<0);++h)n=t.charCodeAt(h),o=n>>8,r=n%256,f.push(r,o);return f}function H(t){return toByteArray(yr(t))}function d(t,e,n,o){let r;for(r=0;r<o&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function a(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function N(t){return t!==t}const xr=function(){const t="0123456789abcdef",e=Array.from({length:256});for(let n=0;n<16;++n){const o=n*16;for(let r=0;r<16;++r)e[o+r]=t[n]+t[r]}return e}();function x(t){return typeof BigInt>"u"?Br:t}function Br(){throw new Error("BigInt not supported")}exports.Buffer=Buffer; |
@@ -1,1 +0,1 @@ | ||
| const w=[],y=[],rt=typeof Uint8Array>"u"?Array:Uint8Array,N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=N.length;t<e;++t)w[t]=N[t],y[N.charCodeAt(t)]=t;y[45]=62,y[95]=63;function ot(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");n===-1&&(n=e);const r=n===e?0:4-n%4;return[n,r]}function ft(t,e,n){return(e+n)*3/4-n}function it(t){let e;const n=ot(t),r=n[0],o=n[1],f=new rt(ft(t,r,o));let u=0;const h=o>0?r-4:r;let c;for(c=0;c<h;c+=4)e=y[t.charCodeAt(c)]<<18|y[t.charCodeAt(c+1)]<<12|y[t.charCodeAt(c+2)]<<6|y[t.charCodeAt(c+3)],f[u++]=e>>16&255,f[u++]=e>>8&255,f[u++]=e&255;return o===2&&(e=y[t.charCodeAt(c)]<<2|y[t.charCodeAt(c+1)]>>4,f[u++]=e&255),o===1&&(e=y[t.charCodeAt(c)]<<10|y[t.charCodeAt(c+1)]<<4|y[t.charCodeAt(c+2)]>>2,f[u++]=e>>8&255,f[u++]=e&255),f}function ut(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function st(t,e,n){let r;const o=[];for(let f=e;f<n;f+=3)r=(t[f]<<16&16711680)+(t[f+1]<<8&65280)+(t[f+2]&255),o.push(ut(r));return o.join("")}function P(t){let e;const n=t.length,r=n%3,o=[],f=16383;for(let u=0,h=n-r;u<h;u+=f)o.push(st(t,u,u+f>h?h:u+f));return r===1?(e=t[n-1],o.push(w[e>>2]+w[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],o.push(w[e>>10]+w[e>>4&63]+w[e<<2&63]+"=")),o.join("")}/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function T(t,e,n,r,o){let f,u;const h=o*8-r-1,c=(1<<h)-1,l=c>>1;let s=-7,a=n?o-1:0;const I=n?-1:1;let d=t[e+a];for(a+=I,f=d&(1<<-s)-1,d>>=-s,s+=h;s>0;)f=f*256+t[e+a],a+=I,s-=8;for(u=f&(1<<-s)-1,f>>=-s,s+=r;s>0;)u=u*256+t[e+a],a+=I,s-=8;if(f===0)f=1-l;else{if(f===c)return u?Number.NaN:(d?-1:1)*Number.POSITIVE_INFINITY;u=u+Math.pow(2,r),f=f-l}return(d?-1:1)*u*Math.pow(2,f-r)}function F(t,e,n,r,o,f){let u,h,c,l=f*8-o-1;const s=(1<<l)-1,a=s>>1,I=o===23?Math.pow(2,-24)-Math.pow(2,-77):0;let d=r?0:f-1;const L=r?1:-1,nt=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),Number.isNaN(e)||e===Number.POSITIVE_INFINITY?(h=Number.isNaN(e)?1:0,u=s):(u=Math.floor(Math.log2(e)),e*(c=Math.pow(2,-u))<1&&(u--,c*=2),e+=u+a>=1?I/c:I*Math.pow(2,1-a),e*c>=2&&(u++,c/=2),u+a>=s?(h=0,u=s):u+a>=1?(h=(e*c-1)*Math.pow(2,o),u=u+a):(h=e*Math.pow(2,a-1)*Math.pow(2,o),u=0));o>=8;)t[n+d]=h&255,d+=L,h/=256,o-=8;for(u=u<<o|h,l+=o;l>0;)t[n+d]=u&255,d+=L,u/=256,l-=8;t[n+d-L]|=nt*128}const k=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,ht=50,S=2147483647;i.TYPED_ARRAY_SUPPORT=ct(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This environment lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ct(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function m(t){if(t>S)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(t)}return j(t,e,n)}i.poolSize=8192;function j(t,e,n){if(typeof t=="string")return lt(t,e);if(ArrayBuffer.isView(t))return pt(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(b(t,ArrayBuffer)||t&&b(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(b(t,SharedArrayBuffer)||t&&b(t.buffer,SharedArrayBuffer)))return Y(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return i.from(r,e,n);const o=gt(t);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return i.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}i.from=function(t,e,n){return j(t,e,n)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function D(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 at(t,e,n){return D(t),t<=0?m(t):e!==void 0?typeof n=="string"?m(t).fill(e,n):m(t).fill(e):m(t)}i.alloc=function(t,e,n){return at(t,e,n)};function _(t){return D(t),m(t<0?0:x(t)|0)}i.allocUnsafe=function(t){return _(t)},i.allocUnsafeSlow=function(t){return _(t)};function lt(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=z(t,e)|0;let r=m(n);const o=r.write(t,e);return o!==n&&(r=r.slice(0,o)),r}function v(t){const e=t.length<0?0:x(t.length)|0,n=m(e);for(let r=0;r<e;r+=1)n[r]=t[r]&255;return n}function pt(t){if(b(t,Uint8Array)){const e=new Uint8Array(t);return Y(e.buffer,e.byteOffset,e.byteLength)}return v(t)}function Y(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return e===void 0&&n===void 0?r=new Uint8Array(t):n===void 0?r=new Uint8Array(t,e):r=new Uint8Array(t,e,n),Object.setPrototypeOf(r,i.prototype),r}function gt(t){if(i.isBuffer(t)){const e=x(t.length)|0,n=m(e);return n.length===0||t.copy(n,0,0,e),n}if(t.length!==void 0)return typeof t.length!="number"||M(t.length)?m(0):v(t);if(t.type==="Buffer"&&Array.isArray(t.data))return v(t.data)}function x(t){if(t>=S)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S.toString(16)+" bytes");return t|0}i.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==i.prototype},i.compare=function(t,e){if(b(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),b(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let o=0,f=Math.min(n,r);o<f;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return i.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=i.allocUnsafe(e);let o=0;for(n=0;n<t.length;++n){let f=t[n];if(b(f,Uint8Array))o+f.length>r.length?(i.isBuffer(f)||(f=i.from(f.buffer,f.byteOffset,f.byteLength)),f.copy(r,o)):Uint8Array.prototype.set.call(r,f,o);else if(i.isBuffer(f))f.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=f.length}return r};function z(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||b(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);const n=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return et(t).length;default:{if(o)return r?-1:$(t).length;e=(""+e).toLowerCase(),o=!0}}}i.byteLength=z;function yt(t,e,n){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Rt(this,e,n);case"utf8":case"utf-8":return q(this,e,n);case"ascii":return At(this,e,n);case"latin1":case"binary":return Ut(this,e,n);case"base64":return Bt(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,e,n);default:{if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}}i.prototype._isBuffer=!0;function B(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}i.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)B(this,e,e+1);return this},i.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)B(this,e,e+3),B(this,e+1,e+2);return this},i.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)B(this,e,e+7),B(this,e+1,e+6),B(this,e+2,e+5),B(this,e+3,e+4);return this},i.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?q(this,0,t):Reflect.apply(yt,this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:i.compare(this,t)===0},i.prototype.inspect=function(){let t="";const e=ht;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},k&&(i.prototype[k]=i.prototype.inspect),i.prototype.compare=function(t,e,n,r,o){if(b(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let f=o-r,u=n-e;const h=Math.min(f,u),c=this.slice(r,o),l=t.slice(e,n);for(let s=0;s<h;++s)if(c[s]!==l[s]){f=c[s],u=l[s];break}return f<u?-1:u<f?1:0};function V(t,e,n,r,o){if(t.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,M(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0)if(o)n=0;else return-1;if(typeof e=="string"&&(e=i.from(e,r)),i.isBuffer(e))return e.length===0?-1:G(t,e,n,r,o);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):G(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function G(t,e,n,r,o){let f=1,u=t.length,h=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;f=2,u/=2,h/=2,n/=2}function c(s,a){return f===1?s[a]:s.readUInt16BE(a*f)}let l;if(o){let s=-1;for(l=n;l<u;l++)if(c(t,l)===c(e,s===-1?0:l-s)){if(s===-1&&(s=l),l-s+1===h)return s*f}else s!==-1&&(l-=l-s),s=-1}else for(n+h>u&&(n=u-h),l=n;l>=0;l--){let s=!0;for(let a=0;a<h;a++)if(c(t,l+a)!==c(e,a)){s=!1;break}if(s)return l}return-1}i.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},i.prototype.indexOf=function(t,e,n){return V(this,t,e,n,!0)},i.prototype.lastIndexOf=function(t,e,n){return V(this,t,e,n,!1)};function dt(t,e,n,r){n=Number(n)||0;const o=t.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;const f=e.length;r>f/2&&(r=f/2);let u;for(u=0;u<r;++u){const h=Number.parseInt(e.slice(u*2,u*2+2),16);if(M(h))return u;t[n+u]=h}return u}function wt(t,e,n,r){return O($(e,t.length-n),t,n,r)}function bt(t,e,n,r){return O(St(e),t,n,r)}function mt(t,e,n,r){return O(et(e),t,n,r)}function Et(t,e,n,r){return O(_t(e,t.length-n),t,n,r)}i.prototype.write=function(t,e,n,r){if(e===void 0)r="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")r=e,n=this.length,e=0;else if(Number.isFinite(e))e=e>>>0,Number.isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new TypeError("Buffer.write(string, encoding, offset[, length]) is no longer supported");const o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let f=!1;for(;;)switch(r){case"hex":return dt(this,t,e,n);case"utf8":case"utf-8":return wt(this,t,e,n);case"ascii":case"latin1":case"binary":return bt(this,t,e,n);case"base64":return mt(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,t,e,n);default:{if(f)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),f=!0}}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Bt(t,e,n){return e===0&&n===t.length?P(t):P(t.slice(e,n))}function q(t,e,n){n=Math.min(t.length,n);const r=[];let o=e;for(;o<n;){const f=t[o];let u=null,h=f>239?4:f>223?3:f>191?2:1;if(o+h<=n){let c,l,s,a;switch(h){case 1:{f<128&&(u=f);break}case 2:{c=t[o+1],(c&192)===128&&(a=(f&31)<<6|c&63,a>127&&(u=a));break}case 3:{c=t[o+1],l=t[o+2],(c&192)===128&&(l&192)===128&&(a=(f&15)<<12|(c&63)<<6|l&63,a>2047&&(a<55296||a>57343)&&(u=a));break}case 4:c=t[o+1],l=t[o+2],s=t[o+3],(c&192)===128&&(l&192)===128&&(s&192)===128&&(a=(f&15)<<18|(c&63)<<12|(l&63)<<6|s&63,a>65535&&a<1114112&&(u=a))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|u&1023),r.push(u),o+=h}return It(r)}const W=4096;function It(t){const e=t.length;if(e<=W)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=W));return n}function At(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]&127);return r}function Ut(t,e,n){let r="";n=Math.min(t.length,n);for(let o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function Rt(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let o="";for(let f=e;f<n;++f)o+=vt[t[f]];return o}function Tt(t,e,n){const r=t.slice(e,n);let o="";for(let f=0;f<r.length-1;f+=2)o+=String.fromCharCode(r[f]+r[f+1]*256);return o}i.prototype.slice=function(t,e){const n=this.length;t=Math.trunc(t),e=e===void 0?n:Math.trunc(e),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,i.prototype),r};function p(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let r=this[t],o=1,f=0;for(;++f<e&&(o*=256);)r+=this[t+f]*o;return r},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let r=this[t+--e],o=1;for(;e>0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t=t>>>0,e||p(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||p(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||p(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||p(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||p(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readBigUInt64LE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&R(t,this.length-8);const r=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))}),i.prototype.readBigUInt64BE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&R(t,this.length-8);const r=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)}),i.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let r=this[t],o=1,f=0;for(;++f<e&&(o*=256);)r+=this[t+f]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let r=e,o=1,f=this[t+--r];for(;r>0&&(o*=256);)f+=this[t+--r]*o;return o*=128,f>=o&&(f-=Math.pow(2,8*e)),f},i.prototype.readInt8=function(t,e){return t=t>>>0,e||p(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},i.prototype.readInt16LE=function(t,e){t=t>>>0,e||p(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},i.prototype.readInt16BE=function(t,e){t=t>>>0,e||p(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},i.prototype.readInt32LE=function(t,e){return t=t>>>0,e||p(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t=t>>>0,e||p(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readBigInt64LE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&R(t,this.length-8);const r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),i.prototype.readBigInt64BE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&R(t,this.length-8);const r=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),i.prototype.readFloatLE=function(t,e){return t=t>>>0,e||p(t,4,this.length),T(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t=t>>>0,e||p(t,4,this.length),T(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||p(t,8,this.length),T(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||p(t,8,this.length),T(this,t,!1,52,8)};function g(t,e,n,r,o,f){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<f)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){const u=Math.pow(2,8*n)-1;g(this,t,e,n,u,0)}let o=1,f=0;for(this[e]=t&255;++f<n&&(o*=256);)this[e+f]=t/o&255;return e+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,n=n>>>0,!r){const u=Math.pow(2,8*n)-1;g(this,t,e,n,u,0)}let o=n-1,f=1;for(this[e+o]=t&255;--o>=0&&(f*=256);)this[e+o]=t/f&255;return e+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,1,255,0),this[e]=t&255,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function J(t,e,n,r,o){tt(e,r,o,t,n,7);let f=Number(e&BigInt(4294967295));t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f,f=f>>8,t[n++]=f;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=u,u=u>>8,t[n++]=u,u=u>>8,t[n++]=u,u=u>>8,t[n++]=u,n}function X(t,e,n,r,o){tt(e,r,o,t,n,7);let f=Number(e&BigInt(4294967295));t[n+7]=f,f=f>>8,t[n+6]=f,f=f>>8,t[n+5]=f,f=f>>8,t[n+4]=f;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=u,u=u>>8,t[n+2]=u,u=u>>8,t[n+1]=u,u=u>>8,t[n]=u,n+8}i.prototype.writeBigUInt64LE=E(function(t,e=0){return J(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=E(function(t,e=0){return X(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){const h=Math.pow(2,8*n-1);g(this,t,e,n,h-1,-h)}let o=0,f=1,u=0;for(this[e]=t&255;++o<n&&(f*=256);)t<0&&u===0&&this[e+o-1]!==0&&(u=1),this[e+o]=Math.trunc(t/f)-u&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e=e>>>0,!r){const h=Math.pow(2,8*n-1);g(this,t,e,n,h-1,-h)}let o=n-1,f=1,u=0;for(this[e+o]=t&255;--o>=0&&(f*=256);)t<0&&u===0&&this[e+o+1]!==0&&(u=1),this[e+o]=Math.trunc(t/f)-u&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},i.prototype.writeBigInt64LE=E(function(t,e=0){return J(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=E(function(t,e=0){return X(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(t,e,n,r,o,f){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function K(t,e,n,r,o){return e=+e,n=n>>>0,o||H(t,e,n,4),F(t,e,n,r,23,4),n+4}i.prototype.writeFloatLE=function(t,e,n){return K(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return K(this,t,e,!1,n)};function Q(t,e,n,r,o){return e=+e,n=n>>>0,o||H(t,e,n,8),F(t,e,n,r,52,8),n+8}i.prototype.writeDoubleLE=function(t,e,n){return Q(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return Q(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),o},i.prototype.fill=function(t,e,n,r){if(typeof t=="string"){if(typeof e=="string"?(r=e,e=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){const f=t.charCodeAt(0);(r==="utf8"&&f<128||r==="latin1")&&(t=f)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{const f=i.isBuffer(t)?t:i.from(t,r),u=f.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=f[o%u]}return this};const A={};function C(t,e,n){A[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:Reflect.apply(e,this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}C("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),C("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),C("ERR_OUT_OF_RANGE",function(t,e,n){let r=`The value of "${t}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=Z(String(n)):typeof n=="bigint"&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=Z(o)),o+="n"),r+=` It must be ${e}. Received ${o}`,r},RangeError);function Z(t){let e="",n=t.length;const r=t[0]==="-"?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function Ot(t,e,n){U(e,"offset"),(t[e]===void 0||t[e+n]===void 0)&&R(e,t.length-(n+1))}function tt(t,e,n,r,o,f){if(t>n||t<e){const u=typeof e=="bigint"?"n":"";let h;throw h=e===0||e===BigInt(0)?`>= 0${u} and < 2${u} ** ${(f+1)*8}${u}`:`>= -(2${u} ** ${(f+1)*8-1}${u}) and < 2 ** ${(f+1)*8-1}${u}`,new A.ERR_OUT_OF_RANGE("value",h,t)}Ot(r,o,f)}function U(t,e){if(typeof t!="number")throw new A.ERR_INVALID_ARG_TYPE(e,"number",t)}function R(t,e,n){throw Math.floor(t)!==t?(U(t,n),new A.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}const Lt=/[^\w+/-]/g;function Nt(t){if(t=t.split("=")[0],t=t.trim().replace(Lt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function $(t,e){e=e||Number.POSITIVE_INFINITY;let n;const r=t.length;let o=null;const f=[];for(let u=0;u<r;++u){if(n=t.charCodeAt(u),n>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&f.push(239,191,189);continue}else if(u+1===r){(e-=3)>-1&&f.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&f.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&f.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;f.push(n)}else if(n<2048){if((e-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function St(t){const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n)&255);return e}function _t(t,e){let n,r,o;const f=[];for(let u=0;u<t.length&&!((e-=2)<0);++u)n=t.charCodeAt(u),r=n>>8,o=n%256,f.push(o,r);return f}function et(t){return it(Nt(t))}function O(t,e,n,r){let o;for(o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function b(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function M(t){return t!==t}const vt=function(){const t="0123456789abcdef",e=Array.from({length:256});for(let n=0;n<16;++n){const r=n*16;for(let o=0;o<16;++o)e[r+o]=t[n]+t[o]}return e}();function E(t){return typeof BigInt>"u"?xt:t}function xt(){throw new Error("BigInt not supported")}export{i as Buffer}; | ||
| const d=[],y=[],ot=typeof Uint8Array>"u"?Array:Uint8Array,L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let t=0,e=L.length;t<e;++t)d[t]=L[t],y[L.charCodeAt(t)]=t;y[45]=62,y[95]=63;function rt(t){const e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");let n=t.indexOf("=");n===-1&&(n=e);const o=n===e?0:4-n%4;return[n,o]}function it(t,e,n){return(e+n)*3/4-n}function ft(t){let e;const n=rt(t),o=n[0],r=n[1],i=new ot(it(t,o,r));let u=0;const h=r>0?o-4:o;let c;for(c=0;c<h;c+=4)e=y[t.charCodeAt(c)]<<18|y[t.charCodeAt(c+1)]<<12|y[t.charCodeAt(c+2)]<<6|y[t.charCodeAt(c+3)],i[u++]=e>>16&255,i[u++]=e>>8&255,i[u++]=e&255;return r===2&&(e=y[t.charCodeAt(c)]<<2|y[t.charCodeAt(c+1)]>>4,i[u++]=e&255),r===1&&(e=y[t.charCodeAt(c)]<<10|y[t.charCodeAt(c+1)]<<4|y[t.charCodeAt(c+2)]>>2,i[u++]=e>>8&255,i[u++]=e&255),i}function ut(t){return d[t>>18&63]+d[t>>12&63]+d[t>>6&63]+d[t&63]}function st(t,e,n){let o;const r=[];for(let i=e;i<n;i+=3)o=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),r.push(ut(o));return r.join("")}function P(t){let e;const n=t.length,o=n%3,r=[],i=16383;for(let u=0,h=n-o;u<h;u+=i)r.push(st(t,u,u+i>h?h:u+i));return o===1?(e=t[n-1],r.push(d[e>>2]+d[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],r.push(d[e>>10]+d[e>>4&63]+d[e<<2&63]+"=")),r.join("")}/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function R(t,e,n,o,r){let i,u;const h=r*8-o-1,c=(1<<h)-1,l=c>>1;let s=-7,a=n?r-1:0;const I=n?-1:1;let w=t[e+a];for(a+=I,i=w&(1<<-s)-1,w>>=-s,s+=h;s>0;)i=i*256+t[e+a],a+=I,s-=8;for(u=i&(1<<-s)-1,i>>=-s,s+=o;s>0;)u=u*256+t[e+a],a+=I,s-=8;if(i===0)i=1-l;else{if(i===c)return u?Number.NaN:(w?-1:1)*Number.POSITIVE_INFINITY;u=u+Math.pow(2,o),i=i-l}return(w?-1:1)*u*Math.pow(2,i-o)}function F(t,e,n,o,r,i){let u,h,c,l=i*8-r-1;const s=(1<<l)-1,a=s>>1,I=r===23?Math.pow(2,-24)-Math.pow(2,-77):0;let w=o?0:i-1;const O=o?1:-1,nt=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),Number.isNaN(e)||e===Number.POSITIVE_INFINITY?(h=Number.isNaN(e)?1:0,u=s):(u=Math.floor(Math.log2(e)),e*(c=Math.pow(2,-u))<1&&(u--,c*=2),e+=u+a>=1?I/c:I*Math.pow(2,1-a),e*c>=2&&(u++,c/=2),u+a>=s?(h=0,u=s):u+a>=1?(h=(e*c-1)*Math.pow(2,r),u=u+a):(h=e*Math.pow(2,a-1)*Math.pow(2,r),u=0));r>=8;)t[n+w]=h&255,w+=O,h/=256,r-=8;for(u=u<<r|h,l+=r;l>0;)t[n+w]=u&255,w+=O,u/=256,l-=8;t[n+w-O]|=nt*128}const k=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null,ht=50,N=2147483647;f.TYPED_ARRAY_SUPPORT=ct(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This environment lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ct(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function m(t){if(t>N)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(t)}return j(t,e,n)}f.poolSize=8192;function j(t,e,n){if(typeof t=="string")return lt(t,e);if(ArrayBuffer.isView(t))return pt(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(b(t,ArrayBuffer)||t&&b(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(b(t,SharedArrayBuffer)||t&&b(t.buffer,SharedArrayBuffer)))return Y(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(o!=null&&o!==t)return f.from(o,e,n);const r=gt(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return f.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}f.from=function(t,e,n){return j(t,e,n)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function D(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 at(t,e,n){return D(t),t<=0?m(t):e!==void 0?typeof n=="string"?m(t).fill(e,n):m(t).fill(e):m(t)}f.alloc=function(t,e,n){return at(t,e,n)};function S(t){return D(t),m(t<0?0:x(t)|0)}f.allocUnsafe=function(t){return S(t)},f.allocUnsafeSlow=function(t){return S(t)};function lt(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=z(t,e)|0;let o=m(n);const r=o.write(t,e);return r!==n&&(o=o.slice(0,r)),o}function _(t){const e=t.length<0?0:x(t.length)|0,n=m(e);for(let o=0;o<e;o+=1)n[o]=t[o]&255;return n}function pt(t){if(b(t,Uint8Array)){const e=new Uint8Array(t);return Y(e.buffer,e.byteOffset,e.byteLength)}return _(t)}function Y(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return e===void 0&&n===void 0?o=new Uint8Array(t):n===void 0?o=new Uint8Array(t,e):o=new Uint8Array(t,e,n),Object.setPrototypeOf(o,f.prototype),o}function gt(t){if(f.isBuffer(t)){const e=x(t.length)|0,n=m(e);return n.length===0||t.copy(n,0,0,e),n}if(t.length!==void 0)return typeof t.length!="number"||M(t.length)?m(0):_(t);if(t.type==="Buffer"&&Array.isArray(t.data))return _(t.data)}function x(t){if(t>=N)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+N.toString(16)+" bytes");return t|0}f.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==f.prototype},f.compare=function(t,e){if(b(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),b(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,o=e.length;for(let r=0,i=Math.min(n,o);r<i;++r)if(t[r]!==e[r]){n=t[r],o=e[r];break}return n<o?-1:o<n?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return f.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const o=f.allocUnsafe(e);let r=0;for(n=0;n<t.length;++n){let i=t[n];if(b(i,Uint8Array))r+i.length>o.length?(f.isBuffer(i)||(i=f.from(i.buffer,i.byteOffset,i.byteLength)),i.copy(o,r)):Uint8Array.prototype.set.call(o,i,r);else if(f.isBuffer(i))i.copy(o,r);else throw new TypeError('"list" argument must be an Array of Buffers');r+=i.length}return o};function z(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||b(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);const n=t.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&n===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return et(t).length;default:{if(r)return o?-1:$(t).length;e=(""+e).toLowerCase(),r=!0}}}f.byteLength=z;function yt(t,e,n){let o=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return vt(this,e,n);case"utf8":case"utf-8":return q(this,e,n);case"ascii":return At(this,e,n);case"latin1":case"binary":return Ut(this,e,n);case"base64":return Bt(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt(this,e,n);default:{if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}}f.prototype._isBuffer=!0;function B(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}f.prototype.swap16=function(){const t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)B(this,e,e+1);return this},f.prototype.swap32=function(){const t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)B(this,e,e+3),B(this,e+1,e+2);return this},f.prototype.swap64=function(){const t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)B(this,e,e+7),B(this,e+1,e+6),B(this,e+2,e+5),B(this,e+3,e+4);return this},f.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?q(this,0,t):Reflect.apply(yt,this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:f.compare(this,t)===0},f.prototype.inspect=function(){let t="";const e=ht;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},k&&(f.prototype[k]=f.prototype.inspect),f.prototype.compare=function(t,e,n,o,r){if(b(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),o===void 0&&(o=0),r===void 0&&(r=this.length),e<0||n>t.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&e>=n)return 0;if(o>=r)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,r>>>=0,this===t)return 0;let i=r-o,u=n-e;const h=Math.min(i,u),c=this.slice(o,r),l=t.slice(e,n);for(let s=0;s<h;++s)if(c[s]!==l[s]){i=c[s],u=l[s];break}return i<u?-1:u<i?1:0};function V(t,e,n,o,r){if(t.length===0)return-1;if(typeof n=="string"?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,M(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0)if(r)n=0;else return-1;if(typeof e=="string"&&(e=f.from(e,o)),f.isBuffer(e))return e.length===0?-1:G(t,e,n,o,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):G(t,[e],n,o,r);throw new TypeError("val must be string, number or Buffer")}function G(t,e,n,o,r){let i=1,u=t.length,h=e.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,u/=2,h/=2,n/=2}function c(s,a){return i===1?s[a]:s.readUInt16BE(a*i)}let l;if(r){let s=-1;for(l=n;l<u;l++)if(c(t,l)===c(e,s===-1?0:l-s)){if(s===-1&&(s=l),l-s+1===h)return s*i}else s!==-1&&(l-=l-s),s=-1}else for(n+h>u&&(n=u-h),l=n;l>=0;l--){let s=!0;for(let a=0;a<h;a++)if(c(t,l+a)!==c(e,a)){s=!1;break}if(s)return l}return-1}f.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},f.prototype.indexOf=function(t,e,n){return V(this,t,e,n,!0)},f.prototype.lastIndexOf=function(t,e,n){return V(this,t,e,n,!1)};function wt(t,e,n,o){n=Number(n)||0;const r=t.length-n;o?(o=Number(o),o>r&&(o=r)):o=r;const i=e.length;o>i/2&&(o=i/2);let u;for(u=0;u<o;++u){const h=Number.parseInt(e.slice(u*2,u*2+2),16);if(M(h))return u;t[n+u]=h}return u}function dt(t,e,n,o){return T($(e,t.length-n),t,n,o)}function bt(t,e,n,o){return T(Nt(e),t,n,o)}function mt(t,e,n,o){return T(et(e),t,n,o)}function Et(t,e,n,o){return T(St(e,t.length-n),t,n,o)}f.prototype.write=function(t,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(Number.isFinite(e))e=e>>>0,Number.isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new TypeError("Buffer.write(string, encoding, offset[, length]) is no longer supported");const r=this.length-e;if((n===void 0||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let i=!1;for(;;)switch(o){case"hex":return wt(this,t,e,n);case"utf8":case"utf-8":return dt(this,t,e,n);case"ascii":case"latin1":case"binary":return bt(this,t,e,n);case"base64":return mt(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,t,e,n);default:{if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Bt(t,e,n){return e===0&&n===t.length?P(t):P(t.slice(e,n))}function q(t,e,n){n=Math.min(t.length,n);const o=[];let r=e;for(;r<n;){const i=t[r];let u=null,h=i>239?4:i>223?3:i>191?2:1;if(r+h<=n){let c,l,s,a;switch(h){case 1:{i<128&&(u=i);break}case 2:{c=t[r+1],(c&192)===128&&(a=(i&31)<<6|c&63,a>127&&(u=a));break}case 3:{c=t[r+1],l=t[r+2],(c&192)===128&&(l&192)===128&&(a=(i&15)<<12|(c&63)<<6|l&63,a>2047&&(a<55296||a>57343)&&(u=a));break}case 4:c=t[r+1],l=t[r+2],s=t[r+3],(c&192)===128&&(l&192)===128&&(s&192)===128&&(a=(i&15)<<18|(c&63)<<12|(l&63)<<6|s&63,a>65535&&a<1114112&&(u=a))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,o.push(u>>>10&1023|55296),u=56320|u&1023),o.push(u),r+=h}return It(o)}const W=4096;function It(t){const e=t.length;if(e<=W)return String.fromCharCode.apply(String,t);let n="",o=0;for(;o<e;)n+=String.fromCharCode.apply(String,t.slice(o,o+=W));return n}function At(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(t[r]&127);return o}function Ut(t,e,n){let o="";n=Math.min(t.length,n);for(let r=e;r<n;++r)o+=String.fromCharCode(t[r]);return o}function vt(t,e,n){const o=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>o)&&(n=o);let r="";for(let i=e;i<n;++i)r+=_t[t[i]];return r}function Rt(t,e,n){const o=t.slice(e,n);let r="";for(let i=0;i<o.length-1;i+=2)r+=String.fromCharCode(o[i]+o[i+1]*256);return r}f.prototype.slice=function(t,e){const n=this.length;t=Math.trunc(t),e=e===void 0?n:Math.trunc(e),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);const o=this.subarray(t,e);return Object.setPrototypeOf(o,f.prototype),o};function p(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let o=this[t],r=1,i=0;for(;++i<e&&(r*=256);)o+=this[t+i]*r;return o},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let o=this[t+--e],r=1;for(;e>0&&(r*=256);)o+=this[t+--e]*r;return o},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t=t>>>0,e||p(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||p(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||p(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||p(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||p(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&v(t,this.length-8);const o=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,r=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(o)+(BigInt(r)<<BigInt(32))}),f.prototype.readBigUInt64BE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&v(t,this.length-8);const o=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],r=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(o)<<BigInt(32))+BigInt(r)}),f.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let o=this[t],r=1,i=0;for(;++i<e&&(r*=256);)o+=this[t+i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*e)),o},f.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||p(t,e,this.length);let o=e,r=1,i=this[t+--o];for(;o>0&&(r*=256);)i+=this[t+--o]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*e)),i},f.prototype.readInt8=function(t,e){return t=t>>>0,e||p(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},f.prototype.readInt16LE=function(t,e){t=t>>>0,e||p(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},f.prototype.readInt16BE=function(t,e){t=t>>>0,e||p(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},f.prototype.readInt32LE=function(t,e){return t=t>>>0,e||p(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t=t>>>0,e||p(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&v(t,this.length-8);const o=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),f.prototype.readBigInt64BE=E(function(t){t=t>>>0,U(t,"offset");const e=this[t],n=this[t+7];(e===void 0||n===void 0)&&v(t,this.length-8);const o=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),f.prototype.readFloatLE=function(t,e){return t=t>>>0,e||p(t,4,this.length),R(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t=t>>>0,e||p(t,4,this.length),R(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||p(t,8,this.length),R(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||p(t,8,this.length),R(this,t,!1,52,8)};function g(t,e,n,o,r,i){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<i)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){const u=Math.pow(2,8*n)-1;g(this,t,e,n,u,0)}let r=1,i=0;for(this[e]=t&255;++i<n&&(r*=256);)this[e+i]=t/r&255;return e+n},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,n=n>>>0,!o){const u=Math.pow(2,8*n)-1;g(this,t,e,n,u,0)}let r=n-1,i=1;for(this[e+r]=t&255;--r>=0&&(i*=256);)this[e+r]=t/i&255;return e+n},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,1,255,0),this[e]=t&255,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function J(t,e,n,o,r){tt(e,o,r,t,n,7);let i=Number(e&BigInt(4294967295));t[n++]=i,i=i>>8,t[n++]=i,i=i>>8,t[n++]=i,i=i>>8,t[n++]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=u,u=u>>8,t[n++]=u,u=u>>8,t[n++]=u,u=u>>8,t[n++]=u,n}function X(t,e,n,o,r){tt(e,o,r,t,n,7);let i=Number(e&BigInt(4294967295));t[n+7]=i,i=i>>8,t[n+6]=i,i=i>>8,t[n+5]=i,i=i>>8,t[n+4]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=u,u=u>>8,t[n+2]=u,u=u>>8,t[n+1]=u,u=u>>8,t[n]=u,n+8}f.prototype.writeBigUInt64LE=E(function(t,e=0){return J(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=E(function(t,e=0){return X(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){const h=Math.pow(2,8*n-1);g(this,t,e,n,h-1,-h)}let r=0,i=1,u=0;for(this[e]=t&255;++r<n&&(i*=256);)t<0&&u===0&&this[e+r-1]!==0&&(u=1),this[e+r]=Math.trunc(t/i)-u&255;return e+n},f.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e=e>>>0,!o){const h=Math.pow(2,8*n-1);g(this,t,e,n,h-1,-h)}let r=n-1,i=1,u=0;for(this[e+r]=t&255;--r>=0&&(i*=256);)t<0&&u===0&&this[e+r+1]!==0&&(u=1),this[e+r]=Math.trunc(t/i)-u&255;return e+n},f.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},f.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},f.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||g(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},f.prototype.writeBigInt64LE=E(function(t,e=0){return J(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=E(function(t,e=0){return X(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(t,e,n,o,r,i){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function K(t,e,n,o,r){return e=+e,n=n>>>0,r||H(t,e,n,4),F(t,e,n,o,23,4),n+4}f.prototype.writeFloatLE=function(t,e,n){return K(this,t,e,!0,n)},f.prototype.writeFloatBE=function(t,e,n){return K(this,t,e,!1,n)};function Q(t,e,n,o,r){return e=+e,n=n>>>0,r||H(t,e,n,8),F(t,e,n,o,52,8),n+8}f.prototype.writeDoubleLE=function(t,e,n){return Q(this,t,e,!0,n)},f.prototype.writeDoubleBE=function(t,e,n){return Q(this,t,e,!1,n)},f.prototype.copy=function(t,e,n,o){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o<n&&(o=n),o===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e<o-n&&(o=t.length-e+n);const r=o-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),e),r},f.prototype.fill=function(t,e,n,o){if(typeof t=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!f.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(t.length===1){const i=t.charCodeAt(0);(o==="utf8"&&i<128||o==="latin1")&&(t=i)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let r;if(typeof t=="number")for(r=e;r<n;++r)this[r]=t;else{const i=f.isBuffer(t)?t:f.from(t,o),u=i.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(r=0;r<n-e;++r)this[r+e]=i[r%u]}return this};const A={};function C(t,e,n){A[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:Reflect.apply(e,this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}C("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),C("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),C("ERR_OUT_OF_RANGE",function(t,e,n){let o=`The value of "${t}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=Z(String(n)):typeof n=="bigint"&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=Z(r)),r+="n"),o+=` It must be ${e}. Received ${r}`,o},RangeError);function Z(t){let e="",n=t.length;const o=t[0]==="-"?1:0;for(;n>=o+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function Tt(t,e,n){U(e,"offset"),(t[e]===void 0||t[e+n]===void 0)&&v(e,t.length-(n+1))}function tt(t,e,n,o,r,i){if(t>n||t<e){const u=typeof e=="bigint"?"n":"";let h;throw h=e===0||e===BigInt(0)?`>= 0${u} and < 2${u} ** ${(i+1)*8}${u}`:`>= -(2${u} ** ${(i+1)*8-1}${u}) and < 2 ** ${(i+1)*8-1}${u}`,new A.ERR_OUT_OF_RANGE("value",h,t)}Tt(o,r,i)}function U(t,e){if(typeof t!="number")throw new A.ERR_INVALID_ARG_TYPE(e,"number",t)}function v(t,e,n){throw Math.floor(t)!==t?(U(t,n),new A.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}const Ot=/[^\w+/-]/g;function Lt(t){if(t=t.split("=")[0],t=t.trim().replace(Ot,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function $(t,e){e=e||Number.POSITIVE_INFINITY;let n;const o=t.length;let r=null;const i=[];for(let u=0;u<o;++u){if(n=t.charCodeAt(u),n>55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(u+1===o){(e-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(e-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return i}function Nt(t){const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n)&255);return e}function St(t,e){let n,o,r;const i=[];for(let u=0;u<t.length&&!((e-=2)<0);++u)n=t.charCodeAt(u),o=n>>8,r=n%256,i.push(r,o);return i}function et(t){return ft(Lt(t))}function T(t,e,n,o){let r;for(r=0;r<o&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function b(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function M(t){return t!==t}const _t=function(){const t="0123456789abcdef",e=Array.from({length:256});for(let n=0;n<16;++n){const o=n*16;for(let r=0;r<16;++r)e[o+r]=t[n]+t[r]}return e}();function E(t){return typeof BigInt>"u"?xt:t}function xt(){throw new Error("BigInt not supported")}export{f as Buffer}; |
@@ -1,5 +0,5 @@ | ||
| "use strict";let y=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),F=(t,e)=>t,g=Error,J=Error,h=Error,b=Error,Z=Error,R=Symbol.for("nodejs.rejection"),l=Symbol.for("kCapture"),A=Symbol.for("events.errorMonitor"),p=Symbol.for("shapeMode"),w=Symbol.for("events.maxEventTargetListeners"),ee=Symbol.for("kEnhanceStackBeforeInspector"),te=Symbol.for("nodejs.watermarkData"),E=Symbol.for("kAsyncResource"),ne=Symbol.for("kFirstEventParam"),N=Symbol.for("kResistStopPropagation"),W=Symbol.for("events.maxEventTargetListenersWarned");class EventEmitter{_events=void 0;_eventsCount=0;_maxListeners=y;[l]=!1;[p]=!1;static captureRejectionSymbol=R;static errorMonitor=A;static kMaxEventTargetListeners=w;static kMaxEventTargetListenersWarned=W;static usingDomains=!1;static get on(){return on}static get once(){return once}static get getEventListeners(){return getEventListeners}static get getMaxListeners(){return getMaxListeners}static get addAbortListener(){return addAbortListener}static get EventEmitterAsyncResource(){return EventEmitterAsyncResource}static get EventEmitter(){return EventEmitter}static setMaxListeners(e=y,...n){if(n.length===0)y=e;else for(const r of n)if(H(r))r[w]=e,r[W]=!1;else if(typeof r.setMaxListeners=="function")r.setMaxListeners(e);else throw new h("eventTargets",["EventEmitter","EventTarget"],r)}static listenerCount(e,n){if(typeof e.listenerCount=="function")return e.listenerCount(n);EventEmitter.prototype.listenerCount.call(e,n)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[l]}static set captureRejections(e){this[l]=e}static get defaultMaxListeners(){return y}static set defaultMaxListeners(e){y=e}constructor(e){this._events===void 0||this._events===Object.getPrototypeOf(this)._events?(this._events={__proto__:null},this._eventsCount=0,this[p]=!1):this[p]=!0,this._maxListeners=this._maxListeners||void 0,e?.captureRejections?this[l]=!!e.captureRejections:this[l]=EventEmitter.prototype[l]}setMaxListeners(e){return this._maxListeners=e,this}getMaxListeners(){return S(this)}emit(e,...n){let r=e==="error";const s=this._events;if(s!==void 0)r&&s[A]!==void 0&&this.emit(A,...n),r=r&&s.error===void 0;else if(!r)return!1;if(r){let i;if(n.length>0&&(i=n[0]),i instanceof Error){try{const a={};Error.captureStackTrace?.(a,EventEmitter.prototype.emit),Object.defineProperty(i,ee,{__proto__:null,value:Function.prototype.bind(re,this,i,a),configurable:!0})}catch{}throw i}let c;try{c=F(i)}catch{c=i}const f=new J(c);throw f.context=i,f}const o=s[e];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,n);i!=null&&O(this,i,e,n)}else{const i=o.length,c=C(o);for(let f=0;f<i;++f){const a=c[f].apply(this,n);a!=null&&O(this,a,e,n)}}return!0}addListener(e,n){return z(this,e,n,!1),this}on(e,n){return this.addListener(e,n)}prependListener(e,n){return z(this,e,n,!0),this}once(e,n){return this.on(e,U(this,e,n)),this}prependOnceListener(e,n){return this.prependListener(e,U(this,e,n)),this}removeListener(e,n){const r=this._events;if(r===void 0)return this;const s=r[e];if(s===void 0)return this;if(s===n||s.listener===n)this._eventsCount-=1,this[p]?r[e]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete r[e],r.removeListener&&this.emit("removeListener",e,s.listener||n));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===n||s[i].listener===n){o=i;break}if(o<0)return this;o===0?s.shift():ce(s,o),s.length===1&&(r[e]=s[0]),r.removeListener!==void 0&&this.emit("removeListener",e,n)}return this}off(e,n){return this.removeListener(e,n)}removeAllListeners(e){const n=this._events;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete n[e]),this[p]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(n))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[p]=!1,this}const r=n[e];if(typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(let s=r.length-1;s>=0;s--)this.removeListener(e,r[s]);return this}listeners(e){return G(this,e,!0)}rawListeners(e){return G(this,e,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(e,n){const r=this._events;if(r!==void 0){const s=r[e];if(typeof s=="function")return n!=null?n===s||n===s.listener?1:0:1;if(s!==void 0){if(n!=null){let o=0;for(let i=0,c=s.length;i<c;i++)(s[i]===n||s[i].listener===n)&&o++;return o}return s.length}}return 0}}class EventEmitterAsyncResource extends EventEmitter{constructor(e){let n;typeof e=="string"?(n=e,e=void 0):n=e?.name||new.target.name,super(e),this[E]=new EventEmitterReferencingAsyncResource(this,n,e)}emit(e,...n){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");const{asyncResource:r}=this;return Array.prototype.unshift(n,super.emit,this,e),Reflect.apply(r.runInAsyncScope,r,n)}emitDestroy(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");this.asyncResource.emitDestroy()}get asyncId(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this.asyncResource.asyncId()}get triggerAsyncId(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this.asyncResource.triggerAsyncId()}get asyncResource(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this[E]}}const on=function(t,e,n={}){const r=n.signal;if(r?.aborted)throw new b(void 0,{cause:r?.reason});const s=n.highWaterMark??n.highWatermark??Number.MAX_SAFE_INTEGER,o=n.lowWaterMark??n.lowWatermark??1,i=new $,c=new $;let f=!1,a=null,d=!1,m=0;const I=Object.setPrototypeOf({next(){if(m){const u=i.shift();return m--,f&&m<o&&(t.resume?.(),f=!1),Promise.resolve(T(u,!1))}if(a){const u=Promise.reject(a);return a=null,u}return d?v():new Promise(function(u,V){c.push({resolve:u,reject:V})})},return(){return v()},throw(u){if(!u||!(u instanceof Error))throw new h("EventEmitter.AsyncIterator","Error",u);x(u)},[Symbol.asyncIterator](){return this},[te]:{get size(){return m},get low(){return o},get high(){return s},get isPaused(){return f}}},Y),{addEventListener:_,removeAll:K}=ue();_(t,e,n[ne]?j:function(...u){return j(u)}),e!=="error"&&typeof t.on=="function"&&_(t,"error",x);const k=n?.close;if(k?.length)for(const u of k)_(t,u,v);const q=r?addAbortListener(r,Q):null;return I;function Q(){x(new b(void 0,{cause:r?.reason}))}function j(u){c.isEmpty()?(m++,!f&&m>s&&(f=!0,t.pause?.()),i.push(u)):c.shift().resolve(T(u,!1))}function x(u){c.isEmpty()?a=u:c.shift().reject(u),v()}function v(){q?.[Symbol.dispose](),K(),d=!0;const u=T(void 0,!0);for(;!c.isEmpty();)c.shift().resolve(u);return Promise.resolve(u)}},once=async function(t,e,n={}){const r=n?.signal;if(r?.aborted)throw new b(void 0,{cause:r?.reason});return new Promise((s,o)=>{const i=d=>{typeof t.removeListener=="function"&&t.removeListener(e,c),r!=null&&L(r,"abort",a),o(d)},c=(...d)=>{typeof t.removeListener=="function"&&t.removeListener("error",i),r!=null&&L(r,"abort",a),s(d)},f={__proto__:null,once:!0,[N]:!0};P(t,e,c,f),e!=="error"&&typeof t.once=="function"&&t.once("error",i);function a(){L(t,e,c),L(t,"error",i),o(new b(void 0,{cause:r?.reason}))}r!=null&&P(r,"abort",a,{__proto__:null,once:!0,[N]:!0})})},addAbortListener=function(t,e){if(t===void 0)throw new h("signal","AbortSignal",t);let n;return t.aborted?queueMicrotask(()=>e()):(t.addEventListener("abort",e,{__proto__:null,once:!0,[N]:!0}),n=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[Symbol.dispose](){n?.()}}},getEventListeners=function(t,e){if(typeof t.listeners=="function")return t.listeners(e);if(H(t)){const n=t[kEvents].get(e),r=[];let s=n?.next;for(;s?.listener!==void 0;){const o=s.listener?.deref?s.listener.deref():s.listener;r.push(o),s=s.next}return r}throw new h("emitter",["EventEmitter","EventTarget"],t)},getMaxListeners=function(t){if(typeof t?.getMaxListeners=="function")return S(t);if(t?.[w])return t[w];throw new h("emitter",["EventEmitter","EventTarget"],t)},D=2048,M=D-1;class B{bottom;top;list;next;constructor(){this.bottom=0,this.top=0,this.list=new Array(D),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&M)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&M}shift(){const e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&M,e)}}class ${head;tail;constructor(){this.head=this.tail=new B}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new B),this.head.push(e)}shift(){const e=this.tail,n=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),n}}function H(t){return typeof t?.addEventListener=="function"}function O(t,e,n,r){if(t[l])try{const s=e.then;typeof s=="function"&&s.call(e,void 0,function(o){process.nextTick(se,t,o,n,r)})}catch(s){t.emit("error",s)}}function se(t,e,n,r){if(typeof t[R]=="function")t[R](e,n,...r);else{const s=t[l];try{t[l]=!1,t.emit("error",e)}finally{t[l]=s}}}function S(t){return t._maxListeners===void 0?y:t._maxListeners}function re(t,e){let n="";try{const{name:o}=this.constructor;o!=="EventEmitter"&&(n=` on ${o} instance`)}catch{}const r=` | ||
| Emitted 'error' event${n} at: | ||
| `,s=(e.stack||"").split(` | ||
| `).slice(1);return t.stack+r+s.join(` | ||
| `)}function z(t,e,n,r){let s,o,i;if(o=t._events,o===void 0?(o=t._events={__proto__:null},t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,n.listener??n),o=t._events),i=o[e]),i===void 0)o[e]=n,++t._eventsCount;else if(typeof i=="function"?i=o[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=S(t),s>0&&i.length>s&&!i.warned){i.warned=!0;const c=new Z(`Possible EventEmitter memory leak detected. ${i.length} ${String(e)} listeners added to ${F(t)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:t,type:e,count:i.length});process.emitWarning(c)}return t}function ie(){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 U(t,e,n){const r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},s=ie.bind(r);return s.listener=n,r.wrapFn=s,s}function G(t,e,n){const r=t._events;if(r===void 0)return[];const s=r[e];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?oe(s):C(s)}function C(t){switch(t.length){case 2:return[t[0],t[1]];case 3:return[t[0],t[1],t[2]];case 4:return[t[0],t[1],t[2],t[3]];case 5:return[t[0],t[1],t[2],t[3],t[4]];case 6:return[t[0],t[1],t[2],t[3],t[4],t[5]]}return Array.prototype.slice(t)}function oe(t){const e=C(t);for(let n=0;n<e.length;++n){const r=e[n].listener;typeof r=="function"&&(e[n]=r)}return e}function T(t,e){return{value:t,done:e}}function L(t,e,n,r){if(typeof t.removeListener=="function")t.removeListener(e,n);else if(typeof t.removeEventListener=="function")t.removeEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function P(t,e,n,r){if(typeof t.on=="function")r?.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function ue(){const t=[];return{addEventListener(e,n,r,s){P(e,n,r,s),Array.prototype.push(t,[e,n,r,s])},removeAll(){for(;t.length>0;)Reflect.apply(L,void 0,t.pop())}}}function ce(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}exports.EventEmitter=EventEmitter; | ||
| "use strict";let y=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),F=(e,t)=>e,g=Error,J=Error,h=Error,b=Error,Z=Error,R=Symbol.for("nodejs.rejection"),l=Symbol.for("kCapture"),A=Symbol.for("events.errorMonitor"),p=Symbol.for("shapeMode"),w=Symbol.for("events.maxEventTargetListeners"),ee=Symbol.for("kEnhanceStackBeforeInspector"),te=Symbol.for("nodejs.watermarkData"),E=Symbol.for("kAsyncResource"),ne=Symbol.for("kFirstEventParam"),N=Symbol.for("kResistStopPropagation"),W=Symbol.for("events.maxEventTargetListenersWarned");class EventEmitter{_events=void 0;_eventsCount=0;_maxListeners=y;[l]=!1;[p]=!1;static captureRejectionSymbol=R;static errorMonitor=A;static kMaxEventTargetListeners=w;static kMaxEventTargetListenersWarned=W;static usingDomains=!1;static get on(){return on}static get once(){return once}static get getEventListeners(){return getEventListeners}static get getMaxListeners(){return getMaxListeners}static get addAbortListener(){return addAbortListener}static get EventEmitterAsyncResource(){return EventEmitterAsyncResource}static get EventEmitter(){return EventEmitter}static setMaxListeners(t=y,...r){if(r.length===0)y=t;else for(const n of r)if(H(n))n[w]=t,n[W]=!1;else if(typeof n.setMaxListeners=="function")n.setMaxListeners(t);else throw new h("eventTargets",["EventEmitter","EventTarget"],n)}static listenerCount(t,r){if(typeof t.listenerCount=="function")return t.listenerCount(r);EventEmitter.prototype.listenerCount.call(t,r)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[l]}static set captureRejections(t){this[l]=t}static get defaultMaxListeners(){return y}static set defaultMaxListeners(t){y=t}constructor(t){this._events===void 0||this._events===Object.getPrototypeOf(this)._events?(this._events={__proto__:null},this._eventsCount=0,this[p]=!1):this[p]=!0,this._maxListeners=this._maxListeners||void 0,t?.captureRejections?this[l]=!!t.captureRejections:this[l]=EventEmitter.prototype[l]}setMaxListeners(t){return this._maxListeners=t,this}getMaxListeners(){return S(this)}emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n&&s[A]!==void 0&&this.emit(A,...r),n=n&&s.error===void 0;else if(!n)return!1;if(n){let i;if(r.length>0&&(i=r[0]),i instanceof Error){try{const f={};Error.captureStackTrace?.(f,EventEmitter.prototype.emit),Object.defineProperty(i,ee,{__proto__:null,value:Function.prototype.bind(re,this,i,f),configurable:!0})}catch{}throw i}let u;try{u=F(i)}catch{u=i}const a=new J(u);throw a.context=i,a}const o=s[t];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,r);i!=null&&O(this,i,t,r)}else{const i=o.length,u=C(o);for(let a=0;a<i;++a){const f=u[a].apply(this,r);f!=null&&O(this,f,t,r)}}return!0}addListener(t,r){return z(this,t,r,!1),this}on(t,r){return this.addListener(t,r)}prependListener(t,r){return z(this,t,r,!0),this}once(t,r){return this.on(t,U(this,t,r)),this}prependOnceListener(t,r){return this.prependListener(t,U(this,t,r)),this}removeListener(t,r){const n=this._events;if(n===void 0)return this;const s=n[t];if(s===void 0)return this;if(s===r||s.listener===r)this._eventsCount-=1,this[p]?n[t]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete n[t],n.removeListener&&this.emit("removeListener",t,s.listener||r));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===r||s[i].listener===r){o=i;break}if(o<0)return this;o===0?s.shift():ce(s,o),s.length===1&&(n[t]=s[0]),n.removeListener!==void 0&&this.emit("removeListener",t,r)}return this}off(t,r){return this.removeListener(t,r)}removeAllListeners(t){const r=this._events;if(r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete r[t]),this[p]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(r))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[p]=!1,this}const n=r[t];if(typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(let s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this}listeners(t){return G(this,t,!0)}rawListeners(t){return G(this,t,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(t,r){const n=this._events;if(n!==void 0){const s=n[t];if(typeof s=="function")return r!=null?r===s||r===s.listener?1:0:1;if(s!==void 0){if(r!=null){let o=0;for(let i=0,u=s.length;i<u;i++)(s[i]===r||s[i].listener===r)&&o++;return o}return s.length}}return 0}}class EventEmitterAsyncResource extends EventEmitter{constructor(t){let r;typeof t=="string"?(r=t,t=void 0):r=t?.name||new.target.name,super(t),this[E]=new EventEmitterReferencingAsyncResource(this,r,t)}emit(t,...r){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");const{asyncResource:n}=this;return Array.prototype.unshift(r,super.emit,this,t),Reflect.apply(n.runInAsyncScope,n,r)}emitDestroy(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");this.asyncResource.emitDestroy()}get asyncId(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this.asyncResource.asyncId()}get triggerAsyncId(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this.asyncResource.triggerAsyncId()}get asyncResource(){if(this[E]===void 0)throw new g("EventEmitterAsyncResource");return this[E]}}const on=function(e,t,r={}){const n=r.signal;if(n?.aborted)throw new b(void 0,{cause:n?.reason});const s=r.highWaterMark??r.highWatermark??Number.MAX_SAFE_INTEGER,o=r.lowWaterMark??r.lowWatermark??1,i=new $,u=new $;let a=!1,f=null,v=!1,m=0;const I=Object.setPrototypeOf({next(){if(m){const c=i.shift();return m--,a&&m<o&&(e.resume?.(),a=!1),Promise.resolve(T(c,!1))}if(f){const c=Promise.reject(f);return f=null,c}return v?d():new Promise(function(c,V){u.push({resolve:c,reject:V})})},return(){return d()},throw(c){if(!c||!(c instanceof Error))throw new h("EventEmitter.AsyncIterator","Error",c);x(c)},[Symbol.asyncIterator](){return this},[te]:{get size(){return m},get low(){return o},get high(){return s},get isPaused(){return a}}},Y),{addEventListener:_,removeAll:K}=ue();_(e,t,r[ne]?j:function(...c){return j(c)}),t!=="error"&&typeof e.on=="function"&&_(e,"error",x);const k=r?.close;if(k?.length)for(const c of k)_(e,c,d);const q=n?addAbortListener(n,Q):null;return I;function Q(){x(new b(void 0,{cause:n?.reason}))}function j(c){u.isEmpty()?(m++,!a&&m>s&&(a=!0,e.pause?.()),i.push(c)):u.shift().resolve(T(c,!1))}function x(c){u.isEmpty()?f=c:u.shift().reject(c),d()}function d(){q?.[Symbol.dispose](),K(),v=!0;const c=T(void 0,!0);for(;!u.isEmpty();)u.shift().resolve(c);return Promise.resolve(c)}},once=async function(e,t,r={}){const n=r?.signal;if(n?.aborted)throw new b(void 0,{cause:n?.reason});return new Promise((s,o)=>{const i=v=>{typeof e.removeListener=="function"&&e.removeListener(t,u),n!=null&&L(n,"abort",f),o(v)},u=(...v)=>{typeof e.removeListener=="function"&&e.removeListener("error",i),n!=null&&L(n,"abort",f),s(v)},a={__proto__:null,once:!0,[N]:!0};P(e,t,u,a),t!=="error"&&typeof e.once=="function"&&e.once("error",i);function f(){L(e,t,u),L(e,"error",i),o(new b(void 0,{cause:n?.reason}))}n!=null&&P(n,"abort",f,{__proto__:null,once:!0,[N]:!0})})},addAbortListener=function(e,t){if(e===void 0)throw new h("signal","AbortSignal",e);let r;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[N]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[Symbol.dispose](){r?.()}}},getEventListeners=function(e,t){if(typeof e.listeners=="function")return e.listeners(t);if(H(e)){const r=e[kEvents].get(t),n=[];let s=r?.next;for(;s?.listener!==void 0;){const o=s.listener?.deref?s.listener.deref():s.listener;n.push(o),s=s.next}return n}throw new h("emitter",["EventEmitter","EventTarget"],e)},getMaxListeners=function(e){if(typeof e?.getMaxListeners=="function")return S(e);if(e?.[w])return e[w];throw new h("emitter",["EventEmitter","EventTarget"],e)},D=2048,M=D-1;class B{bottom;top;list;next;constructor(){this.bottom=0,this.top=0,this.list=new Array(D),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&M)===this.bottom}push(t){this.list[this.top]=t,this.top=this.top+1&M}shift(){const t=this.list[this.bottom];return t===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&M,t)}}class ${head;tail;constructor(){this.head=this.tail=new B}isEmpty(){return this.head.isEmpty()}push(t){this.head.isFull()&&(this.head=this.head.next=new B),this.head.push(t)}shift(){const t=this.tail,r=t.shift();return t.isEmpty()&&t.next!==null&&(this.tail=t.next,t.next=null),r}}function H(e){return typeof e?.addEventListener=="function"}function O(e,t,r,n){if(e[l])try{const s=t.then;typeof s=="function"&&s.call(t,void 0,function(o){process.nextTick(se,e,o,r,n)})}catch(s){e.emit("error",s)}}function se(e,t,r,n){if(typeof e[R]=="function")e[R](t,r,...n);else{const s=e[l];try{e[l]=!1,e.emit("error",t)}finally{e[l]=s}}}function S(e){return e._maxListeners===void 0?y:e._maxListeners}function re(e,t){let r="";try{const{name:o}=this.constructor;o!=="EventEmitter"&&(r=` on ${o} instance`)}catch{}const n=` | ||
| Emitted 'error' event${r} at: | ||
| `,s=(t.stack||"").split(` | ||
| `).slice(1);return e.stack+n+s.join(` | ||
| `)}function z(e,t,r,n){let s,o,i;if(o=e._events,o===void 0?(o=e._events={__proto__:null},e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener??r),o=e._events),i=o[t]),i===void 0)o[t]=r,++e._eventsCount;else if(typeof i=="function"?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),s=S(e),s>0&&i.length>s&&!i.warned){i.warned=!0;const u=new Z(`Possible EventEmitter memory leak detected. ${i.length} ${String(t)} listeners added to ${F(e)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:e,type:t,count:i.length});process.emitWarning(u)}return e}function ie(){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 U(e,t,r){const n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=ie.bind(n);return s.listener=r,n.wrapFn=s,s}function G(e,t,r){const n=e._events;if(n===void 0)return[];const s=n[t];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?oe(s):C(s)}function C(e){switch(e.length){case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];case 4:return[e[0],e[1],e[2],e[3]];case 5:return[e[0],e[1],e[2],e[3],e[4]];case 6:return[e[0],e[1],e[2],e[3],e[4],e[5]]}return Array.prototype.slice(e)}function oe(e){const t=C(e);for(let r=0;r<t.length;++r){const n=t[r].listener;typeof n=="function"&&(t[r]=n)}return t}function T(e,t){return{value:e,done:t}}function L(e,t,r,n){if(typeof e.removeListener=="function")e.removeListener(t,r);else if(typeof e.removeEventListener=="function")e.removeEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function P(e,t,r,n){if(typeof e.on=="function")n?.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function ue(){const e=[];return{addEventListener(t,r,n,s){P(t,r,n,s),Array.prototype.push(e,[t,r,n,s])},removeAll(){for(;e.length>0;)Reflect.apply(L,void 0,e.pop())}}}function ce(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}exports.EventEmitter=EventEmitter; |
@@ -1,5 +0,5 @@ | ||
| let v=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),F=(t,e)=>t,_=Error,Z=Error,h=Error,w=Error,ee=Error,R=Symbol.for("nodejs.rejection"),a=Symbol.for("kCapture"),M=Symbol.for("events.errorMonitor"),g=Symbol.for("shapeMode"),b=Symbol.for("events.maxEventTargetListeners"),te=Symbol.for("kEnhanceStackBeforeInspector"),ne=Symbol.for("nodejs.watermarkData"),d=Symbol.for("kAsyncResource"),re=Symbol.for("kFirstEventParam"),S=Symbol.for("kResistStopPropagation"),W=Symbol.for("events.maxEventTargetListenersWarned");class m{_events=void 0;_eventsCount=0;_maxListeners=v;[a]=!1;[g]=!1;static captureRejectionSymbol=R;static errorMonitor=M;static kMaxEventTargetListeners=b;static kMaxEventTargetListenersWarned=W;static usingDomains=!1;static get on(){return ie}static get once(){return oe}static get getEventListeners(){return ue}static get getMaxListeners(){return ce}static get addAbortListener(){return $}static get EventEmitterAsyncResource(){return se}static get EventEmitter(){return m}static setMaxListeners(e=v,...n){if(n.length===0)v=e;else for(const r of n)if(q(r))r[b]=e,r[W]=!1;else if(typeof r.setMaxListeners=="function")r.setMaxListeners(e);else throw new h("eventTargets",["EventEmitter","EventTarget"],r)}static listenerCount(e,n){if(typeof e.listenerCount=="function")return e.listenerCount(n);m.prototype.listenerCount.call(e,n)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[a]}static set captureRejections(e){this[a]=e}static get defaultMaxListeners(){return v}static set defaultMaxListeners(e){v=e}constructor(e){this._events===void 0||this._events===Object.getPrototypeOf(this)._events?(this._events={__proto__:null},this._eventsCount=0,this[g]=!1):this[g]=!0,this._maxListeners=this._maxListeners||void 0,e?.captureRejections?this[a]=!!e.captureRejections:this[a]=m.prototype[a]}setMaxListeners(e){return this._maxListeners=e,this}getMaxListeners(){return j(this)}emit(e,...n){let r=e==="error";const s=this._events;if(s!==void 0)r&&s[M]!==void 0&&this.emit(M,...n),r=r&&s.error===void 0;else if(!r)return!1;if(r){let i;if(n.length>0&&(i=n[0]),i instanceof Error){try{const l={};Error.captureStackTrace?.(l,m.prototype.emit),Object.defineProperty(i,te,{__proto__:null,value:Function.prototype.bind(le,this,i,l),configurable:!0})}catch{}throw i}let c;try{c=F(i)}catch{c=i}const f=new Z(c);throw f.context=i,f}const o=s[e];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,n);i!=null&&z(this,i,e,n)}else{const i=o.length,c=C(o);for(let f=0;f<i;++f){const l=c[f].apply(this,n);l!=null&&z(this,l,e,n)}}return!0}addListener(e,n){return B(this,e,n,!1),this}on(e,n){return this.addListener(e,n)}prependListener(e,n){return B(this,e,n,!0),this}once(e,n){return this.on(e,G(this,e,n)),this}prependOnceListener(e,n){return this.prependListener(e,G(this,e,n)),this}removeListener(e,n){const r=this._events;if(r===void 0)return this;const s=r[e];if(s===void 0)return this;if(s===n||s.listener===n)this._eventsCount-=1,this[g]?r[e]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete r[e],r.removeListener&&this.emit("removeListener",e,s.listener||n));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===n||s[i].listener===n){o=i;break}if(o<0)return this;o===0?s.shift():me(s,o),s.length===1&&(r[e]=s[0]),r.removeListener!==void 0&&this.emit("removeListener",e,n)}return this}off(e,n){return this.removeListener(e,n)}removeAllListeners(e){const n=this._events;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete n[e]),this[g]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(n))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[g]=!1,this}const r=n[e];if(typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(let s=r.length-1;s>=0;s--)this.removeListener(e,r[s]);return this}listeners(e){return U(this,e,!0)}rawListeners(e){return U(this,e,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(e,n){const r=this._events;if(r!==void 0){const s=r[e];if(typeof s=="function")return n!=null?n===s||n===s.listener?1:0:1;if(s!==void 0){if(n!=null){let o=0;for(let i=0,c=s.length;i<c;i++)(s[i]===n||s[i].listener===n)&&o++;return o}return s.length}}return 0}}class se extends m{constructor(e){let n;typeof e=="string"?(n=e,e=void 0):n=e?.name||new.target.name,super(e),this[d]=new EventEmitterReferencingAsyncResource(this,n,e)}emit(e,...n){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");const{asyncResource:r}=this;return Array.prototype.unshift(n,super.emit,this,e),Reflect.apply(r.runInAsyncScope,r,n)}emitDestroy(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");this.asyncResource.emitDestroy()}get asyncId(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");return this.asyncResource.asyncId()}get triggerAsyncId(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");return this.asyncResource.triggerAsyncId()}get asyncResource(){if(this[d]===void 0)throw new _("EventEmitterAsyncResource");return this[d]}}const ie=function(t,e,n={}){const r=n.signal;if(r?.aborted)throw new w(void 0,{cause:r?.reason});const s=n.highWaterMark??n.highWatermark??Number.MAX_SAFE_INTEGER,o=n.lowWaterMark??n.lowWatermark??1,i=new K,c=new K;let f=!1,l=null,p=!1,y=0;const H=Object.setPrototypeOf({next(){if(y){const u=i.shift();return y--,f&&y<o&&(t.resume?.(),f=!1),Promise.resolve(P(u,!1))}if(l){const u=Promise.reject(l);return l=null,u}return p?L():new Promise(function(u,X){c.push({resolve:u,reject:X})})},return(){return L()},throw(u){if(!u||!(u instanceof Error))throw new h("EventEmitter.AsyncIterator","Error",u);A(u)},[Symbol.asyncIterator](){return this},[ne]:{get size(){return y},get low(){return o},get high(){return s},get isPaused(){return f}}},Y),{addEventListener:x,removeAll:J}=de();x(t,e,n[re]?I:function(...u){return I(u)}),e!=="error"&&typeof t.on=="function"&&x(t,"error",A);const O=n?.close;if(O?.length)for(const u of O)x(t,u,L);const Q=r?$(r,V):null;return H;function V(){A(new w(void 0,{cause:r?.reason}))}function I(u){c.isEmpty()?(y++,!f&&y>s&&(f=!0,t.pause?.()),i.push(u)):c.shift().resolve(P(u,!1))}function A(u){c.isEmpty()?l=u:c.shift().reject(u),L()}function L(){Q?.[Symbol.dispose](),J(),p=!0;const u=P(void 0,!0);for(;!c.isEmpty();)c.shift().resolve(u);return Promise.resolve(u)}},oe=async function(t,e,n={}){const r=n?.signal;if(r?.aborted)throw new w(void 0,{cause:r?.reason});return new Promise((s,o)=>{const i=p=>{typeof t.removeListener=="function"&&t.removeListener(e,c),r!=null&&E(r,"abort",l),o(p)},c=(...p)=>{typeof t.removeListener=="function"&&t.removeListener("error",i),r!=null&&E(r,"abort",l),s(p)},f={__proto__:null,once:!0,[S]:!0};T(t,e,c,f),e!=="error"&&typeof t.once=="function"&&t.once("error",i);function l(){E(t,e,c),E(t,"error",i),o(new w(void 0,{cause:r?.reason}))}r!=null&&T(r,"abort",l,{__proto__:null,once:!0,[S]:!0})})},$=function(t,e){if(t===void 0)throw new h("signal","AbortSignal",t);let n;return t.aborted?queueMicrotask(()=>e()):(t.addEventListener("abort",e,{__proto__:null,once:!0,[S]:!0}),n=()=>{t.removeEventListener("abort",e)}),{__proto__:null,[Symbol.dispose](){n?.()}}},ue=function(t,e){if(typeof t.listeners=="function")return t.listeners(e);if(q(t)){const n=t[kEvents].get(e),r=[];let s=n?.next;for(;s?.listener!==void 0;){const o=s.listener?.deref?s.listener.deref():s.listener;r.push(o),s=s.next}return r}throw new h("emitter",["EventEmitter","EventTarget"],t)},ce=function(t){if(typeof t?.getMaxListeners=="function")return j(t);if(t?.[b])return t[b];throw new h("emitter",["EventEmitter","EventTarget"],t)},D=2048,k=D-1;class N{bottom;top;list;next;constructor(){this.bottom=0,this.top=0,this.list=new Array(D),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&k)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&k}shift(){const e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&k,e)}}class K{head;tail;constructor(){this.head=this.tail=new N}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new N),this.head.push(e)}shift(){const e=this.tail,n=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),n}}function q(t){return typeof t?.addEventListener=="function"}function z(t,e,n,r){if(t[a])try{const s=e.then;typeof s=="function"&&s.call(e,void 0,function(o){process.nextTick(fe,t,o,n,r)})}catch(s){t.emit("error",s)}}function fe(t,e,n,r){if(typeof t[R]=="function")t[R](e,n,...r);else{const s=t[a];try{t[a]=!1,t.emit("error",e)}finally{t[a]=s}}}function j(t){return t._maxListeners===void 0?v:t._maxListeners}function le(t,e){let n="";try{const{name:o}=this.constructor;o!=="EventEmitter"&&(n=` on ${o} instance`)}catch{}const r=` | ||
| Emitted 'error' event${n} at: | ||
| `,s=(e.stack||"").split(` | ||
| `).slice(1);return t.stack+r+s.join(` | ||
| `)}function B(t,e,n,r){let s,o,i;if(o=t._events,o===void 0?(o=t._events={__proto__:null},t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,n.listener??n),o=t._events),i=o[e]),i===void 0)o[e]=n,++t._eventsCount;else if(typeof i=="function"?i=o[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=j(t),s>0&&i.length>s&&!i.warned){i.warned=!0;const c=new ee(`Possible EventEmitter memory leak detected. ${i.length} ${String(e)} listeners added to ${F(t)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:t,type:e,count:i.length});process.emitWarning(c)}return t}function ae(){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 G(t,e,n){const r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},s=ae.bind(r);return s.listener=n,r.wrapFn=s,s}function U(t,e,n){const r=t._events;if(r===void 0)return[];const s=r[e];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?he(s):C(s)}function C(t){switch(t.length){case 2:return[t[0],t[1]];case 3:return[t[0],t[1],t[2]];case 4:return[t[0],t[1],t[2],t[3]];case 5:return[t[0],t[1],t[2],t[3],t[4]];case 6:return[t[0],t[1],t[2],t[3],t[4],t[5]]}return Array.prototype.slice(t)}function he(t){const e=C(t);for(let n=0;n<e.length;++n){const r=e[n].listener;typeof r=="function"&&(e[n]=r)}return e}function P(t,e){return{value:t,done:e}}function E(t,e,n,r){if(typeof t.removeListener=="function")t.removeListener(e,n);else if(typeof t.removeEventListener=="function")t.removeEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function T(t,e,n,r){if(typeof t.on=="function")r?.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,n,r);else throw new h("emitter","EventEmitter",t)}function de(){const t=[];return{addEventListener(e,n,r,s){T(e,n,r,s),Array.prototype.push(t,[e,n,r,s])},removeAll(){for(;t.length>0;)Reflect.apply(E,void 0,t.pop())}}}function me(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}export{m as EventEmitter}; | ||
| let y=10;const Y=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),F=(e,t)=>e,_=Error,Z=Error,h=Error,w=Error,tt=Error,R=Symbol.for("nodejs.rejection"),f=Symbol.for("kCapture"),M=Symbol.for("events.errorMonitor"),g=Symbol.for("shapeMode"),b=Symbol.for("events.maxEventTargetListeners"),et=Symbol.for("kEnhanceStackBeforeInspector"),rt=Symbol.for("nodejs.watermarkData"),v=Symbol.for("kAsyncResource"),nt=Symbol.for("kFirstEventParam"),S=Symbol.for("kResistStopPropagation"),W=Symbol.for("events.maxEventTargetListenersWarned");class m{_events=void 0;_eventsCount=0;_maxListeners=y;[f]=!1;[g]=!1;static captureRejectionSymbol=R;static errorMonitor=M;static kMaxEventTargetListeners=b;static kMaxEventTargetListenersWarned=W;static usingDomains=!1;static get on(){return it}static get once(){return ot}static get getEventListeners(){return ct}static get getMaxListeners(){return ut}static get addAbortListener(){return $}static get EventEmitterAsyncResource(){return st}static get EventEmitter(){return m}static setMaxListeners(t=y,...r){if(r.length===0)y=t;else for(const n of r)if(q(n))n[b]=t,n[W]=!1;else if(typeof n.setMaxListeners=="function")n.setMaxListeners(t);else throw new h("eventTargets",["EventEmitter","EventTarget"],n)}static listenerCount(t,r){if(typeof t.listenerCount=="function")return t.listenerCount(r);m.prototype.listenerCount.call(t,r)}static init(){throw new Error("EventEmitter.init() is not implemented.")}static get captureRejections(){return this[f]}static set captureRejections(t){this[f]=t}static get defaultMaxListeners(){return y}static set defaultMaxListeners(t){y=t}constructor(t){this._events===void 0||this._events===Object.getPrototypeOf(this)._events?(this._events={__proto__:null},this._eventsCount=0,this[g]=!1):this[g]=!0,this._maxListeners=this._maxListeners||void 0,t?.captureRejections?this[f]=!!t.captureRejections:this[f]=m.prototype[f]}setMaxListeners(t){return this._maxListeners=t,this}getMaxListeners(){return j(this)}emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n&&s[M]!==void 0&&this.emit(M,...r),n=n&&s.error===void 0;else if(!n)return!1;if(n){let i;if(r.length>0&&(i=r[0]),i instanceof Error){try{const a={};Error.captureStackTrace?.(a,m.prototype.emit),Object.defineProperty(i,et,{__proto__:null,value:Function.prototype.bind(at,this,i,a),configurable:!0})}catch{}throw i}let u;try{u=F(i)}catch{u=i}const l=new Z(u);throw l.context=i,l}const o=s[t];if(o===void 0)return!1;if(typeof o=="function"){const i=o.apply(this,r);i!=null&&z(this,i,t,r)}else{const i=o.length,u=C(o);for(let l=0;l<i;++l){const a=u[l].apply(this,r);a!=null&&z(this,a,t,r)}}return!0}addListener(t,r){return B(this,t,r,!1),this}on(t,r){return this.addListener(t,r)}prependListener(t,r){return B(this,t,r,!0),this}once(t,r){return this.on(t,G(this,t,r)),this}prependOnceListener(t,r){return this.prependListener(t,G(this,t,r)),this}removeListener(t,r){const n=this._events;if(n===void 0)return this;const s=n[t];if(s===void 0)return this;if(s===r||s.listener===r)this._eventsCount-=1,this[g]?n[t]=void 0:this._eventsCount===0?this._events={__proto__:null}:(delete n[t],n.removeListener&&this.emit("removeListener",t,s.listener||r));else if(typeof s!="function"){let o=-1;for(let i=s.length-1;i>=0;i--)if(s[i]===r||s[i].listener===r){o=i;break}if(o<0)return this;o===0?s.shift():mt(s,o),s.length===1&&(n[t]=s[0]),n.removeListener!==void 0&&this.emit("removeListener",t,r)}return this}off(t,r){return this.removeListener(t,r)}removeAllListeners(t){const r=this._events;if(r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events={__proto__:null},this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events={__proto__:null}:delete r[t]),this[g]=!1,this;if(arguments.length===0){for(const s of Reflect.ownKeys(r))s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventsCount=0,this[g]=!1,this}const n=r[t];if(typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(let s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this}listeners(t){return U(this,t,!0)}rawListeners(t){return U(this,t,!1)}eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}listenerCount(t,r){const n=this._events;if(n!==void 0){const s=n[t];if(typeof s=="function")return r!=null?r===s||r===s.listener?1:0:1;if(s!==void 0){if(r!=null){let o=0;for(let i=0,u=s.length;i<u;i++)(s[i]===r||s[i].listener===r)&&o++;return o}return s.length}}return 0}}class st extends m{constructor(t){let r;typeof t=="string"?(r=t,t=void 0):r=t?.name||new.target.name,super(t),this[v]=new EventEmitterReferencingAsyncResource(this,r,t)}emit(t,...r){if(this[v]===void 0)throw new _("EventEmitterAsyncResource");const{asyncResource:n}=this;return Array.prototype.unshift(r,super.emit,this,t),Reflect.apply(n.runInAsyncScope,n,r)}emitDestroy(){if(this[v]===void 0)throw new _("EventEmitterAsyncResource");this.asyncResource.emitDestroy()}get asyncId(){if(this[v]===void 0)throw new _("EventEmitterAsyncResource");return this.asyncResource.asyncId()}get triggerAsyncId(){if(this[v]===void 0)throw new _("EventEmitterAsyncResource");return this.asyncResource.triggerAsyncId()}get asyncResource(){if(this[v]===void 0)throw new _("EventEmitterAsyncResource");return this[v]}}const it=function(e,t,r={}){const n=r.signal;if(n?.aborted)throw new w(void 0,{cause:n?.reason});const s=r.highWaterMark??r.highWatermark??Number.MAX_SAFE_INTEGER,o=r.lowWaterMark??r.lowWatermark??1,i=new K,u=new K;let l=!1,a=null,p=!1,d=0;const H=Object.setPrototypeOf({next(){if(d){const c=i.shift();return d--,l&&d<o&&(e.resume?.(),l=!1),Promise.resolve(P(c,!1))}if(a){const c=Promise.reject(a);return a=null,c}return p?L():new Promise(function(c,X){u.push({resolve:c,reject:X})})},return(){return L()},throw(c){if(!c||!(c instanceof Error))throw new h("EventEmitter.AsyncIterator","Error",c);A(c)},[Symbol.asyncIterator](){return this},[rt]:{get size(){return d},get low(){return o},get high(){return s},get isPaused(){return l}}},Y),{addEventListener:x,removeAll:J}=vt();x(e,t,r[nt]?I:function(...c){return I(c)}),t!=="error"&&typeof e.on=="function"&&x(e,"error",A);const O=r?.close;if(O?.length)for(const c of O)x(e,c,L);const Q=n?$(n,V):null;return H;function V(){A(new w(void 0,{cause:n?.reason}))}function I(c){u.isEmpty()?(d++,!l&&d>s&&(l=!0,e.pause?.()),i.push(c)):u.shift().resolve(P(c,!1))}function A(c){u.isEmpty()?a=c:u.shift().reject(c),L()}function L(){Q?.[Symbol.dispose](),J(),p=!0;const c=P(void 0,!0);for(;!u.isEmpty();)u.shift().resolve(c);return Promise.resolve(c)}},ot=async function(e,t,r={}){const n=r?.signal;if(n?.aborted)throw new w(void 0,{cause:n?.reason});return new Promise((s,o)=>{const i=p=>{typeof e.removeListener=="function"&&e.removeListener(t,u),n!=null&&E(n,"abort",a),o(p)},u=(...p)=>{typeof e.removeListener=="function"&&e.removeListener("error",i),n!=null&&E(n,"abort",a),s(p)},l={__proto__:null,once:!0,[S]:!0};T(e,t,u,l),t!=="error"&&typeof e.once=="function"&&e.once("error",i);function a(){E(e,t,u),E(e,"error",i),o(new w(void 0,{cause:n?.reason}))}n!=null&&T(n,"abort",a,{__proto__:null,once:!0,[S]:!0})})},$=function(e,t){if(e===void 0)throw new h("signal","AbortSignal",e);let r;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[S]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[Symbol.dispose](){r?.()}}},ct=function(e,t){if(typeof e.listeners=="function")return e.listeners(t);if(q(e)){const r=e[kEvents].get(t),n=[];let s=r?.next;for(;s?.listener!==void 0;){const o=s.listener?.deref?s.listener.deref():s.listener;n.push(o),s=s.next}return n}throw new h("emitter",["EventEmitter","EventTarget"],e)},ut=function(e){if(typeof e?.getMaxListeners=="function")return j(e);if(e?.[b])return e[b];throw new h("emitter",["EventEmitter","EventTarget"],e)},D=2048,k=D-1;class N{bottom;top;list;next;constructor(){this.bottom=0,this.top=0,this.list=new Array(D),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&k)===this.bottom}push(t){this.list[this.top]=t,this.top=this.top+1&k}shift(){const t=this.list[this.bottom];return t===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&k,t)}}class K{head;tail;constructor(){this.head=this.tail=new N}isEmpty(){return this.head.isEmpty()}push(t){this.head.isFull()&&(this.head=this.head.next=new N),this.head.push(t)}shift(){const t=this.tail,r=t.shift();return t.isEmpty()&&t.next!==null&&(this.tail=t.next,t.next=null),r}}function q(e){return typeof e?.addEventListener=="function"}function z(e,t,r,n){if(e[f])try{const s=t.then;typeof s=="function"&&s.call(t,void 0,function(o){process.nextTick(lt,e,o,r,n)})}catch(s){e.emit("error",s)}}function lt(e,t,r,n){if(typeof e[R]=="function")e[R](t,r,...n);else{const s=e[f];try{e[f]=!1,e.emit("error",t)}finally{e[f]=s}}}function j(e){return e._maxListeners===void 0?y:e._maxListeners}function at(e,t){let r="";try{const{name:o}=this.constructor;o!=="EventEmitter"&&(r=` on ${o} instance`)}catch{}const n=` | ||
| Emitted 'error' event${r} at: | ||
| `,s=(t.stack||"").split(` | ||
| `).slice(1);return e.stack+n+s.join(` | ||
| `)}function B(e,t,r,n){let s,o,i;if(o=e._events,o===void 0?(o=e._events={__proto__:null},e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,r.listener??r),o=e._events),i=o[t]),i===void 0)o[t]=r,++e._eventsCount;else if(typeof i=="function"?i=o[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),s=j(e),s>0&&i.length>s&&!i.warned){i.warned=!0;const u=new tt(`Possible EventEmitter memory leak detected. ${i.length} ${String(t)} listeners added to ${F(e)}. MaxListeners is ${s}. Use emitter.setMaxListeners() to increase limit`,{name:"MaxListenersExceededWarning",emitter:e,type:t,count:i.length});process.emitWarning(u)}return e}function ft(){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 G(e,t,r){const n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=ft.bind(n);return s.listener=r,n.wrapFn=s,s}function U(e,t,r){const n=e._events;if(n===void 0)return[];const s=n[t];return s===void 0?[]:typeof s=="function"?r?[s.listener||s]:[s]:r?ht(s):C(s)}function C(e){switch(e.length){case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];case 4:return[e[0],e[1],e[2],e[3]];case 5:return[e[0],e[1],e[2],e[3],e[4]];case 6:return[e[0],e[1],e[2],e[3],e[4],e[5]]}return Array.prototype.slice(e)}function ht(e){const t=C(e);for(let r=0;r<t.length;++r){const n=t[r].listener;typeof n=="function"&&(t[r]=n)}return t}function P(e,t){return{value:e,done:t}}function E(e,t,r,n){if(typeof e.removeListener=="function")e.removeListener(t,r);else if(typeof e.removeEventListener=="function")e.removeEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function T(e,t,r,n){if(typeof e.on=="function")n?.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,r,n);else throw new h("emitter","EventEmitter",e)}function vt(){const e=[];return{addEventListener(t,r,n,s){T(t,r,n,s),Array.prototype.push(e,[t,r,n,s])},removeAll(){for(;e.length>0;)Reflect.apply(E,void 0,e.pop())}}}function mt(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}export{m as EventEmitter}; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";const events=require("node-mock-http/_polyfill/events"),buffer=require("node-mock-http/_polyfill/buffer");function createNotImplementedError(n){throw new Error(`${n} is not implemented yet!`)}class Readable extends events.EventEmitter{__unenv__={};readableEncoding=null;readableEnded=!0;readableFlowing=!1;readableHighWaterMark=0;readableLength=0;readableObjectMode=!1;readableAborted=!1;readableDidRead=!1;closed=!1;errored=null;readable=!1;destroyed=!1;static from(e,t){return new Readable(t)}constructor(e){super()}_read(e){}read(e){}setEncoding(e){return this}pause(){return this}resume(){return this}isPaused(){return!0}unpipe(e){return this}unshift(e,t){}wrap(e){return this}push(e,t){return!1}_destroy(e,t){this.removeAllListeners()}destroy(e){return this.destroyed=!0,this._destroy(e),this}pipe(e,t){return{}}compose(e,t){throw new Error("Method not implemented.")}[Symbol.asyncDispose](){return this.destroy(),Promise.resolve()}async*[Symbol.asyncIterator](){throw createNotImplementedError("Readable.asyncIterator")}iterator(e){throw createNotImplementedError("Readable.iterator")}map(e,t){throw createNotImplementedError("Readable.map")}filter(e,t){throw createNotImplementedError("Readable.filter")}forEach(e,t){throw createNotImplementedError("Readable.forEach")}reduce(e,t,r){throw createNotImplementedError("Readable.reduce")}find(e,t){throw createNotImplementedError("Readable.find")}findIndex(e,t){throw createNotImplementedError("Readable.findIndex")}some(e,t){throw createNotImplementedError("Readable.some")}toArray(e){throw createNotImplementedError("Readable.toArray")}every(e,t){throw createNotImplementedError("Readable.every")}flatMap(e,t){throw createNotImplementedError("Readable.flatMap")}drop(e,t){throw createNotImplementedError("Readable.drop")}take(e,t){throw createNotImplementedError("Readable.take")}asIndexedPairs(e){throw createNotImplementedError("Readable.asIndexedPairs")}}class Writable extends events.EventEmitter{__unenv__={};writable=!0;writableEnded=!1;writableFinished=!1;writableHighWaterMark=0;writableLength=0;writableObjectMode=!1;writableCorked=0;closed=!1;errored=null;writableNeedDrain=!1;destroyed=!1;_data;_encoding="utf8";constructor(e){super()}pipe(e,t){return{}}_write(e,t,r){if(this.writableEnded){r&&r();return}if(this._data===void 0)this._data=e;else{const s=typeof this._data=="string"?buffer.Buffer.from(this._data,this._encoding||t||"utf8"):this._data,i=typeof e=="string"?buffer.Buffer.from(e,t||this._encoding||"utf8"):e;this._data=buffer.Buffer.concat([s,i])}this._encoding=t,r&&r()}_writev(e,t){}_destroy(e,t){}_final(e){}write(e,t,r){const s=typeof t=="string"?this._encoding:"utf8",i=typeof t=="function"?t:typeof r=="function"?r:void 0;return this._write(e,s,i),!0}setDefaultEncoding(e){return this}end(e,t,r){const s=typeof e=="function"?e:typeof t=="function"?t:typeof r=="function"?r:void 0;if(this.writableEnded)return s&&s(),this;const i=e===s?void 0:e;if(i){const u=t===s?void 0:t;this.write(i,u,s)}return this.writableEnded=!0,this.writableFinished=!0,this.emit("close"),this.emit("finish"),this}cork(){}uncork(){}destroy(e){return this.destroyed=!0,delete this._data,this.removeAllListeners(),this}compose(e,t){throw new Error("Method not implemented.")}}const o$2=class{allowHalfOpen=!0;_destroy;constructor(e=new Readable,t=new Writable){Object.assign(this,e),Object.assign(this,t),this._destroy=a(e._destroy,t._destroy)}};function p$1(){return Object.assign(o$2.prototype,Readable.prototype),Object.assign(o$2.prototype,Writable.prototype),o$2}function a(...n){return function(...e){for(const t of n)t(...e)}}const Duplex=p$1();class Socket extends Duplex{__unenv__={};bufferSize=0;bytesRead=0;bytesWritten=0;connecting=!1;destroyed=!1;pending=!1;localAddress="";localPort=0;remoteAddress="";remoteFamily="";remotePort=0;autoSelectFamilyAttemptedAddresses=[];readyState="readOnly";constructor(e){super()}write(e,t,r){return!1}connect(e,t,r){return this}end(e,t,r){return this}setEncoding(e){return this}pause(){return this}resume(){return this}setTimeout(e,t){return this}setNoDelay(e){return this}setKeepAlive(e,t){return this}address(){return{}}unref(){return this}ref(){return this}destroySoon(){this.destroy()}resetAndDestroy(){const e=new Error("ERR_SOCKET_CLOSED");return e.code="ERR_SOCKET_CLOSED",this.destroy(e),this}}class IncomingMessage extends Readable{aborted=!1;httpVersion="1.1";httpVersionMajor=1;httpVersionMinor=1;complete=!0;connection;socket;headers={};trailers={};method="GET";url="/";statusCode=200;statusMessage="";closed=!1;errored=null;readable=!1;constructor(e){super(),this.socket=this.connection=e||new Socket}get rawHeaders(){const e=this.headers,t=[];for(const r in e)if(Array.isArray(e[r]))for(const s of e[r])t.push(r,s);else t.push(r,e[r]);return t}get rawTrailers(){return[]}setTimeout(e,t){return this}get headersDistinct(){return o$1(this.headers)}get trailersDistinct(){return o$1(this.trailers)}}function o$1(n){const e={};for(const[t,r]of Object.entries(n))t&&(e[t]=(Array.isArray(r)?r:[r]).filter(Boolean));return e}class ServerResponse extends Writable{statusCode=200;statusMessage="";upgrading=!1;chunkedEncoding=!1;shouldKeepAlive=!1;useChunkedEncodingByDefault=!1;sendDate=!1;finished=!1;headersSent=!1;strictContentLength=!1;connection=null;socket=null;req;_headers={};constructor(e){super(),this.req=e}assignSocket(e){e._httpMessage=this,this.socket=e,this.connection=e,this.emit("socket",e),this._flush()}_flush(){this.flushHeaders()}detachSocket(e){}writeContinue(e){}writeHead(e,t,r){e&&(this.statusCode=e),typeof t=="string"&&(this.statusMessage=t,t=void 0);const s=r||t;if(s&&!Array.isArray(s))for(const i in s)this.setHeader(i,s[i]);return this.headersSent=!0,this}writeProcessing(){}setTimeout(e,t){return this}appendHeader(e,t){e=e.toLowerCase();const r=this._headers[e],s=[...Array.isArray(r)?r:[r],...Array.isArray(t)?t:[t]].filter(Boolean);return this._headers[e]=s.length>1?s:s[0],this}setHeader(e,t){return this._headers[e.toLowerCase()]=t,this}setHeaders(e){for(const[t,r]of Object.entries(e))this.setHeader(t,r);return this}getHeader(e){return this._headers[e.toLowerCase()]}getHeaders(){return this._headers}getHeaderNames(){return Object.keys(this._headers)}hasHeader(e){return e.toLowerCase()in this._headers}removeHeader(e){delete this._headers[e.toLowerCase()]}addTrailers(e){}flushHeaders(){}writeEarlyHints(e,t){typeof t=="function"&&t()}}const NodeHeadersObj=(()=>{const n=function(){};return n.prototype=Object.create(null),n})();function toNodeRequestHeaders(n={}){const e=new NodeHeadersObj,t=Array.isArray(n)||o(n)?n:Object.entries(n);for(const[r,s]of t)if(s){if(e[r]===void 0){e[r]=s;continue}e[r]=[...Array.isArray(e[r])?e[r]:[e[r]],...Array.isArray(s)?s:[s]]}return e}function o(n){return typeof n?.entries=="function"}function toWebResponseHeaders(n={}){if(n instanceof Headers)return n;const e=new Headers;for(const[t,r]of Object.entries(n))if(r!==void 0){if(Array.isArray(r)){for(const s of r)e.append(t,String(s));continue}e.set(t,String(r))}return e}const p=new Set([101,204,205,304]);async function callNodeRequestHandler(n,e){const t=new IncomingMessage,r=new ServerResponse(t);t.url=e.url?.toString()||"/";let s;if(!t.url.startsWith("/")){const d=new URL(t.url);s=d.host,t.url=d.pathname+d.search+d.hash}t.method=e.method||"GET",t.headers=toNodeRequestHeaders(e.headers||{}),t.headers.host||(t.headers.host=e.host||s||"localhost"),t.connection.encrypted=t.connection.encrypted||e.protocol==="https",t.body=e.body||null,t.__unenv__=e.context,await n(t,r);let i=r._data;(p.has(r.statusCode)||t.method.toUpperCase()==="HEAD")&&(i=null,delete r._headers["content-length"]);const u={status:r.statusCode,statusText:r.statusMessage,headers:r._headers,body:i};return t.destroy(),r.destroy(),u}async function fetchNodeRequestHandler(n,e,t={}){try{const r=await callNodeRequestHandler(n,{url:e,...t});return new Response(r.body,{status:r.status,statusText:r.statusText,headers:toWebResponseHeaders(r.headers)})}catch(r){return new Response(r.toString(),{status:Number.parseInt(r.statusCode||r.code)||500,statusText:r.statusText})}}exports.IncomingMessage=IncomingMessage,exports.ServerResponse=ServerResponse,exports.callNodeRequestHandler=callNodeRequestHandler,exports.fetchNodeRequestHandler=fetchNodeRequestHandler; | ||
| "use strict";const events=require("node-mock-http/_polyfill/events"),buffer=require("node-mock-http/_polyfill/buffer");function createNotImplementedError(n){throw new Error(`${n} is not implemented yet!`)}class Readable extends events.EventEmitter{__unenv__={};readableEncoding=null;readableEnded=!0;readableFlowing=!1;readableHighWaterMark=0;readableLength=0;readableObjectMode=!1;readableAborted=!1;readableDidRead=!1;closed=!1;errored=null;readable=!1;destroyed=!1;static from(e,t){return new Readable(t)}constructor(e){super()}_read(e){}read(e){}setEncoding(e){return this}pause(){return this}resume(){return this}isPaused(){return!0}unpipe(e){return this}unshift(e,t){}wrap(e){return this}push(e,t){return!1}_destroy(e,t){this.removeAllListeners()}destroy(e){return this.destroyed=!0,this._destroy(e),this}pipe(e,t){return{}}compose(e,t){throw new Error("Method not implemented.")}[Symbol.asyncDispose](){return this.destroy(),Promise.resolve()}async*[Symbol.asyncIterator](){throw createNotImplementedError("Readable.asyncIterator")}iterator(e){throw createNotImplementedError("Readable.iterator")}map(e,t){throw createNotImplementedError("Readable.map")}filter(e,t){throw createNotImplementedError("Readable.filter")}forEach(e,t){throw createNotImplementedError("Readable.forEach")}reduce(e,t,r){throw createNotImplementedError("Readable.reduce")}find(e,t){throw createNotImplementedError("Readable.find")}findIndex(e,t){throw createNotImplementedError("Readable.findIndex")}some(e,t){throw createNotImplementedError("Readable.some")}toArray(e){throw createNotImplementedError("Readable.toArray")}every(e,t){throw createNotImplementedError("Readable.every")}flatMap(e,t){throw createNotImplementedError("Readable.flatMap")}drop(e,t){throw createNotImplementedError("Readable.drop")}take(e,t){throw createNotImplementedError("Readable.take")}asIndexedPairs(e){throw createNotImplementedError("Readable.asIndexedPairs")}}class Writable extends events.EventEmitter{__unenv__={};writable=!0;writableEnded=!1;writableFinished=!1;writableHighWaterMark=0;writableLength=0;writableObjectMode=!1;writableCorked=0;closed=!1;errored=null;writableNeedDrain=!1;writableAborted=!1;destroyed=!1;_data;_encoding="utf8";constructor(e){super()}pipe(e,t){return{}}_write(e,t,r){if(this.writableEnded){r&&r();return}if(this._data===void 0)this._data=e;else{const s=typeof this._data=="string"?buffer.Buffer.from(this._data,this._encoding||t||"utf8"):this._data,i=typeof e=="string"?buffer.Buffer.from(e,t||this._encoding||"utf8"):e;this._data=buffer.Buffer.concat([s,i])}this._encoding=t,r&&r()}_writev(e,t){}_destroy(e,t){}_final(e){}write(e,t,r){const s=typeof t=="string"?this._encoding:"utf8",i=typeof t=="function"?t:typeof r=="function"?r:void 0;return this._write(e,s,i),!0}setDefaultEncoding(e){return this}end(e,t,r){const s=typeof e=="function"?e:typeof t=="function"?t:typeof r=="function"?r:void 0;if(this.writableEnded)return s&&s(),this;const i=e===s?void 0:e;if(i){const u=t===s?void 0:t;this.write(i,u,s)}return this.writableEnded=!0,this.writableFinished=!0,this.emit("close"),this.emit("finish"),this}cork(){}uncork(){}destroy(e){return this.destroyed=!0,delete this._data,this.removeAllListeners(),this}compose(e,t){throw new Error("Method not implemented.")}}const o$2=class{allowHalfOpen=!0;_destroy;constructor(e=new Readable,t=new Writable){Object.assign(this,e),Object.assign(this,t),this._destroy=a(e._destroy,t._destroy)}};function p$1(){return Object.assign(o$2.prototype,Readable.prototype),Object.assign(o$2.prototype,Writable.prototype),o$2}function a(...n){return function(...e){for(const t of n)t(...e)}}const Duplex=p$1();class Socket extends Duplex{__unenv__={};bufferSize=0;bytesRead=0;bytesWritten=0;connecting=!1;destroyed=!1;pending=!1;localAddress="";localPort=0;remoteAddress="";remoteFamily="";remotePort=0;autoSelectFamilyAttemptedAddresses=[];readyState="readOnly";constructor(e){super()}write(e,t,r){return!1}connect(e,t,r){return this}end(e,t,r){return this}setEncoding(e){return this}pause(){return this}resume(){return this}setTimeout(e,t){return this}setNoDelay(e){return this}setKeepAlive(e,t){return this}address(){return{}}unref(){return this}ref(){return this}destroySoon(){this.destroy()}resetAndDestroy(){const e=new Error("ERR_SOCKET_CLOSED");return e.code="ERR_SOCKET_CLOSED",this.destroy(e),this}}class IncomingMessage extends Readable{aborted=!1;httpVersion="1.1";httpVersionMajor=1;httpVersionMinor=1;complete=!0;connection;socket;headers={};trailers={};method="GET";url="/";statusCode=200;statusMessage="";closed=!1;errored=null;readable=!1;constructor(e){super(),this.socket=this.connection=e||new Socket}get rawHeaders(){const e=this.headers,t=[];for(const r in e)if(Array.isArray(e[r]))for(const s of e[r])t.push(r,s);else t.push(r,e[r]);return t}get rawTrailers(){return[]}setTimeout(e,t){return this}get headersDistinct(){return o$1(this.headers)}get trailersDistinct(){return o$1(this.trailers)}}function o$1(n){const e={};for(const[t,r]of Object.entries(n))t&&(e[t]=(Array.isArray(r)?r:[r]).filter(Boolean));return e}class ServerResponse extends Writable{statusCode=200;statusMessage="";upgrading=!1;chunkedEncoding=!1;shouldKeepAlive=!1;useChunkedEncodingByDefault=!1;sendDate=!1;finished=!1;headersSent=!1;strictContentLength=!1;connection=null;socket=null;req;_headers={};constructor(e){super(),this.req=e}assignSocket(e){e._httpMessage=this,this.socket=e,this.connection=e,this.emit("socket",e),this._flush()}_flush(){this.flushHeaders()}detachSocket(e){}writeContinue(e){}writeHead(e,t,r){e&&(this.statusCode=e),typeof t=="string"&&(this.statusMessage=t,t=void 0);const s=r||t;if(s&&!Array.isArray(s))for(const i in s)this.setHeader(i,s[i]);return this.headersSent=!0,this}writeProcessing(){}setTimeout(e,t){return this}appendHeader(e,t){e=e.toLowerCase();const r=this._headers[e],s=[...Array.isArray(r)?r:[r],...Array.isArray(t)?t:[t]].filter(Boolean);return this._headers[e]=s.length>1?s:s[0],this}setHeader(e,t){return this._headers[e.toLowerCase()]=t,this}setHeaders(e){for(const[t,r]of Object.entries(e))this.setHeader(t,r);return this}getHeader(e){return this._headers[e.toLowerCase()]}getHeaders(){return this._headers}getHeaderNames(){return Object.keys(this._headers)}hasHeader(e){return e.toLowerCase()in this._headers}removeHeader(e){delete this._headers[e.toLowerCase()]}addTrailers(e){}flushHeaders(){}writeEarlyHints(e,t){typeof t=="function"&&t()}}const NodeHeadersObj=(()=>{const n=function(){};return n.prototype=Object.create(null),n})();function toNodeRequestHeaders(n={}){const e=new NodeHeadersObj,t=Array.isArray(n)||o(n)?n:Object.entries(n);for(const[r,s]of t)if(s){if(e[r]===void 0){e[r]=s;continue}e[r]=[...Array.isArray(e[r])?e[r]:[e[r]],...Array.isArray(s)?s:[s]]}return e}function o(n){return typeof n?.entries=="function"}function toWebResponseHeaders(n={}){if(n instanceof Headers)return n;const e=new Headers;for(const[t,r]of Object.entries(n))if(r!==void 0){if(Array.isArray(r)){for(const s of r)e.append(t,String(s));continue}e.set(t,String(r))}return e}const p=new Set([101,204,205,304]);async function callNodeRequestHandler(n,e){const t=new IncomingMessage,r=new ServerResponse(t);t.url=e.url?.toString()||"/";let s;if(!t.url.startsWith("/")){const d=new URL(t.url);s=d.host,t.url=d.pathname+d.search+d.hash}t.method=e.method||"GET",t.headers=toNodeRequestHeaders(e.headers||{}),t.headers.host||(t.headers.host=e.host||s||"localhost"),t.connection.encrypted=t.connection.encrypted||e.protocol==="https",t.body=e.body||null,t.__unenv__=e.context,await n(t,r);let i=r._data;(p.has(r.statusCode)||t.method.toUpperCase()==="HEAD")&&(i=null,delete r._headers["content-length"]);const u={status:r.statusCode,statusText:r.statusMessage,headers:r._headers,body:i};return t.destroy(),r.destroy(),u}async function fetchNodeRequestHandler(n,e,t={}){try{const r=await callNodeRequestHandler(n,{url:e,...t});return new Response(r.body,{status:r.status,statusText:r.statusText,headers:toWebResponseHeaders(r.headers)})}catch(r){return new Response(r.toString(),{status:Number.parseInt(r.statusCode||r.code)||500,statusText:r.statusText})}}exports.IncomingMessage=IncomingMessage,exports.ServerResponse=ServerResponse,exports.callNodeRequestHandler=callNodeRequestHandler,exports.fetchNodeRequestHandler=fetchNodeRequestHandler; |
+6
-4
@@ -1,2 +0,2 @@ | ||
| import NodeHTTP from 'node:http'; | ||
| import NodeHTTP, { IncomingMessage as IncomingMessage$1 } from 'node:http'; | ||
| import * as NodeNet from 'node:net'; | ||
@@ -73,3 +73,3 @@ import { Socket as Socket$1 } from 'node:net'; | ||
| destroy(error?: Error): this; | ||
| pipe<T>(_destenition: T, _options?: { | ||
| pipe<T>(_destination: T, _options?: { | ||
| end?: boolean; | ||
@@ -141,2 +141,3 @@ }): T; | ||
| readonly writableNeedDrain: boolean; | ||
| readonly writableAborted: boolean; | ||
| destroyed: boolean; | ||
@@ -167,3 +168,3 @@ _data: unknown; | ||
| declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse { | ||
| declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse<IncomingMessage$1> { | ||
| statusCode: number; | ||
@@ -227,2 +228,3 @@ statusMessage: string; | ||
| export { type AbstractRequest, type AbstractResponse, IncomingMessage, type NodeRequestHandler, type NodeRequestHeaders, type NodeResponseHeaders, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler }; | ||
| export { IncomingMessage, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler }; | ||
| export type { AbstractRequest, AbstractResponse, NodeRequestHandler, NodeRequestHeaders, NodeResponseHeaders }; |
+6
-4
@@ -1,2 +0,2 @@ | ||
| import NodeHTTP from 'node:http'; | ||
| import NodeHTTP, { IncomingMessage as IncomingMessage$1 } from 'node:http'; | ||
| import * as NodeNet from 'node:net'; | ||
@@ -73,3 +73,3 @@ import { Socket as Socket$1 } from 'node:net'; | ||
| destroy(error?: Error): this; | ||
| pipe<T>(_destenition: T, _options?: { | ||
| pipe<T>(_destination: T, _options?: { | ||
| end?: boolean; | ||
@@ -141,2 +141,3 @@ }): T; | ||
| readonly writableNeedDrain: boolean; | ||
| readonly writableAborted: boolean; | ||
| destroyed: boolean; | ||
@@ -167,3 +168,3 @@ _data: unknown; | ||
| declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse { | ||
| declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse<IncomingMessage$1> { | ||
| statusCode: number; | ||
@@ -227,2 +228,3 @@ statusMessage: string; | ||
| export { type AbstractRequest, type AbstractResponse, IncomingMessage, type NodeRequestHandler, type NodeRequestHeaders, type NodeResponseHeaders, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler }; | ||
| export { IncomingMessage, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler }; | ||
| export type { AbstractRequest, AbstractResponse, NodeRequestHandler, NodeRequestHeaders, NodeResponseHeaders }; |
+6
-4
@@ -1,2 +0,2 @@ | ||
| import NodeHTTP from 'node:http'; | ||
| import NodeHTTP, { IncomingMessage as IncomingMessage$1 } from 'node:http'; | ||
| import * as NodeNet from 'node:net'; | ||
@@ -73,3 +73,3 @@ import { Socket as Socket$1 } from 'node:net'; | ||
| destroy(error?: Error): this; | ||
| pipe<T>(_destenition: T, _options?: { | ||
| pipe<T>(_destination: T, _options?: { | ||
| end?: boolean; | ||
@@ -141,2 +141,3 @@ }): T; | ||
| readonly writableNeedDrain: boolean; | ||
| readonly writableAborted: boolean; | ||
| destroyed: boolean; | ||
@@ -167,3 +168,3 @@ _data: unknown; | ||
| declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse { | ||
| declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse<IncomingMessage$1> { | ||
| statusCode: number; | ||
@@ -227,2 +228,3 @@ statusMessage: string; | ||
| export { type AbstractRequest, type AbstractResponse, IncomingMessage, type NodeRequestHandler, type NodeRequestHeaders, type NodeResponseHeaders, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler }; | ||
| export { IncomingMessage, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler }; | ||
| export type { AbstractRequest, AbstractResponse, NodeRequestHandler, NodeRequestHeaders, NodeResponseHeaders }; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| import{EventEmitter as f}from"node-mock-http/_polyfill/events";import{Buffer as h}from"node-mock-http/_polyfill/buffer";function o(n){throw new Error(`${n} is not implemented yet!`)}class i extends f{__unenv__={};readableEncoding=null;readableEnded=!0;readableFlowing=!1;readableHighWaterMark=0;readableLength=0;readableObjectMode=!1;readableAborted=!1;readableDidRead=!1;closed=!1;errored=null;readable=!1;destroyed=!1;static from(e,t){return new i(t)}constructor(e){super()}_read(e){}read(e){}setEncoding(e){return this}pause(){return this}resume(){return this}isPaused(){return!0}unpipe(e){return this}unshift(e,t){}wrap(e){return this}push(e,t){return!1}_destroy(e,t){this.removeAllListeners()}destroy(e){return this.destroyed=!0,this._destroy(e),this}pipe(e,t){return{}}compose(e,t){throw new Error("Method not implemented.")}[Symbol.asyncDispose](){return this.destroy(),Promise.resolve()}async*[Symbol.asyncIterator](){throw o("Readable.asyncIterator")}iterator(e){throw o("Readable.iterator")}map(e,t){throw o("Readable.map")}filter(e,t){throw o("Readable.filter")}forEach(e,t){throw o("Readable.forEach")}reduce(e,t,r){throw o("Readable.reduce")}find(e,t){throw o("Readable.find")}findIndex(e,t){throw o("Readable.findIndex")}some(e,t){throw o("Readable.some")}toArray(e){throw o("Readable.toArray")}every(e,t){throw o("Readable.every")}flatMap(e,t){throw o("Readable.flatMap")}drop(e,t){throw o("Readable.drop")}take(e,t){throw o("Readable.take")}asIndexedPairs(e){throw o("Readable.asIndexedPairs")}}class l extends f{__unenv__={};writable=!0;writableEnded=!1;writableFinished=!1;writableHighWaterMark=0;writableLength=0;writableObjectMode=!1;writableCorked=0;closed=!1;errored=null;writableNeedDrain=!1;destroyed=!1;_data;_encoding="utf8";constructor(e){super()}pipe(e,t){return{}}_write(e,t,r){if(this.writableEnded){r&&r();return}if(this._data===void 0)this._data=e;else{const s=typeof this._data=="string"?h.from(this._data,this._encoding||t||"utf8"):this._data,a=typeof e=="string"?h.from(e,t||this._encoding||"utf8"):e;this._data=h.concat([s,a])}this._encoding=t,r&&r()}_writev(e,t){}_destroy(e,t){}_final(e){}write(e,t,r){const s=typeof t=="string"?this._encoding:"utf8",a=typeof t=="function"?t:typeof r=="function"?r:void 0;return this._write(e,s,a),!0}setDefaultEncoding(e){return this}end(e,t,r){const s=typeof e=="function"?e:typeof t=="function"?t:typeof r=="function"?r:void 0;if(this.writableEnded)return s&&s(),this;const a=e===s?void 0:e;if(a){const u=t===s?void 0:t;this.write(a,u,s)}return this.writableEnded=!0,this.writableFinished=!0,this.emit("close"),this.emit("finish"),this}cork(){}uncork(){}destroy(e){return this.destroyed=!0,delete this._data,this.removeAllListeners(),this}compose(e,t){throw new Error("Method not implemented.")}}const c=class{allowHalfOpen=!0;_destroy;constructor(e=new i,t=new l){Object.assign(this,e),Object.assign(this,t),this._destroy=g(e._destroy,t._destroy)}};function _(){return Object.assign(c.prototype,i.prototype),Object.assign(c.prototype,l.prototype),c}function g(...n){return function(...e){for(const t of n)t(...e)}}const m=_();class A extends m{__unenv__={};bufferSize=0;bytesRead=0;bytesWritten=0;connecting=!1;destroyed=!1;pending=!1;localAddress="";localPort=0;remoteAddress="";remoteFamily="";remotePort=0;autoSelectFamilyAttemptedAddresses=[];readyState="readOnly";constructor(e){super()}write(e,t,r){return!1}connect(e,t,r){return this}end(e,t,r){return this}setEncoding(e){return this}pause(){return this}resume(){return this}setTimeout(e,t){return this}setNoDelay(e){return this}setKeepAlive(e,t){return this}address(){return{}}unref(){return this}ref(){return this}destroySoon(){this.destroy()}resetAndDestroy(){const e=new Error("ERR_SOCKET_CLOSED");return e.code="ERR_SOCKET_CLOSED",this.destroy(e),this}}class y extends i{aborted=!1;httpVersion="1.1";httpVersionMajor=1;httpVersionMinor=1;complete=!0;connection;socket;headers={};trailers={};method="GET";url="/";statusCode=200;statusMessage="";closed=!1;errored=null;readable=!1;constructor(e){super(),this.socket=this.connection=e||new A}get rawHeaders(){const e=this.headers,t=[];for(const r in e)if(Array.isArray(e[r]))for(const s of e[r])t.push(r,s);else t.push(r,e[r]);return t}get rawTrailers(){return[]}setTimeout(e,t){return this}get headersDistinct(){return p(this.headers)}get trailersDistinct(){return p(this.trailers)}}function p(n){const e={};for(const[t,r]of Object.entries(n))t&&(e[t]=(Array.isArray(r)?r:[r]).filter(Boolean));return e}class w extends l{statusCode=200;statusMessage="";upgrading=!1;chunkedEncoding=!1;shouldKeepAlive=!1;useChunkedEncodingByDefault=!1;sendDate=!1;finished=!1;headersSent=!1;strictContentLength=!1;connection=null;socket=null;req;_headers={};constructor(e){super(),this.req=e}assignSocket(e){e._httpMessage=this,this.socket=e,this.connection=e,this.emit("socket",e),this._flush()}_flush(){this.flushHeaders()}detachSocket(e){}writeContinue(e){}writeHead(e,t,r){e&&(this.statusCode=e),typeof t=="string"&&(this.statusMessage=t,t=void 0);const s=r||t;if(s&&!Array.isArray(s))for(const a in s)this.setHeader(a,s[a]);return this.headersSent=!0,this}writeProcessing(){}setTimeout(e,t){return this}appendHeader(e,t){e=e.toLowerCase();const r=this._headers[e],s=[...Array.isArray(r)?r:[r],...Array.isArray(t)?t:[t]].filter(Boolean);return this._headers[e]=s.length>1?s:s[0],this}setHeader(e,t){return this._headers[e.toLowerCase()]=t,this}setHeaders(e){for(const[t,r]of Object.entries(e))this.setHeader(t,r);return this}getHeader(e){return this._headers[e.toLowerCase()]}getHeaders(){return this._headers}getHeaderNames(){return Object.keys(this._headers)}hasHeader(e){return e.toLowerCase()in this._headers}removeHeader(e){delete this._headers[e.toLowerCase()]}addTrailers(e){}flushHeaders(){}writeEarlyHints(e,t){typeof t=="function"&&t()}}const E=(()=>{const n=function(){};return n.prototype=Object.create(null),n})();function R(n={}){const e=new E,t=Array.isArray(n)||H(n)?n:Object.entries(n);for(const[r,s]of t)if(s){if(e[r]===void 0){e[r]=s;continue}e[r]=[...Array.isArray(e[r])?e[r]:[e[r]],...Array.isArray(s)?s:[s]]}return e}function H(n){return typeof n?.entries=="function"}function S(n={}){if(n instanceof Headers)return n;const e=new Headers;for(const[t,r]of Object.entries(n))if(r!==void 0){if(Array.isArray(r)){for(const s of r)e.append(t,String(s));continue}e.set(t,String(r))}return e}const C=new Set([101,204,205,304]);async function b(n,e){const t=new y,r=new w(t);t.url=e.url?.toString()||"/";let s;if(!t.url.startsWith("/")){const d=new URL(t.url);s=d.host,t.url=d.pathname+d.search+d.hash}t.method=e.method||"GET",t.headers=R(e.headers||{}),t.headers.host||(t.headers.host=e.host||s||"localhost"),t.connection.encrypted=t.connection.encrypted||e.protocol==="https",t.body=e.body||null,t.__unenv__=e.context,await n(t,r);let a=r._data;(C.has(r.statusCode)||t.method.toUpperCase()==="HEAD")&&(a=null,delete r._headers["content-length"]);const u={status:r.statusCode,statusText:r.statusMessage,headers:r._headers,body:a};return t.destroy(),r.destroy(),u}async function O(n,e,t={}){try{const r=await b(n,{url:e,...t});return new Response(r.body,{status:r.status,statusText:r.statusText,headers:S(r.headers)})}catch(r){return new Response(r.toString(),{status:Number.parseInt(r.statusCode||r.code)||500,statusText:r.statusText})}}export{y as IncomingMessage,w as ServerResponse,b as callNodeRequestHandler,O as fetchNodeRequestHandler}; | ||
| import{EventEmitter as f}from"node-mock-http/_polyfill/events";import{Buffer as h}from"node-mock-http/_polyfill/buffer";function o(n){throw new Error(`${n} is not implemented yet!`)}class i extends f{__unenv__={};readableEncoding=null;readableEnded=!0;readableFlowing=!1;readableHighWaterMark=0;readableLength=0;readableObjectMode=!1;readableAborted=!1;readableDidRead=!1;closed=!1;errored=null;readable=!1;destroyed=!1;static from(e,t){return new i(t)}constructor(e){super()}_read(e){}read(e){}setEncoding(e){return this}pause(){return this}resume(){return this}isPaused(){return!0}unpipe(e){return this}unshift(e,t){}wrap(e){return this}push(e,t){return!1}_destroy(e,t){this.removeAllListeners()}destroy(e){return this.destroyed=!0,this._destroy(e),this}pipe(e,t){return{}}compose(e,t){throw new Error("Method not implemented.")}[Symbol.asyncDispose](){return this.destroy(),Promise.resolve()}async*[Symbol.asyncIterator](){throw o("Readable.asyncIterator")}iterator(e){throw o("Readable.iterator")}map(e,t){throw o("Readable.map")}filter(e,t){throw o("Readable.filter")}forEach(e,t){throw o("Readable.forEach")}reduce(e,t,r){throw o("Readable.reduce")}find(e,t){throw o("Readable.find")}findIndex(e,t){throw o("Readable.findIndex")}some(e,t){throw o("Readable.some")}toArray(e){throw o("Readable.toArray")}every(e,t){throw o("Readable.every")}flatMap(e,t){throw o("Readable.flatMap")}drop(e,t){throw o("Readable.drop")}take(e,t){throw o("Readable.take")}asIndexedPairs(e){throw o("Readable.asIndexedPairs")}}class l extends f{__unenv__={};writable=!0;writableEnded=!1;writableFinished=!1;writableHighWaterMark=0;writableLength=0;writableObjectMode=!1;writableCorked=0;closed=!1;errored=null;writableNeedDrain=!1;writableAborted=!1;destroyed=!1;_data;_encoding="utf8";constructor(e){super()}pipe(e,t){return{}}_write(e,t,r){if(this.writableEnded){r&&r();return}if(this._data===void 0)this._data=e;else{const s=typeof this._data=="string"?h.from(this._data,this._encoding||t||"utf8"):this._data,a=typeof e=="string"?h.from(e,t||this._encoding||"utf8"):e;this._data=h.concat([s,a])}this._encoding=t,r&&r()}_writev(e,t){}_destroy(e,t){}_final(e){}write(e,t,r){const s=typeof t=="string"?this._encoding:"utf8",a=typeof t=="function"?t:typeof r=="function"?r:void 0;return this._write(e,s,a),!0}setDefaultEncoding(e){return this}end(e,t,r){const s=typeof e=="function"?e:typeof t=="function"?t:typeof r=="function"?r:void 0;if(this.writableEnded)return s&&s(),this;const a=e===s?void 0:e;if(a){const u=t===s?void 0:t;this.write(a,u,s)}return this.writableEnded=!0,this.writableFinished=!0,this.emit("close"),this.emit("finish"),this}cork(){}uncork(){}destroy(e){return this.destroyed=!0,delete this._data,this.removeAllListeners(),this}compose(e,t){throw new Error("Method not implemented.")}}const c=class{allowHalfOpen=!0;_destroy;constructor(e=new i,t=new l){Object.assign(this,e),Object.assign(this,t),this._destroy=g(e._destroy,t._destroy)}};function _(){return Object.assign(c.prototype,i.prototype),Object.assign(c.prototype,l.prototype),c}function g(...n){return function(...e){for(const t of n)t(...e)}}const m=_();class A extends m{__unenv__={};bufferSize=0;bytesRead=0;bytesWritten=0;connecting=!1;destroyed=!1;pending=!1;localAddress="";localPort=0;remoteAddress="";remoteFamily="";remotePort=0;autoSelectFamilyAttemptedAddresses=[];readyState="readOnly";constructor(e){super()}write(e,t,r){return!1}connect(e,t,r){return this}end(e,t,r){return this}setEncoding(e){return this}pause(){return this}resume(){return this}setTimeout(e,t){return this}setNoDelay(e){return this}setKeepAlive(e,t){return this}address(){return{}}unref(){return this}ref(){return this}destroySoon(){this.destroy()}resetAndDestroy(){const e=new Error("ERR_SOCKET_CLOSED");return e.code="ERR_SOCKET_CLOSED",this.destroy(e),this}}class y extends i{aborted=!1;httpVersion="1.1";httpVersionMajor=1;httpVersionMinor=1;complete=!0;connection;socket;headers={};trailers={};method="GET";url="/";statusCode=200;statusMessage="";closed=!1;errored=null;readable=!1;constructor(e){super(),this.socket=this.connection=e||new A}get rawHeaders(){const e=this.headers,t=[];for(const r in e)if(Array.isArray(e[r]))for(const s of e[r])t.push(r,s);else t.push(r,e[r]);return t}get rawTrailers(){return[]}setTimeout(e,t){return this}get headersDistinct(){return p(this.headers)}get trailersDistinct(){return p(this.trailers)}}function p(n){const e={};for(const[t,r]of Object.entries(n))t&&(e[t]=(Array.isArray(r)?r:[r]).filter(Boolean));return e}class w extends l{statusCode=200;statusMessage="";upgrading=!1;chunkedEncoding=!1;shouldKeepAlive=!1;useChunkedEncodingByDefault=!1;sendDate=!1;finished=!1;headersSent=!1;strictContentLength=!1;connection=null;socket=null;req;_headers={};constructor(e){super(),this.req=e}assignSocket(e){e._httpMessage=this,this.socket=e,this.connection=e,this.emit("socket",e),this._flush()}_flush(){this.flushHeaders()}detachSocket(e){}writeContinue(e){}writeHead(e,t,r){e&&(this.statusCode=e),typeof t=="string"&&(this.statusMessage=t,t=void 0);const s=r||t;if(s&&!Array.isArray(s))for(const a in s)this.setHeader(a,s[a]);return this.headersSent=!0,this}writeProcessing(){}setTimeout(e,t){return this}appendHeader(e,t){e=e.toLowerCase();const r=this._headers[e],s=[...Array.isArray(r)?r:[r],...Array.isArray(t)?t:[t]].filter(Boolean);return this._headers[e]=s.length>1?s:s[0],this}setHeader(e,t){return this._headers[e.toLowerCase()]=t,this}setHeaders(e){for(const[t,r]of Object.entries(e))this.setHeader(t,r);return this}getHeader(e){return this._headers[e.toLowerCase()]}getHeaders(){return this._headers}getHeaderNames(){return Object.keys(this._headers)}hasHeader(e){return e.toLowerCase()in this._headers}removeHeader(e){delete this._headers[e.toLowerCase()]}addTrailers(e){}flushHeaders(){}writeEarlyHints(e,t){typeof t=="function"&&t()}}const E=(()=>{const n=function(){};return n.prototype=Object.create(null),n})();function R(n={}){const e=new E,t=Array.isArray(n)||H(n)?n:Object.entries(n);for(const[r,s]of t)if(s){if(e[r]===void 0){e[r]=s;continue}e[r]=[...Array.isArray(e[r])?e[r]:[e[r]],...Array.isArray(s)?s:[s]]}return e}function H(n){return typeof n?.entries=="function"}function v(n={}){if(n instanceof Headers)return n;const e=new Headers;for(const[t,r]of Object.entries(n))if(r!==void 0){if(Array.isArray(r)){for(const s of r)e.append(t,String(s));continue}e.set(t,String(r))}return e}const S=new Set([101,204,205,304]);async function b(n,e){const t=new y,r=new w(t);t.url=e.url?.toString()||"/";let s;if(!t.url.startsWith("/")){const d=new URL(t.url);s=d.host,t.url=d.pathname+d.search+d.hash}t.method=e.method||"GET",t.headers=R(e.headers||{}),t.headers.host||(t.headers.host=e.host||s||"localhost"),t.connection.encrypted=t.connection.encrypted||e.protocol==="https",t.body=e.body||null,t.__unenv__=e.context,await n(t,r);let a=r._data;(S.has(r.statusCode)||t.method.toUpperCase()==="HEAD")&&(a=null,delete r._headers["content-length"]);const u={status:r.statusCode,statusText:r.statusMessage,headers:r._headers,body:a};return t.destroy(),r.destroy(),u}async function C(n,e,t={}){try{const r=await b(n,{url:e,...t});return new Response(r.body,{status:r.status,statusText:r.statusText,headers:v(r.headers)})}catch(r){return new Response(r.toString(),{status:Number.parseInt(r.statusCode||r.code)||500,statusText:r.statusText})}}export{y as IncomingMessage,w as ServerResponse,b as callNodeRequestHandler,C as fetchNodeRequestHandler}; |
+11
-11
| { | ||
| "name": "node-mock-http", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "", | ||
@@ -50,15 +50,15 @@ "repository": "unjs/node-mock-http", | ||
| "devDependencies": { | ||
| "@types/node": "^22.12.0", | ||
| "@vitest/coverage-v8": "^3.0.4", | ||
| "automd": "^0.3.12", | ||
| "changelogen": "^0.5.7", | ||
| "eslint": "^9.19.0", | ||
| "@types/node": "^24.0.4", | ||
| "@vitest/coverage-v8": "^3.2.4", | ||
| "automd": "^0.4.0", | ||
| "changelogen": "^0.6.1", | ||
| "eslint": "^9.29.0", | ||
| "eslint-config-unjs": "^0.4.2", | ||
| "jiti": "^2.4.2", | ||
| "prettier": "^3.4.2", | ||
| "typescript": "^5.7.3", | ||
| "unbuild": "^3.3.1", | ||
| "vitest": "^3.0.4" | ||
| "prettier": "^3.6.1", | ||
| "typescript": "^5.8.3", | ||
| "unbuild": "^3.5.0", | ||
| "vitest": "^3.2.4" | ||
| }, | ||
| "packageManager": "pnpm@10.2.0" | ||
| "packageManager": "pnpm@10.12.3" | ||
| } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
147913
0.21%752
0.27%