var Particle;(()=>{var e={9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),h=0,l=u>0?a-4:a;for(r=0;r>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;sc?c:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";const n=r(9742),o=r(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?s(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return h(e),s(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(o)return n?-1:G(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;is&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),h=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function O(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function C(e,t,r,n,o){F(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function M(e,t,r,n,o){F(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function N(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||j(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||j(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Q((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||j(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,!n){L(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Q((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Q((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function F(e,t,r,n,o,i){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new $.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new $.ERR_BUFFER_OUT_OF_BOUNDS;throw new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Q(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},584:e=>{e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},1924:(e,t,r)=>{"use strict";var n=r(210),o=r(5559),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),o=r(210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),h=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=s(n,a,arguments);u&&c&&(u(t,"length").configurable&&c(t,"length",{value:1+h(0,e.length-(arguments.length-1))}));return t};var l=function(){return s(n,i,arguments)};c?c(e.exports,"apply",{value:l}):e.exports.apply=l},7187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,o,{once:!0})}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=h.bind(n);return o.listener=r,n.wrapFn=o,o}function f(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,h=p(u,c);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return f(this,e,!0)},i.prototype.rawListeners=function(e){return f(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},6230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},7648:e=>{"use strict";var t=Array.prototype.slice,r=Object.prototype.toString;e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var o,i=t.call(arguments,1),a=Math.max(0,n.length-i.length),s=[],u=0;u{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var c=function(){throw new a},h=u?function(){try{return c}catch(e){try{return u(arguments,"callee").get}catch(e){return c}}}():c,l=r(1405)(),f=r(8185)(),d=Object.getPrototypeOf||(f?function(e){return e.__proto__}:null),p={},y="undefined"!=typeof Uint8Array&&d?d(Uint8Array):n,g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l&&d?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l&&d?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l&&d?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l&&d?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l&&d?d(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":h,"%TypedArray%":y,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(d)try{null.error}catch(e){var m=d(d(e));g["%Error.prototype%"]=m}var v=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&d&&(r=d(o.prototype))}return g[t]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=r(8612),_=r(7642),x=w.call(Function.call,Array.prototype.concat),S=w.call(Function.apply,Array.prototype.splice),E=w.call(Function.call,String.prototype.replace),A=w.call(Function.call,String.prototype.slice),T=w.call(Function.call,RegExp.prototype.exec),R=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,k=function(e,t){var r,n=e;if(_(b,n)&&(n="%"+(r=b[n])[0]+"%"),_(g,n)){var i=g[n];if(i===p&&(i=v(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=A(e,0,1),r=A(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return E(e,R,(function(e,t,r,o){n[n.length]=r?E(o,O,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=k("%"+n+"%",t),s=i.name,c=i.value,h=!1,l=i.alias;l&&(n=l[0],S(r,x([0,1],l)));for(var f=1,d=!0;f=r.length){var v=u(c,p);c=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[p]}else d=_(c,p),c=c[p];d&&!h&&(g[s]=c)}}return c}},8185:e=>{"use strict";var t={foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof r)}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(5419);e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},7642:(e,t,r)=>{"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,h=-7,l=r?o-1:0,f=r?-1:1,d=e[t+l];for(l+=f,i=d&(1<<-h)-1,d>>=-h,h+=s;h>0;i=256*i+e[t+l],l+=f,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;h>0;a=256*a+e[t+l],l+=f,h-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,h=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?f/u:f*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(t*u-1)*Math.pow(2,o),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=p,s/=256,o-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,c-=8);e[r+d-p]|=128*y}},3300:(e,t,r)=>{"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();e.exports=t=n.fetch,n.fetch&&(t.default=n.fetch.bind(n)),t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response},4155:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,u=[],c=!1,h=-1;function l(){c&&s&&(c=!1,s.length?u=s.concat(u):h=-1,u.length&&f())}function f(){if(!c){var e=a(l);c=!0;for(var t=u.length;t;){for(s=u,u=[];++h1)for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-c,_=Math.floor,x=String.fromCharCode;function S(e){throw new RangeError(b[e])}function E(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function A(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+E((e=e.replace(v,".")).split("."),t).join(".")}function T(e){for(var t,r,n=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=x((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=x(e)})).join("")}function O(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var n=0;for(e=r?_(e/f):e>>1,e+=_(e/t);e>w*h>>1;n+=u)e=_(e/w);return _(n+(w+1)*e/(e+l))}function I(e){var t,r,n,o,i,a,l,f,g,m,v,b=[],w=e.length,x=0,E=p,A=d;for((r=e.lastIndexOf(y))<0&&(r=0),n=0;n=128&&S("not-basic"),b.push(e.charCodeAt(n));for(o=r>0?r+1:0;o=w&&S("invalid-input"),((f=(v=e.charCodeAt(o++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:u)>=u||f>_((s-x)/a))&&S("overflow"),x+=f*a,!(f<(g=l<=A?c:l>=A+h?h:l-A));l+=u)a>_(s/(m=u-g))&&S("overflow"),a*=m;A=k(x-i,t=b.length+1,0==i),_(x/t)>s-E&&S("overflow"),E+=_(x/t),x%=t,b.splice(x++,0,E)}return R(b)}function P(e){var t,r,n,o,i,a,l,f,g,m,v,b,w,E,A,R=[];for(b=(e=T(e)).length,t=p,r=0,i=d,a=0;a=t&&v_((s-r)/(w=n+1))&&S("overflow"),r+=(l-t)*w,t=l,a=0;as&&S("overflow"),v==t){for(f=r,g=u;!(f<(m=g<=i?c:g>=i+h?h:g-i));g+=u)A=f-m,E=u-m,R.push(x(O(m+A%E,0))),f=_(A/E);R.push(x(O(f,0))),i=k(r,w,n==o),r=0,++n}++r,++t}return R.join("")}a={version:"1.4.1",ucs2:{decode:T,encode:R},decode:I,encode:P,toASCII:function(e){return A(e,(function(e){return m.test(e)?"xn--"+P(e):e}))},toUnicode:function(e){return A(e,(function(e){return g.test(e)?I(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},5798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC1738",o="RFC3986";e.exports={default:o,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n,RFC3986:o}},129:(e,t,r)=>{"use strict";var n=r(8261),o=r(5235),i=r(5798);e.exports={formats:i,parse:o,stringify:n}},5235:(e,t,r)=>{"use strict";var n=r(2769),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),c=s?i.slice(0,s.index):i,h=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;h.push(c)}for(var l=0;r.depth>0&&null!==(s=a.exec(i))&&l=0;--i){var a,s=e[i];if("[]"===s&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,h=parseInt(c,10);r.parseArrays||""!==c?!isNaN(h)&&s!==c&&String(h)===c&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[])[h]=o:"__proto__"!==c&&(a[c]=o):a={0:o}}o=a}return o}(h,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var h="string"==typeof e?function(e,t){var r,c={__proto__:null},h=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,l=t.parameterLimit===1/0?void 0:t.parameterLimit,f=h.split(t.delimiter,l),d=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(g=i(g)?[g]:g),o.call(c,y)?c[y]=n.combine(c[y],g):c[y]=g}return c}(e,r):e,l=r.plainObjects?Object.create(null):{},f=Object.keys(h),d=0;d{"use strict";var n=r(7478),o=r(2769),i=r(5798),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},u=Array.isArray,c=Array.prototype.push,h=function(e,t){c.apply(e,u(t)?t:[t])},l=Date.prototype.toISOString,f=i.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},p={},y=function e(t,r,i,a,s,c,l,f,y,g,m,v,b,w,_,x){for(var S,E=t,A=x,T=0,R=!1;void 0!==(A=A.get(p))&&!R;){var O=A.get(t);if(T+=1,void 0!==O){if(O===T)throw new RangeError("Cyclic object value");R=!0}void 0===A.get(p)&&(T=0)}if("function"==typeof f?E=f(r,E):E instanceof Date?E=m(E):"comma"===i&&u(E)&&(E=o.maybeMap(E,(function(e){return e instanceof Date?m(e):e}))),null===E){if(s)return l&&!w?l(r,d.encoder,_,"key",v):r;E=""}if("string"==typeof(S=E)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||o.isBuffer(E))return l?[b(w?r:l(r,d.encoder,_,"key",v))+"="+b(l(E,d.encoder,_,"value",v))]:[b(r)+"="+b(String(E))];var k,I=[];if(void 0===E)return I;if("comma"===i&&u(E))w&&l&&(E=o.maybeMap(E,l)),k=[{value:E.length>0?E.join(",")||null:void 0}];else if(u(f))k=f;else{var P=Object.keys(E);k=y?P.sort(y):P}for(var j=a&&u(E)&&1===E.length?r+"[]":r,L=0;L0?_+w:""}},2769:(e,t,r)=>{"use strict";var n=r(5798),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||i===n.RFC1738&&(40===h||41===h)?u+=s.charAt(c):h<128?u+=a[h]:h<2048?u+=a[192|h>>6]+a[128|63&h]:h<55296||h>=57344?u+=a[224|h>>12]+a[128|h>>6&63]+a[128|63&h]:(c+=1,h=65536+((1023&h)<<10|1023&s.charCodeAt(c)),u+=a[240|h>>18]+a[128|h>>12&63]+a[128|h>>6&63]+a[128|63&h])}return u},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n{"use strict";var n=r(210),o=r(1924),i=r(7470),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),h=o("WeakMap.prototype.set",!0),l=o("WeakMap.prototype.has",!0),f=o("Map.prototype.get",!0),d=o("Map.prototype.set",!0),p=o("Map.prototype.has",!0),y=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new a("Side channel does not contain "+i(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(u){if(t)return f(t,n)}else if(r)return function(e,t){var r=y(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return l(e,n)}else if(u){if(t)return p(t,n)}else if(r)return function(e,t){return!!y(e,t)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),h(e,n,o)):u?(t||(t=new u),d(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=y(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n}},7470:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,h=s&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,_=String.prototype.toLowerCase,x=RegExp.prototype.test,S=Array.prototype.concat,E=Array.prototype.join,A=Array.prototype.slice,T=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,O=Object.getOwnPropertySymbols,k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,I="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===I||"symbol")?Symbol.toStringTag:null,j=Object.prototype.propertyIsEnumerable,L=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function C(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||x.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-T(-e):T(e);if(n!==e){var o=String(n),i=v.call(t,o.length+1);return b.call(o,r,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var M=r(7165),N=M.custom,B=F(N)?N:null;function U(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function $(e){return b.call(String(e),/"/g,""")}function D(e){return!("[object Array]"!==V(e)||P&&"object"==typeof e&&P in e)}function q(e){return!("[object RegExp]"!==V(e)||P&&"object"==typeof e&&P in e)}function F(e){if(I)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!k)return!1;try{return k.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,o){var s=r||{};if(W(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!W(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=s.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return z(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return y?C(t,w):w}if("bigint"==typeof t){var x=String(t)+"n";return y?C(t,x):x}var T=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=T&&T>0&&"object"==typeof t)return D(t)?"[Array]":"[Object]";var O=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=E.call(Array(e.indent+1)," ")}return{base:r,prev:E.call(Array(t+1),r)}}(s,n);if(void 0===o)o=[];else if(G(o,t)>=0)return"[Circular]";function N(t,r,i){if(r&&(o=A.call(o)).push(r),i){var a={depth:s.depth};return W(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,n+1,o)}return e(t,s,n+1,o)}if("function"==typeof t&&!q(t)){var H=function(e){if(e.name)return e.name;var t=m.call(g.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),K=Z(t,N);return"[Function"+(H?": "+H:" (anonymous)")+"]"+(K.length>0?" { "+E.call(K,", ")+" }":"")}if(F(t)){var ee=I?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(t);return"object"!=typeof t||I?ee:Y(ee)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var te="<"+_.call(String(t.nodeName)),re=t.attributes||[],ne=0;ne"}if(D(t)){if(0===t.length)return"[]";var oe=Z(t,N);return O&&!function(e){for(var t=0;t=0)return!1;return!0}(oe)?"["+Q(oe,O)+"]":"[ "+E.call(oe,", ")+" ]"}if(function(e){return!("[object Error]"!==V(e)||P&&"object"==typeof e&&P in e)}(t)){var ie=Z(t,N);return"cause"in Error.prototype||!("cause"in t)||j.call(t,"cause")?0===ie.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(ie,", ")+" }":"{ ["+String(t)+"] "+E.call(S.call("[cause]: "+N(t.cause),ie),", ")+" }"}if("object"==typeof t&&u){if(B&&"function"==typeof t[B]&&M)return M(t,{depth:T-n});if("symbol"!==u&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ae=[];return a&&a.call(t,(function(e,r){ae.push(N(r,t,!0)+" => "+N(e,t))})),X("Map",i.call(t),ae,O)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var se=[];return h&&h.call(t,(function(e){se.push(N(e,t))})),X("Set",c.call(t),se,O)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return J("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{l.call(e,l)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return J("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return J("WeakRef");if(function(e){return!("[object Number]"!==V(e)||P&&"object"==typeof e&&P in e)}(t))return Y(N(Number(t)));if(function(e){if(!e||"object"!=typeof e||!R)return!1;try{return R.call(e),!0}catch(e){}return!1}(t))return Y(N(R.call(t)));if(function(e){return!("[object Boolean]"!==V(e)||P&&"object"==typeof e&&P in e)}(t))return Y(p.call(t));if(function(e){return!("[object String]"!==V(e)||P&&"object"==typeof e&&P in e)}(t))return Y(N(String(t)));if(!function(e){return!("[object Date]"!==V(e)||P&&"object"==typeof e&&P in e)}(t)&&!q(t)){var ue=Z(t,N),ce=L?L(t)===Object.prototype:t instanceof Object||t.constructor===Object,he=t instanceof Object?"":"null prototype",le=!ce&&P&&Object(t)===t&&P in t?v.call(V(t),8,-1):he?"Object":"",fe=(ce||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(le||he?"["+E.call(S.call([],le||[],he||[]),": ")+"] ":"");return 0===ue.length?fe+"{}":O?fe+"{"+Q(ue,O)+"}":fe+"{ "+E.call(ue,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function W(e,t){return H.call(e,t)}function V(e){return y.call(e)}function G(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;rt.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return z(v.call(e,0,t.maxStringLength),t)+n}return U(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Y(e){return"Object("+e+")"}function J(e){return e+" { ? }"}function X(e,t,r,n){return e+" ("+t+") {"+(n?Q(r,n):E.call(r,", "))+"}"}function Q(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+E.call(e,","+r)+"\n"+t.prev}function Z(e,t){var r=D(e),n=[];if(r){n.length=e.length;for(var o=0;o{var n=r(1989),o=r(5676),i=r(8234),a=r(584),s=r(8575),u=t;u.request=function(e,t){e="string"==typeof e?s.parse(e):i(e);var o=-1===r.g.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||o,u=e.hostname||e.host,c=e.port,h=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?a+"//"+u:"")+(c?":"+c:"")+h,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new n(e);return t&&l.on("response",t),l},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=o.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},8725:(e,t,r)=>{var n;function o(){if(void 0!==n)return n;if(r.g.XMLHttpRequest){n=new r.g.XMLHttpRequest;try{n.open("GET",r.g.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function i(e){var t=o();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}t.fetch=a(r.g.fetch)&&a(r.g.ReadableStream),t.writableStream=a(r.g.WritableStream),t.abortController=a(r.g.AbortController),t.arraybuffer=t.fetch||i("arraybuffer"),t.msstream=!t.fetch&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!o()&&a(o().overrideMimeType),n=null},1989:(e,t,r)=>{var n=r(8764).Buffer,o=r(4155),i=r(8725),a=r(1183),s=r(5676),u=r(925),c=s.IncomingMessage,h=s.readyStates;var l=e.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+n.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var o=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)o=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!i.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":"text"}(t,o),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};a(l,u.Writable),l.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===f.indexOf(r)&&(this._headers[r]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var n=e._headers,a=null;"GET"!==t.method&&"HEAD"!==t.method&&(a=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var s=[];if(Object.keys(n).forEach((function(e){var t=n[e].name,r=n[e].value;Array.isArray(r)?r.forEach((function(e){s.push([t,e])})):s.push([t,r])})),"fetch"===e._mode){var u=null;if(i.abortController){var c=new AbortController;u=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=r.g.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}r.g.fetch(e._opts.url,{method:e._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:u}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var l=e._xhr=new r.g.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){l.setRequestHeader(e[0],e[1])})),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case h.LOADING:case h.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{l.send(a)}catch(t){return void o.nextTick((function(){e.emit("error",t)}))}}}},l.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new c(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},l.prototype._write=function(e,t,r){this._body.push(e),r()},l.prototype._resetTimers=function(e){var t=this;r.g.clearTimeout(t._socketTimer),t._socketTimer=null,e?(r.g.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=r.g.setTimeout((function(){t.emit("timeout")}),t._socketTimeout))},l.prototype.abort=l.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},l.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},l.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},l.prototype.flushHeaders=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},5676:(e,t,r)=>{var n=r(4155),o=r(8764).Buffer,i=r(8725),a=r(1183),s=r(925),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(e,t,r,a){var u=this;if(s.Readable.call(u),u._mode=r,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){n.nextTick((function(){u.emit("close")}))})),"fetch"===r){if(u._fetchResponse=t,u.url=t.url,u.statusCode=t.status,u.statusMessage=t.statusText,t.headers.forEach((function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)})),i.writableStream){var c=new WritableStream({write:function(e){return a(!1),new Promise((function(t,r){u._destroyed?r():u.push(o.from(e))?t():u._resumeFetch=t}))},close:function(){a(!0),u._destroyed||u.push(null)},abort:function(e){a(!0),u._destroyed||u.emit("error",e)}});try{return void t.body.pipeTo(c).catch((function(e){a(!0),u._destroyed||u.emit("error",e)}))}catch(e){}}var h=t.body.getReader();!function e(){h.read().then((function(t){u._destroyed||(a(t.done),t.done?u.push(null):(u.push(o.from(t.value)),e()))})).catch((function(e){a(!0),u._destroyed||u.emit("error",e)}))}()}else{if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}})),u._charset="x-user-defined",!i.overrideMimeType){var l=u.rawHeaders["mime-type"];if(l){var f=l.match(/;\s*charset=([^;])(;|$)/);f&&(u._charset=f[1].toLowerCase())}u._charset||(u._charset="utf-8")}}};a(c,s.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(e){var t=this,n=t._xhr,i=null;switch(t._mode){case"text":if((i=n.responseText).length>t._pos){var a=i.substr(t._pos);if("x-user-defined"===t._charset){for(var s=o.alloc(a.length),c=0;ct._pos&&(t.push(o.from(new Uint8Array(h.result.slice(t._pos)))),t._pos=h.result.byteLength)},h.onload=function(){e(!0),t.push(null)},h.readAsArrayBuffer(i)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}},1183:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7303:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var o,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(n(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},9560:(e,t,r)=>{"use strict";var n=r(4155),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=h;var i=r(4002),a=r(3313);r(1183)(h,i);for(var s=o(a.prototype),u=0;u{"use strict";e.exports=o;var n=r(1846);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(1183)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},4002:(e,t,r)=>{"use strict";var n,o=r(4155);e.exports=A,A.ReadableState=E;r(7187).EventEmitter;var i=function(e,t){return e.listeners(t).length},a=r(1463),s=r(8764).Buffer,u=r.g.Uint8Array||function(){};var c,h=r(3646);c=h&&h.debuglog?h.debuglog("stream"):function(){};var l,f,d,p=r(6641),y=r(3369),g=r(624).getHighWaterMark,m=r(7303).q,v=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1183)(A,a);var x=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(e,t,o){n=n||r(9560),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",o),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(636).s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function A(e){if(n=n||r(9560),!(this instanceof A))return new A(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function T(e,t,r,n,o){c("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}(e,a);else if(o||(i=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),i)x(e,i);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?x(e,new _):R(e,a,t,!0);else if(a.ended)x(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?R(e,a,t,!1):j(e,a)):R(e,a,t,!1)}else n||(a.reading=!1,j(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(P,e))}function P(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function j(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){c("readable nexttick read 0"),e.read(0)}function N(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function $(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(D,t,e))}function D(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function q(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?$(this):I(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&$(this),null;var n,o=t.needReadable;return c("need readable",o),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&$(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){x(this,new w("_read()"))},A.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var a=(!t||!1!==t.end)&&e!==o.stdout&&e!==o.stderr?u:g;function s(t,o){c("onunpipe"),t===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",h),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function u(){c("onend"),e.end()}n.endEmitted?o.nextTick(a):r.once("end",a),e.on("unpipe",s);var h=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",h);var l=!1;function f(t){c("ondata");var o=e.write(t);c("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==q(n.pipes,e))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){c("onerror",t),g(),e.removeListener("error",d),0===i(e,"error")&&x(e,t)}function p(){e.removeListener("finish",y),g()}function y(){c("onfinish"),e.removeListener("close",p),g()}function g(){c("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",p),e.once("finish",y),e.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?I(this):n.reading||o.nextTick(M,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(C,this),r},A.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(C,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(N,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(c("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i{"use strict";e.exports=h;var n=r(7303).q,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(9560);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length{"use strict";var n,o=r(4155);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=A,A.WritableState=E;var a={deprecate:r(4927)},s=r(1463),u=r(8764).Buffer,c=r.g.Uint8Array||function(){};var h,l=r(3369),f=r(624).getHighWaterMark,d=r(7303).q,p=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,v=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,x=l.errorOrDestroy;function S(){}function E(e,t,a){n=n||r(9560),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(P,e,t),e._writableState.errorEmitted=!0,x(e,n)):(i(n),e._writableState.errorEmitted=!0,x(e,n),P(e,t))}(e,r,n,t,i);else{var a=k(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||O(e,r),n?o.nextTick(R,e,r,a,i):R(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(e){var t=this instanceof(n=n||r(9560));if(!t&&!h.call(A,this))return new A(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function T(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function R(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,T(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,h=r.encoding,l=r.callback;if(T(e,t,!1,t.objectMode?1:c.length,c,h,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(r){t.pendingcb--,r&&x(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)}))}function P(e,t){var r=k(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(1183)(A,s),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===A&&(e&&e._writableState instanceof E)}})):h=function(e){return e instanceof this},A.prototype.pipe=function(){x(this,new m)},A.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(e,t){var r=new w;x(e,r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new b:"string"==typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(x(e,i),o.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,o,i){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,o);n!==a&&(r=!0,o="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(e,t){t(e)}},6819:(e,t,r)=>{"use strict";var n,o=r(4155);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(5467),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),h=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function g(e){o.nextTick(y,e)}var m=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[h])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){o.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[h]?r(p(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(v,(i(t={},d,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,h,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[l]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[l]=null,r[s]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[h]=!0})),e.on("readable",g.bind(null,r)),r}},6641:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,o=a.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=o,n=s,a.prototype.copy.call(t,r,n),s+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return eo.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return s(this,function(e){for(var t=1;t{"use strict";var n=r(4155);function o(e,t){a(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,e)):n.nextTick(o,r,e):t?(n.nextTick(i,r),t(e)):n.nextTick(i,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},5467:(e,t,r)=>{"use strict";var n=r(7303).q.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9689:(e,t,r)=>{"use strict";var n;var o=r(7303).q,i=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o0,(function(e){h||(h=e),e&&f.forEach(u),i||(f.forEach(u),l(h))}))}));return t.reduce(c)}},624:(e,t,r)=>{"use strict";var n=r(7303).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},1463:(e,t,r)=>{e.exports=r(7187).EventEmitter},925:(e,t,r)=>{(t=e.exports=r(4002)).Stream=t,t.Readable=t,t.Writable=r(3313),t.Duplex=r(9560),t.Transform=r(1846),t.PassThrough=r(4842),t.finished=r(5467),t.pipeline=r(9689)},3738:(e,t,r)=>{var n=r(8764),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},636:(e,t,r)=>{"use strict";var n=r(3738).Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=h,this.end=l,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function h(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return o>0&&(e.lastNeed=o-1),o;if(--n=0)return o>0&&(e.lastNeed=o-2),o;if(--n=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},8234:e=>{e.exports=function(){for(var e={},r=0;r{"use strict";var n=r(4971);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var i=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),l=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(129);function v(e,t,r){if(e&&"object"==typeof e&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o127?j+="x":j+=P[L];if(!j.match(f)){var M=k.slice(0,T),N=k.slice(T+1),B=P.match(d);B&&(M.push(B[1]),N.unshift(B[2])),N.length&&(v="/"+N.join(".")+v),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+U,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!p[_])for(T=0,I=c.length;T0)&&r.host.split("@"))&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname);return r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=x.slice(-1)[0],A=(r.host||e.host||x.length>1)&&("."===E||".."===E)||""===E,T=0,R=x.length;R>=0;R--)"."===(E=x[R])?x.splice(R,1):".."===E?(x.splice(R,1),T++):T&&(x.splice(R,1),T--);if(!w&&!_)for(;T--;T)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),A&&"/"!==x.join("/").substr(-1)&&x.push("");var O,k=""===x[0]||x[0]&&"/"===x[0].charAt(0);S&&(r.hostname=k?"":x.length?x.shift():"",r.host=r.hostname,(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname));return(w=w||r.host&&x.length)&&!k&&x.unshift(""),x.length>0?r.pathname=x.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=v(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o},4927:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},7731:(e,t,r)=>{var n=r(8764).Buffer;const o=r(3300),i=r(6230),a=r(129),s=r(5014),u=r(4147);e.exports=class{constructor(e){this.setBaseUrl(e)}setBaseUrl(e){this.baseUrl=e}get({uri:e,auth:t,headers:r,query:n,context:o}){return this.request({uri:e,method:"get",auth:t,headers:r,query:n,context:o})}head({uri:e,auth:t,headers:r,query:n,context:o}){return this.request({uri:e,method:"head",auth:t,headers:r,query:n,context:o})}post({uri:e,headers:t,data:r,auth:n,context:o}){return this.request({uri:e,method:"post",auth:n,headers:t,data:r,context:o})}put({uri:e,auth:t,headers:r,data:n,query:o,context:i}){return this.request({uri:e,method:"put",auth:t,headers:r,data:n,query:o,context:i})}delete({uri:e,auth:t,headers:r,data:n,context:o}){return this.request({uri:e,method:"delete",auth:t,headers:r,data:n,context:o})}request({uri:e,method:t,headers:r,data:n,auth:o,query:i,form:a,files:s,context:u,isBuffer:c=!1}){const h=this._sanitizeFiles(s),l=this._buildRequest({uri:e,method:t,headers:r,data:n,auth:o,query:i,form:a,context:u,files:h});return this._promiseResponse(l,c)}_promiseResponse(e,t,r=o){let i;return r(...e).then((e=>(i=e.status,e.ok?204===i?"":t?e.blob():e.json():e.text().then((t=>{const r=JSON.parse(t),n=Object.assign(e,{text:t});throw Object.assign(r,{response:n})}))))).then((e=>t?e.arrayBuffer().then((e=>this.isForBrowser()?e:n.from(e))):{body:e,statusCode:i})).catch((t=>{let r,n=`${i?`HTTP error ${i}`:"Network error"} from ${e[0]}`;t.error_description&&(n=`${n} - ${t.error_description}`,r=t.error_description);const o=new Error(n);throw Object.assign(o,{statusCode:i,errorDescription:n,shortErrorDescription:r,error:t,body:t}),o}))}_buildRequest({uri:e,method:t,headers:r,data:n,auth:o,query:i,form:s,files:c,context:h}){let l=e;if(this.baseUrl&&"/"===e[0]&&(l=`${this.baseUrl}${e}`),i){const e=a.stringify(i),t=l.includes("?");l=`${l}${t?"&":"?"}${e}`}const f={"User-Agent":`${u.name}/${u.version} (${u.repository.url})`};let d,p;c?(p={},d=this._getFromData(c,s)):s?(p={"Content-Type":"application/x-www-form-urlencoded"},d=a.stringify(s)):n&&(p={"Content-Type":"application/json"},d=JSON.stringify(n));return[l,{method:t,body:d,headers:Object.assign({},f,p,this._getAuthorizationHeader(o),this._getContextHeaders(h),r)}]}isForBrowser(){return"undefined"!=typeof window}_getFromData(e,t){const r=new i;for(let[t,n]of Object.entries(e)){let e=n.path,o=n.data;if(!this.isForBrowser()){const t=this._getNodeFormData(n);e=t.path,o=t.file}r.append(t,o,e)}if(t)for(let[e,n]of Object.entries(t))r.append(e,n);return r}_getNodeFormData(e){let t=e.data;return"string"==typeof e.data&&(t=s.createReadStream(e.data)),{file:t,path:{filepath:e.path}}}_getContextHeaders(e={}){return Object.assign({},this._getToolContext(e.tool),this._getProjectContext(e.project))}_getToolContext(e={}){let t="";if(e.name&&(t+=this._toolIdent(e),e.components))for(let r of e.components)t+=", "+this._toolIdent(r);return t?{"X-Particle-Tool":t}:{}}_toolIdent(e){return this._nameAtVersion(e.name,e.version)}_nameAtVersion(e,t){let r="";return e&&(r+=e,t&&(r+="@"+t)),r}_getProjectContext(e={}){let t=this._buildSemicolonSeparatedProperties(e,"name");return t?{"X-Particle-Project":t}:{}}_buildSemicolonSeparatedProperties(e,t){let r="";if(e[t]){r+=e[t];for(let n in e)n!==t&&e.hasOwnProperty(n)&&(r+="; "+n+"="+e[n])}return r}_getAuthorizationHeader(e){if(!e)return{};if("string"==typeof e)return{Authorization:`Bearer ${e}`};let t;return t=this.isForBrowser()?btoa(`${e.username}:${e.password}`):n.from(`${e.username}:${e.password}`).toString("base64"),{Authorization:`Basic ${t}`}}_sanitizeFiles(e){let t;return e&&(t={},Object.keys(e).forEach(((r,n)=>{t[n?`file${n+1}`:"file"]={data:e[r],path:r}}))),t}}},5318:(e,t,r)=>{const n=r(101);let o;e.exports=class{constructor({auth:e,api:t=new o}){this.auth=e,this.api=t}ready(){return Boolean(this.auth)}libraries(e={}){return this.api.listLibraries(Object.assign({},e,{auth:this.auth})).then((e=>(e.body.data||[]).map((e=>new n(this,e)))))}library(e,t={}){return this.api.getLibrary(Object.assign({},t,{name:e,auth:this.auth})).then((e=>{const t=e.body.data||{};return new n(this,t)}))}libraryVersions(e,t={}){return this.api.getLibraryVersions(Object.assign({},t,{name:e,auth:this.auth})).then((e=>(e.body.data||[]).map((e=>new n(this,e)))))}contributeLibrary(e){return this.api.contributeLibrary({archive:e,auth:this.auth}).then((e=>{const t=e.body.data||{};return new n(this,t)}),(e=>{this._throwError(e)}))}publishLibrary(e){return this.api.publishLibrary({name:e,auth:this.auth}).then((e=>{const t=e.body.data||{};return new n(this,t)}),(e=>{this._throwError(e)}))}deleteLibrary({name:e,force:t}){return this.api.deleteLibrary({name:e,force:t,auth:this.auth}).then((()=>!0),(e=>this._throwError(e)))}_throwError(e){if(e.body&&e.body.errors){const t=e.body.errors.map((e=>e.message)).join("\n");throw new Error(t)}throw e}downloadFile(e){return this.api.downloadFile({uri:e})}compileCode(e,t,r){return this.api.compileCode({files:e,platformId:t,targetVersion:r,auth:this.auth})}signalDevice({signal:e,deviceId:t}){return this.api.signalDevice({signal:e,deviceId:t,auth:this.auth})}listDevices(){return this.api.listDevices({auth:this.auth})}listBuildTargets(){return this.api.listBuildTargets({onlyFeatured:!0,auth:this.auth}).then((e=>{let t=[];for(let r of e.body.targets)for(let e of r.platforms)t.push({version:r.version,platform:e,prerelease:r.prereleases.indexOf(e)>-1,firmware_vendor:r.firmware_vendor});return t}),(()=>{}))}trackingIdentity({full:e=!1,context:t}={}){return this.api.trackingIdentity({full:e,context:t,auth:this.auth}).then((e=>e.body))}},o=r(7845)},3822:e=>{e.exports={baseUrl:"https://api.particle.io",clientSecret:"particle-api",clientId:"particle-api",tokenDuration:7776e3,auth:void 0}},705:(e,t,r)=>{const n=r(8501),o=r(8501),i=r(8575),{EventEmitter:a}=r(7187);e.exports=class extends a{constructor(e,t){super(),this.uri=e,this.token=t,this.reconnectInterval=2e3,this.timeout=13e3,this.data="",this.buf="",this.parse=this.parse.bind(this),this.end=this.end.bind(this),this.idleTimeoutExpired=this.idleTimeoutExpired.bind(this)}connect(){return new Promise(((e,t)=>{const{hostname:r,protocol:a,port:s,path:u}=i.parse(this.uri);this.origin=`${a}//${r}${s?":"+s:""}`;const c="https:"===a,h=(c?o:n).request({hostname:r,protocol:a,path:`${u}?access_token=${this.token}`,method:"get",port:parseInt(s,10)||(c?443:80),mode:"prefer-streaming"});this.req=h;let l=!1,f=setTimeout((()=>{this.req&&this.req.abort(),t({error:new Error("Timeout"),errorDescription:`Timeout connecting to ${this.uri}`})}),this.timeout);h.on("error",(e=>{clearTimeout(f),l?this.end():t({error:e,errorDescription:`Network error from ${this.uri}`})})),h.on("response",(r=>{clearTimeout(f);const n=r.statusCode;if(200!==n){let e="";return r.on("data",(t=>e+=t)),void r.on("end",(()=>{try{e=JSON.parse(e)}catch(e){}finally{let r=`HTTP error ${n} from ${this.uri}`;e&&e.error_description&&(r+=" - "+e.error_description),t({statusCode:n,errorDescription:r,body:e}),this.req=void 0}}))}this.data="",this.buf="",l=!0,r.on("data",this.parse),r.once("end",this.end),this.startIdleTimeout(),e(this)})),h.end()}))}abort(){this.req&&(this.req.abort(),this.req=void 0),this.removeAllListeners()}emitSafe(e,t){try{this.emit(e,t)}catch(t){"error"!==e&&this.emitSafe("error",t)}}end(){this.stopIdleTimeout(),this.req&&(this.req=void 0,this.emitSafe("disconnect"),this.reconnect())}reconnect(){setTimeout((()=>{this.isOffline()?this.reconnect():(this.emitSafe("reconnect"),this.connect().then((()=>{this.emitSafe("reconnect-success")})).catch((e=>{this.emitSafe("reconnect-error",e),this.reconnect()})))}),this.reconnectInterval)}isOffline(){return"undefined"!=typeof navigator&&!navigator.hasOwnProperty("onLine")&&!navigator.onLine}startIdleTimeout(){this.stopIdleTimeout(),this.idleTimeout=setTimeout(this.idleTimeoutExpired,this.timeout)}stopIdleTimeout(){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null)}idleTimeoutExpired(){this.req&&(this.req.abort(),this.end())}parse(e){this.startIdleTimeout(),this.buf+=e;let t=0,r=this.buf.length,n=!1;for(;t0&&(this.buf=this.buf.slice(t))}parseEventStreamLine(e,t,r){if(0===r)try{if(this.data.length>0&&this.event){const e=JSON.parse(this.data);e.name=this.eventName||"",this.emitSafe("event",e)}}catch(e){}finally{this.data="",this.eventName=void 0,this.event=!1}else if(t>0){const n=this.buf.slice(e,e+t);let o=0;o=" "!==this.buf[e+t+1]?t+1:t+2,e+=o;const i=r-o,a=this.buf.slice(e,e+i);"data"===n?this.data+=a+"\n":"event"===n&&(this.eventName=a,this.event=!0)}}}},101:e=>{e.exports=class{constructor(e,t){Object.defineProperty(this,"client",{value:e}),this._assignAttributes(t),this.downloadUrl=t.links&&t.links.download}_assignAttributes(e){Object.assign(this,e.attributes)}download(){return this.downloadUrl?this.client.downloadFile(this.downloadUrl):Promise.reject(new Error("No download URL for this library"))}}},7845:(e,t,r)=>{const n=r(3822),o=r(705),i=r(7731),a=r(5318);class s{constructor(e={}){e.auth&&this.setDefaultAuth(e.auth),Object.assign(this,n,e),this.context={},this.agent=new i(this.baseUrl)}_isValidContext(e,t){return("tool"===e||"project"===e)&&void 0!==t}setContext(e,t){if(void 0!==t){if(!this._isValidContext(e,t))throw Error("unknown context name or undefined context: "+e);this.context[e]=t}}_buildContext(e){return Object.assign(this.context,e)}login({username:e,password:t,tokenDuration:r=this.tokenDuration,headers:n,context:o}){return this.request({uri:"/oauth/token",method:"post",headers:n,form:{username:e,password:t,grant_type:"password",client_id:this.clientId,client_secret:this.clientSecret,expires_in:r},context:o})}sendOtp({mfaToken:e,otp:t,headers:r,context:n}){return this.request({uri:"/oauth/token",method:"post",headers:r,form:{grant_type:"urn:custom:mfa-otp",mfa_token:e,otp:t,client_id:this.clientId,client_secret:this.clientSecret},context:n})}enableMfa({auth:e,headers:t,context:r}){return this.get({uri:"/v1/user/mfa-enable",auth:e,headers:t,context:r})}confirmMfa({mfaToken:e,otp:t,invalidateTokens:r=!1,auth:n,headers:o,context:i}){let a={mfa_token:e,otp:t};return r&&(a.invalidate_tokens=!0),this.post({uri:"/v1/user/mfa-enable",auth:n,headers:o,data:a,context:i})}disableMfa({currentPassword:e,auth:t,headers:r,context:n}){return this.put({uri:"/v1/user/mfa-disable",auth:t,headers:r,data:{current_password:e},context:n})}createCustomer({email:e,password:t,product:r,headers:n,context:o}){return this.request({uri:`/v1/products/${r}/customers`,method:"post",headers:n,form:{email:e,password:t,grant_type:"client_credentials",client_id:this.clientId,client_secret:this.clientSecret},context:o})}loginAsClientOwner({headers:e,context:t}){return this.request({uri:"/oauth/token",method:"post",headers:e,form:{grant_type:"client_credentials",client_id:this.clientId,client_secret:this.clientSecret},context:t})}createUser({username:e,password:t,accountInfo:r,utm:n,headers:o,context:i}){return this.post({uri:"/v1/users",headers:o,data:{username:e,password:t,account_info:r,utm:n},context:i})}verifyUser({token:e,headers:t,context:r}){return this.post({uri:"/v1/user/verify",headers:t,data:{token:e},context:r})}resetPassword({username:e,headers:t,context:r}){return this.post({uri:"/v1/user/password-reset",headers:t,data:{username:e},context:r})}deleteAccessToken({username:e,password:t,token:r,headers:n,context:o}){return this.delete({uri:`/v1/access_tokens/${r}`,auth:{username:e,password:t},headers:n,data:{access_token:r},context:o})}deleteCurrentAccessToken({auth:e,headers:t,context:r}){return this.delete({uri:"/v1/access_tokens/current",auth:e,headers:t,context:r})}deleteActiveAccessTokens({auth:e,headers:t,context:r}){return this.delete({uri:"/v1/access_tokens",auth:e,headers:t,context:r})}deleteUser({auth:e,password:t,headers:r,context:n}){return this.delete({uri:"/v1/user",data:{password:t},auth:e,headers:r,context:n})}listAccessTokens({username:e,password:t,otp:r,headers:n,context:o}){return this.get({uri:"/v1/access_tokens",auth:{username:e,password:t},query:r?{otp:r}:void 0,headers:n,context:o})}trackingIdentity({full:e=!1,auth:t,headers:r,context:n}={}){return this.get({uri:"/v1/user/identify",auth:t,headers:r,query:e?void 0:{tracking:1},context:n})}listDevices({deviceId:e,deviceName:t,groups:r,sortAttr:n,sortDir:o,page:i,perPage:a,product:s,auth:u,headers:c,context:h}){let l,f;return s?(l=`/v1/products/${s}/devices`,f={deviceId:e,deviceName:t,groups:Array.isArray(r)?r.join(","):void 0,sortAttr:n,sortDir:o,page:i,per_page:a}):l="/v1/devices",this.get({uri:l,auth:u,headers:c,query:f,context:h})}getDevice({deviceId:e,product:t,auth:r,headers:n,context:o}){const i=this.deviceUri({deviceId:e,product:t});return this.get({uri:i,auth:r,headers:n,context:o})}claimDevice({deviceId:e,requestTransfer:t,auth:r,headers:n,context:o}){return this.post({uri:"/v1/devices",auth:r,headers:n,data:{id:e,request_transfer:!!t},context:o})}addDeviceToProduct({deviceId:e,product:t,file:r,auth:n,headers:o,context:i}){let a,s;return r?a={file:r}:e&&(s={id:e}),this.request({uri:`/v1/products/${t}/devices`,method:"post",headers:o,data:s,files:a,auth:n,context:i})}removeDevice({deviceId:e,deny:t,product:r,auth:n,headers:o,context:i}){const a=this.deviceUri({deviceId:e,product:r}),s=r?{deny:t}:void 0;return this.delete({uri:a,data:s,auth:n,headers:o,context:i})}removeDeviceOwner({deviceId:e,product:t,auth:r,headers:n,context:o}){const i=`/v1/products/${t}/devices/${e}/owner`;return this.delete({uri:i,auth:r,headers:n,context:o})}renameDevice({deviceId:e,name:t,product:r,auth:n,headers:o,context:i}){return this.updateDevice({deviceId:e,name:t,product:r,auth:n,headers:o,context:i})}signalDevice({deviceId:e,signal:t,product:r,auth:n,headers:o,context:i}){return this.updateDevice({deviceId:e,signal:t,product:r,auth:n,headers:o,context:i})}setDeviceNotes({deviceId:e,notes:t,product:r,auth:n,headers:o,context:i}){return this.updateDevice({deviceId:e,notes:t,product:r,auth:n,headers:o,context:i})}markAsDevelopmentDevice({deviceId:e,development:t=!0,product:r,auth:n,headers:o,context:i}){return this.updateDevice({deviceId:e,development:t,product:r,auth:n,headers:o,context:i})}lockDeviceProductFirmware({deviceId:e,desiredFirmwareVersion:t,flash:r,product:n,auth:o,headers:i,context:a}){return this.updateDevice({deviceId:e,desiredFirmwareVersion:t,flash:r,product:n,auth:o,headers:i,context:a})}unlockDeviceProductFirmware({deviceId:e,product:t,auth:r,headers:n,context:o}){return this.updateDevice({deviceId:e,desiredFirmwareVersion:null,product:t,auth:r,headers:n,context:o})}updateDevice({deviceId:e,name:t,signal:r,notes:n,development:o,desiredFirmwareVersion:i,flash:a,product:s,auth:u,headers:c,context:h}){let l;void 0!==r&&(l=r?"1":"0");const f=this.deviceUri({deviceId:e,product:s}),d=s?{name:t,signal:l,notes:n,development:o,desired_firmware_version:i,flash:a}:{name:t,signal:l,notes:n};return this.put({uri:f,auth:u,headers:c,data:d,context:h})}provisionDevice({productId:e,auth:t,headers:r,context:n}){return this.post({uri:"/v1/devices",auth:t,headers:r,data:{product_id:e},context:n})}getClaimCode({iccid:e,product:t,auth:r,headers:n,context:o}){const i=t?`/v1/products/${t}/device_claims`:"/v1/device_claims";return this.post({uri:i,auth:r,headers:n,data:{iccid:e},context:o})}validatePromoCode({promoCode:e,auth:t,headers:r,context:n}){return this.get({uri:`/v1/promo_code/${e}`,auth:t,headers:r,context:n})}changeProduct({deviceId:e,productId:t,auth:r,headers:n,context:o}){return this.put({uri:`/v1/devices/${e}`,auth:r,headers:n,data:{product_id:t},context:o})}getVariable({deviceId:e,name:t,product:r,auth:n,headers:o,context:i}){const a=r?`/v1/products/${r}/devices/${e}/${t}`:`/v1/devices/${e}/${t}`;return this.get({uri:a,auth:n,headers:o,context:i})}flashDevice({deviceId:e,product:t,files:r,targetVersion:n,auth:o,headers:i,context:a}){const s=this.deviceUri({deviceId:e,product:t}),u={};return n?u.build_target_version=n:u.latest="true",this.request({uri:s,method:"put",auth:o,headers:i,files:r,form:u,context:a})}flashTinker({deviceId:e,auth:t,headers:r,context:n}){return console&&console.warning&&console.warning("Particle.flashTinker is deprecated"),this.put({uri:`/v1/devices/${e}`,headers:r,data:{app:"tinker"},auth:t,context:n})}compileCode({files:e,platformId:t,targetVersion:r,auth:n,headers:o,context:i}){const a={platform_id:t};return r?a.build_target_version=r:a.latest="true",this.request({uri:"/v1/binaries",method:"post",auth:n,headers:o,files:e,form:a,context:i})}downloadFirmwareBinary({binaryId:e,auth:t,headers:r,context:n}){return this.request({uri:`/v1/binaries/${e}`,method:"get",auth:t,headers:r,context:n,isBuffer:!0})}sendPublicKey({deviceId:e,key:t,algorithm:r,auth:n,headers:o,context:i}){return this.post({uri:`/v1/provisioning/${e}`,auth:n,headers:o,data:{deviceID:e,publicKey:"string"==typeof t?t:t.toString(),filename:"particle-api",order:`manual_${Date.now()}`,algorithm:r||"rsa"},context:i})}callFunction({deviceId:e,name:t,argument:r,product:n,auth:o,headers:i,context:a}){const s=n?`/v1/products/${n}/devices/${e}/${t}`:`/v1/devices/${e}/${t}`;return this.post({uri:s,auth:o,headers:i,data:{args:r},context:a})}getEventStream({deviceId:e,name:t,org:r,product:n,auth:i}){let a="/v1/";return r&&(a+=`orgs/${r}/`),n&&(a+=`products/${n}/`),e&&(a+="devices/","mine"!==e.toLowerCase()&&(a+=`${e}/`)),a+="events",t&&(a+=`/${encodeURIComponent(t)}`),i=this._getActiveAuthToken(i),new o(`${this.baseUrl}${a}`,i).connect()}publishEvent({name:e,data:t,isPrivate:r,product:n,auth:o,headers:i,context:a}){const s=n?`/v1/products/${n}/events`:"/v1/devices/events",u={name:e,data:t,private:r};return this.post({uri:s,auth:o,headers:i,data:u,context:a})}createWebhook({event:e,url:t,device:r,rejectUnauthorized:n,noDefaults:o,hook:i,product:a,auth:s,headers:u,context:c}){const h=a?`/v1/products/${a}/webhooks`:"/v1/webhooks",l={event:e,url:t,deviceId:r,rejectUnauthorized:n,noDefaults:o};return i&&(l.requestType=i.method,l.auth=i.auth,l.headers=i.headers,l.query=i.query,l.json=i.json,l.form=i.form,l.body=i.body,l.responseTemplate=i.responseTemplate,l.responseTopic=i.responseEvent,l.errorResponseTopic=i.errorResponseEvent),l.requestType||(l.requestType="POST"),this.post({uri:h,auth:s,headers:u,data:l,context:c})}deleteWebhook({hookId:e,product:t,auth:r,headers:n,context:o}){const i=t?`/v1/products/${t}/webhooks/${e}`:`/v1/webhooks/${e}`;return this.delete({uri:i,auth:r,headers:n,context:o})}listWebhooks({product:e,auth:t,headers:r,context:n}){const o=e?`/v1/products/${e}/webhooks`:"/v1/webhooks";return this.get({uri:o,auth:t,headers:r,context:n})}createIntegration({event:e,settings:t,deviceId:r,product:n,auth:o,headers:i,context:a}){const s=n?`/v1/products/${n}/integrations`:"/v1/integrations",u=Object.assign({event:e,deviceid:r},t);return this.post({uri:s,data:u,auth:o,headers:i,context:a})}editIntegration({integrationId:e,event:t,settings:r,deviceId:n,product:o,auth:i,headers:a,context:s}){const u=o?`/v1/products/${o}/integrations/${e}`:`/v1/integrations/${e}`,c=Object.assign({event:t,deviceid:n},r);return this.put({uri:u,auth:i,headers:a,data:c,context:s})}deleteIntegration({integrationId:e,product:t,auth:r,headers:n,context:o}){const i=t?`/v1/products/${t}/integrations/${e}`:`/v1/integrations/${e}`;return this.delete({uri:i,auth:r,headers:n,context:o})}listIntegrations({product:e,auth:t,headers:r,context:n}){const o=e?`/v1/products/${e}/integrations`:"/v1/integrations";return this.get({uri:o,auth:t,headers:r,context:n})}getUserInfo({auth:e,headers:t,context:r}){return this.get({uri:"/v1/user",auth:e,headers:t,context:r})}setUserInfo({accountInfo:e,auth:t,headers:r,context:n}){const o={account_info:e};return this.put({uri:"/v1/user",auth:t,headers:r,data:o,context:n})}changeUsername({currentPassword:e,username:t,invalidateTokens:r=!1,auth:n,headers:o,context:i}){const a={username:t,current_password:e};return r&&(a.invalidate_tokens=!0),this.put({uri:"/v1/user",auth:n,headers:o,data:a,context:i})}changeUserPassword({currentPassword:e,password:t,invalidateTokens:r=!1,auth:n,headers:o,context:i}){const a={password:t,current_password:e};return r&&(a.invalidate_tokens=!0),this.put({uri:"/v1/user",auth:n,headers:o,data:a,context:i})}listSIMs({iccid:e,deviceId:t,deviceName:r,page:n,perPage:o,product:i,auth:a,headers:s,context:u}){const c=i?`/v1/products/${i}/sims`:"/v1/sims",h=i?{iccid:e,deviceId:t,deviceName:r,page:n,per_page:o}:void 0;return this.get({uri:c,auth:a,headers:s,query:h,context:u})}getSIMDataUsage({iccid:e,product:t,auth:r,headers:n,context:o}){const i=t?`/v1/products/${t}/sims/${e}/data_usage`:`/v1/sims/${e}/data_usage`;return this.get({uri:i,auth:r,headers:n,context:o})}getFleetDataUsage({product:e,auth:t,headers:r,context:n}){return this.get({uri:`/v1/products/${e}/sims/data_usage`,auth:t,headers:r,context:n})}checkSIM({iccid:e,auth:t,headers:r,context:n}){return this.head({uri:`/v1/sims/${e}`,auth:t,headers:r,context:n})}activateSIM({iccid:e,iccids:t,country:r,promoCode:n,product:o,auth:i,headers:a,context:s}){t=t||[e];const u=o?`/v1/products/${o}/sims`:`/v1/sims/${e}`,c=o?{sims:t,country:r}:{country:r,promoCode:n,action:"activate"},h=o?"post":"put";return this.request({uri:u,method:h,headers:a,data:c,auth:i,context:s})}deactivateSIM({iccid:e,product:t,auth:r,headers:n,context:o}){const i=t?`/v1/products/${t}/sims/${e}`:`/v1/sims/${e}`;return this.put({uri:i,auth:r,headers:n,data:{action:"deactivate"},context:o})}reactivateSIM({iccid:e,mbLimit:t,product:r,auth:n,headers:o,context:i}){const a=r?`/v1/products/${r}/sims/${e}`:`/v1/sims/${e}`,s={mb_limit:t,action:"reactivate"};return this.put({uri:a,auth:n,headers:o,data:s,context:i})}updateSIM({iccid:e,mbLimit:t,product:r,auth:n,headers:o,context:i}){const a=r?`/v1/products/${r}/sims/${e}`:`/v1/sims/${e}`,s={mb_limit:t};return this.put({uri:a,auth:n,headers:o,data:s,context:i})}removeSIM({iccid:e,product:t,auth:r,headers:n,context:o}){const i=t?`/v1/products/${t}/sims/${e}`:`/v1/sims/${e}`;return this.delete({uri:i,auth:r,headers:n,context:o})}listBuildTargets({onlyFeatured:e,auth:t,headers:r,context:n}){const o=e?{featured:!!e}:void 0;return this.get({uri:"/v1/build_targets",auth:t,headers:r,query:o,context:n})}listLibraries({page:e,limit:t,filter:r,sort:n,architectures:o,category:i,scope:a,excludeScopes:s,auth:u,headers:c,context:h}){return this.get({uri:"/v1/libraries",auth:u,headers:c,query:{page:e,filter:r,limit:t,sort:n,architectures:this._asList(o),category:i,scope:a,excludeScopes:this._asList(s)},context:h})}_asList(e){return Array.isArray(e)?e.join(","):e}getLibrary({name:e,version:t,auth:r,headers:n,context:o}){return this.get({uri:`/v1/libraries/${e}`,auth:r,headers:n,query:{version:t},context:o})}getLibraryVersions({name:e,page:t,limit:r,auth:n,headers:o,context:i}){return this.get({uri:`/v1/libraries/${e}/versions`,auth:n,headers:o,query:{page:t,limit:r},context:i})}contributeLibrary({archive:e,auth:t,headers:r,context:n}){const o={"archive.tar.gz":e};return this.request({uri:"/v1/libraries",method:"post",auth:t,headers:r,files:o,context:n})}publishLibrary({name:e,auth:t,headers:r,context:n}){return this.request({uri:`/v1/libraries/${e}`,method:"patch",auth:t,headers:r,data:{visibility:"public"},context:n})}deleteLibrary({name:e,force:t,auth:r,headers:n,context:o}){return this.delete({uri:`/v1/libraries/${e}`,auth:r,headers:n,data:{force:t},context:o})}downloadFile({uri:e,headers:t,context:r}){return this.request({uri:e,method:"get",headers:t,context:r,isBuffer:!0})}listOAuthClients({product:e,auth:t,headers:r,context:n}){const o=e?`/v1/products/${e}/clients`:"/v1/clients";return this.get({uri:o,auth:t,headers:r,context:n})}createOAuthClient({name:e,type:t,redirect_uri:r,scope:n,product:o,auth:i,headers:a,context:s}){const u=o?`/v1/products/${o}/clients`:"/v1/clients",c={name:e,type:t,redirect_uri:r,scope:n};return this.post({uri:u,auth:i,headers:a,data:c,context:s})}updateOAuthClient({clientId:e,name:t,scope:r,product:n,auth:o,headers:i,context:a}){const s=n?`/v1/products/${n}/clients/${e}`:`/v1/clients/${e}`,u={name:t,scope:r};return this.put({uri:s,data:u,auth:o,headers:i,context:a})}deleteOAuthClient({clientId:e,product:t,auth:r,headers:n,context:o}){const i=t?`/v1/products/${t}/clients/${e}`:`/v1/clients/${e}`;return this.delete({uri:i,auth:r,headers:n,context:o})}listProducts({auth:e,headers:t,context:r}){return this.get({uri:"/v1/products",auth:e,headers:t,context:r})}getProduct({product:e,auth:t,headers:r,context:n}){return this.get({uri:`/v1/products/${e}`,auth:t,headers:r,context:n})}listProductFirmware({product:e,auth:t,headers:r,context:n}){return this.get({uri:`/v1/products/${e}/firmware`,auth:t,headers:r,context:n})}uploadProductFirmware({file:e,version:t,title:r,description:n,product:o,auth:i,headers:a,context:s}){return this.request({uri:`/v1/products/${o}/firmware`,method:"post",auth:i,headers:a,form:{version:t,title:r,description:n},files:{"firmware.bin":e},context:s})}getProductFirmware({version:e,product:t,auth:r,headers:n,context:o}){return this.get({uri:`/v1/products/${t}/firmware/${e}`,auth:r,headers:n,context:o})}updateProductFirmware({version:e,title:t,description:r,product:n,auth:o,headers:i,context:a}){const s=`/v1/products/${n}/firmware/${e}`;return this.put({uri:s,auth:o,headers:i,data:{title:t,description:r},context:a})}downloadProductFirmware({version:e,product:t,auth:r,headers:n,context:o}){return this.request({uri:`/v1/products/${t}/firmware/${e}/binary`,method:"get",auth:r,headers:n,context:o,isBuffer:!0})}releaseProductFirmware({version:e,product:t,auth:r,headers:n,context:o}){const i=`/v1/products/${t}/firmware/release`;return this.put({uri:i,auth:r,headers:n,data:{version:e},context:o})}listTeamMembers({product:e,auth:t,headers:r,context:n}){return this.get({uri:`/v1/products/${e}/team`,auth:t,headers:r,context:n})}inviteTeamMember({username:e,product:t,auth:r,headers:n,context:o}){return this.post({uri:`/v1/products/${t}/team`,auth:r,headers:n,data:{username:e},context:o})}removeTeamMember({username:e,product:t,auth:r,headers:n,context:o}){return this.delete({uri:`/v1/products/${t}/team/${e}`,auth:r,headers:n,context:o})}lookupSerialNumber({serialNumber:e,auth:t,headers:r,context:n}){return this.get({uri:`/v1/serial_numbers/${e}`,auth:t,headers:r,context:n})}createMeshNetwork({name:e,deviceId:t,iccid:r,auth:n,headers:o,context:i}){return this.post({uri:"/v1/networks",auth:n,headers:o,data:{name:e,device_id:t,iccid:r},context:i})}removeMeshNetwork({networkId:e,auth:t,headers:r,context:n}){return this.delete({uri:`/v1/networks/${e}`,auth:t,headers:r,context:n})}listMeshNetworks({page:e,perPage:t,auth:r,headers:n,context:o}){const i=e?{page:e,per_page:t}:void 0;return this.get({uri:"/v1/networks",auth:r,headers:n,query:i,context:o})}getMeshNetwork({networkId:e,auth:t,headers:r,context:n}){return this.get({uri:`/v1/networks/${e}`,auth:t,headers:r,context:n})}updateMeshNetwork({networkId:e,action:t,deviceId:r,auth:n,headers:o,context:i}){return this.put({uri:`/v1/networks/${e}`,auth:n,headers:o,data:{action:t,device_id:r},context:i})}addMeshNetworkDevice({networkId:e,deviceId:t,auth:r,headers:n,context:o}){return this.updateMeshNetwork({action:"add-device",networkId:e,deviceId:t,auth:r,headers:n,context:o})}removeMeshNetworkDevice({networkId:e,deviceId:t,auth:r,headers:n,context:o}){return e?this.updateMeshNetwork({action:"remove-device",networkId:e,deviceId:t,auth:r,headers:n,context:o}):this.delete({uri:`/v1/devices/${t}/network`,auth:r,headers:n,context:o})}listMeshNetworkDevices({networkId:e,role:t,page:r,perPage:n,auth:o,headers:i,context:a}){const s=t||r?{role:t,page:r,per_page:n}:void 0;return this.get({uri:`/v1/networks/${e}/devices`,auth:o,headers:i,query:s,context:a})}getProductConfiguration({auth:e,product:t,headers:r,context:n}){return this.get({uri:`/v1/products/${t}/config`,auth:e,headers:r,context:n})}getProductConfigurationSchema({auth:e,product:t,headers:r={},context:n}){return r.accept="application/schema+json",this.get({uri:`/v1/products/${t}/config`,auth:e,headers:r,context:n})}getProductDeviceConfiguration({auth:e,product:t,deviceId:r,headers:n,context:o}){return this.get({uri:`/v1/products/${t}/config/${r}`,auth:e,headers:n,context:o})}getProductDeviceConfigurationSchema({auth:e,product:t,deviceId:r,headers:n,context:o}){return n.accept="application/schema+json",this.get({uri:`/v1/products/${t}/config/${r}`,auth:e,headers:n,context:o})}setProductConfiguration({auth:e,product:t,config:r,headers:n,context:o}){return this.put({uri:`/v1/products/${t}/config`,auth:e,data:r,headers:n,context:o})}setProductDeviceConfiguration({auth:e,product:t,deviceId:r,config:n,headers:o,context:i}){return this.put({uri:`/v1/products/${t}/config/${r}`,data:n,auth:e,headers:o,context:i})}getProductLocations({auth:e,product:t,dateRange:r,rectBl:n,rectTr:o,deviceId:i,deviceName:a,groups:s,page:u,perPage:c,headers:h,context:l}){return this.get({uri:`/v1/products/${t}/locations`,query:{date_range:r,rect_bl:n,rect_tr:o,device_id:i,device_name:a,groups:s,page:u,per_page:c},auth:e,headers:h,context:l})}getProductDeviceLocations({auth:e,product:t,dateRange:r,rectBl:n,rectTr:o,deviceId:i,headers:a,context:s}){return this.get({uri:`/v1/products/${t}/locations/${i}`,query:{date_range:r,rect_bl:n,rect_tr:o},auth:e,headers:a,context:s})}executeLogic({auth:e,org:t,logic:r,headers:n,context:o}){return this.post({uri:this._namespacedPath(t,"logic/execute"),auth:e,data:r,headers:n,context:o})}createLogicFunction({auth:e,org:t,logicFunction:r,headers:n,context:o}){return this.post({uri:this._namespacedPath(t,"logic/functions"),auth:e,data:{logic_function:r},headers:n,context:o})}getLogicFunction({auth:e,org:t,logicFunctionId:r,headers:n,context:o}){return this.get({uri:this._namespacedPath(t,`logic/functions/${r}`),auth:e,headers:n,context:o})}updateLogicFunction({auth:e,org:t,logicFunctionId:r,logicFunction:n,headers:o,context:i}){return this.put({uri:this._namespacedPath(t,`logic/functions/${r}`),auth:e,data:{logic_function:n},headers:o,context:i})}deleteLogicFunction({auth:e,org:t,logicFunctionId:r,headers:n,context:o}){return this.delete({uri:this._namespacedPath(t,`logic/functions/${r}`),auth:e,headers:n,context:o})}listLogicFunctions({auth:e,org:t,todayStats:r,headers:n,context:o}){return this.get({uri:this._namespacedPath(t,"logic/functions"),query:{today_stats:r},auth:e,headers:n,context:o})}listLogicRuns({auth:e,org:t,logicFunctionId:r,headers:n,context:o}){return this.get({uri:this._namespacedPath(t,`logic/functions/${r}/runs`),auth:e,headers:n,context:o})}getLogicRun({auth:e,org:t,logicFunctionId:r,logicRunId:n,headers:o,context:i}){return this.get({uri:this._namespacedPath(t,`logic/functions/${r}/runs/${n}`),auth:e,headers:o,context:i})}getLogicRunLogs({auth:e,org:t,logicFunctionId:r,logicRunId:n,headers:o,context:i}){return this.get({uri:this._namespacedPath(t,`logic/functions/${r}/runs/${n}/logs`),auth:e,headers:o,context:i})}createLedger({auth:e,org:t,ledger:r,headers:n,context:o}){return this.post({uri:this._namespacedPath(t,"ledgers"),auth:e,data:{ledger:r},headers:n,context:o})}getLedger({auth:e,org:t,ledgerName:r,headers:n,context:o}){return this.get({uri:this._namespacedPath(t,`ledgers/${r}`),auth:e,headers:n,context:o})}updateLedger({auth:e,org:t,ledgerName:r,ledger:n,headers:o,context:i}){return this.put({uri:this._namespacedPath(t,`ledgers/${r}`),auth:e,data:{ledger:n},headers:o,context:i})}archiveLedger({auth:e,org:t,ledgerName:r,headers:n,context:o}){return this.delete({uri:this._namespacedPath(t,`ledgers/${r}`),auth:e,headers:n,context:o})}listLedgers({auth:e,org:t,scope:r,page:n,perPage:o,archived:i,headers:a,context:s}){return this.get({uri:this._namespacedPath(t,"ledgers"),query:{scope:r,page:n,per_page:o,archived:i},auth:e,headers:a,context:s})}getLedgerInstance({auth:e,org:t,ledgerName:r,scopeValue:n,headers:o,context:i}){return this.get({uri:this._namespacedPath(t,`ledgers/${r}/instances/${n}`),auth:e,headers:o,context:i})}setLedgerInstance({auth:e,org:t,ledgerName:r,scopeValue:n,instance:o,setMode:i,headers:a,context:s}){return this.put({uri:this._namespacedPath(t,`ledgers/${r}/instances/${n}`),query:{set_mode:i},auth:e,data:{instance:o},headers:a,context:s})}deleteLedgerInstance({auth:e,org:t,ledgerName:r,scopeValue:n,headers:o,context:i}){return this.delete({uri:this._namespacedPath(t,`ledgers/${r}/instances/${n}`),auth:e,headers:o,context:i})}listLedgerInstances({auth:e,org:t,ledgerName:r,page:n,perPage:o,headers:i,context:a}){return this.get({uri:this._namespacedPath(t,`ledgers/${r}/instances`),query:{page:n,per_page:o},auth:e,headers:i,context:a})}listLedgerInstanceVersions({auth:e,org:t,ledgerName:r,scopeValue:n,replacedBefore:o,replacedAfter:i,headers:a,context:s}){return this.get({uri:this._namespacedPath(t,`ledgers/${r}/instances/${n}/versions`),query:{replaced_before:o,replaced_after:i},auth:e,headers:a,context:s})}getLedgerInstanceVersion({auth:e,org:t,ledgerName:r,scopeValue:n,version:o,headers:i,context:a}){return this.get({uri:this._namespacedPath(t,`ledgers/${r}/instances/${n}/versions/${o}`),auth:e,headers:i,context:a})}setDefaultAuth(e){if("string"==typeof e&&0!==e.length)this._defaultAuth=e;else{if("object"!=typeof e||!("username"in e)||!("password"in e))throw new Error("Must pass a non-empty string or object with username and password for basic auth!");this._defaultAuth=e}}_getActiveAuthToken(e){return e||this._defaultAuth}deviceUri({deviceId:e,product:t}){return t?`/v1/products/${t}/devices/${e}`:`/v1/devices/${e}`}_namespacedPath(e,t){return e?`/v1/orgs/${e}/${t}`:`/v1/${t}`}get({uri:e,auth:t,headers:r,query:n,context:o}){return o=this._buildContext(o),t=this._getActiveAuthToken(t),this.agent.get({uri:e,auth:t,headers:r,query:n,context:o})}head({uri:e,auth:t,headers:r,query:n,context:o}){return o=this._buildContext(o),t=this._getActiveAuthToken(t),this.agent.head({uri:e,auth:t,headers:r,query:n,context:o})}post({uri:e,auth:t,headers:r,data:n,context:o}){return o=this._buildContext(o),t=this._getActiveAuthToken(t),this.agent.post({uri:e,auth:t,headers:r,data:n,context:o})}put({uri:e,auth:t,headers:r,data:n,query:o,context:i}){return i=this._buildContext(i),t=this._getActiveAuthToken(t),this.agent.put({uri:e,auth:t,headers:r,data:n,query:o,context:i})}delete({uri:e,auth:t,headers:r,data:n,context:o}){return o=this._buildContext(o),t=this._getActiveAuthToken(t),this.agent.delete({uri:e,auth:t,headers:r,data:n,context:o})}request(e){return e.context=this._buildContext(e.context),e.auth=this._getActiveAuthToken(e.auth),this.agent.request(e)}client(e={}){return new a(Object.assign({api:this},e))}setBaseUrl(e){this.baseUrl=e,this.agent.setBaseUrl(e)}}s.prototype.removeAccessToken=s.prototype.deleteAccessToken,e.exports=s},7165:()=>{},1408:()=>{},3646:()=>{},5014:()=>{},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"particle-api-js","version":"10.4.3","description":"Particle API Client","main":"src/Particle.js","scripts":{"prepublish":"npm run lint && npm run build","test":"npm run lint && npm run typecheck && npm run test:unit","test:ci":"npm run lint && npm run test:unit -- --forbid-only && npm run coverage","test:unit":"mocha test/ -R spec","test:unit:silent":"npm run test:unit > tmp/test-unit-log.txt 2>&1","test:browser":"karma start --single-run","test:watch":"npm run test:unit -- --watch","typecheck":"tsc --noEmit","coverage":"nyc --reporter=text --include=\'src/**/*.js\' --temp-dir=./tmp/ --check-coverage --lines 91 npm run test:unit:silent","lint":"eslint . --ext .js --format unix --ignore-path .gitignore --ignore-pattern \\"dist/*\\"","lint:fix":"npm run lint -- --fix","docs":"documentation build src/Particle.js --shallow -g -f md -o docs/api.md","build":"webpack --env mode=production","build-nomin":"webpack --env mode=development","preversion":"npm run test && npm run prepublish","reinstall":"rm -rf ./node_modules && npm i","version":"npm run build && npm run docs && npm run update-changelog && git add dist/* docs/*","update-changelog":"VERSION=`node -p -e \\"require(\'./package.json\').version\\"` bash -c \'read -p \\"Update CHANGELOG.md for version $VERSION and press ENTER when done.\\"\' && git add CHANGELOG.md"},"repository":{"type":"git","url":"https://github.com/particle-iot/particle-api-js"},"author":"Julien Vanier ","contributors":["Ido Kleinman","Bryce Kahle","Justin Debbink","Matthew McGowan","Julien Vanier","Wojtek Siudzinski","Emily Rose"],"keywords":["particle","library","spark","api"],"license":"Apache-2.0","devDependencies":{"@types/node":"^20.5.9","buffer":"^6.0.3","chai":"^4.3.6","chai-as-promised":"^7.1.1","documentation":"^4.0.0-rc.1","eslint":"^8.17.0","eslint-config-particle":"^2.2.1","events":"^3.3.0","karma":"^1.1.1","karma-chai":"^0.1.0","karma-cli":"^1.0.1","karma-coverage":"^1.1.0","karma-firefox-launcher":"^1.0.0","karma-mocha":"^1.1.1","karma-webpack":"^5.0.0","mocha":"^2.5.1","nyc":"^15.1.0","process":"^0.11.10","should":"^9.0.0","sinon":"^7.2.5","sinon-chai":"^3.7.0","terser-webpack-plugin":"^5.3.9","typescript":"^5.2.2","url":"^0.11.3","webpack":"^5.88.2","webpack-cli":"^5.1.4"},"dependencies":{"form-data":"^4.0.0","node-fetch":"^2.7.0","qs":"^6.11.2","stream-http":"^3.2.0"},"browser":{"./fs":false,"http":"stream-http","https":"stream-http"},"engines":{"node":">=12.x","npm":"8.x"}}')}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(7845);Particle=n})(); //# sourceMappingURL=particle.min.js.map