next
Version:
The React Framework
1 lines • 399 kB
JavaScript
(()=>{var __webpack_modules__={1900:(A,e,t)=>{"use strict";const{parseContentType:s}=t(4318);function getInstance(A){const e=A.headers;const t=s(e["content-type"]);if(!t)throw new Error("Malformed content type");for(const s of o){const o=s.detect(t);if(!o)continue;const r={limits:A.limits,headers:e,conType:t,highWaterMark:undefined,fileHwm:undefined,defCharset:undefined,defParamCharset:undefined,preservePath:false};if(A.highWaterMark)r.highWaterMark=A.highWaterMark;if(A.fileHwm)r.fileHwm=A.fileHwm;r.defCharset=A.defCharset;r.defParamCharset=A.defParamCharset;r.preservePath=A.preservePath;return new s(r)}throw new Error(`Unsupported content type: ${e["content-type"]}`)}const o=[t(6104),t(8506)].filter((function(A){return typeof A.detect==="function"}));A.exports=A=>{if(typeof A!=="object"||A===null)A={};if(typeof A.headers!=="object"||A.headers===null||typeof A.headers["content-type"]!=="string"){throw new Error("Missing Content-Type")}return getInstance(A)}},6104:(A,e,t)=>{"use strict";const{Readable:s,Writable:o}=t(2781);const r=t(6542);const{basename:i,convertToUTF8:n,getDecoder:g,parseContentType:C,parseDisposition:E}=t(4318);const Q=Buffer.from("\r\n");const I=Buffer.from("\r");const B=Buffer.from("-");function noop(){}const a=2e3;const c=16*1024;const h=0;const l=1;const u=2;class HeaderParser{constructor(A){this.header=Object.create(null);this.pairCount=0;this.byteCount=0;this.state=h;this.name="";this.value="";this.crlf=0;this.cb=A}reset(){this.header=Object.create(null);this.pairCount=0;this.byteCount=0;this.state=h;this.name="";this.value="";this.crlf=0}push(A,e,t){let s=e;while(e<t){switch(this.state){case h:{let o=false;for(;e<t;++e){if(this.byteCount===c)return-1;++this.byteCount;const t=A[e];if(f[t]!==1){if(t!==58)return-1;this.name+=A.latin1Slice(s,e);if(this.name.length===0)return-1;++e;o=true;this.state=l;break}}if(!o){this.name+=A.latin1Slice(s,e);break}}case l:{let o=false;for(;e<t;++e){if(this.byteCount===c)return-1;++this.byteCount;const t=A[e];if(t!==32&&t!==9){s=e;o=true;this.state=u;break}}if(!o)break}case u:switch(this.crlf){case 0:for(;e<t;++e){if(this.byteCount===c)return-1;++this.byteCount;const t=A[e];if(y[t]!==1){if(t!==13)return-1;++this.crlf;break}}this.value+=A.latin1Slice(s,e++);break;case 1:if(this.byteCount===c)return-1;++this.byteCount;if(A[e++]!==10)return-1;++this.crlf;break;case 2:{if(this.byteCount===c)return-1;++this.byteCount;const t=A[e];if(t===32||t===9){s=e;this.crlf=0}else{if(++this.pairCount<a){this.name=this.name.toLowerCase();if(this.header[this.name]===undefined)this.header[this.name]=[this.value];else this.header[this.name].push(this.value)}if(t===13){++this.crlf;++e}else{s=e;this.crlf=0;this.state=h;this.name="";this.value=""}}break}case 3:{if(this.byteCount===c)return-1;++this.byteCount;if(A[e++]!==10)return-1;const t=this.header;this.reset();this.cb(t);return e}}break}}return e}}class FileStream extends s{constructor(A,e){super(A);this.truncated=false;this._readcb=null;this.once("end",(()=>{this._read();if(--e._fileEndsLeft===0&&e._finalcb){const A=e._finalcb;e._finalcb=null;process.nextTick(A)}}))}_read(A){const e=this._readcb;if(e){this._readcb=null;e()}}}const d={push:(A,e)=>{},destroy:()=>{}};function callAndUnsetCb(A,e){const t=A._writecb;A._writecb=null;if(e)A.destroy(e);else if(t)t()}function nullDecoder(A,e){return A}class Multipart extends o{constructor(A){const e={autoDestroy:true,emitClose:true,highWaterMark:typeof A.highWaterMark==="number"?A.highWaterMark:undefined};super(e);if(!A.conType.params||typeof A.conType.params.boundary!=="string")throw new Error("Multipart: Boundary not found");const t=A.conType.params.boundary;const s=typeof A.defParamCharset==="string"&&A.defParamCharset?g(A.defParamCharset):nullDecoder;const o=A.defCharset||"utf8";const a=A.preservePath;const c={autoDestroy:true,emitClose:true,highWaterMark:typeof A.fileHwm==="number"?A.fileHwm:undefined};const h=A.limits;const l=h&&typeof h.fieldSize==="number"?h.fieldSize:1*1024*1024;const u=h&&typeof h.fileSize==="number"?h.fileSize:Infinity;const f=h&&typeof h.files==="number"?h.files:Infinity;const y=h&&typeof h.fields==="number"?h.fields:Infinity;const D=h&&typeof h.parts==="number"?h.parts:Infinity;let k=-1;let w=0;let S=0;let p=false;this._fileEndsLeft=0;this._fileStream=undefined;this._complete=false;let N=0;let R;let b=0;let m;let F;let L;let M;let U=false;let Y=false;let J=false;this._hparser=null;const q=new HeaderParser((A=>{this._hparser=null;p=false;L="text/plain";m=o;F="7bit";M=undefined;U=false;let e;if(!A["content-disposition"]){p=true;return}const t=E(A["content-disposition"][0],s);if(!t||t.type!=="form-data"){p=true;return}if(t.params){if(t.params.name)M=t.params.name;if(t.params["filename*"])e=t.params["filename*"];else if(t.params.filename)e=t.params.filename;if(e!==undefined&&!a)e=i(e)}if(A["content-type"]){const e=C(A["content-type"][0]);if(e){L=`${e.type}/${e.subtype}`;if(e.params&&typeof e.params.charset==="string")m=e.params.charset.toLowerCase()}}if(A["content-transfer-encoding"])F=A["content-transfer-encoding"][0].toLowerCase();if(L==="application/octet-stream"||e!==undefined){if(S===f){if(!Y){Y=true;this.emit("filesLimit")}p=true;return}++S;if(this.listenerCount("file")===0){p=true;return}N=0;this._fileStream=new FileStream(c,this);++this._fileEndsLeft;this.emit("file",M,this._fileStream,{filename:e,encoding:F,mimeType:L})}else{if(w===y){if(!J){J=true;this.emit("fieldsLimit")}p=true;return}++w;if(this.listenerCount("field")===0){p=true;return}R=[];b=0}}));let T=0;const ssCb=(A,e,t,s,o)=>{A:while(e){if(this._hparser!==null){const A=this._hparser.push(e,t,s);if(A===-1){this._hparser=null;q.reset();this.emit("error",new Error("Malformed part header"));break}t=A}if(t===s)break;if(T!==0){if(T===1){switch(e[t]){case 45:T=2;++t;break;case 13:T=3;++t;break;default:T=0}if(t===s)return}if(T===2){T=0;if(e[t]===45){this._complete=true;this._bparser=d;return}const A=this._writecb;this._writecb=noop;ssCb(false,B,0,1,false);this._writecb=A}else if(T===3){T=0;if(e[t]===10){++t;if(k>=D)break;this._hparser=q;if(t===s)break;continue A}else{const A=this._writecb;this._writecb=noop;ssCb(false,I,0,1,false);this._writecb=A}}}if(!p){if(this._fileStream){let A;const r=Math.min(s-t,u-N);if(!o){A=Buffer.allocUnsafe(r);e.copy(A,0,t,t+r)}else{A=e.slice(t,t+r)}N+=A.length;if(N===u){if(A.length>0)this._fileStream.push(A);this._fileStream.emit("limit");this._fileStream.truncated=true;p=true}else if(!this._fileStream.push(A)){if(this._writecb)this._fileStream._readcb=this._writecb;this._writecb=null}}else if(R!==undefined){let A;const r=Math.min(s-t,l-b);if(!o){A=Buffer.allocUnsafe(r);e.copy(A,0,t,t+r)}else{A=e.slice(t,t+r)}b+=r;R.push(A);if(b===l){p=true;U=true}}}break}if(A){T=1;if(this._fileStream){this._fileStream.push(null);this._fileStream=null}else if(R!==undefined){let A;switch(R.length){case 0:A="";break;case 1:A=n(R[0],m,0);break;default:A=n(Buffer.concat(R,b),m,0)}R=undefined;b=0;this.emit("field",M,A,{nameTruncated:false,valueTruncated:U,encoding:F,mimeType:L})}if(++k===D)this.emit("partsLimit")}};this._bparser=new r(`\r\n--${t}`,ssCb);this._writecb=null;this._finalcb=null;this.write(Q)}static detect(A){return A.type==="multipart"&&A.subtype==="form-data"}_write(A,e,t){this._writecb=t;this._bparser.push(A,0);if(this._writecb)callAndUnsetCb(this)}_destroy(A,e){this._hparser=null;this._bparser=d;if(!A)A=checkEndState(this);const t=this._fileStream;if(t){this._fileStream=null;t.destroy(A)}e(A)}_final(A){this._bparser.destroy();if(!this._complete)return A(new Error("Unexpected end of form"));if(this._fileEndsLeft)this._finalcb=finalcb.bind(null,this,A);else finalcb(this,A)}}function finalcb(A,e,t){if(t)return e(t);t=checkEndState(A);e(t)}function checkEndState(A){if(A._hparser)return new Error("Malformed part header");const e=A._fileStream;if(e){A._fileStream=null;e.destroy(new Error("Unexpected end of file"))}if(!A._complete)return new Error("Unexpected end of form")}const f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1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const e={autoDestroy:true,emitClose:true,highWaterMark:typeof A.highWaterMark==="number"?A.highWaterMark:undefined};super(e);let t=A.defCharset||"utf8";if(A.conType.params&&typeof A.conType.params.charset==="string")t=A.conType.params.charset;this.charset=t;const s=A.limits;this.fieldSizeLimit=s&&typeof s.fieldSize==="number"?s.fieldSize:1*1024*1024;this.fieldsLimit=s&&typeof s.fields==="number"?s.fields:Infinity;this.fieldNameSizeLimit=s&&typeof s.fieldNameSize==="number"?s.fieldNameSize:100;this._inKey=true;this._keyTrunc=false;this._valTrunc=false;this._bytesKey=0;this._bytesVal=0;this._fields=0;this._key="";this._val="";this._byte=-2;this._lastPos=0;this._encode=0;this._decoder=o(t)}static detect(A){return A.type==="application"&&A.subtype==="x-www-form-urlencoded"}_write(A,e,t){if(this._fields>=this.fieldsLimit)return t();let s=0;const o=A.length;this._lastPos=0;if(this._byte!==-2){s=readPctEnc(this,A,s,o);if(s===-1)return t(new Error("Malformed urlencoded form"));if(s>=o)return t();if(this._inKey)++this._bytesKey;else++this._bytesVal}A:while(s<o){if(this._inKey){s=skipKeyBytes(this,A,s,o);while(s<o){switch(A[s]){case 61:if(this._lastPos<s)this._key+=A.latin1Slice(this._lastPos,s);this._lastPos=++s;this._key=this._decoder(this._key,this._encode);this._encode=0;this._inKey=false;continue A;case 38:if(this._lastPos<s)this._key+=A.latin1Slice(this._lastPos,s);this._lastPos=++s;this._key=this._decoder(this._key,this._encode);this._encode=0;if(this._bytesKey>0){this.emit("field",this._key,"",{nameTruncated:this._keyTrunc,valueTruncated:false,encoding:this.charset,mimeType:"text/plain"})}this._key="";this._val="";this._keyTrunc=false;this._valTrunc=false;this._bytesKey=0;this._bytesVal=0;if(++this._fields>=this.fieldsLimit){this.emit("fieldsLimit");return t()}continue;case 43:if(this._lastPos<s)this._key+=A.latin1Slice(this._lastPos,s);this._key+=" ";this._lastPos=s+1;break;case 37:if(this._encode===0)this._encode=1;if(this._lastPos<s)this._key+=A.latin1Slice(this._lastPos,s);this._lastPos=s+1;this._byte=-1;s=readPctEnc(this,A,s+1,o);if(s===-1)return t(new Error("Malformed urlencoded form"));if(s>=o)return t();++this._bytesKey;s=skipKeyBytes(this,A,s,o);continue}++s;++this._bytesKey;s=skipKeyBytes(this,A,s,o)}if(this._lastPos<s)this._key+=A.latin1Slice(this._lastPos,s)}else{s=skipValBytes(this,A,s,o);while(s<o){switch(A[s]){case 38:if(this._lastPos<s)this._val+=A.latin1Slice(this._lastPos,s);this._lastPos=++s;this._inKey=true;this._val=this._decoder(this._val,this._encode);this._encode=0;if(this._bytesKey>0||this._bytesVal>0){this.emit("field",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:"text/plain"})}this._key="";this._val="";this._keyTrunc=false;this._valTrunc=false;this._bytesKey=0;this._bytesVal=0;if(++this._fields>=this.fieldsLimit){this.emit("fieldsLimit");return t()}continue A;case 43:if(this._lastPos<s)this._val+=A.latin1Slice(this._lastPos,s);this._val+=" ";this._lastPos=s+1;break;case 37:if(this._encode===0)this._encode=1;if(this._lastPos<s)this._val+=A.latin1Slice(this._lastPos,s);this._lastPos=s+1;this._byte=-1;s=readPctEnc(this,A,s+1,o);if(s===-1)return t(new Error("Malformed urlencoded form"));if(s>=o)return t();++this._bytesVal;s=skipValBytes(this,A,s,o);continue}++s;++this._bytesVal;s=skipValBytes(this,A,s,o)}if(this._lastPos<s)this._val+=A.latin1Slice(this._lastPos,s)}}t()}_final(A){if(this._byte!==-2)return A(new Error("Malformed urlencoded form"));if(!this._inKey||this._bytesKey>0||this._bytesVal>0){if(this._inKey)this._key=this._decoder(this._key,this._encode);else this._val=this._decoder(this._val,this._encode);this.emit("field",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:"text/plain"})}A()}}function readPctEnc(A,e,t,s){if(t>=s)return s;if(A._byte===-1){const o=r[e[t++]];if(o===-1)return-1;if(o>=8)A._encode=2;if(t<s){const s=r[e[t++]];if(s===-1)return-1;if(A._inKey)A._key+=String.fromCharCode((o<<4)+s);else A._val+=String.fromCharCode((o<<4)+s);A._byte=-2;A._lastPos=t}else{A._byte=o}}else{const s=r[e[t++]];if(s===-1)return-1;if(A._inKey)A._key+=String.fromCharCode((A._byte<<4)+s);else A._val+=String.fromCharCode((A._byte<<4)+s);A._byte=-2;A._lastPos=t}return t}function skipKeyBytes(A,e,t,s){if(A._bytesKey>A.fieldNameSizeLimit){if(!A._keyTrunc){if(A._lastPos<t)A._key+=e.latin1Slice(A._lastPos,t-1)}A._keyTrunc=true;for(;t<s;++t){const s=e[t];if(s===61||s===38)break;++A._bytesKey}A._lastPos=t}return t}function skipValBytes(A,e,t,s){if(A._bytesVal>A.fieldSizeLimit){if(!A._valTrunc){if(A._lastPos<t)A._val+=e.latin1Slice(A._lastPos,t-1)}A._valTrunc=true;for(;t<s;++t){if(e[t]===38)break;++A._bytesVal}A._lastPos=t}return t}const r=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];A.exports=URLEncoded},4318:function(A){"use strict";function parseContentType(A){if(A.length===0)return;const e=Object.create(null);let s=0;for(;s<A.length;++s){const e=A.charCodeAt(s);if(t[e]!==1){if(e!==47||s===0)return;break}}if(s===A.length)return;const o=A.slice(0,s).toLowerCase();const r=++s;for(;s<A.length;++s){const o=A.charCodeAt(s);if(t[o]!==1){if(s===r)return;if(parseContentTypeParams(A,s,e)===undefined)return;break}}if(s===r)return;const i=A.slice(r,s).toLowerCase();return{type:o,subtype:i,params:e}}function parseContentTypeParams(A,e,o){while(e<A.length){for(;e<A.length;++e){const t=A.charCodeAt(e);if(t!==32&&t!==9)break}if(e===A.length)break;if(A.charCodeAt(e++)!==59)return;for(;e<A.length;++e){const t=A.charCodeAt(e);if(t!==32&&t!==9)break}if(e===A.length)return;let r;const i=e;for(;e<A.length;++e){const s=A.charCodeAt(e);if(t[s]!==1){if(s!==61)return;break}}if(e===A.length)return;r=A.slice(i,e);++e;if(e===A.length)return;let n="";let g;if(A.charCodeAt(e)===34){g=++e;let t=false;for(;e<A.length;++e){const o=A.charCodeAt(e);if(o===92){if(t){g=e;t=false}else{n+=A.slice(g,e);t=true}continue}if(o===34){if(t){g=e;t=false;continue}n+=A.slice(g,e);break}if(t){g=e-1;t=false}if(s[o]!==1)return}if(e===A.length)return;++e}else{g=e;for(;e<A.length;++e){const s=A.charCodeAt(e);if(t[s]!==1){if(e===g)return;break}}n=A.slice(g,e)}r=r.toLowerCase();if(o[r]===undefined)o[r]=n}return o}function parseDisposition(A,e){if(A.length===0)return;const s=Object.create(null);let o=0;for(;o<A.length;++o){const r=A.charCodeAt(o);if(t[r]!==1){if(parseDispositionParams(A,o,s,e)===undefined)return;break}}const r=A.slice(0,o).toLowerCase();return{type:r,params:s}}function parseDispositionParams(A,e,n,g){while(e<A.length){for(;e<A.length;++e){const t=A.charCodeAt(e);if(t!==32&&t!==9)break}if(e===A.length)break;if(A.charCodeAt(e++)!==59)return;for(;e<A.length;++e){const t=A.charCodeAt(e);if(t!==32&&t!==9)break}if(e===A.length)return;let C;const E=e;for(;e<A.length;++e){const s=A.charCodeAt(e);if(t[s]!==1){if(s===61)break;return}}if(e===A.length)return;let Q="";let I;let B;C=A.slice(E,e);if(C.charCodeAt(C.length-1)===42){const t=++e;for(;e<A.length;++e){const t=A.charCodeAt(e);if(o[t]!==1){if(t!==39)return;break}}if(e===A.length)return;B=A.slice(t,e);++e;for(;e<A.length;++e){const t=A.charCodeAt(e);if(t===39)break}if(e===A.length)return;++e;if(e===A.length)return;I=e;let s=0;for(;e<A.length;++e){const t=A.charCodeAt(e);if(r[t]!==1){if(t===37){let t;let o;if(e+2<A.length&&(t=i[A.charCodeAt(e+1)])!==-1&&(o=i[A.charCodeAt(e+2)])!==-1){const r=(t<<4)+o;Q+=A.slice(I,e);Q+=String.fromCharCode(r);e+=2;I=e+1;if(r>=128)s=2;else if(s===0)s=1;continue}return}break}}Q+=A.slice(I,e);Q=convertToUTF8(Q,B,s);if(Q===undefined)return}else{++e;if(e===A.length)return;if(A.charCodeAt(e)===34){I=++e;let t=false;for(;e<A.length;++e){const o=A.charCodeAt(e);if(o===92){if(t){I=e;t=false}else{Q+=A.slice(I,e);t=true}continue}if(o===34){if(t){I=e;t=false;continue}Q+=A.slice(I,e);break}if(t){I=e-1;t=false}if(s[o]!==1)return}if(e===A.length)return;++e}else{I=e;for(;e<A.length;++e){const s=A.charCodeAt(e);if(t[s]!==1){if(e===I)return;break}}Q=A.slice(I,e)}Q=g(Q,2);if(Q===undefined)return}C=C.toLowerCase();if(n[C]===undefined)n[C]=Q}return n}function getDecoder(A){let t;while(true){switch(A){case"utf-8":case"utf8":return e.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return e.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return e.utf16le;case"base64":return e.base64;default:if(t===undefined){t=true;A=A.toLowerCase();continue}return e.other.bind(A)}}}const e={utf8:(A,e)=>{if(A.length===0)return"";if(typeof A==="string"){if(e<2)return A;A=Buffer.from(A,"latin1")}return A.utf8Slice(0,A.length)},latin1:(A,e)=>{if(A.length===0)return"";if(typeof A==="string")return A;return A.latin1Slice(0,A.length)},utf16le:(A,e)=>{if(A.length===0)return"";if(typeof A==="string")A=Buffer.from(A,"latin1");return A.ucs2Slice(0,A.length)},base64:(A,e)=>{if(A.length===0)return"";if(typeof A==="string")A=Buffer.from(A,"latin1");return A.base64Slice(0,A.length)},other:(A,e)=>{if(A.length===0)return"";if(typeof A==="string")A=Buffer.from(A,"latin1");try{const e=new TextDecoder(this);return e.decode(A)}catch{}}};function convertToUTF8(A,e,t){const s=getDecoder(e);if(s)return s(A,t)}function basename(A){if(typeof A!=="string")return"";for(let e=A.length-1;e>=0;--e){switch(A.charCodeAt(e)){case 47:case 92:A=A.slice(e+1);return A===".."||A==="."?"":A}}return A===".."||A==="."?"":A}const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];A.exports={basename:basename,convertToUTF8:convertToUTF8,getDecoder:getDecoder,parseContentType:parseContentType,parseDisposition:parseDisposition}},6542:A=>{"use strict";function memcmp(A,e,t,s,o){for(let r=0;r<o;++r){if(A[e+r]!==t[s+r])return false}return true}class SBMH{constructor(A,e){if(typeof e!=="function")throw new Error("Missing match callback");if(typeof A==="string")A=Buffer.from(A);else if(!Buffer.isBuffer(A))throw new Error(`Expected Buffer for needle, got ${typeof A}`);const t=A.length;this.maxMatches=Infinity;this.matches=0;this._cb=e;this._lookbehindSize=0;this._needle=A;this._bufPos=0;this._lookbehind=Buffer.allocUnsafe(t);this._occ=[t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t];if(t>1){for(let e=0;e<t-1;++e)this._occ[A[e]]=t-1-e}}reset(){this.matches=0;this._lookbehindSize=0;this._bufPos=0}push(A,e){let t;if(!Buffer.isBuffer(A))A=Buffer.from(A,"latin1");const s=A.length;this._bufPos=e||0;while(t!==s&&this.matches<this.maxMatches)t=feed(this,A);return t}destroy(){const A=this._lookbehindSize;if(A)this._cb(false,this._lookbehind,0,A,false);this.reset()}}function feed(A,e){const t=e.length;const s=A._needle;const o=s.length;let r=-A._lookbehindSize;const i=o-1;const n=s[i];const g=t-o;const C=A._occ;const E=A._lookbehind;if(r<0){while(r<0&&r<=g){const t=r+i;const s=t<0?E[A._lookbehindSize+t]:e[t];if(s===n&&matchNeedle(A,e,r,i)){A._lookbehindSize=0;++A.matches;if(r>-A._lookbehindSize)A._cb(true,E,0,A._lookbehindSize+r,false);else A._cb(true,undefined,0,0,true);return A._bufPos=r+o}r+=C[s]}while(r<0&&!matchNeedle(A,e,r,t-r))++r;if(r<0){const s=A._lookbehindSize+r;if(s>0){A._cb(false,E,0,s,false)}A._lookbehindSize-=s;E.copy(E,0,s,A._lookbehindSize);E.set(e,A._lookbehindSize);A._lookbehindSize+=t;A._bufPos=t;return t}A._cb(false,E,0,A._lookbehindSize,false);A._lookbehindSize=0}r+=A._bufPos;const Q=s[0];while(r<=g){const t=e[r+i];if(t===n&&e[r]===Q&&memcmp(s,0,e,r,i)){++A.matches;if(r>0)A._cb(true,e,A._bufPos,r,true);else A._cb(true,undefined,0,0,true);return A._bufPos=r+o}r+=C[t]}while(r<t){if(e[r]!==Q||!memcmp(e,r,s,0,t-r)){++r;continue}e.copy(E,0,r,t);A._lookbehindSize=t-r;break}if(r>0)A._cb(false,e,A._bufPos,r<t?r:t,true);A._bufPos=t;return t}function matchNeedle(A,e,t,s){const o=A._lookbehind;const r=A._lookbehindSize;const i=A._needle;for(let A=0;A<s;++A,++t){const s=t<0?o[r+t]:e[t];if(s!==i[A])return false}return true}A.exports=SBMH},9002:(A,e,t)=>{"use strict";const s=t(8978);const o=t(5456);const r=t(223);const i=t(1820);const n=t(7238);const g=t(7354);const C=t(1957);const{InvalidArgumentError:E}=r;const Q=t(740);const I=t(7814);const B=t(2666);const a=t(1198);const c=t(9265);const h=t(1598);const l=t(403);const{getGlobalDispatcher:u,setGlobalDispatcher:d}=t(7763);const f=t(901);const y=t(9836);const D=t(190);let k;try{t(6113);k=true}catch{k=false}Object.assign(o.prototype,Q);A.exports.Dispatcher=o;A.exports.Client=s;A.exports.Pool=i;A.exports.BalancedPool=n;A.exports.Agent=g;A.exports.ProxyAgent=l;A.exports.DecoratorHandler=f;A.exports.RedirectHandler=y;A.exports.createRedirectInterceptor=D;A.exports.buildConnector=I;A.exports.errors=r;function makeDispatcher(A){return(e,t,s)=>{if(typeof t==="function"){s=t;t=null}if(!e||typeof e!=="string"&&typeof e!=="object"&&!(e instanceof URL)){throw new E("invalid url")}if(t!=null&&typeof t!=="object"){throw new E("invalid opts")}if(t&&t.path!=null){if(typeof t.path!=="string"){throw new E("invalid opts.path")}let A=t.path;if(!t.path.startsWith("/")){A=`/${A}`}e=new URL(C.parseOrigin(e).origin+A)}else{if(!t){t=typeof e==="object"?e:{}}e=C.parseURL(e)}const{agent:o,dispatcher:r=u()}=t;if(o){throw new E("unsupported opts.agent. Did you mean opts.client?")}return A.call(r,{...t,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:t.method||(t.body?"PUT":"GET")},s)}}A.exports.setGlobalDispatcher=d;A.exports.getGlobalDispatcher=u;if(C.nodeMajor>16||C.nodeMajor===16&&C.nodeMinor>=8){let e=null;A.exports.fetch=async function fetch(A){if(!e){e=t(3059).fetch}try{return await e(...arguments)}catch(A){Error.captureStackTrace(A,this);throw A}};A.exports.Headers=t(3506).Headers;A.exports.Response=t(1992).Response;A.exports.Request=t(1450).Request;A.exports.FormData=t(131).FormData;A.exports.File=t(4100).File;A.exports.FileReader=t(5217).FileReader;const{setGlobalOrigin:s,getGlobalOrigin:o}=t(2392);A.exports.setGlobalOrigin=s;A.exports.getGlobalOrigin=o}if(C.nodeMajor>=16){const{deleteCookie:e,getCookies:s,getSetCookies:o,setCookie:r}=t(5244);A.exports.deleteCookie=e;A.exports.getCookies=s;A.exports.getSetCookies=o;A.exports.setCookie=r;const{parseMIMEType:i,serializeAMimeType:n}=t(8790);A.exports.parseMIMEType=i;A.exports.serializeAMimeType=n}if(C.nodeMajor>=18&&k){const{WebSocket:e}=t(4475);A.exports.WebSocket=e}A.exports.request=makeDispatcher(Q.request);A.exports.stream=makeDispatcher(Q.stream);A.exports.pipeline=makeDispatcher(Q.pipeline);A.exports.connect=makeDispatcher(Q.connect);A.exports.upgrade=makeDispatcher(Q.upgrade);A.exports.MockClient=B;A.exports.MockPool=c;A.exports.MockAgent=a;A.exports.mockErrors=h},7354:(A,e,t)=>{"use strict";const{InvalidArgumentError:s}=t(223);const{kClients:o,kRunning:r,kClose:i,kDestroy:n,kDispatch:g,kInterceptors:C}=t(2270);const E=t(9291);const Q=t(1820);const I=t(8978);const B=t(1957);const a=t(190);const{WeakRef:c,FinalizationRegistry:h}=t(8277)();const l=Symbol("onConnect");const u=Symbol("onDisconnect");const d=Symbol("onConnectionError");const f=Symbol("maxRedirections");const y=Symbol("onDrain");const D=Symbol("factory");const k=Symbol("finalizer");const w=Symbol("options");function defaultFactory(A,e){return e&&e.connections===1?new I(A,e):new Q(A,e)}class Agent extends E{constructor({factory:A=defaultFactory,maxRedirections:e=0,connect:t,...r}={}){super();if(typeof A!=="function"){throw new s("factory must be a function.")}if(t!=null&&typeof t!=="function"&&typeof t!=="object"){throw new s("connect must be a function or an object")}if(!Number.isInteger(e)||e<0){throw new s("maxRedirections must be a positive number")}if(t&&typeof t!=="function"){t={...t}}this[C]=r.interceptors&&r.interceptors.Agent&&Array.isArray(r.interceptors.Agent)?r.interceptors.Agent:[a({maxRedirections:e})];this[w]={...B.deepClone(r),connect:t};this[w].interceptors=r.interceptors?{...r.interceptors}:undefined;this[f]=e;this[D]=A;this[o]=new Map;this[k]=new h((A=>{const e=this[o].get(A);if(e!==undefined&&e.deref()===undefined){this[o].delete(A)}}));const i=this;this[y]=(A,e)=>{i.emit("drain",A,[i,...e])};this[l]=(A,e)=>{i.emit("connect",A,[i,...e])};this[u]=(A,e,t)=>{i.emit("disconnect",A,[i,...e],t)};this[d]=(A,e,t)=>{i.emit("connectionError",A,[i,...e],t)}}get[r](){let A=0;for(const e of this[o].values()){const t=e.deref();if(t){A+=t[r]}}return A}[g](A,e){let t;if(A.origin&&(typeof A.origin==="string"||A.origin instanceof URL)){t=String(A.origin)}else{throw new s("opts.origin must be a non-empty string or URL.")}const r=this[o].get(t);let i=r?r.deref():null;if(!i){i=this[D](A.origin,this[w]).on("drain",this[y]).on("connect",this[l]).on("disconnect",this[u]).on("connectionError",this[d]);this[o].set(t,new c(i));this[k].register(i,t)}return i.dispatch(A,e)}async[i](){const A=[];for(const e of this[o].values()){const t=e.deref();if(t){A.push(t.close())}}await Promise.all(A)}async[n](A){const e=[];for(const t of this[o].values()){const s=t.deref();if(s){e.push(s.destroy(A))}}await Promise.all(e)}}A.exports=Agent},5057:(A,e,t)=>{const{RequestAbortedError:s}=t(223);const o=Symbol("kListener");const r=Symbol("kSignal");function abort(A){if(A.abort){A.abort()}else{A.onError(new s)}}function addSignal(A,e){A[r]=null;A[o]=null;if(!e){return}if(e.aborted){abort(A);return}A[r]=e;A[o]=()=>{abort(A)};if("addEventListener"in A[r]){A[r].addEventListener("abort",A[o])}else{A[r].addListener("abort",A[o])}}function removeSignal(A){if(!A[r]){return}if("removeEventListener"in A[r]){A[r].removeEventListener("abort",A[o])}else{A[r].removeListener("abort",A[o])}A[r]=null;A[o]=null}A.exports={addSignal:addSignal,removeSignal:removeSignal}},35:(A,e,t)=>{"use strict";const{InvalidArgumentError:s,RequestAbortedError:o,SocketError:r}=t(223);const{AsyncResource:i}=t(852);const n=t(1957);const{addSignal:g,removeSignal:C}=t(5057);class ConnectHandler extends i{constructor(A,e){if(!A||typeof A!=="object"){throw new s("invalid opts")}if(typeof e!=="function"){throw new s("invalid callback")}const{signal:t,opaque:o,responseHeaders:r}=A;if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new s("signal must be an EventEmitter or EventTarget")}super("UNDICI_CONNECT");this.opaque=o||null;this.responseHeaders=r||null;this.callback=e;this.abort=null;g(this,t)}onConnect(A,e){if(!this.callback){throw new o}this.abort=A;this.context=e}onHeaders(){throw new r("bad connect",null)}onUpgrade(A,e,t){const{callback:s,opaque:o,context:r}=this;C(this);this.callback=null;const i=this.responseHeaders==="raw"?n.parseRawHeaders(e):n.parseHeaders(e);this.runInAsyncScope(s,null,null,{statusCode:A,headers:i,socket:t,opaque:o,context:r})}onError(A){const{callback:e,opaque:t}=this;C(this);if(e){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(e,null,A,{opaque:t})}))}}}function connect(A,e){if(e===undefined){return new Promise(((e,t)=>{connect.call(this,A,((A,s)=>A?t(A):e(s)))}))}try{const t=new ConnectHandler(A,e);this.dispatch({...A,method:"CONNECT"},t)}catch(t){if(typeof e!=="function"){throw t}const s=A&&A.opaque;queueMicrotask((()=>e(t,{opaque:s})))}}A.exports=connect},412:(A,e,t)=>{"use strict";const{Readable:s,Duplex:o,PassThrough:r}=t(2781);const{InvalidArgumentError:i,InvalidReturnValueError:n,RequestAbortedError:g}=t(223);const C=t(1957);const{AsyncResource:E}=t(852);const{addSignal:Q,removeSignal:I}=t(5057);const B=t(9491);const a=Symbol("resume");class PipelineRequest extends s{constructor(){super({autoDestroy:true});this[a]=null}_read(){const{[a]:A}=this;if(A){this[a]=null;A()}}_destroy(A,e){this._read();e(A)}}class PipelineResponse extends s{constructor(A){super({autoDestroy:true});this[a]=A}_read(){this[a]()}_destroy(A,e){if(!A&&!this._readableState.endEmitted){A=new g}e(A)}}class PipelineHandler extends E{constructor(A,e){if(!A||typeof A!=="object"){throw new i("invalid opts")}if(typeof e!=="function"){throw new i("invalid handler")}const{signal:t,method:s,opaque:r,onInfo:n,responseHeaders:E}=A;if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new i("signal must be an EventEmitter or EventTarget")}if(s==="CONNECT"){throw new i("invalid method")}if(n&&typeof n!=="function"){throw new i("invalid onInfo callback")}super("UNDICI_PIPELINE");this.opaque=r||null;this.responseHeaders=E||null;this.handler=e;this.abort=null;this.context=null;this.onInfo=n||null;this.req=(new PipelineRequest).on("error",C.nop);this.ret=new o({readableObjectMode:A.objectMode,autoDestroy:true,read:()=>{const{body:A}=this;if(A&&A.resume){A.resume()}},write:(A,e,t)=>{const{req:s}=this;if(s.push(A,e)||s._readableState.destroyed){t()}else{s[a]=t}},destroy:(A,e)=>{const{body:t,req:s,res:o,ret:r,abort:i}=this;if(!A&&!r._readableState.endEmitted){A=new g}if(i&&A){i()}C.destroy(t,A);C.destroy(s,A);C.destroy(o,A);I(this);e(A)}}).on("prefinish",(()=>{const{req:A}=this;A.push(null)}));this.res=null;Q(this,t)}onConnect(A,e){const{ret:t,res:s}=this;B(!s,"pipeline cannot be retried");if(t.destroyed){throw new g}this.abort=A;this.context=e}onHeaders(A,e,t){const{opaque:s,handler:o,context:r}=this;if(A<200){if(this.onInfo){const t=this.responseHeaders==="raw"?C.parseRawHeaders(e):C.parseHeaders(e);this.onInfo({statusCode:A,headers:t})}return}this.res=new PipelineResponse(t);let i;try{this.handler=null;const t=this.responseHeaders==="raw"?C.parseRawHeaders(e):C.parseHeaders(e);i=this.runInAsyncScope(o,null,{statusCode:A,headers:t,opaque:s,body:this.res,context:r})}catch(A){this.res.on("error",C.nop);throw A}if(!i||typeof i.on!=="function"){throw new n("expected Readable")}i.on("data",(A=>{const{ret:e,body:t}=this;if(!e.push(A)&&t.pause){t.pause()}})).on("error",(A=>{const{ret:e}=this;C.destroy(e,A)})).on("end",(()=>{const{ret:A}=this;A.push(null)})).on("close",(()=>{const{ret:A}=this;if(!A._readableState.ended){C.destroy(A,new g)}}));this.body=i}onData(A){const{res:e}=this;return e.push(A)}onComplete(A){const{res:e}=this;e.push(null)}onError(A){const{ret:e}=this;this.handler=null;C.destroy(e,A)}}function pipeline(A,e){try{const t=new PipelineHandler(A,e);this.dispatch({...A,body:t.req},t);return t.ret}catch(A){return(new r).destroy(A)}}A.exports=pipeline},7634:(A,e,t)=>{"use strict";const s=t(8478);const{InvalidArgumentError:o,RequestAbortedError:r}=t(223);const i=t(1957);const{getResolveErrorBodyCallback:n}=t(4871);const{AsyncResource:g}=t(852);const{addSignal:C,removeSignal:E}=t(5057);class RequestHandler extends g{constructor(A,e){if(!A||typeof A!=="object"){throw new o("invalid opts")}const{signal:t,method:s,opaque:r,body:n,onInfo:g,responseHeaders:E,throwOnError:Q,highWaterMark:I}=A;try{if(typeof e!=="function"){throw new o("invalid callback")}if(I&&(typeof I!=="number"||I<0)){throw new o("invalid highWaterMark")}if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new o("signal must be an EventEmitter or EventTarget")}if(s==="CONNECT"){throw new o("invalid method")}if(g&&typeof g!=="function"){throw new o("invalid onInfo callback")}super("UNDICI_REQUEST")}catch(A){if(i.isStream(n)){i.destroy(n.on("error",i.nop),A)}throw A}this.responseHeaders=E||null;this.opaque=r||null;this.callback=e;this.res=null;this.abort=null;this.body=n;this.trailers={};this.context=null;this.onInfo=g||null;this.throwOnError=Q;this.highWaterMark=I;if(i.isStream(n)){n.on("error",(A=>{this.onError(A)}))}C(this,t)}onConnect(A,e){if(!this.callback){throw new r}this.abort=A;this.context=e}onHeaders(A,e,t,o){const{callback:r,opaque:g,abort:C,context:E,responseHeaders:Q,highWaterMark:I}=this;const B=Q==="raw"?i.parseRawHeaders(e):i.parseHeaders(e);if(A<200){if(this.onInfo){this.onInfo({statusCode:A,headers:B})}return}const a=Q==="raw"?i.parseHeaders(e):B;const c=a["content-type"];const h=new s({resume:t,abort:C,contentType:c,highWaterMark:I});this.callback=null;this.res=h;if(r!==null){if(this.throwOnError&&A>=400){this.runInAsyncScope(n,null,{callback:r,body:h,contentType:c,statusCode:A,statusMessage:o,headers:B})}else{this.runInAsyncScope(r,null,null,{statusCode:A,headers:B,trailers:this.trailers,opaque:g,body:h,context:E})}}}onData(A){const{res:e}=this;return e.push(A)}onComplete(A){const{res:e}=this;E(this);i.parseHeaders(A,this.trailers);e.push(null)}onError(A){const{res:e,callback:t,body:s,opaque:o}=this;E(this);if(t){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(t,null,A,{opaque:o})}))}if(e){this.res=null;queueMicrotask((()=>{i.destroy(e,A)}))}if(s){this.body=null;i.destroy(s,A)}}}function request(A,e){if(e===undefined){return new Promise(((e,t)=>{request.call(this,A,((A,s)=>A?t(A):e(s)))}))}try{this.dispatch(A,new RequestHandler(A,e))}catch(t){if(typeof e!=="function"){throw t}const s=A&&A.opaque;queueMicrotask((()=>e(t,{opaque:s})))}}A.exports=request},7654:(A,e,t)=>{"use strict";const{finished:s,PassThrough:o}=t(2781);const{InvalidArgumentError:r,InvalidReturnValueError:i,RequestAbortedError:n}=t(223);const g=t(1957);const{getResolveErrorBodyCallback:C}=t(4871);const{AsyncResource:E}=t(852);const{addSignal:Q,removeSignal:I}=t(5057);class StreamHandler extends E{constructor(A,e,t){if(!A||typeof A!=="object"){throw new r("invalid opts")}const{signal:s,method:o,opaque:i,body:n,onInfo:C,responseHeaders:E,throwOnError:I}=A;try{if(typeof t!=="function"){throw new r("invalid callback")}if(typeof e!=="function"){throw new r("invalid factory")}if(s&&typeof s.on!=="function"&&typeof s.addEventListener!=="function"){throw new r("signal must be an EventEmitter or EventTarget")}if(o==="CONNECT"){throw new r("invalid method")}if(C&&typeof C!=="function"){throw new r("invalid onInfo callback")}super("UNDICI_STREAM")}catch(A){if(g.isStream(n)){g.destroy(n.on("error",g.nop),A)}throw A}this.responseHeaders=E||null;this.opaque=i||null;this.factory=e;this.callback=t;this.res=null;this.abort=null;this.context=null;this.trailers=null;this.body=n;this.onInfo=C||null;this.throwOnError=I||false;if(g.isStream(n)){n.on("error",(A=>{this.onError(A)}))}Q(this,s)}onConnect(A,e){if(!this.callback){throw new n}this.abort=A;this.context=e}onHeaders(A,e,t,r){const{factory:n,opaque:E,context:Q,callback:I,responseHeaders:B}=this;const a=B==="raw"?g.parseRawHeaders(e):g.parseHeaders(e);if(A<200){if(this.onInfo){this.onInfo({statusCode:A,headers:a})}return}this.factory=null;let c;if(this.throwOnError&&A>=400){const t=B==="raw"?g.parseHeaders(e):a;const s=t["content-type"];c=new o;this.callback=null;this.runInAsyncScope(C,null,{callback:I,body:c,contentType:s,statusCode:A,statusMessage:r,headers:a})}else{c=this.runInAsyncScope(n,null,{statusCode:A,headers:a,opaque:E,context:Q});if(!c||typeof c.write!=="function"||typeof c.end!=="function"||typeof c.on!=="function"){throw new i("expected Writable")}s(c,{readable:false},(A=>{const{callback:e,res:t,opaque:s,trailers:o,abort:r}=this;this.res=null;if(A||!t.readable){g.destroy(t,A)}this.callback=null;this.runInAsyncScope(e,null,A||null,{opaque:s,trailers:o});if(A){r()}}))}c.on("drain",t);this.res=c;const h=c.writableNeedDrain!==undefined?c.writableNeedDrain:c._writableState&&c._writableState.needDrain;return h!==true}onData(A){const{res:e}=this;return e.write(A)}onComplete(A){const{res:e}=this;I(this);this.trailers=g.parseHeaders(A);e.end()}onError(A){const{res:e,callback:t,opaque:s,body:o}=this;I(this);this.factory=null;if(e){this.res=null;g.destroy(e,A)}else if(t){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(t,null,A,{opaque:s})}))}if(o){this.body=null;g.destroy(o,A)}}}function stream(A,e,t){if(t===undefined){return new Promise(((t,s)=>{stream.call(this,A,e,((A,e)=>A?s(A):t(e)))}))}try{this.dispatch(A,new StreamHandler(A,e,t))}catch(e){if(typeof t!=="function"){throw e}const s=A&&A.opaque;queueMicrotask((()=>t(e,{opaque:s})))}}A.exports=stream},1027:(A,e,t)=>{"use strict";const{InvalidArgumentError:s,RequestAbortedError:o,SocketError:r}=t(223);const{AsyncResource:i}=t(852);const n=t(1957);const{addSignal:g,removeSignal:C}=t(5057);const E=t(9491);class UpgradeHandler extends i{constructor(A,e){if(!A||typeof A!=="object"){throw new s("invalid opts")}if(typeof e!=="function"){throw new s("invalid callback")}const{signal:t,opaque:o,responseHeaders:r}=A;if(t&&typeof t.on!=="function"&&typeof t.addEventListener!=="function"){throw new s("signal must be an EventEmitter or EventTarget")}super("UNDICI_UPGRADE");this.responseHeaders=r||null;this.opaque=o||null;this.callback=e;this.abort=null;this.context=null;g(this,t)}onConnect(A,e){if(!this.callback){throw new o}this.abort=A;this.context=null}onHeaders(){throw new r("bad upgrade",null)}onUpgrade(A,e,t){const{callback:s,opaque:o,context:r}=this;E.strictEqual(A,101);C(this);this.callback=null;const i=this.responseHeaders==="raw"?n.parseRawHeaders(e):n.parseHeaders(e);this.runInAsyncScope(s,null,null,{headers:i,socket:t,opaque:o,context:r})}onError(A){const{callback:e,opaque:t}=this;C(this);if(e){this.callback=null;queueMicrotask((()=>{this.runInAsyncScope(e,null,A,{opaque:t})}))}}}function upgrade(A,e){if(e===undefined){return new Promise(((e,t)=>{upgrade.call(this,A,((A,s)=>A?t(A):e(s)))}))}try{const t=new UpgradeHandler(A,e);this.dispatch({...A,method:A.method||"GET",upgrade:A.protocol||"Websocket"},t)}catch(t){if(typeof e!=="function"){throw t}const s=A&&A.opaque;queueMicrotask((()=>e(t,{opaque:s})))}}A.exports=upgrade},740:(A,e,t)=>{"use strict";A.exports.request=t(7634);A.exports.stream=t(7654);A.exports.pipeline=t(412);A.exports.upgrade=t(1027);A.exports.connect=t(35)},8478:(A,e,t)=>{"use strict";const s=t(9491);const{Readable:o}=t(2781);const{RequestAbortedError:r,NotSupportedError:i,InvalidArgumentError:n}=t(223);const g=t(1957);const{ReadableStreamFrom:C,toUSVString:E}=t(1957);let Q;const I=Symbol("kConsume");const B=Symbol("kReading");const a=Symbol("kBody");const c=Symbol("abort");const h=Symbol("kContentType");A.exports=class BodyReadable extends o{constructor({resume:A,abort:e,contentType:t="",highWaterMark:s=64*1024}){super({autoDestroy:true,read:A,highWaterMark:s});this._readableState.dataEmitted=false;this[c]=e;this[I]=null;this[a]=null;this[h]=t;this[B]=false}destroy(A){if(this.destroyed){return this}if(!A&&!this._readableState.endEmitted){A=new r}if(A){this[c]()}return super.destroy(A)}emit(A,...e){if(A==="data"){this._readableState.dataEmitted=true}else if(A==="error"){this._readableState.errorEmitted=true}return super.emit(A,...e)}on(A,...e){if(A==="data"||A==="readable"){this[B]=true}return super.on(A,...e)}addListener(A,...e){return this.on(A,...e)}off(A,...e){const t=super.off(A,...e);if(A==="data"||A==="readable"){this[B]=this.listenerCount("data")>0||this.listenerCount("readable")>0}return t}removeListener(A,...e){return this.off(A,...e)}push(A){if(this[I]&&A!==null&&this.readableLength===0){consumePush(this[I],A);return this[B]?super.push(A):true}return super.push(A)}async text(){return consume(this,"text")}async json(){return consume(this,"json")}async blob(){return consume(this,"blob")}async arrayBuffer(){return consume(this,"arrayBuffer")}async formData(){throw new i}get bodyUsed(){return g.isDisturbed(this)}get body(){if(!this[a]){this[a]=C(this);if(this[I]){this[a].getReader();s(this[a].locked)}}return this[a]}async dump(A){let e=A&&Number.isFinite(A.limit)?A.limit:262144;const t=A&&A.signal;const abortFn=()=>{this.destroy()};if(t){if(typeof t!=="object"||!("aborted"in t)){throw new n("signal must be an AbortSignal")}g.throwIfAborted(t);t.addEventListener("abort",abortFn,{once:true})}try{for await(const A of this){g.throwIfAborted(t);e-=Buffer.byteLength(A);if(e<0){return}}}catch{g.throwIfAborted(t)}finally{if(t){t.removeEventListener("abort",abortFn)}}}};function isLocked(A){return A[a]&&A[a].locked===true||A[I]}function isUnusable(A){return g.isDisturbed(A)||isLocked(A)}async function consume(A,e){if(isUnusable(A)){throw new TypeError("unusable")}s(!A[I]);return new Promise(((t,s)=>{A[I]={type:e,stream:A,resolve:t,reject:s,length:0,body:[]};A.on("error",(function(A){consumeFinish(this[I],A)})).on("close",(function(){if(this[I].body!==null){consumeFinish(this[I],new r)}}));process.nextTick(consumeStart,A[I])}))}function consumeStart(A){if(A.body===null){return}const{_readableState:e}=A.stream;for(const t of e.buffer){consumePush(A,t)}if(e.endEmitted){consumeEnd(this[I])}else{A.stream.on("end",(function(){consumeEnd(this[I])}))}A.stream.resume();while(A.stream.read()!=null){}}function consumeEnd(A){const{type:e,body:s,resolve:o,stream:r,length:i}=A;try{if(e==="text"){o(E(Buffer.concat(s)))}else if(e==="json"){o(JSON.parse(Buffer.concat(s)))}else if(e==="arrayBuffer"){const A=new Uint8Array(i);let e=0;for(const t of s){A.set(t,e);e+=t.byteLength}o(A)}else if(e==="blob"){if(!Q){Q=t(4300).Blob}o(new Q(s,{type:r[h]}))}consumeFinish(A)}catch(A){r.destroy(A)}}function consumePush(A,e){A.length+=e.length;A.body.push(e)}function consumeFinish(A,e){if(A.body===null){return}if(e){A.reject(e)}else{A.resolve()}A.type=null;A.stream=null;A.resolve=null;A.reject=null;A.length=0;A.body=null}},4871:(A,e,t)=>{const s=t(9491);const{ResponseStatusCodeError:o}=t(223);const{toUSVString:r}=t(1957);async function getResolveErrorBodyCallback({callback:A,body:e,contentType:t,statusCode:i,statusMessage:n,headers:g}){s(e);let C=[];let E=0;for await(const A of e){C.push(A);E+=A.length;if(E>128*1024){C=null;break}}if(i===204||!t||!C){process.nextTick(A,new o(`Response status code ${i}${n?`: ${n}`:""}`,i,g));return}try{if(t.startsWith("application/json")){const e=JSON.parse(r(Buffer.concat(C)));process.nextTick(A,new o(`Response status code ${i}${n?`: ${n}`:""}`,i,g,e));return}if(t.startsWith("text/")){const e=r(Buffer.concat(C));process.nextTick(A,new o(`Response status code ${i}${n?`: ${n}`:""}`,i,g,e));return}}catch(A){}process.nextTick(A,new o(`Response status code ${i}${n?`: ${n}`:""}`,i,g))}A.exports={getResolveErrorBodyCallback:getResolveErrorBodyCallback}},7238:(A,e,t)=>{"use strict";const{BalancedPoolMissingUpstreamError:s,InvalidArgumentError:o}=t(223);const{PoolBase:r,kClients:i,kNeedDrain:n,kAddClient:g,kRemoveClient:C,kGetDispatcher:E}=t(1051);const Q=t(1820);const{kUrl:I,kInterceptors:B}=t(2270);const{parseOrigin:a}=t(1957);const c=Symbol("factory");const h=Symbol("options");const l=Symbol("kGreatestCommonDivisor");const u=Symbol("kCurrentWeight");const d=Symbol("kIndex");const f=Symbol("kWeight");const y=Symbol("kMaxWeightPerServer");const D=Symbol("kErrorPenalty");function getGreatestCommonDivisor(A,e){if(e===0)return A;return getGreatestCommonDivisor(e,A%e)}function defaultFactory(A,e){return new Q(A,e)}class BalancedPool extends r{constructor(A=[],{factory:e=defaultFactory,...t}={}){super();this[h]=t;this[d]=-1;this[u]=0;this[y]=this[h].maxWeightPerServer||100;this[D]=this[h].errorPenalty||15;if(!Array.isArray(A)){A=[A]}if(typeof e!=="function"){throw new o("factory must be a function.")}this[B]=t.interceptors&&t.interceptors.BalancedPool&&Array.isArray(t.interceptors.BalancedPool)?t.interceptors.BalancedPool:[];this[c]=e;for(const e of A){this.addUpstream(e)}this._updateBalancedPoolStats()}addUpstream(A){const e=a(A).origin;if(this[i].find((A=>A[I].origin===e&&A.closed!==true&&A.destroyed!==true))){return this}const t=this[c](e,Object.assign({},this[h]));this[g](t);t.on("connect",(()=>{t[f]=Math.min(this[y],t[f]+this[D])}));t.on("connectionError",(()=>{t[f]=Math.max(1,t[f]-this[D]);this._updateBalancedPoolStats()}));t.on("disconnect",((...A)=>{const e=A[2];if(e&&e.code==="UND_ERR_SOCKET"){t[f]=Math.max(1,t[f]-this[D]);this._updateBalancedPoolStats()}}));for(const A of this[i]){A[f]=this[y]}this._updateBalancedPoolStats();return this}_updateBalancedPoolStats(){this[l]=this[i].map((A=>A[f])).reduce(getGreatestCommonDivisor,0)}removeUpstream(A){const e=a(A).origin;const t=this[i].find((A=>A[I].origin===e&&A.closed!==true&&A.destroyed!==true));if(t){this[C](t)}return this}get upstreams(){return this[i].filter((A=>A.closed!==true&&A.destroyed!==true)).map((A=>A[I].origin))}[E](){if(this[i].length===0){throw new s}const A=this[i].find((A=>!A[n]&&A.closed!==true&&A.destroyed!==true));if(!A){return}const e=this[i].map((A=>A[n])).reduce(((A,e)=>A&&e),true);if(e){return}let t=0;let o=this[i].findIndex((A=>!A[n]));while(t++<this[i].length){this[d]=(this[d]+1)%this[i].length;const A=this[i][this[d]];if(A[f]>this[i][o][f]&&!A[n]){o=this[d]}if(this[d]===0){this[u]=this[u]-this[l];if(this[u]<=0){this[u]=this[y]}}if(A[f]>=this[u]&&!A[n]){return A}}this[u]=this[i][o][f];this[d]=o;return this[i][o]}}A.exports=BalancedPool},8978:(A,e,t)=>{"use strict";const s=t(9491);const o=t(1808);const r=t(1957);const i=t(7562);const n=t(87);const g=t(9291);const{RequestContentLengthMismatchError:C,ResponseContentLengthMismatchError:E,InvalidArgumentError:Q,RequestAbortedError:I,HeadersTimeoutError:B,HeadersOverflowError:a,SocketError:c,InformationalError:h,BodyTimeoutError:l,HTTPParserError:u,ResponseExceededMaxSizeError:d,ClientDestroyedError:f}=t(223);const y=t(7814);const{kUrl:D,kReset:k,kServerName:w,kClient:S,kBusy:p,kParser:N,kConnect:R,kBlocking:b,kResuming:m,kRunning:F,kPending:L,kSize:M,kWriting:U,kQueue:Y,k