@dcl/governance-site 1.15.1-20105651460.commit-7620061 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import{bx as Nr,k as xr,bu as Cr,e as H,c as be,by as Ce,g as Lr,bF as Ur}from"./index-6c5c6262.js";var Be={exports:{}},Me={},xe={},Qe;function Or(){if(Qe)return xe;Qe=1,xe.byteLength=i,xe.toByteArray=v,xe.fromByteArray=g;for(var T=[],w=[],M=typeof Uint8Array<"u"?Uint8Array:Array,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L=0,E=b.length;L<E;++L)T[L]=b[L],w[b.charCodeAt(L)]=L;w["-".charCodeAt(0)]=62,w["_".charCodeAt(0)]=63;function y(_){var S=_.length;if(S%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=_.indexOf("=");F===-1&&(F=S);var x=F===S?0:4-F%4;return[F,x]}function i(_){var S=y(_),F=S[0],x=S[1];return(F+x)*3/4-x}function l(_,S,F){return(S+F)*3/4-F}function v(_){var S,F=y(_),x=F[0],u=F[1],p=new M(l(_,x,u)),C=0,N=u>0?x-4:x,I;for(I=0;I<N;I+=4)S=w[_.charCodeAt(I)]<<18|w[_.charCodeAt(I+1)]<<12|w[_.charCodeAt(I+2)]<<6|w[_.charCodeAt(I+3)],p[C++]=S>>16&255,p[C++]=S>>8&255,p[C++]=S&255;return u===2&&(S=w[_.charCodeAt(I)]<<2|w[_.charCodeAt(I+1)]>>4,p[C++]=S&255),u===1&&(S=w[_.charCodeAt(I)]<<10|w[_.charCodeAt(I+1)]<<4|w[_.charCodeAt(I+2)]>>2,p[C++]=S>>8&255,p[C++]=S&255),p}function m(_){return T[_>>18&63]+T[_>>12&63]+T[_>>6&63]+T[_&63]}function s(_,S,F){for(var x,u=[],p=S;p<F;p+=3)x=(_[p]<<16&16711680)+(_[p+1]<<8&65280)+(_[p+2]&255),u.push(m(x));return u.join("")}function g(_){for(var S,F=_.length,x=F%3,u=[],p=16383,C=0,N=F-x;C<N;C+=p)u.push(s(_,C,C+p>N?N:C+p));return x===1?(S=_[F-1],u.push(T[S>>2]+T[S<<4&63]+"==")):x===2&&(S=(_[F-2]<<8)+_[F-1],u.push(T[S>>10]+T[S>>4&63]+T[S<<2&63]+"=")),u.join("")}return xe}var Fe={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var er;function Dr(){return er||(er=1,Fe.read=function(T,w,M,b,L){var E,y,i=L*8-b-1,l=(1<<i)-1,v=l>>1,m=-7,s=M?L-1:0,g=M?-1:1,_=T[w+s];for(s+=g,E=_&(1<<-m)-1,_>>=-m,m+=i;m>0;E=E*256+T[w+s],s+=g,m-=8);for(y=E&(1<<-m)-1,E>>=-m,m+=b;m>0;y=y*256+T[w+s],s+=g,m-=8);if(E===0)E=1-v;else{if(E===l)return y?NaN:(_?-1:1)*(1/0);y=y+Math.pow(2,b),E=E-v}return(_?-1:1)*y*Math.pow(2,E-b)},Fe.write=function(T,w,M,b,L,E){var y,i,l,v=E*8-L-1,m=(1<<v)-1,s=m>>1,g=L===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=b?0:E-1,S=b?1:-1,F=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===1/0?(i=isNaN(w)?1:0,y=m):(y=Math.floor(Math.log(w)/Math.LN2),w*(l=Math.pow(2,-y))<1&&(y--,l*=2),y+s>=1?w+=g/l:w+=g*Math.pow(2,1-s),w*l>=2&&(y++,l/=2),y+s>=m?(i=0,y=m):y+s>=1?(i=(w*l-1)*Math.pow(2,L),y=y+s):(i=w*Math.pow(2,s-1)*Math.pow(2,L),y=0));L>=8;T[M+_]=i&255,_+=S,i/=256,L-=8);for(y=y<<L|i,v+=L;v>0;T[M+_]=y&255,_+=S,y/=256,v-=8);T[M+_-S]|=F*128}),Fe}/*!
1
+ import{bz as Nr,i as xr,bt as Cr,e as H,c as be,bA as Ce,g as Lr,bI as Ur}from"./index-2ef9f1d1.js";var Be={exports:{}},Me={},xe={},Qe;function Or(){if(Qe)return xe;Qe=1,xe.byteLength=i,xe.toByteArray=S,xe.fromByteArray=g;for(var T=[],w=[],M=typeof Uint8Array<"u"?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L=0,E=_.length;L<E;++L)T[L]=_[L],w[_.charCodeAt(L)]=L;w["-".charCodeAt(0)]=62,w["_".charCodeAt(0)]=63;function p(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=m.indexOf("=");F===-1&&(F=b);var x=F===b?0:4-F%4;return[F,x]}function i(m){var b=p(m),F=b[0],x=b[1];return(F+x)*3/4-x}function l(m,b,F){return(b+F)*3/4-F}function S(m){var b,F=p(m),x=F[0],u=F[1],y=new M(l(m,x,u)),C=0,N=u>0?x-4:x,I;for(I=0;I<N;I+=4)b=w[m.charCodeAt(I)]<<18|w[m.charCodeAt(I+1)]<<12|w[m.charCodeAt(I+2)]<<6|w[m.charCodeAt(I+3)],y[C++]=b>>16&255,y[C++]=b>>8&255,y[C++]=b&255;return u===2&&(b=w[m.charCodeAt(I)]<<2|w[m.charCodeAt(I+1)]>>4,y[C++]=b&255),u===1&&(b=w[m.charCodeAt(I)]<<10|w[m.charCodeAt(I+1)]<<4|w[m.charCodeAt(I+2)]>>2,y[C++]=b>>8&255,y[C++]=b&255),y}function R(m){return T[m>>18&63]+T[m>>12&63]+T[m>>6&63]+T[m&63]}function h(m,b,F){for(var x,u=[],y=b;y<F;y+=3)x=(m[y]<<16&16711680)+(m[y+1]<<8&65280)+(m[y+2]&255),u.push(R(x));return u.join("")}function g(m){for(var b,F=m.length,x=F%3,u=[],y=16383,C=0,N=F-x;C<N;C+=y)u.push(h(m,C,C+y>N?N:C+y));return x===1?(b=m[F-1],u.push(T[b>>2]+T[b<<4&63]+"==")):x===2&&(b=(m[F-2]<<8)+m[F-1],u.push(T[b>>10]+T[b>>4&63]+T[b<<2&63]+"=")),u.join("")}return xe}var Fe={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var er;function Dr(){return er||(er=1,Fe.read=function(T,w,M,_,L){var E,p,i=L*8-_-1,l=(1<<i)-1,S=l>>1,R=-7,h=M?L-1:0,g=M?-1:1,m=T[w+h];for(h+=g,E=m&(1<<-R)-1,m>>=-R,R+=i;R>0;E=E*256+T[w+h],h+=g,R-=8);for(p=E&(1<<-R)-1,E>>=-R,R+=_;R>0;p=p*256+T[w+h],h+=g,R-=8);if(E===0)E=1-S;else{if(E===l)return p?NaN:(m?-1:1)*(1/0);p=p+Math.pow(2,_),E=E-S}return(m?-1:1)*p*Math.pow(2,E-_)},Fe.write=function(T,w,M,_,L,E){var p,i,l,S=E*8-L-1,R=(1<<S)-1,h=R>>1,g=L===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=_?0:E-1,b=_?1:-1,F=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===1/0?(i=isNaN(w)?1:0,p=R):(p=Math.floor(Math.log(w)/Math.LN2),w*(l=Math.pow(2,-p))<1&&(p--,l*=2),p+h>=1?w+=g/l:w+=g*Math.pow(2,1-h),w*l>=2&&(p++,l/=2),p+h>=R?(i=0,p=R):p+h>=1?(i=(w*l-1)*Math.pow(2,L),p=p+h):(i=w*Math.pow(2,h-1)*Math.pow(2,L),p=0));L>=8;T[M+m]=i&255,m+=b,i/=256,L-=8);for(p=p<<L|i,S+=L;S>0;T[M+m]=p&255,m+=b,p/=256,S-=8);T[M+m-b]|=F*128}),Fe}/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */var rr;function Ie(){return rr||(rr=1,function(T){const w=Or(),M=Dr(),b=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;T.Buffer=i,T.SlowBuffer=p,T.INSPECT_MAX_BYTES=50;const L=2147483647;T.kMaxLength=L,i.TYPED_ARRAY_SUPPORT=E(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function E(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function y(t){if(t>L)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return s(t)}return l(t,e,r)}i.poolSize=8192;function l(t,e,r){if(typeof t=="string")return g(t,e);if(ArrayBuffer.isView(t))return S(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(ee(t,ArrayBuffer)||t&&ee(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ee(t,SharedArrayBuffer)||t&&ee(t.buffer,SharedArrayBuffer)))return F(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return i.from(n,e,r);const f=x(t);if(f)return f;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return i.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}i.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function v(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function m(t,e,r){return v(t),t<=0?y(t):e!==void 0?typeof r=="string"?y(t).fill(e,r):y(t).fill(e):y(t)}i.alloc=function(t,e,r){return m(t,e,r)};function s(t){return v(t),y(t<0?0:u(t)|0)}i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)};function g(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=C(t,e)|0;let n=y(r);const f=n.write(t,e);return f!==r&&(n=n.slice(0,f)),n}function _(t){const e=t.length<0?0:u(t.length)|0,r=y(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function S(t){if(ee(t,Uint8Array)){const e=new Uint8Array(t);return F(e.buffer,e.byteOffset,e.byteLength)}return _(t)}function F(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,i.prototype),n}function x(t){if(i.isBuffer(t)){const e=u(t.length)|0,r=y(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||le(t.length)?y(0):_(t);if(t.type==="Buffer"&&Array.isArray(t.data))return _(t.data)}function u(t){if(t>=L)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+L.toString(16)+" bytes");return t|0}function p(t){return+t!=t&&(t=0),i.alloc(+t)}i.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==i.prototype},i.compare=function(e,r){if(ee(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),ee(r,Uint8Array)&&(r=i.from(r,r.offset,r.byteLength)),!i.isBuffer(e)||!i.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,f=r.length;for(let c=0,R=Math.min(n,f);c<R;++c)if(e[c]!==r[c]){n=e[c],f=r[c];break}return n<f?-1:f<n?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return i.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;const f=i.allocUnsafe(r);let c=0;for(n=0;n<e.length;++n){let R=e[n];if(ee(R,Uint8Array))c+R.length>f.length?(i.isBuffer(R)||(R=i.from(R)),R.copy(f,c)):Uint8Array.prototype.set.call(f,R,c);else if(i.isBuffer(R))R.copy(f,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=R.length}return f};function C(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||ee(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let f=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ve(t).length;default:if(f)return n?-1:$(t).length;e=(""+e).toLowerCase(),f=!0}}i.byteLength=C;function N(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return oe(this,e,r);case"utf8":case"utf-8":return he(this,e,r);case"ascii":return ne(this,e,r);case"latin1":case"binary":return ce(this,e,r);case"base64":return ie(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function I(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}i.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 r=0;r<e;r+=2)I(this,r,r+1);return this},i.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)I(this,r,r+3),I(this,r+1,r+2);return this},i.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)I(this,r,r+7),I(this,r+1,r+6),I(this,r+2,r+5),I(this,r+3,r+4);return this},i.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?he(this,0,e):N.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:i.compare(this,e)===0},i.prototype.inspect=function(){let e="";const r=T.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},b&&(i.prototype[b]=i.prototype.inspect),i.prototype.compare=function(e,r,n,f,c){if(ee(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),f===void 0&&(f=0),c===void 0&&(c=this.length),r<0||n>e.length||f<0||c>this.length)throw new RangeError("out of range index");if(f>=c&&r>=n)return 0;if(f>=c)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,f>>>=0,c>>>=0,this===e)return 0;let R=c-f,W=n-r;const z=Math.min(R,W),K=this.slice(f,c),X=e.slice(r,n);for(let V=0;V<z;++V)if(K[V]!==X[V]){R=K[V],W=X[V];break}return R<W?-1:W<R?1:0};function D(t,e,r,n,f){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,le(r)&&(r=f?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(f)return-1;r=t.length-1}else if(r<0)if(f)r=0;else return-1;if(typeof e=="string"&&(e=i.from(e,n)),i.isBuffer(e))return e.length===0?-1:G(t,e,r,n,f);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?f?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):G(t,[e],r,n,f);throw new TypeError("val must be string, number or Buffer")}function G(t,e,r,n,f){let c=1,R=t.length,W=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;c=2,R/=2,W/=2,r/=2}function z(X,V){return c===1?X[V]:X.readUInt16BE(V*c)}let K;if(f){let X=-1;for(K=r;K<R;K++)if(z(t,K)===z(e,X===-1?0:K-X)){if(X===-1&&(X=K),K-X+1===W)return X*c}else X!==-1&&(K-=K-X),X=-1}else for(r+W>R&&(r=R-W),K=r;K>=0;K--){let X=!0;for(let V=0;V<W;V++)if(z(t,K+V)!==z(e,V)){X=!1;break}if(X)return K}return-1}i.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1},i.prototype.indexOf=function(e,r,n){return D(this,e,r,n,!0)},i.prototype.lastIndexOf=function(e,r,n){return D(this,e,r,n,!1)};function k(t,e,r,n){r=Number(r)||0;const f=t.length-r;n?(n=Number(n),n>f&&(n=f)):n=f;const c=e.length;n>c/2&&(n=c/2);let R;for(R=0;R<n;++R){const W=parseInt(e.substr(R*2,2),16);if(le(W))return R;t[r+R]=W}return R}function P(t,e,r,n){return we($(e,t.length-r),t,r,n)}function Q(t,e,r,n){return we(ae(e),t,r,n)}function ue(t,e,r,n){return we(ve(e),t,r,n)}function me(t,e,r,n){return we(ge(e,t.length-r),t,r,n)}i.prototype.write=function(e,r,n,f){if(r===void 0)f="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")f=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,f===void 0&&(f="utf8")):(f=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const c=this.length-r;if((n===void 0||n>c)&&(n=c),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");let R=!1;for(;;)switch(f){case"hex":return k(this,e,r,n);case"utf8":case"utf-8":return P(this,e,r,n);case"ascii":case"latin1":case"binary":return Q(this,e,r,n);case"base64":return ue(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,e,r,n);default:if(R)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),R=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(t,e,r){return e===0&&r===t.length?w.fromByteArray(t):w.fromByteArray(t.slice(e,r))}function he(t,e,r){r=Math.min(t.length,r);const n=[];let f=e;for(;f<r;){const c=t[f];let R=null,W=c>239?4:c>223?3:c>191?2:1;if(f+W<=r){let z,K,X,V;switch(W){case 1:c<128&&(R=c);break;case 2:z=t[f+1],(z&192)===128&&(V=(c&31)<<6|z&63,V>127&&(R=V));break;case 3:z=t[f+1],K=t[f+2],(z&192)===128&&(K&192)===128&&(V=(c&15)<<12|(z&63)<<6|K&63,V>2047&&(V<55296||V>57343)&&(R=V));break;case 4:z=t[f+1],K=t[f+2],X=t[f+3],(z&192)===128&&(K&192)===128&&(X&192)===128&&(V=(c&15)<<18|(z&63)<<12|(K&63)<<6|X&63,V>65535&&V<1114112&&(R=V))}}R===null?(R=65533,W=1):R>65535&&(R-=65536,n.push(R>>>10&1023|55296),R=56320|R&1023),n.push(R),f+=W}return Re(n)}const fe=4096;function Re(t){const e=t.length;if(e<=fe)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=fe));return r}function ne(t,e,r){let n="";r=Math.min(t.length,r);for(let f=e;f<r;++f)n+=String.fromCharCode(t[f]&127);return n}function ce(t,e,r){let n="";r=Math.min(t.length,r);for(let f=e;f<r;++f)n+=String.fromCharCode(t[f]);return n}function oe(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let f="";for(let c=e;c<r;++c)f+=Se[t[c]];return f}function de(t,e,r){const n=t.slice(e,r);let f="";for(let c=0;c<n.length-1;c+=2)f+=String.fromCharCode(n[c]+n[c+1]*256);return f}i.prototype.slice=function(e,r){const n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);const f=this.subarray(e,r);return Object.setPrototypeOf(f,i.prototype),f};function J(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=this[e],c=1,R=0;for(;++R<r&&(c*=256);)f+=this[e+R]*c;return f},i.prototype.readUintBE=i.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=this[e+--r],c=1;for(;r>0&&(c*=256);)f+=this[e+--r]*c;return f},i.prototype.readUint8=i.prototype.readUInt8=function(e,r){return e=e>>>0,r||J(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||J(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||J(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||J(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||J(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,c=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(f)+(BigInt(c)<<BigInt(32))}),i.prototype.readBigUInt64BE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],c=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(f)<<BigInt(32))+BigInt(c)}),i.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=this[e],c=1,R=0;for(;++R<r&&(c*=256);)f+=this[e+R]*c;return c*=128,f>=c&&(f-=Math.pow(2,8*r)),f},i.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=r,c=1,R=this[e+--f];for(;f>0&&(c*=256);)R+=this[e+--f]*c;return c*=128,R>=c&&(R-=Math.pow(2,8*r)),R},i.prototype.readInt8=function(e,r){return e=e>>>0,r||J(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},i.prototype.readInt16LE=function(e,r){e=e>>>0,r||J(e,2,this.length);const n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},i.prototype.readInt16BE=function(e,r){e=e>>>0,r||J(e,2,this.length);const n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},i.prototype.readInt32LE=function(e,r){return e=e>>>0,r||J(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,r){return e=e>>>0,r||J(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(f)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),i.prototype.readBigInt64BE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(f)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),i.prototype.readFloatLE=function(e,r){return e=e>>>0,r||J(e,4,this.length),M.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,r){return e=e>>>0,r||J(e,4,this.length),M.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||J(e,8,this.length),M.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||J(e,8,this.length),M.read(this,e,!1,52,8)};function Z(t,e,r,n,f,c){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||e<c)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,r,n,f){if(e=+e,r=r>>>0,n=n>>>0,!f){const W=Math.pow(2,8*n)-1;Z(this,e,r,n,W,0)}let c=1,R=0;for(this[r]=e&255;++R<n&&(c*=256);)this[r+R]=e/c&255;return r+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(e,r,n,f){if(e=+e,r=r>>>0,n=n>>>0,!f){const W=Math.pow(2,8*n)-1;Z(this,e,r,n,W,0)}let c=n-1,R=1;for(this[r+c]=e&255;--c>=0&&(R*=256);)this[r+c]=e/R&255;return r+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,1,255,0),this[r]=e&255,r+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function te(t,e,r,n,f){a(e,n,f,t,r,7);let c=Number(e&BigInt(4294967295));t[r++]=c,c=c>>8,t[r++]=c,c=c>>8,t[r++]=c,c=c>>8,t[r++]=c;let R=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=R,R=R>>8,t[r++]=R,R=R>>8,t[r++]=R,R=R>>8,t[r++]=R,r}function pe(t,e,r,n,f){a(e,n,f,t,r,7);let c=Number(e&BigInt(4294967295));t[r+7]=c,c=c>>8,t[r+6]=c,c=c>>8,t[r+5]=c,c=c>>8,t[r+4]=c;let R=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=R,R=R>>8,t[r+2]=R,R=R>>8,t[r+1]=R,R=R>>8,t[r]=R,r+8}i.prototype.writeBigUInt64LE=re(function(e,r=0){return te(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=re(function(e,r=0){return pe(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(e,r,n,f){if(e=+e,r=r>>>0,!f){const z=Math.pow(2,8*n-1);Z(this,e,r,n,z-1,-z)}let c=0,R=1,W=0;for(this[r]=e&255;++c<n&&(R*=256);)e<0&&W===0&&this[r+c-1]!==0&&(W=1),this[r+c]=(e/R>>0)-W&255;return r+n},i.prototype.writeIntBE=function(e,r,n,f){if(e=+e,r=r>>>0,!f){const z=Math.pow(2,8*n-1);Z(this,e,r,n,z-1,-z)}let c=n-1,R=1,W=0;for(this[r+c]=e&255;--c>=0&&(R*=256);)e<0&&W===0&&this[r+c+1]!==0&&(W=1),this[r+c]=(e/R>>0)-W&255;return r+n},i.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},i.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},i.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},i.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},i.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},i.prototype.writeBigInt64LE=re(function(e,r=0){return te(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=re(function(e,r=0){return pe(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(t,e,r,n,f,c){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function d(t,e,r,n,f){return e=+e,r=r>>>0,f||ye(t,e,r,4),M.write(t,e,r,n,23,4),r+4}i.prototype.writeFloatLE=function(e,r,n){return d(this,e,r,!0,n)},i.prototype.writeFloatBE=function(e,r,n){return d(this,e,r,!1,n)};function h(t,e,r,n,f){return e=+e,r=r>>>0,f||ye(t,e,r,8),M.write(t,e,r,n,52,8),r+8}i.prototype.writeDoubleLE=function(e,r,n){return h(this,e,r,!0,n)},i.prototype.writeDoubleBE=function(e,r,n){return h(this,e,r,!1,n)},i.prototype.copy=function(e,r,n,f){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!f&&f!==0&&(f=this.length),r>=e.length&&(r=e.length),r||(r=0),f>0&&f<n&&(f=n),f===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),e.length-r<f-n&&(f=e.length-r+n);const c=f-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,f):Uint8Array.prototype.set.call(e,this.subarray(n,f),r),c},i.prototype.fill=function(e,r,n,f){if(typeof e=="string"){if(typeof r=="string"?(f=r,r=0,n=this.length):typeof n=="string"&&(f=n,n=this.length),f!==void 0&&typeof f!="string")throw new TypeError("encoding must be a string");if(typeof f=="string"&&!i.isEncoding(f))throw new TypeError("Unknown encoding: "+f);if(e.length===1){const R=e.charCodeAt(0);(f==="utf8"&&R<128||f==="latin1")&&(e=R)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let c;if(typeof e=="number")for(c=r;c<n;++c)this[c]=e;else{const R=i.isBuffer(e)?e:i.from(e,f),W=R.length;if(W===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(c=0;c<n-r;++c)this[c+r]=R[c%W]}return this};const A={};function O(t,e,r){A[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(f){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:f,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}O("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),O("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),O("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,f=r;return Number.isInteger(r)&&Math.abs(r)>2**32?f=q(String(r)):typeof r=="bigint"&&(f=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(f=q(f)),f+="n"),n+=` It must be ${e}. Received ${f}`,n},RangeError);function q(t){let e="",r=t.length;const n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function o(t,e,r){B(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&U(e,t.length-(r+1))}function a(t,e,r,n,f,c){if(t>r||t<e){const R=typeof e=="bigint"?"n":"";let W;throw c>3?e===0||e===BigInt(0)?W=`>= 0${R} and < 2${R} ** ${(c+1)*8}${R}`:W=`>= -(2${R} ** ${(c+1)*8-1}${R}) and < 2 ** ${(c+1)*8-1}${R}`:W=`>= ${e}${R} and <= ${r}${R}`,new A.ERR_OUT_OF_RANGE("value",W,t)}o(n,f,c)}function B(t,e){if(typeof t!="number")throw new A.ERR_INVALID_ARG_TYPE(e,"number",t)}function U(t,e,r){throw Math.floor(t)!==t?(B(t,r),new A.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}const Y=/[^+/0-9A-Za-z-_]/g;function j(t){if(t=t.split("=")[0],t=t.trim().replace(Y,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function $(t,e){e=e||1/0;let r;const n=t.length;let f=null;const c=[];for(let R=0;R<n;++R){if(r=t.charCodeAt(R),r>55295&&r<57344){if(!f){if(r>56319){(e-=3)>-1&&c.push(239,191,189);continue}else if(R+1===n){(e-=3)>-1&&c.push(239,191,189);continue}f=r;continue}if(r<56320){(e-=3)>-1&&c.push(239,191,189),f=r;continue}r=(f-55296<<10|r-56320)+65536}else f&&(e-=3)>-1&&c.push(239,191,189);if(f=null,r<128){if((e-=1)<0)break;c.push(r)}else if(r<2048){if((e-=2)<0)break;c.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;c.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;c.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return c}function ae(t){const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function ge(t,e){let r,n,f;const c=[];for(let R=0;R<t.length&&!((e-=2)<0);++R)r=t.charCodeAt(R),n=r>>8,f=r%256,c.push(f),c.push(n);return c}function ve(t){return w.toByteArray(j(t))}function we(t,e,r,n){let f;for(f=0;f<n&&!(f+r>=e.length||f>=t.length);++f)e[f+r]=t[f];return f}function ee(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function le(t){return t!==t}const Se=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let f=0;f<16;++f)e[n+f]=t[r]+t[f]}return e}();function re(t){return typeof BigInt>"u"?se:t}function se(){throw new Error("BigInt not supported")}}(Me)),Me}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var tr;function Pr(){return tr||(tr=1,function(T,w){var M=Ie(),b=M.Buffer;function L(y,i){for(var l in y)i[l]=y[l]}b.from&&b.alloc&&b.allocUnsafe&&b.allocUnsafeSlow?T.exports=M:(L(M,w),w.Buffer=E);function E(y,i,l){return b(y,i,l)}E.prototype=Object.create(b.prototype),L(b,E),E.from=function(y,i,l){if(typeof y=="number")throw new TypeError("Argument must not be a number");return b(y,i,l)},E.alloc=function(y,i,l){if(typeof y!="number")throw new TypeError("Argument must be a number");var v=b(y);return i!==void 0?typeof l=="string"?v.fill(i,l):v.fill(i):v.fill(0),v},E.allocUnsafe=function(y){if(typeof y!="number")throw new TypeError("Argument must be a number");return b(y)},E.allocUnsafeSlow=function(y){if(typeof y!="number")throw new TypeError("Argument must be a number");return M.SlowBuffer(y)}}(Be,Be.exports)),Be.exports}var Ne,nr;function Jr(){if(nr)return Ne;nr=1;var T=Nr;return Ne=function(M){return!!T(M)},Ne}var Ae={exports:{}},Le,ir;function Br(){return ir||(ir=1,Le=xr.EventEmitter),Le}var Ue,or;function kr(){if(or)return Ue;or=1;function T(S,F){var x=Object.keys(S);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(S);F&&(u=u.filter(function(p){return Object.getOwnPropertyDescriptor(S,p).enumerable})),x.push.apply(x,u)}return x}function w(S){for(var F=1;F<arguments.length;F++){var x=arguments[F]!=null?arguments[F]:{};F%2?T(Object(x),!0).forEach(function(u){M(S,u,x[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(x)):T(Object(x)).forEach(function(u){Object.defineProperty(S,u,Object.getOwnPropertyDescriptor(x,u))})}return S}function M(S,F,x){return F=y(F),F in S?Object.defineProperty(S,F,{value:x,enumerable:!0,configurable:!0,writable:!0}):S[F]=x,S}function b(S,F){if(!(S instanceof F))throw new TypeError("Cannot call a class as a function")}function L(S,F){for(var x=0;x<F.length;x++){var u=F[x];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(S,y(u.key),u)}}function E(S,F,x){return F&&L(S.prototype,F),x&&L(S,x),Object.defineProperty(S,"prototype",{writable:!1}),S}function y(S){var F=i(S,"string");return typeof F=="symbol"?F:String(F)}function i(S,F){if(typeof S!="object"||S===null)return S;var x=S[Symbol.toPrimitive];if(x!==void 0){var u=x.call(S,F||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(S)}var l=Ie(),v=l.Buffer,m=Cr,s=m.inspect,g=s&&s.custom||"inspect";function _(S,F,x){v.prototype.copy.call(S,F,x)}return Ue=function(){function S(){b(this,S),this.head=null,this.tail=null,this.length=0}return E(S,[{key:"push",value:function(x){var u={data:x,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}},{key:"unshift",value:function(x){var u={data:x,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}},{key:"shift",value:function(){if(this.length!==0){var x=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,x}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(x){if(this.length===0)return"";for(var u=this.head,p=""+u.data;u=u.next;)p+=x+u.data;return p}},{key:"concat",value:function(x){if(this.length===0)return v.alloc(0);for(var u=v.allocUnsafe(x>>>0),p=this.head,C=0;p;)_(p.data,u,C),C+=p.data.length,p=p.next;return u}},{key:"consume",value:function(x,u){var p;return x<this.head.data.length?(p=this.head.data.slice(0,x),this.head.data=this.head.data.slice(x)):x===this.head.data.length?p=this.shift():p=u?this._getString(x):this._getBuffer(x),p}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(x){var u=this.head,p=1,C=u.data;for(x-=C.length;u=u.next;){var N=u.data,I=x>N.length?N.length:x;if(I===N.length?C+=N:C+=N.slice(0,x),x-=I,x===0){I===N.length?(++p,u.next?this.head=u.next:this.head=this.tail=null):(this.head=u,u.data=N.slice(I));break}++p}return this.length-=p,C}},{key:"_getBuffer",value:function(x){var u=v.allocUnsafe(x),p=this.head,C=1;for(p.data.copy(u),x-=p.data.length;p=p.next;){var N=p.data,I=x>N.length?N.length:x;if(N.copy(u,u.length-x,0,I),x-=I,x===0){I===N.length?(++C,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=N.slice(I));break}++C}return this.length-=C,u}},{key:g,value:function(x,u){return s(this,w(w({},u),{},{depth:0,customInspect:!1}))}}]),S}(),Ue}var Oe,ar;function Fr(){if(ar)return Oe;ar=1;function T(y,i){var l=this,v=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return v||m?(i?i(y):y&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,H.nextTick(L,this,y)):H.nextTick(L,this,y)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(y||null,function(s){!i&&s?l._writableState?l._writableState.errorEmitted?H.nextTick(M,l):(l._writableState.errorEmitted=!0,H.nextTick(w,l,s)):H.nextTick(w,l,s):i?(H.nextTick(M,l),i(s)):H.nextTick(M,l)}),this)}function w(y,i){L(y,i),M(y)}function M(y){y._writableState&&!y._writableState.emitClose||y._readableState&&!y._readableState.emitClose||y.emit("close")}function b(){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)}function L(y,i){y.emit("error",i)}function E(y,i){var l=y._readableState,v=y._writableState;l&&l.autoDestroy||v&&v.autoDestroy?y.destroy(i):y.emit("error",i)}return Oe={destroy:T,undestroy:b,errorOrDestroy:E},Oe}var De={},ur;function _e(){if(ur)return De;ur=1;function T(i,l){i.prototype=Object.create(l.prototype),i.prototype.constructor=i,i.__proto__=l}var w={};function M(i,l,v){v||(v=Error);function m(g,_,S){return typeof l=="string"?l:l(g,_,S)}var s=function(g){T(_,g);function _(S,F,x){return g.call(this,m(S,F,x))||this}return _}(v);s.prototype.name=v.name,s.prototype.code=i,w[i]=s}function b(i,l){if(Array.isArray(i)){var v=i.length;return i=i.map(function(m){return String(m)}),v>2?"one of ".concat(l," ").concat(i.slice(0,v-1).join(", "),", or ")+i[v-1]:v===2?"one of ".concat(l," ").concat(i[0]," or ").concat(i[1]):"of ".concat(l," ").concat(i[0])}else return"of ".concat(l," ").concat(String(i))}function L(i,l,v){return i.substr(!v||v<0?0:+v,l.length)===l}function E(i,l,v){return(v===void 0||v>i.length)&&(v=i.length),i.substring(v-l.length,v)===l}function y(i,l,v){return typeof v!="number"&&(v=0),v+l.length>i.length?!1:i.indexOf(l,v)!==-1}return M("ERR_INVALID_OPT_VALUE",function(i,l){return'The value "'+l+'" is invalid for option "'+i+'"'},TypeError),M("ERR_INVALID_ARG_TYPE",function(i,l,v){var m;typeof l=="string"&&L(l,"not ")?(m="must not be",l=l.replace(/^not /,"")):m="must be";var s;if(E(i," argument"))s="The ".concat(i," ").concat(m," ").concat(b(l,"type"));else{var g=y(i,".")?"property":"argument";s='The "'.concat(i,'" ').concat(g," ").concat(m," ").concat(b(l,"type"))}return s+=". Received type ".concat(typeof v),s},TypeError),M("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),M("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),M("ERR_STREAM_PREMATURE_CLOSE","Premature close"),M("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),M("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),M("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),M("ERR_STREAM_WRITE_AFTER_END","write after end"),M("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),M("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),M("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),De.codes=w,De}var Pe,fr;function Ar(){if(fr)return Pe;fr=1;var T=_e().codes.ERR_INVALID_OPT_VALUE;function w(b,L,E){return b.highWaterMark!=null?b.highWaterMark:L?b[E]:null}function M(b,L,E,y){var i=w(L,y,E);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var l=y?E:"highWaterMark";throw new T(l,i)}return Math.floor(i)}return b.objectMode?16:16*1024}return Pe={getHighWaterMark:M},Pe}var ke,lr;function qr(){if(lr)return ke;lr=1,ke=T;function T(M,b){if(w("noDeprecation"))return M;var L=!1;function E(){if(!L){if(w("throwDeprecation"))throw new Error(b);w("traceDeprecation")?console.trace(b):console.warn(b),L=!0}return M.apply(this,arguments)}return E}function w(M){try{if(!be.localStorage)return!1}catch{return!1}var b=be.localStorage[M];return b==null?!1:String(b).toLowerCase()==="true"}return ke}var qe,sr;function Tr(){if(sr)return qe;sr=1,qe=k;function T(d){var h=this;this.next=null,this.entry=null,this.finish=function(){ye(h,d)}}var w;k.WritableState=D;var M={deprecate:qr()},b=Br(),L=Ie().Buffer,E=(typeof be<"u"?be:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function y(d){return L.from(d)}function i(d){return L.isBuffer(d)||d instanceof E}var l=Fr(),v=Ar(),m=v.getHighWaterMark,s=_e().codes,g=s.ERR_INVALID_ARG_TYPE,_=s.ERR_METHOD_NOT_IMPLEMENTED,S=s.ERR_MULTIPLE_CALLBACK,F=s.ERR_STREAM_CANNOT_PIPE,x=s.ERR_STREAM_DESTROYED,u=s.ERR_STREAM_NULL_VALUES,p=s.ERR_STREAM_WRITE_AFTER_END,C=s.ERR_UNKNOWN_ENCODING,N=l.errorOrDestroy;Ce(k,b);function I(){}function D(d,h,A){w=w||Ee(),d=d||{},typeof A!="boolean"&&(A=h instanceof w),this.objectMode=!!d.objectMode,A&&(this.objectMode=this.objectMode||!!d.writableObjectMode),this.highWaterMark=m(this,d,"writableHighWaterMark",A),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var O=d.decodeStrings===!1;this.decodeStrings=!O,this.defaultEncoding=d.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){Re(h,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new T(this)}D.prototype.getBuffer=function(){for(var h=this.bufferedRequest,A=[];h;)A.push(h),h=h.next;return A},function(){try{Object.defineProperty(D.prototype,"buffer",{get:M.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(h){return G.call(this,h)?!0:this!==k?!1:h&&h._writableState instanceof D}})):G=function(h){return h instanceof this};function k(d){w=w||Ee();var h=this instanceof w;if(!h&&!G.call(k,this))return new k(d);this._writableState=new D(d,this,h),this.writable=!0,d&&(typeof d.write=="function"&&(this._write=d.write),typeof d.writev=="function"&&(this._writev=d.writev),typeof d.destroy=="function"&&(this._destroy=d.destroy),typeof d.final=="function"&&(this._final=d.final)),b.call(this)}k.prototype.pipe=function(){N(this,new F)};function P(d,h){var A=new p;N(d,A),H.nextTick(h,A)}function Q(d,h,A,O){var q;return A===null?q=new u:typeof A!="string"&&!h.objectMode&&(q=new g("chunk",["string","Buffer"],A)),q?(N(d,q),H.nextTick(O,q),!1):!0}k.prototype.write=function(d,h,A){var O=this._writableState,q=!1,o=!O.objectMode&&i(d);return o&&!L.isBuffer(d)&&(d=y(d)),typeof h=="function"&&(A=h,h=null),o?h="buffer":h||(h=O.defaultEncoding),typeof A!="function"&&(A=I),O.ending?P(this,A):(o||Q(this,O,d,A))&&(O.pendingcb++,q=me(this,O,o,d,h,A)),q},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var d=this._writableState;d.corked&&(d.corked--,!d.writing&&!d.corked&&!d.bufferProcessing&&d.bufferedRequest&&oe(this,d))},k.prototype.setDefaultEncoding=function(h){if(typeof h=="string"&&(h=h.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((h+"").toLowerCase())>-1))throw new C(h);return this._writableState.defaultEncoding=h,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ue(d,h,A){return!d.objectMode&&d.decodeStrings!==!1&&typeof h=="string"&&(h=L.from(h,A)),h}Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function me(d,h,A,O,q,o){if(!A){var a=ue(h,O,q);O!==a&&(A=!0,q="buffer",O=a)}var B=h.objectMode?1:O.length;h.length+=B;var U=h.length<h.highWaterMark;if(U||(h.needDrain=!0),h.writing||h.corked){var Y=h.lastBufferedRequest;h.lastBufferedRequest={chunk:O,encoding:q,isBuf:A,callback:o,next:null},Y?Y.next=h.lastBufferedRequest:h.bufferedRequest=h.lastBufferedRequest,h.bufferedRequestCount+=1}else ie(d,h,!1,B,O,q,o);return U}function ie(d,h,A,O,q,o,a){h.writelen=O,h.writecb=a,h.writing=!0,h.sync=!0,h.destroyed?h.onwrite(new x("write")):A?d._writev(q,h.onwrite):d._write(q,o,h.onwrite),h.sync=!1}function he(d,h,A,O,q){--h.pendingcb,A?(H.nextTick(q,O),H.nextTick(te,d,h),d._writableState.errorEmitted=!0,N(d,O)):(q(O),d._writableState.errorEmitted=!0,N(d,O),te(d,h))}function fe(d){d.writing=!1,d.writecb=null,d.length-=d.writelen,d.writelen=0}function Re(d,h){var A=d._writableState,O=A.sync,q=A.writecb;if(typeof q!="function")throw new S;if(fe(A),h)he(d,A,O,h,q);else{var o=de(A)||d.destroyed;!o&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&oe(d,A),O?H.nextTick(ne,d,A,o,q):ne(d,A,o,q)}}function ne(d,h,A,O){A||ce(d,h),h.pendingcb--,O(),te(d,h)}function ce(d,h){h.length===0&&h.needDrain&&(h.needDrain=!1,d.emit("drain"))}function oe(d,h){h.bufferProcessing=!0;var A=h.bufferedRequest;if(d._writev&&A&&A.next){var O=h.bufferedRequestCount,q=new Array(O),o=h.corkedRequestsFree;o.entry=A;for(var a=0,B=!0;A;)q[a]=A,A.isBuf||(B=!1),A=A.next,a+=1;q.allBuffers=B,ie(d,h,!0,h.length,q,"",o.finish),h.pendingcb++,h.lastBufferedRequest=null,o.next?(h.corkedRequestsFree=o.next,o.next=null):h.corkedRequestsFree=new T(h),h.bufferedRequestCount=0}else{for(;A;){var U=A.chunk,Y=A.encoding,j=A.callback,$=h.objectMode?1:U.length;if(ie(d,h,!1,$,U,Y,j),A=A.next,h.bufferedRequestCount--,h.writing)break}A===null&&(h.lastBufferedRequest=null)}h.bufferedRequest=A,h.bufferProcessing=!1}k.prototype._write=function(d,h,A){A(new _("_write()"))},k.prototype._writev=null,k.prototype.end=function(d,h,A){var O=this._writableState;return typeof d=="function"?(A=d,d=null,h=null):typeof h=="function"&&(A=h,h=null),d!=null&&this.write(d,h),O.corked&&(O.corked=1,this.uncork()),O.ending||pe(this,O,A),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function de(d){return d.ending&&d.length===0&&d.bufferedRequest===null&&!d.finished&&!d.writing}function J(d,h){d._final(function(A){h.pendingcb--,A&&N(d,A),h.prefinished=!0,d.emit("prefinish"),te(d,h)})}function Z(d,h){!h.prefinished&&!h.finalCalled&&(typeof d._final=="function"&&!h.destroyed?(h.pendingcb++,h.finalCalled=!0,H.nextTick(J,d,h)):(h.prefinished=!0,d.emit("prefinish")))}function te(d,h){var A=de(h);if(A&&(Z(d,h),h.pendingcb===0&&(h.finished=!0,d.emit("finish"),h.autoDestroy))){var O=d._readableState;(!O||O.autoDestroy&&O.endEmitted)&&d.destroy()}return A}function pe(d,h,A){h.ending=!0,te(d,h),A&&(h.finished?H.nextTick(A):d.once("finish",A)),h.ended=!0,d.writable=!1}function ye(d,h,A){var O=d.entry;for(d.entry=null;O;){var q=O.callback;h.pendingcb--,q(A),O=O.next}h.corkedRequestsFree.next=d}return Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(h){this._writableState&&(this._writableState.destroyed=h)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(d,h){h(d)},qe}var je,hr;function Ee(){if(hr)return je;hr=1;var T=Object.keys||function(v){var m=[];for(var s in v)m.push(s);return m};je=y;var w=Ir(),M=Tr();Ce(y,w);for(var b=T(M.prototype),L=0;L<b.length;L++){var E=b[L];y.prototype[E]||(y.prototype[E]=M.prototype[E])}function y(v){if(!(this instanceof y))return new y(v);w.call(this,v),M.call(this,v),this.allowHalfOpen=!0,v&&(v.readable===!1&&(this.readable=!1),v.writable===!1&&(this.writable=!1),v.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",i)))}Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(y.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(y.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function i(){this._writableState.ended||H.nextTick(l,this)}function l(v){v.end()}return Object.defineProperty(y.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(m){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=m,this._writableState.destroyed=m)}}),je}var We={},cr;function dr(){if(cr)return We;cr=1;var T=Pr().Buffer,w=T.isEncoding||function(u){switch(u=""+u,u&&u.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 M(u){if(!u)return"utf8";for(var p;;)switch(u){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 u;default:if(p)return;u=(""+u).toLowerCase(),p=!0}}function b(u){var p=M(u);if(typeof p!="string"&&(T.isEncoding===w||!w(u)))throw new Error("Unknown encoding: "+u);return p||u}We.StringDecoder=L;function L(u){this.encoding=b(u);var p;switch(this.encoding){case"utf16le":this.text=s,this.end=g,p=4;break;case"utf8":this.fillLast=l,p=4;break;case"base64":this.text=_,this.end=S,p=3;break;default:this.write=F,this.end=x;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=T.allocUnsafe(p)}L.prototype.write=function(u){if(u.length===0)return"";var p,C;if(this.lastNeed){if(p=this.fillLast(u),p===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;return C<u.length?p?p+this.text(u,C):this.text(u,C):p||""},L.prototype.end=m,L.prototype.text=v,L.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length};function E(u){return u<=127?0:u>>5===6?2:u>>4===14?3:u>>3===30?4:u>>6===2?-1:-2}function y(u,p,C){var N=p.length-1;if(N<C)return 0;var I=E(p[N]);return I>=0?(I>0&&(u.lastNeed=I-1),I):--N<C||I===-2?0:(I=E(p[N]),I>=0?(I>0&&(u.lastNeed=I-2),I):--N<C||I===-2?0:(I=E(p[N]),I>=0?(I>0&&(I===2?I=0:u.lastNeed=I-3),I):0))}function i(u,p,C){if((p[0]&192)!==128)return u.lastNeed=0,"�";if(u.lastNeed>1&&p.length>1){if((p[1]&192)!==128)return u.lastNeed=1,"�";if(u.lastNeed>2&&p.length>2&&(p[2]&192)!==128)return u.lastNeed=2,"�"}}function l(u){var p=this.lastTotal-this.lastNeed,C=i(this,u);if(C!==void 0)return C;if(this.lastNeed<=u.length)return u.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,p,0,u.length),this.lastNeed-=u.length}function v(u,p){var C=y(this,u,p);if(!this.lastNeed)return u.toString("utf8",p);this.lastTotal=C;var N=u.length-(C-this.lastNeed);return u.copy(this.lastChar,0,N),u.toString("utf8",p,N)}function m(u){var p=u&&u.length?this.write(u):"";return this.lastNeed?p+"�":p}function s(u,p){if((u.length-p)%2===0){var C=u.toString("utf16le",p);if(C){var N=C.charCodeAt(C.length-1);if(N>=55296&&N<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",p,u.length-1)}function g(u){var p=u&&u.length?this.write(u):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return p+this.lastChar.toString("utf16le",0,C)}return p}function _(u,p){var C=(u.length-p)%3;return C===0?u.toString("base64",p):(this.lastNeed=3-C,this.lastTotal=3,C===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",p,u.length-C))}function S(u){var p=u&&u.length?this.write(u):"";return this.lastNeed?p+this.lastChar.toString("base64",0,3-this.lastNeed):p}function F(u){return u.toString(this.encoding)}function x(u){return u&&u.length?this.write(u):""}return We}var $e,pr;function Ze(){if(pr)return $e;pr=1;var T=_e().codes.ERR_STREAM_PREMATURE_CLOSE;function w(E){var y=!1;return function(){if(!y){y=!0;for(var i=arguments.length,l=new Array(i),v=0;v<i;v++)l[v]=arguments[v];E.apply(this,l)}}}function M(){}function b(E){return E.setHeader&&typeof E.abort=="function"}function L(E,y,i){if(typeof y=="function")return L(E,null,y);y||(y={}),i=w(i||M);var l=y.readable||y.readable!==!1&&E.readable,v=y.writable||y.writable!==!1&&E.writable,m=function(){E.writable||g()},s=E._writableState&&E._writableState.finished,g=function(){v=!1,s=!0,l||i.call(E)},_=E._readableState&&E._readableState.endEmitted,S=function(){l=!1,_=!0,v||i.call(E)},F=function(C){i.call(E,C)},x=function(){var C;if(l&&!_)return(!E._readableState||!E._readableState.ended)&&(C=new T),i.call(E,C);if(v&&!s)return(!E._writableState||!E._writableState.ended)&&(C=new T),i.call(E,C)},u=function(){E.req.on("finish",g)};return b(E)?(E.on("complete",g),E.on("abort",x),E.req?u():E.on("request",u)):v&&!E._writableState&&(E.on("end",m),E.on("close",m)),E.on("end",S),E.on("finish",g),y.error!==!1&&E.on("error",F),E.on("close",x),function(){E.removeListener("complete",g),E.removeListener("abort",x),E.removeListener("request",u),E.req&&E.req.removeListener("finish",g),E.removeListener("end",m),E.removeListener("close",m),E.removeListener("finish",g),E.removeListener("end",S),E.removeListener("error",F),E.removeListener("close",x)}}return $e=L,$e}var He,yr;function jr(){if(yr)return He;yr=1;var T;function w(C,N,I){return N=M(N),N in C?Object.defineProperty(C,N,{value:I,enumerable:!0,configurable:!0,writable:!0}):C[N]=I,C}function M(C){var N=b(C,"string");return typeof N=="symbol"?N:String(N)}function b(C,N){if(typeof C!="object"||C===null)return C;var I=C[Symbol.toPrimitive];if(I!==void 0){var D=I.call(C,N||"default");if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(N==="string"?String:Number)(C)}var L=Ze(),E=Symbol("lastResolve"),y=Symbol("lastReject"),i=Symbol("error"),l=Symbol("ended"),v=Symbol("lastPromise"),m=Symbol("handlePromise"),s=Symbol("stream");function g(C,N){return{value:C,done:N}}function _(C){var N=C[E];if(N!==null){var I=C[s].read();I!==null&&(C[v]=null,C[E]=null,C[y]=null,N(g(I,!1)))}}function S(C){H.nextTick(_,C)}function F(C,N){return function(I,D){C.then(function(){if(N[l]){I(g(void 0,!0));return}N[m](I,D)},D)}}var x=Object.getPrototypeOf(function(){}),u=Object.setPrototypeOf((T={get stream(){return this[s]},next:function(){var N=this,I=this[i];if(I!==null)return Promise.reject(I);if(this[l])return Promise.resolve(g(void 0,!0));if(this[s].destroyed)return new Promise(function(P,Q){H.nextTick(function(){N[i]?Q(N[i]):P(g(void 0,!0))})});var D=this[v],G;if(D)G=new Promise(F(D,this));else{var k=this[s].read();if(k!==null)return Promise.resolve(g(k,!1));G=new Promise(this[m])}return this[v]=G,G}},w(T,Symbol.asyncIterator,function(){return this}),w(T,"return",function(){var N=this;return new Promise(function(I,D){N[s].destroy(null,function(G){if(G){D(G);return}I(g(void 0,!0))})})}),T),x),p=function(N){var I,D=Object.create(u,(I={},w(I,s,{value:N,writable:!0}),w(I,E,{value:null,writable:!0}),w(I,y,{value:null,writable:!0}),w(I,i,{value:null,writable:!0}),w(I,l,{value:N._readableState.endEmitted,writable:!0}),w(I,m,{value:function(k,P){var Q=D[s].read();Q?(D[v]=null,D[E]=null,D[y]=null,k(g(Q,!1))):(D[E]=k,D[y]=P)},writable:!0}),I));return D[v]=null,L(N,function(G){if(G&&G.code!=="ERR_STREAM_PREMATURE_CLOSE"){var k=D[y];k!==null&&(D[v]=null,D[E]=null,D[y]=null,k(G)),D[i]=G;return}var P=D[E];P!==null&&(D[v]=null,D[E]=null,D[y]=null,P(g(void 0,!0))),D[l]=!0}),N.on("readable",S.bind(null,D)),D};return He=p,He}var Ge,gr;function Wr(){return gr||(gr=1,Ge=function(){throw new Error("Readable.from is not available in the browser")}),Ge}var Ve,wr;function Ir(){if(wr)return Ve;wr=1,Ve=P;var T;P.ReadableState=k,xr.EventEmitter;var w=function(a,B){return a.listeners(B).length},M=Br(),b=Ie().Buffer,L=(typeof be<"u"?be:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function E(o){return b.from(o)}function y(o){return b.isBuffer(o)||o instanceof L}var i=Cr,l;i&&i.debuglog?l=i.debuglog("stream"):l=function(){};var v=kr(),m=Fr(),s=Ar(),g=s.getHighWaterMark,_=_e().codes,S=_.ERR_INVALID_ARG_TYPE,F=_.ERR_STREAM_PUSH_AFTER_EOF,x=_.ERR_METHOD_NOT_IMPLEMENTED,u=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,p,C,N;Ce(P,M);var I=m.errorOrDestroy,D=["error","close","destroy","pause","resume"];function G(o,a,B){if(typeof o.prependListener=="function")return o.prependListener(a,B);!o._events||!o._events[a]?o.on(a,B):Array.isArray(o._events[a])?o._events[a].unshift(B):o._events[a]=[B,o._events[a]]}function k(o,a,B){T=T||Ee(),o=o||{},typeof B!="boolean"&&(B=a instanceof T),this.objectMode=!!o.objectMode,B&&(this.objectMode=this.objectMode||!!o.readableObjectMode),this.highWaterMark=g(this,o,"readableHighWaterMark",B),this.buffer=new v,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=o.emitClose!==!1,this.autoDestroy=!!o.autoDestroy,this.destroyed=!1,this.defaultEncoding=o.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,o.encoding&&(p||(p=dr().StringDecoder),this.decoder=new p(o.encoding),this.encoding=o.encoding)}function P(o){if(T=T||Ee(),!(this instanceof P))return new P(o);var a=this instanceof T;this._readableState=new k(o,this,a),this.readable=!0,o&&(typeof o.read=="function"&&(this._read=o.read),typeof o.destroy=="function"&&(this._destroy=o.destroy)),M.call(this)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(a){this._readableState&&(this._readableState.destroyed=a)}}),P.prototype.destroy=m.destroy,P.prototype._undestroy=m.undestroy,P.prototype._destroy=function(o,a){a(o)},P.prototype.push=function(o,a){var B=this._readableState,U;return B.objectMode?U=!0:typeof o=="string"&&(a=a||B.defaultEncoding,a!==B.encoding&&(o=b.from(o,a),a=""),U=!0),Q(this,o,a,!1,U)},P.prototype.unshift=function(o){return Q(this,o,null,!0,!1)};function Q(o,a,B,U,Y){l("readableAddChunk",a);var j=o._readableState;if(a===null)j.reading=!1,Re(o,j);else{var $;if(Y||($=me(j,a)),$)I(o,$);else if(j.objectMode||a&&a.length>0)if(typeof a!="string"&&!j.objectMode&&Object.getPrototypeOf(a)!==b.prototype&&(a=E(a)),U)j.endEmitted?I(o,new u):ue(o,j,a,!0);else if(j.ended)I(o,new F);else{if(j.destroyed)return!1;j.reading=!1,j.decoder&&!B?(a=j.decoder.write(a),j.objectMode||a.length!==0?ue(o,j,a,!1):oe(o,j)):ue(o,j,a,!1)}else U||(j.reading=!1,oe(o,j))}return!j.ended&&(j.length<j.highWaterMark||j.length===0)}function ue(o,a,B,U){a.flowing&&a.length===0&&!a.sync?(a.awaitDrain=0,o.emit("data",B)):(a.length+=a.objectMode?1:B.length,U?a.buffer.unshift(B):a.buffer.push(B),a.needReadable&&ne(o)),oe(o,a)}function me(o,a){var B;return!y(a)&&typeof a!="string"&&a!==void 0&&!o.objectMode&&(B=new S("chunk",["string","Buffer","Uint8Array"],a)),B}P.prototype.isPaused=function(){return this._readableState.flowing===!1},P.prototype.setEncoding=function(o){p||(p=dr().StringDecoder);var a=new p(o);this._readableState.decoder=a,this._readableState.encoding=this._readableState.decoder.encoding;for(var B=this._readableState.buffer.head,U="";B!==null;)U+=a.write(B.data),B=B.next;return this._readableState.buffer.clear(),U!==""&&this._readableState.buffer.push(U),this._readableState.length=U.length,this};var ie=1073741824;function he(o){return o>=ie?o=ie:(o--,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o++),o}function fe(o,a){return o<=0||a.length===0&&a.ended?0:a.objectMode?1:o!==o?a.flowing&&a.length?a.buffer.head.data.length:a.length:(o>a.highWaterMark&&(a.highWaterMark=he(o)),o<=a.length?o:a.ended?a.length:(a.needReadable=!0,0))}P.prototype.read=function(o){l("read",o),o=parseInt(o,10);var a=this._readableState,B=o;if(o!==0&&(a.emittedReadable=!1),o===0&&a.needReadable&&((a.highWaterMark!==0?a.length>=a.highWaterMark:a.length>0)||a.ended))return l("read: emitReadable",a.length,a.ended),a.length===0&&a.ended?A(this):ne(this),null;if(o=fe(o,a),o===0&&a.ended)return a.length===0&&A(this),null;var U=a.needReadable;l("need readable",U),(a.length===0||a.length-o<a.highWaterMark)&&(U=!0,l("length less than watermark",U)),a.ended||a.reading?(U=!1,l("reading or ended",U)):U&&(l("do read"),a.reading=!0,a.sync=!0,a.length===0&&(a.needReadable=!0),this._read(a.highWaterMark),a.sync=!1,a.reading||(o=fe(B,a)));var Y;return o>0?Y=h(o,a):Y=null,Y===null?(a.needReadable=a.length<=a.highWaterMark,o=0):(a.length-=o,a.awaitDrain=0),a.length===0&&(a.ended||(a.needReadable=!0),B!==o&&a.ended&&A(this)),Y!==null&&this.emit("data",Y),Y};function Re(o,a){if(l("onEofChunk"),!a.ended){if(a.decoder){var B=a.decoder.end();B&&B.length&&(a.buffer.push(B),a.length+=a.objectMode?1:B.length)}a.ended=!0,a.sync?ne(o):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,ce(o)))}}function ne(o){var a=o._readableState;l("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(l("emitReadable",a.flowing),a.emittedReadable=!0,H.nextTick(ce,o))}function ce(o){var a=o._readableState;l("emitReadable_",a.destroyed,a.length,a.ended),!a.destroyed&&(a.length||a.ended)&&(o.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,d(o)}function oe(o,a){a.readingMore||(a.readingMore=!0,H.nextTick(de,o,a))}function de(o,a){for(;!a.reading&&!a.ended&&(a.length<a.highWaterMark||a.flowing&&a.length===0);){var B=a.length;if(l("maybeReadMore read 0"),o.read(0),B===a.length)break}a.readingMore=!1}P.prototype._read=function(o){I(this,new x("_read()"))},P.prototype.pipe=function(o,a){var B=this,U=this._readableState;switch(U.pipesCount){case 0:U.pipes=o;break;case 1:U.pipes=[U.pipes,o];break;default:U.pipes.push(o);break}U.pipesCount+=1,l("pipe count=%d opts=%j",U.pipesCount,a);var Y=(!a||a.end!==!1)&&o!==H.stdout&&o!==H.stderr,j=Y?ae:se;U.endEmitted?H.nextTick(j):B.once("end",j),o.on("unpipe",$);function $(t,e){l("onunpipe"),t===B&&e&&e.hasUnpiped===!1&&(e.hasUnpiped=!0,we())}function ae(){l("onend"),o.end()}var ge=J(B);o.on("drain",ge);var ve=!1;function we(){l("cleanup"),o.removeListener("close",Se),o.removeListener("finish",re),o.removeListener("drain",ge),o.removeListener("error",le),o.removeListener("unpipe",$),B.removeListener("end",ae),B.removeListener("end",se),B.removeListener("data",ee),ve=!0,U.awaitDrain&&(!o._writableState||o._writableState.needDrain)&&ge()}B.on("data",ee);function ee(t){l("ondata");var e=o.write(t);l("dest.write",e),e===!1&&((U.pipesCount===1&&U.pipes===o||U.pipesCount>1&&q(U.pipes,o)!==-1)&&!ve&&(l("false write response, pause",U.awaitDrain),U.awaitDrain++),B.pause())}function le(t){l("onerror",t),se(),o.removeListener("error",le),w(o,"error")===0&&I(o,t)}G(o,"error",le);function Se(){o.removeListener("finish",re),se()}o.once("close",Se);function re(){l("onfinish"),o.removeListener("close",Se),se()}o.once("finish",re);function se(){l("unpipe"),B.unpipe(o)}return o.emit("pipe",B),U.flowing||(l("pipe resume"),B.resume()),o};function J(o){return function(){var B=o._readableState;l("pipeOnDrain",B.awaitDrain),B.awaitDrain&&B.awaitDrain--,B.awaitDrain===0&&w(o,"data")&&(B.flowing=!0,d(o))}}P.prototype.unpipe=function(o){var a=this._readableState,B={hasUnpiped:!1};if(a.pipesCount===0)return this;if(a.pipesCount===1)return o&&o!==a.pipes?this:(o||(o=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,o&&o.emit("unpipe",this,B),this);if(!o){var U=a.pipes,Y=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var j=0;j<Y;j++)U[j].emit("unpipe",this,{hasUnpiped:!1});return this}var $=q(a.pipes,o);return $===-1?this:(a.pipes.splice($,1),a.pipesCount-=1,a.pipesCount===1&&(a.pipes=a.pipes[0]),o.emit("unpipe",this,B),this)},P.prototype.on=function(o,a){var B=M.prototype.on.call(this,o,a),U=this._readableState;return o==="data"?(U.readableListening=this.listenerCount("readable")>0,U.flowing!==!1&&this.resume()):o==="readable"&&!U.endEmitted&&!U.readableListening&&(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,l("on readable",U.length,U.reading),U.length?ne(this):U.reading||H.nextTick(te,this)),B},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(o,a){var B=M.prototype.removeListener.call(this,o,a);return o==="readable"&&H.nextTick(Z,this),B},P.prototype.removeAllListeners=function(o){var a=M.prototype.removeAllListeners.apply(this,arguments);return(o==="readable"||o===void 0)&&H.nextTick(Z,this),a};function Z(o){var a=o._readableState;a.readableListening=o.listenerCount("readable")>0,a.resumeScheduled&&!a.paused?a.flowing=!0:o.listenerCount("data")>0&&o.resume()}function te(o){l("readable nexttick read 0"),o.read(0)}P.prototype.resume=function(){var o=this._readableState;return o.flowing||(l("resume"),o.flowing=!o.readableListening,pe(this,o)),o.paused=!1,this};function pe(o,a){a.resumeScheduled||(a.resumeScheduled=!0,H.nextTick(ye,o,a))}function ye(o,a){l("resume",a.reading),a.reading||o.read(0),a.resumeScheduled=!1,o.emit("resume"),d(o),a.flowing&&!a.reading&&o.read(0)}P.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function d(o){var a=o._readableState;for(l("flow",a.flowing);a.flowing&&o.read()!==null;);}P.prototype.wrap=function(o){var a=this,B=this._readableState,U=!1;o.on("end",function(){if(l("wrapped end"),B.decoder&&!B.ended){var $=B.decoder.end();$&&$.length&&a.push($)}a.push(null)}),o.on("data",function($){if(l("wrapped data"),B.decoder&&($=B.decoder.write($)),!(B.objectMode&&$==null)&&!(!B.objectMode&&(!$||!$.length))){var ae=a.push($);ae||(U=!0,o.pause())}});for(var Y in o)this[Y]===void 0&&typeof o[Y]=="function"&&(this[Y]=function(ae){return function(){return o[ae].apply(o,arguments)}}(Y));for(var j=0;j<D.length;j++)o.on(D[j],this.emit.bind(this,D[j]));return this._read=function($){l("wrapped _read",$),U&&(U=!1,o.resume())},this},typeof Symbol=="function"&&(P.prototype[Symbol.asyncIterator]=function(){return C===void 0&&(C=jr()),C(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(a){this._readableState&&(this._readableState.flowing=a)}}),P._fromList=h,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function h(o,a){if(a.length===0)return null;var B;return a.objectMode?B=a.buffer.shift():!o||o>=a.length?(a.decoder?B=a.buffer.join(""):a.buffer.length===1?B=a.buffer.first():B=a.buffer.concat(a.length),a.buffer.clear()):B=a.buffer.consume(o,a.decoder),B}function A(o){var a=o._readableState;l("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,H.nextTick(O,a,o))}function O(o,a){if(l("endReadableNT",o.endEmitted,o.length),!o.endEmitted&&o.length===0&&(o.endEmitted=!0,a.readable=!1,a.emit("end"),o.autoDestroy)){var B=a._writableState;(!B||B.autoDestroy&&B.finished)&&a.destroy()}}typeof Symbol=="function"&&(P.from=function(o,a){return N===void 0&&(N=Wr()),N(P,o,a)});function q(o,a){for(var B=0,U=o.length;B<U;B++)if(o[B]===a)return B;return-1}return Ve}var Ye,br;function Mr(){if(br)return Ye;br=1,Ye=i;var T=_e().codes,w=T.ERR_METHOD_NOT_IMPLEMENTED,M=T.ERR_MULTIPLE_CALLBACK,b=T.ERR_TRANSFORM_ALREADY_TRANSFORMING,L=T.ERR_TRANSFORM_WITH_LENGTH_0,E=Ee();Ce(i,E);function y(m,s){var g=this._transformState;g.transforming=!1;var _=g.writecb;if(_===null)return this.emit("error",new M);g.writechunk=null,g.writecb=null,s!=null&&this.push(s),_(m);var S=this._readableState;S.reading=!1,(S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}function i(m){if(!(this instanceof i))return new i(m);E.call(this,m),this._transformState={afterTransform:y.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,m&&(typeof m.transform=="function"&&(this._transform=m.transform),typeof m.flush=="function"&&(this._flush=m.flush)),this.on("prefinish",l)}function l(){var m=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,g){v(m,s,g)}):v(this,null,null)}i.prototype.push=function(m,s){return this._transformState.needTransform=!1,E.prototype.push.call(this,m,s)},i.prototype._transform=function(m,s,g){g(new w("_transform()"))},i.prototype._write=function(m,s,g){var _=this._transformState;if(_.writecb=g,_.writechunk=m,_.writeencoding=s,!_.transforming){var S=this._readableState;(_.needTransform||S.needReadable||S.length<S.highWaterMark)&&this._read(S.highWaterMark)}},i.prototype._read=function(m){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},i.prototype._destroy=function(m,s){E.prototype._destroy.call(this,m,function(g){s(g)})};function v(m,s,g){if(s)return m.emit("error",s);if(g!=null&&m.push(g),m._writableState.length)throw new L;if(m._transformState.transforming)throw new b;return m.push(null)}return Ye}var Ke,Er;function $r(){if(Er)return Ke;Er=1,Ke=w;var T=Mr();Ce(w,T);function w(M){if(!(this instanceof w))return new w(M);T.call(this,M)}return w.prototype._transform=function(M,b,L){L(null,M)},Ke}var Je,_r;function Hr(){if(_r)return Je;_r=1;var T;function w(g){var _=!1;return function(){_||(_=!0,g.apply(void 0,arguments))}}var M=_e().codes,b=M.ERR_MISSING_ARGS,L=M.ERR_STREAM_DESTROYED;function E(g){if(g)throw g}function y(g){return g.setHeader&&typeof g.abort=="function"}function i(g,_,S,F){F=w(F);var x=!1;g.on("close",function(){x=!0}),T===void 0&&(T=Ze()),T(g,{readable:_,writable:S},function(p){if(p)return F(p);x=!0,F()});var u=!1;return function(p){if(!x&&!u){if(u=!0,y(g))return g.abort();if(typeof g.destroy=="function")return g.destroy();F(p||new L("pipe"))}}}function l(g){g()}function v(g,_){return g.pipe(_)}function m(g){return!g.length||typeof g[g.length-1]!="function"?E:g.pop()}function s(){for(var g=arguments.length,_=new Array(g),S=0;S<g;S++)_[S]=arguments[S];var F=m(_);if(Array.isArray(_[0])&&(_=_[0]),_.length<2)throw new b("streams");var x,u=_.map(function(p,C){var N=C<_.length-1,I=C>0;return i(p,N,I,function(D){x||(x=D),D&&u.forEach(l),!N&&(u.forEach(l),F(x))})});return _.reduce(v)}return Je=s,Je}var mr;function zr(){return mr||(mr=1,function(T,w){w=T.exports=Ir(),w.Stream=w,w.Readable=w,w.Writable=Tr(),w.Duplex=Ee(),w.Transform=Mr(),w.PassThrough=$r(),w.finished=Ze(),w.pipeline=Hr()}(Ae,Ae.exports)),Ae.exports}var Te={exports:{}},ze,Rr;function Gr(){if(Rr)return ze;Rr=1;var T=1e3,w=T*60,M=w*60,b=M*24,L=b*7,E=b*365.25;ze=function(m,s){s=s||{};var g=typeof m;if(g==="string"&&m.length>0)return y(m);if(g==="number"&&isFinite(m))return s.long?l(m):i(m);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(m))};function y(m){if(m=String(m),!(m.length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(m);if(s){var g=parseFloat(s[1]),_=(s[2]||"ms").toLowerCase();switch(_){case"years":case"year":case"yrs":case"yr":case"y":return g*E;case"weeks":case"week":case"w":return g*L;case"days":case"day":case"d":return g*b;case"hours":case"hour":case"hrs":case"hr":case"h":return g*M;case"minutes":case"minute":case"mins":case"min":case"m":return g*w;case"seconds":case"second":case"secs":case"sec":case"s":return g*T;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function i(m){var s=Math.abs(m);return s>=b?Math.round(m/b)+"d":s>=M?Math.round(m/M)+"h":s>=w?Math.round(m/w)+"m":s>=T?Math.round(m/T)+"s":m+"ms"}function l(m){var s=Math.abs(m);return s>=b?v(m,s,b,"day"):s>=M?v(m,s,M,"hour"):s>=w?v(m,s,w,"minute"):s>=T?v(m,s,T,"second"):m+" ms"}function v(m,s,g,_){var S=s>=g*1.5;return Math.round(m/g)+" "+_+(S?"s":"")}return ze}var Xe,vr;function Vr(){if(vr)return Xe;vr=1;function T(w){b.debug=b,b.default=b,b.coerce=v,b.disable=y,b.enable=E,b.enabled=i,b.humanize=Gr(),b.destroy=m,Object.keys(w).forEach(s=>{b[s]=w[s]}),b.names=[],b.skips=[],b.formatters={};function M(s){let g=0;for(let _=0;_<s.length;_++)g=(g<<5)-g+s.charCodeAt(_),g|=0;return b.colors[Math.abs(g)%b.colors.length]}b.selectColor=M;function b(s){let g,_=null,S,F;function x(...u){if(!x.enabled)return;const p=x,C=Number(new Date),N=C-(g||C);p.diff=N,p.prev=g,p.curr=C,g=C,u[0]=b.coerce(u[0]),typeof u[0]!="string"&&u.unshift("%O");let I=0;u[0]=u[0].replace(/%([a-zA-Z%])/g,(G,k)=>{if(G==="%%")return"%";I++;const P=b.formatters[k];if(typeof P=="function"){const Q=u[I];G=P.call(p,Q),u.splice(I,1),I--}return G}),b.formatArgs.call(p,u),(p.log||b.log).apply(p,u)}return x.namespace=s,x.useColors=b.useColors(),x.color=b.selectColor(s),x.extend=L,x.destroy=b.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(S!==b.namespaces&&(S=b.namespaces,F=b.enabled(s)),F),set:u=>{_=u}}),typeof b.init=="function"&&b.init(x),x}function L(s,g){const _=b(this.namespace+(typeof g>"u"?":":g)+s);return _.log=this.log,_}function E(s){b.save(s),b.namespaces=s,b.names=[],b.skips=[];let g;const _=(typeof s=="string"?s:"").split(/[\s,]+/),S=_.length;for(g=0;g<S;g++)_[g]&&(s=_[g].replace(/\*/g,".*?"),s[0]==="-"?b.skips.push(new RegExp("^"+s.slice(1)+"$")):b.names.push(new RegExp("^"+s+"$")))}function y(){const s=[...b.names.map(l),...b.skips.map(l).map(g=>"-"+g)].join(",");return b.enable(""),s}function i(s){if(s[s.length-1]==="*")return!0;let g,_;for(g=0,_=b.skips.length;g<_;g++)if(b.skips[g].test(s))return!1;for(g=0,_=b.names.length;g<_;g++)if(b.names[g].test(s))return!0;return!1}function l(s){return s.toString().substring(2,s.toString().length-2).replace(/\.\*\?$/,"*")}function v(s){return s instanceof Error?s.stack||s.message:s}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return b.enable(b.load()),b}return Xe=T,Xe}var Sr;function Xr(){return Sr||(Sr=1,function(T,w){w.formatArgs=b,w.save=L,w.load=E,w.useColors=M,w.storage=y(),w.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function M(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function b(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+T.exports.humanize(this.diff),!this.useColors)return;const v="color: "+this.color;l.splice(1,0,v,"color: inherit");let m=0,s=0;l[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(m++,g==="%c"&&(s=m))}),l.splice(s,0,v)}w.log=console.debug||console.log||(()=>{});function L(l){try{l?w.storage.setItem("debug",l):w.storage.removeItem("debug")}catch{}}function E(){let l;try{l=w.storage.getItem("debug")}catch{}return!l&&typeof H<"u"&&"env"in H&&(l={}.DEBUG),l}function y(){try{return localStorage}catch{}}T.exports=Vr()(w);const{formatters:i}=T.exports;i.j=function(l){try{return JSON.stringify(l)}catch(v){return"[UnexpectedJSONParseError]: "+v.message}}}(Te,Te.exports)),Te.exports}const Zr=Lr(Ur);export{Ie as a,Jr as b,Pr as c,Xr as d,zr as e,Zr as r};
6
+ */var rr;function Ie(){return rr||(rr=1,function(T){const w=Or(),M=Dr(),_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;T.Buffer=i,T.SlowBuffer=y,T.INSPECT_MAX_BYTES=50;const L=2147483647;T.kMaxLength=L,i.TYPED_ARRAY_SUPPORT=E(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function E(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function p(t){if(t>L)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return l(t,e,r)}i.poolSize=8192;function l(t,e,r){if(typeof t=="string")return g(t,e);if(ArrayBuffer.isView(t))return b(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(ee(t,ArrayBuffer)||t&&ee(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ee(t,SharedArrayBuffer)||t&&ee(t.buffer,SharedArrayBuffer)))return F(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return i.from(n,e,r);const f=x(t);if(f)return f;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return i.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}i.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function S(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function R(t,e,r){return S(t),t<=0?p(t):e!==void 0?typeof r=="string"?p(t).fill(e,r):p(t).fill(e):p(t)}i.alloc=function(t,e,r){return R(t,e,r)};function h(t){return S(t),p(t<0?0:u(t)|0)}i.allocUnsafe=function(t){return h(t)},i.allocUnsafeSlow=function(t){return h(t)};function g(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=C(t,e)|0;let n=p(r);const f=n.write(t,e);return f!==r&&(n=n.slice(0,f)),n}function m(t){const e=t.length<0?0:u(t.length)|0,r=p(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function b(t){if(ee(t,Uint8Array)){const e=new Uint8Array(t);return F(e.buffer,e.byteOffset,e.byteLength)}return m(t)}function F(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,i.prototype),n}function x(t){if(i.isBuffer(t)){const e=u(t.length)|0,r=p(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||le(t.length)?p(0):m(t);if(t.type==="Buffer"&&Array.isArray(t.data))return m(t.data)}function u(t){if(t>=L)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+L.toString(16)+" bytes");return t|0}function y(t){return+t!=t&&(t=0),i.alloc(+t)}i.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==i.prototype},i.compare=function(e,r){if(ee(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),ee(r,Uint8Array)&&(r=i.from(r,r.offset,r.byteLength)),!i.isBuffer(e)||!i.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,f=r.length;for(let c=0,v=Math.min(n,f);c<v;++c)if(e[c]!==r[c]){n=e[c],f=r[c];break}return n<f?-1:f<n?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return i.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;const f=i.allocUnsafe(r);let c=0;for(n=0;n<e.length;++n){let v=e[n];if(ee(v,Uint8Array))c+v.length>f.length?(i.isBuffer(v)||(v=i.from(v)),v.copy(f,c)):Uint8Array.prototype.set.call(f,v,c);else if(i.isBuffer(v))v.copy(f,c);else throw new TypeError('"list" argument must be an Array of Buffers');c+=v.length}return f};function C(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||ee(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let f=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ve(t).length;default:if(f)return n?-1:$(t).length;e=(""+e).toLowerCase(),f=!0}}i.byteLength=C;function N(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return oe(this,e,r);case"utf8":case"utf-8":return he(this,e,r);case"ascii":return ne(this,e,r);case"latin1":case"binary":return ce(this,e,r);case"base64":return ie(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function I(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}i.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 r=0;r<e;r+=2)I(this,r,r+1);return this},i.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)I(this,r,r+3),I(this,r+1,r+2);return this},i.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)I(this,r,r+7),I(this,r+1,r+6),I(this,r+2,r+5),I(this,r+3,r+4);return this},i.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?he(this,0,e):N.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:i.compare(this,e)===0},i.prototype.inspect=function(){let e="";const r=T.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},_&&(i.prototype[_]=i.prototype.inspect),i.prototype.compare=function(e,r,n,f,c){if(ee(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),f===void 0&&(f=0),c===void 0&&(c=this.length),r<0||n>e.length||f<0||c>this.length)throw new RangeError("out of range index");if(f>=c&&r>=n)return 0;if(f>=c)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,f>>>=0,c>>>=0,this===e)return 0;let v=c-f,W=n-r;const z=Math.min(v,W),K=this.slice(f,c),X=e.slice(r,n);for(let V=0;V<z;++V)if(K[V]!==X[V]){v=K[V],W=X[V];break}return v<W?-1:W<v?1:0};function D(t,e,r,n,f){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,le(r)&&(r=f?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(f)return-1;r=t.length-1}else if(r<0)if(f)r=0;else return-1;if(typeof e=="string"&&(e=i.from(e,n)),i.isBuffer(e))return e.length===0?-1:G(t,e,r,n,f);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?f?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):G(t,[e],r,n,f);throw new TypeError("val must be string, number or Buffer")}function G(t,e,r,n,f){let c=1,v=t.length,W=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;c=2,v/=2,W/=2,r/=2}function z(X,V){return c===1?X[V]:X.readUInt16BE(V*c)}let K;if(f){let X=-1;for(K=r;K<v;K++)if(z(t,K)===z(e,X===-1?0:K-X)){if(X===-1&&(X=K),K-X+1===W)return X*c}else X!==-1&&(K-=K-X),X=-1}else for(r+W>v&&(r=v-W),K=r;K>=0;K--){let X=!0;for(let V=0;V<W;V++)if(z(t,K+V)!==z(e,V)){X=!1;break}if(X)return K}return-1}i.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1},i.prototype.indexOf=function(e,r,n){return D(this,e,r,n,!0)},i.prototype.lastIndexOf=function(e,r,n){return D(this,e,r,n,!1)};function k(t,e,r,n){r=Number(r)||0;const f=t.length-r;n?(n=Number(n),n>f&&(n=f)):n=f;const c=e.length;n>c/2&&(n=c/2);let v;for(v=0;v<n;++v){const W=parseInt(e.substr(v*2,2),16);if(le(W))return v;t[r+v]=W}return v}function P(t,e,r,n){return we($(e,t.length-r),t,r,n)}function Q(t,e,r,n){return we(ae(e),t,r,n)}function ue(t,e,r,n){return we(ve(e),t,r,n)}function me(t,e,r,n){return we(ge(e,t.length-r),t,r,n)}i.prototype.write=function(e,r,n,f){if(r===void 0)f="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")f=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,f===void 0&&(f="utf8")):(f=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const c=this.length-r;if((n===void 0||n>c)&&(n=c),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");let v=!1;for(;;)switch(f){case"hex":return k(this,e,r,n);case"utf8":case"utf-8":return P(this,e,r,n);case"ascii":case"latin1":case"binary":return Q(this,e,r,n);case"base64":return ue(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,e,r,n);default:if(v)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),v=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(t,e,r){return e===0&&r===t.length?w.fromByteArray(t):w.fromByteArray(t.slice(e,r))}function he(t,e,r){r=Math.min(t.length,r);const n=[];let f=e;for(;f<r;){const c=t[f];let v=null,W=c>239?4:c>223?3:c>191?2:1;if(f+W<=r){let z,K,X,V;switch(W){case 1:c<128&&(v=c);break;case 2:z=t[f+1],(z&192)===128&&(V=(c&31)<<6|z&63,V>127&&(v=V));break;case 3:z=t[f+1],K=t[f+2],(z&192)===128&&(K&192)===128&&(V=(c&15)<<12|(z&63)<<6|K&63,V>2047&&(V<55296||V>57343)&&(v=V));break;case 4:z=t[f+1],K=t[f+2],X=t[f+3],(z&192)===128&&(K&192)===128&&(X&192)===128&&(V=(c&15)<<18|(z&63)<<12|(K&63)<<6|X&63,V>65535&&V<1114112&&(v=V))}}v===null?(v=65533,W=1):v>65535&&(v-=65536,n.push(v>>>10&1023|55296),v=56320|v&1023),n.push(v),f+=W}return Re(n)}const fe=4096;function Re(t){const e=t.length;if(e<=fe)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=fe));return r}function ne(t,e,r){let n="";r=Math.min(t.length,r);for(let f=e;f<r;++f)n+=String.fromCharCode(t[f]&127);return n}function ce(t,e,r){let n="";r=Math.min(t.length,r);for(let f=e;f<r;++f)n+=String.fromCharCode(t[f]);return n}function oe(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let f="";for(let c=e;c<r;++c)f+=Se[t[c]];return f}function de(t,e,r){const n=t.slice(e,r);let f="";for(let c=0;c<n.length-1;c+=2)f+=String.fromCharCode(n[c]+n[c+1]*256);return f}i.prototype.slice=function(e,r){const n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);const f=this.subarray(e,r);return Object.setPrototypeOf(f,i.prototype),f};function J(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=this[e],c=1,v=0;for(;++v<r&&(c*=256);)f+=this[e+v]*c;return f},i.prototype.readUintBE=i.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=this[e+--r],c=1;for(;r>0&&(c*=256);)f+=this[e+--r]*c;return f},i.prototype.readUint8=i.prototype.readUInt8=function(e,r){return e=e>>>0,r||J(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||J(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||J(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||J(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||J(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,c=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(f)+(BigInt(c)<<BigInt(32))}),i.prototype.readBigUInt64BE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],c=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(f)<<BigInt(32))+BigInt(c)}),i.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=this[e],c=1,v=0;for(;++v<r&&(c*=256);)f+=this[e+v]*c;return c*=128,f>=c&&(f-=Math.pow(2,8*r)),f},i.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||J(e,r,this.length);let f=r,c=1,v=this[e+--f];for(;f>0&&(c*=256);)v+=this[e+--f]*c;return c*=128,v>=c&&(v-=Math.pow(2,8*r)),v},i.prototype.readInt8=function(e,r){return e=e>>>0,r||J(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},i.prototype.readInt16LE=function(e,r){e=e>>>0,r||J(e,2,this.length);const n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},i.prototype.readInt16BE=function(e,r){e=e>>>0,r||J(e,2,this.length);const n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},i.prototype.readInt32LE=function(e,r){return e=e>>>0,r||J(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,r){return e=e>>>0,r||J(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(f)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),i.prototype.readBigInt64BE=re(function(e){e=e>>>0,B(e,"offset");const r=this[e],n=this[e+7];(r===void 0||n===void 0)&&U(e,this.length-8);const f=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(f)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),i.prototype.readFloatLE=function(e,r){return e=e>>>0,r||J(e,4,this.length),M.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,r){return e=e>>>0,r||J(e,4,this.length),M.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||J(e,8,this.length),M.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||J(e,8,this.length),M.read(this,e,!1,52,8)};function Z(t,e,r,n,f,c){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>f||e<c)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,r,n,f){if(e=+e,r=r>>>0,n=n>>>0,!f){const W=Math.pow(2,8*n)-1;Z(this,e,r,n,W,0)}let c=1,v=0;for(this[r]=e&255;++v<n&&(c*=256);)this[r+v]=e/c&255;return r+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(e,r,n,f){if(e=+e,r=r>>>0,n=n>>>0,!f){const W=Math.pow(2,8*n)-1;Z(this,e,r,n,W,0)}let c=n-1,v=1;for(this[r+c]=e&255;--c>=0&&(v*=256);)this[r+c]=e/v&255;return r+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,1,255,0),this[r]=e&255,r+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function te(t,e,r,n,f){a(e,n,f,t,r,7);let c=Number(e&BigInt(4294967295));t[r++]=c,c=c>>8,t[r++]=c,c=c>>8,t[r++]=c,c=c>>8,t[r++]=c;let v=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=v,v=v>>8,t[r++]=v,v=v>>8,t[r++]=v,v=v>>8,t[r++]=v,r}function pe(t,e,r,n,f){a(e,n,f,t,r,7);let c=Number(e&BigInt(4294967295));t[r+7]=c,c=c>>8,t[r+6]=c,c=c>>8,t[r+5]=c,c=c>>8,t[r+4]=c;let v=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=v,v=v>>8,t[r+2]=v,v=v>>8,t[r+1]=v,v=v>>8,t[r]=v,r+8}i.prototype.writeBigUInt64LE=re(function(e,r=0){return te(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=re(function(e,r=0){return pe(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(e,r,n,f){if(e=+e,r=r>>>0,!f){const z=Math.pow(2,8*n-1);Z(this,e,r,n,z-1,-z)}let c=0,v=1,W=0;for(this[r]=e&255;++c<n&&(v*=256);)e<0&&W===0&&this[r+c-1]!==0&&(W=1),this[r+c]=(e/v>>0)-W&255;return r+n},i.prototype.writeIntBE=function(e,r,n,f){if(e=+e,r=r>>>0,!f){const z=Math.pow(2,8*n-1);Z(this,e,r,n,z-1,-z)}let c=n-1,v=1,W=0;for(this[r+c]=e&255;--c>=0&&(v*=256);)e<0&&W===0&&this[r+c+1]!==0&&(W=1),this[r+c]=(e/v>>0)-W&255;return r+n},i.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},i.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},i.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},i.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},i.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Z(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},i.prototype.writeBigInt64LE=re(function(e,r=0){return te(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=re(function(e,r=0){return pe(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(t,e,r,n,f,c){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function d(t,e,r,n,f){return e=+e,r=r>>>0,f||ye(t,e,r,4),M.write(t,e,r,n,23,4),r+4}i.prototype.writeFloatLE=function(e,r,n){return d(this,e,r,!0,n)},i.prototype.writeFloatBE=function(e,r,n){return d(this,e,r,!1,n)};function s(t,e,r,n,f){return e=+e,r=r>>>0,f||ye(t,e,r,8),M.write(t,e,r,n,52,8),r+8}i.prototype.writeDoubleLE=function(e,r,n){return s(this,e,r,!0,n)},i.prototype.writeDoubleBE=function(e,r,n){return s(this,e,r,!1,n)},i.prototype.copy=function(e,r,n,f){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!f&&f!==0&&(f=this.length),r>=e.length&&(r=e.length),r||(r=0),f>0&&f<n&&(f=n),f===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),e.length-r<f-n&&(f=e.length-r+n);const c=f-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,f):Uint8Array.prototype.set.call(e,this.subarray(n,f),r),c},i.prototype.fill=function(e,r,n,f){if(typeof e=="string"){if(typeof r=="string"?(f=r,r=0,n=this.length):typeof n=="string"&&(f=n,n=this.length),f!==void 0&&typeof f!="string")throw new TypeError("encoding must be a string");if(typeof f=="string"&&!i.isEncoding(f))throw new TypeError("Unknown encoding: "+f);if(e.length===1){const v=e.charCodeAt(0);(f==="utf8"&&v<128||f==="latin1")&&(e=v)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let c;if(typeof e=="number")for(c=r;c<n;++c)this[c]=e;else{const v=i.isBuffer(e)?e:i.from(e,f),W=v.length;if(W===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(c=0;c<n-r;++c)this[c+r]=v[c%W]}return this};const A={};function O(t,e,r){A[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(f){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:f,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}O("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),O("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),O("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,f=r;return Number.isInteger(r)&&Math.abs(r)>2**32?f=q(String(r)):typeof r=="bigint"&&(f=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(f=q(f)),f+="n"),n+=` It must be ${e}. Received ${f}`,n},RangeError);function q(t){let e="",r=t.length;const n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function o(t,e,r){B(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&U(e,t.length-(r+1))}function a(t,e,r,n,f,c){if(t>r||t<e){const v=typeof e=="bigint"?"n":"";let W;throw c>3?e===0||e===BigInt(0)?W=`>= 0${v} and < 2${v} ** ${(c+1)*8}${v}`:W=`>= -(2${v} ** ${(c+1)*8-1}${v}) and < 2 ** ${(c+1)*8-1}${v}`:W=`>= ${e}${v} and <= ${r}${v}`,new A.ERR_OUT_OF_RANGE("value",W,t)}o(n,f,c)}function B(t,e){if(typeof t!="number")throw new A.ERR_INVALID_ARG_TYPE(e,"number",t)}function U(t,e,r){throw Math.floor(t)!==t?(B(t,r),new A.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}const Y=/[^+/0-9A-Za-z-_]/g;function j(t){if(t=t.split("=")[0],t=t.trim().replace(Y,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function $(t,e){e=e||1/0;let r;const n=t.length;let f=null;const c=[];for(let v=0;v<n;++v){if(r=t.charCodeAt(v),r>55295&&r<57344){if(!f){if(r>56319){(e-=3)>-1&&c.push(239,191,189);continue}else if(v+1===n){(e-=3)>-1&&c.push(239,191,189);continue}f=r;continue}if(r<56320){(e-=3)>-1&&c.push(239,191,189),f=r;continue}r=(f-55296<<10|r-56320)+65536}else f&&(e-=3)>-1&&c.push(239,191,189);if(f=null,r<128){if((e-=1)<0)break;c.push(r)}else if(r<2048){if((e-=2)<0)break;c.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;c.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;c.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return c}function ae(t){const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function ge(t,e){let r,n,f;const c=[];for(let v=0;v<t.length&&!((e-=2)<0);++v)r=t.charCodeAt(v),n=r>>8,f=r%256,c.push(f),c.push(n);return c}function ve(t){return w.toByteArray(j(t))}function we(t,e,r,n){let f;for(f=0;f<n&&!(f+r>=e.length||f>=t.length);++f)e[f+r]=t[f];return f}function ee(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function le(t){return t!==t}const Se=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let f=0;f<16;++f)e[n+f]=t[r]+t[f]}return e}();function re(t){return typeof BigInt>"u"?se:t}function se(){throw new Error("BigInt not supported")}}(Me)),Me}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var tr;function Pr(){return tr||(tr=1,function(T,w){var M=Ie(),_=M.Buffer;function L(p,i){for(var l in p)i[l]=p[l]}_.from&&_.alloc&&_.allocUnsafe&&_.allocUnsafeSlow?T.exports=M:(L(M,w),w.Buffer=E);function E(p,i,l){return _(p,i,l)}E.prototype=Object.create(_.prototype),L(_,E),E.from=function(p,i,l){if(typeof p=="number")throw new TypeError("Argument must not be a number");return _(p,i,l)},E.alloc=function(p,i,l){if(typeof p!="number")throw new TypeError("Argument must be a number");var S=_(p);return i!==void 0?typeof l=="string"?S.fill(i,l):S.fill(i):S.fill(0),S},E.allocUnsafe=function(p){if(typeof p!="number")throw new TypeError("Argument must be a number");return _(p)},E.allocUnsafeSlow=function(p){if(typeof p!="number")throw new TypeError("Argument must be a number");return M.SlowBuffer(p)}}(Be,Be.exports)),Be.exports}var Ne,nr;function Jr(){if(nr)return Ne;nr=1;var T=Nr;return Ne=function(M){return!!T(M)},Ne}var Ae={exports:{}},Le,ir;function Br(){return ir||(ir=1,Le=xr.EventEmitter),Le}var Ue,or;function kr(){if(or)return Ue;or=1;function T(b,F){var x=Object.keys(b);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(b);F&&(u=u.filter(function(y){return Object.getOwnPropertyDescriptor(b,y).enumerable})),x.push.apply(x,u)}return x}function w(b){for(var F=1;F<arguments.length;F++){var x=arguments[F]!=null?arguments[F]:{};F%2?T(Object(x),!0).forEach(function(u){M(b,u,x[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(x)):T(Object(x)).forEach(function(u){Object.defineProperty(b,u,Object.getOwnPropertyDescriptor(x,u))})}return b}function M(b,F,x){return F=p(F),F in b?Object.defineProperty(b,F,{value:x,enumerable:!0,configurable:!0,writable:!0}):b[F]=x,b}function _(b,F){if(!(b instanceof F))throw new TypeError("Cannot call a class as a function")}function L(b,F){for(var x=0;x<F.length;x++){var u=F[x];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(b,p(u.key),u)}}function E(b,F,x){return F&&L(b.prototype,F),x&&L(b,x),Object.defineProperty(b,"prototype",{writable:!1}),b}function p(b){var F=i(b,"string");return typeof F=="symbol"?F:String(F)}function i(b,F){if(typeof b!="object"||b===null)return b;var x=b[Symbol.toPrimitive];if(x!==void 0){var u=x.call(b,F||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(b)}var l=Ie(),S=l.Buffer,R=Cr,h=R.inspect,g=h&&h.custom||"inspect";function m(b,F,x){S.prototype.copy.call(b,F,x)}return Ue=function(){function b(){_(this,b),this.head=null,this.tail=null,this.length=0}return E(b,[{key:"push",value:function(x){var u={data:x,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}},{key:"unshift",value:function(x){var u={data:x,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}},{key:"shift",value:function(){if(this.length!==0){var x=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,x}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(x){if(this.length===0)return"";for(var u=this.head,y=""+u.data;u=u.next;)y+=x+u.data;return y}},{key:"concat",value:function(x){if(this.length===0)return S.alloc(0);for(var u=S.allocUnsafe(x>>>0),y=this.head,C=0;y;)m(y.data,u,C),C+=y.data.length,y=y.next;return u}},{key:"consume",value:function(x,u){var y;return x<this.head.data.length?(y=this.head.data.slice(0,x),this.head.data=this.head.data.slice(x)):x===this.head.data.length?y=this.shift():y=u?this._getString(x):this._getBuffer(x),y}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(x){var u=this.head,y=1,C=u.data;for(x-=C.length;u=u.next;){var N=u.data,I=x>N.length?N.length:x;if(I===N.length?C+=N:C+=N.slice(0,x),x-=I,x===0){I===N.length?(++y,u.next?this.head=u.next:this.head=this.tail=null):(this.head=u,u.data=N.slice(I));break}++y}return this.length-=y,C}},{key:"_getBuffer",value:function(x){var u=S.allocUnsafe(x),y=this.head,C=1;for(y.data.copy(u),x-=y.data.length;y=y.next;){var N=y.data,I=x>N.length?N.length:x;if(N.copy(u,u.length-x,0,I),x-=I,x===0){I===N.length?(++C,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=N.slice(I));break}++C}return this.length-=C,u}},{key:g,value:function(x,u){return h(this,w(w({},u),{},{depth:0,customInspect:!1}))}}]),b}(),Ue}var Oe,ar;function Fr(){if(ar)return Oe;ar=1;function T(p,i){var l=this,S=this._readableState&&this._readableState.destroyed,R=this._writableState&&this._writableState.destroyed;return S||R?(i?i(p):p&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,H.nextTick(L,this,p)):H.nextTick(L,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(h){!i&&h?l._writableState?l._writableState.errorEmitted?H.nextTick(M,l):(l._writableState.errorEmitted=!0,H.nextTick(w,l,h)):H.nextTick(w,l,h):i?(H.nextTick(M,l),i(h)):H.nextTick(M,l)}),this)}function w(p,i){L(p,i),M(p)}function M(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}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)}function L(p,i){p.emit("error",i)}function E(p,i){var l=p._readableState,S=p._writableState;l&&l.autoDestroy||S&&S.autoDestroy?p.destroy(i):p.emit("error",i)}return Oe={destroy:T,undestroy:_,errorOrDestroy:E},Oe}var De={},ur;function Ee(){if(ur)return De;ur=1;function T(i,l){i.prototype=Object.create(l.prototype),i.prototype.constructor=i,i.__proto__=l}var w={};function M(i,l,S){S||(S=Error);function R(g,m,b){return typeof l=="string"?l:l(g,m,b)}var h=function(g){T(m,g);function m(b,F,x){return g.call(this,R(b,F,x))||this}return m}(S);h.prototype.name=S.name,h.prototype.code=i,w[i]=h}function _(i,l){if(Array.isArray(i)){var S=i.length;return i=i.map(function(R){return String(R)}),S>2?"one of ".concat(l," ").concat(i.slice(0,S-1).join(", "),", or ")+i[S-1]:S===2?"one of ".concat(l," ").concat(i[0]," or ").concat(i[1]):"of ".concat(l," ").concat(i[0])}else return"of ".concat(l," ").concat(String(i))}function L(i,l,S){return i.substr(!S||S<0?0:+S,l.length)===l}function E(i,l,S){return(S===void 0||S>i.length)&&(S=i.length),i.substring(S-l.length,S)===l}function p(i,l,S){return typeof S!="number"&&(S=0),S+l.length>i.length?!1:i.indexOf(l,S)!==-1}return M("ERR_INVALID_OPT_VALUE",function(i,l){return'The value "'+l+'" is invalid for option "'+i+'"'},TypeError),M("ERR_INVALID_ARG_TYPE",function(i,l,S){var R;typeof l=="string"&&L(l,"not ")?(R="must not be",l=l.replace(/^not /,"")):R="must be";var h;if(E(i," argument"))h="The ".concat(i," ").concat(R," ").concat(_(l,"type"));else{var g=p(i,".")?"property":"argument";h='The "'.concat(i,'" ').concat(g," ").concat(R," ").concat(_(l,"type"))}return h+=". Received type ".concat(typeof S),h},TypeError),M("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),M("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),M("ERR_STREAM_PREMATURE_CLOSE","Premature close"),M("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),M("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),M("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),M("ERR_STREAM_WRITE_AFTER_END","write after end"),M("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),M("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),M("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),De.codes=w,De}var Pe,fr;function Ar(){if(fr)return Pe;fr=1;var T=Ee().codes.ERR_INVALID_OPT_VALUE;function w(_,L,E){return _.highWaterMark!=null?_.highWaterMark:L?_[E]:null}function M(_,L,E,p){var i=w(L,p,E);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var l=p?E:"highWaterMark";throw new T(l,i)}return Math.floor(i)}return _.objectMode?16:16*1024}return Pe={getHighWaterMark:M},Pe}var ke,lr;function qr(){if(lr)return ke;lr=1,ke=T;function T(M,_){if(w("noDeprecation"))return M;var L=!1;function E(){if(!L){if(w("throwDeprecation"))throw new Error(_);w("traceDeprecation")?console.trace(_):console.warn(_),L=!0}return M.apply(this,arguments)}return E}function w(M){try{if(!be.localStorage)return!1}catch{return!1}var _=be.localStorage[M];return _==null?!1:String(_).toLowerCase()==="true"}return ke}var qe,sr;function Tr(){if(sr)return qe;sr=1,qe=k;function T(d){var s=this;this.next=null,this.entry=null,this.finish=function(){ye(s,d)}}var w;k.WritableState=D;var M={deprecate:qr()},_=Br(),L=Ie().Buffer,E=(typeof be<"u"?be:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function p(d){return L.from(d)}function i(d){return L.isBuffer(d)||d instanceof E}var l=Fr(),S=Ar(),R=S.getHighWaterMark,h=Ee().codes,g=h.ERR_INVALID_ARG_TYPE,m=h.ERR_METHOD_NOT_IMPLEMENTED,b=h.ERR_MULTIPLE_CALLBACK,F=h.ERR_STREAM_CANNOT_PIPE,x=h.ERR_STREAM_DESTROYED,u=h.ERR_STREAM_NULL_VALUES,y=h.ERR_STREAM_WRITE_AFTER_END,C=h.ERR_UNKNOWN_ENCODING,N=l.errorOrDestroy;Ce(k,_);function I(){}function D(d,s,A){w=w||_e(),d=d||{},typeof A!="boolean"&&(A=s instanceof w),this.objectMode=!!d.objectMode,A&&(this.objectMode=this.objectMode||!!d.writableObjectMode),this.highWaterMark=R(this,d,"writableHighWaterMark",A),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var O=d.decodeStrings===!1;this.decodeStrings=!O,this.defaultEncoding=d.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){Re(s,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=d.emitClose!==!1,this.autoDestroy=!!d.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new T(this)}D.prototype.getBuffer=function(){for(var s=this.bufferedRequest,A=[];s;)A.push(s),s=s.next;return A},function(){try{Object.defineProperty(D.prototype,"buffer",{get:M.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(s){return G.call(this,s)?!0:this!==k?!1:s&&s._writableState instanceof D}})):G=function(s){return s instanceof this};function k(d){w=w||_e();var s=this instanceof w;if(!s&&!G.call(k,this))return new k(d);this._writableState=new D(d,this,s),this.writable=!0,d&&(typeof d.write=="function"&&(this._write=d.write),typeof d.writev=="function"&&(this._writev=d.writev),typeof d.destroy=="function"&&(this._destroy=d.destroy),typeof d.final=="function"&&(this._final=d.final)),_.call(this)}k.prototype.pipe=function(){N(this,new F)};function P(d,s){var A=new y;N(d,A),H.nextTick(s,A)}function Q(d,s,A,O){var q;return A===null?q=new u:typeof A!="string"&&!s.objectMode&&(q=new g("chunk",["string","Buffer"],A)),q?(N(d,q),H.nextTick(O,q),!1):!0}k.prototype.write=function(d,s,A){var O=this._writableState,q=!1,o=!O.objectMode&&i(d);return o&&!L.isBuffer(d)&&(d=p(d)),typeof s=="function"&&(A=s,s=null),o?s="buffer":s||(s=O.defaultEncoding),typeof A!="function"&&(A=I),O.ending?P(this,A):(o||Q(this,O,d,A))&&(O.pendingcb++,q=me(this,O,o,d,s,A)),q},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var d=this._writableState;d.corked&&(d.corked--,!d.writing&&!d.corked&&!d.bufferProcessing&&d.bufferedRequest&&oe(this,d))},k.prototype.setDefaultEncoding=function(s){if(typeof s=="string"&&(s=s.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((s+"").toLowerCase())>-1))throw new C(s);return this._writableState.defaultEncoding=s,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ue(d,s,A){return!d.objectMode&&d.decodeStrings!==!1&&typeof s=="string"&&(s=L.from(s,A)),s}Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function me(d,s,A,O,q,o){if(!A){var a=ue(s,O,q);O!==a&&(A=!0,q="buffer",O=a)}var B=s.objectMode?1:O.length;s.length+=B;var U=s.length<s.highWaterMark;if(U||(s.needDrain=!0),s.writing||s.corked){var Y=s.lastBufferedRequest;s.lastBufferedRequest={chunk:O,encoding:q,isBuf:A,callback:o,next:null},Y?Y.next=s.lastBufferedRequest:s.bufferedRequest=s.lastBufferedRequest,s.bufferedRequestCount+=1}else ie(d,s,!1,B,O,q,o);return U}function ie(d,s,A,O,q,o,a){s.writelen=O,s.writecb=a,s.writing=!0,s.sync=!0,s.destroyed?s.onwrite(new x("write")):A?d._writev(q,s.onwrite):d._write(q,o,s.onwrite),s.sync=!1}function he(d,s,A,O,q){--s.pendingcb,A?(H.nextTick(q,O),H.nextTick(te,d,s),d._writableState.errorEmitted=!0,N(d,O)):(q(O),d._writableState.errorEmitted=!0,N(d,O),te(d,s))}function fe(d){d.writing=!1,d.writecb=null,d.length-=d.writelen,d.writelen=0}function Re(d,s){var A=d._writableState,O=A.sync,q=A.writecb;if(typeof q!="function")throw new b;if(fe(A),s)he(d,A,O,s,q);else{var o=de(A)||d.destroyed;!o&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&oe(d,A),O?H.nextTick(ne,d,A,o,q):ne(d,A,o,q)}}function ne(d,s,A,O){A||ce(d,s),s.pendingcb--,O(),te(d,s)}function ce(d,s){s.length===0&&s.needDrain&&(s.needDrain=!1,d.emit("drain"))}function oe(d,s){s.bufferProcessing=!0;var A=s.bufferedRequest;if(d._writev&&A&&A.next){var O=s.bufferedRequestCount,q=new Array(O),o=s.corkedRequestsFree;o.entry=A;for(var a=0,B=!0;A;)q[a]=A,A.isBuf||(B=!1),A=A.next,a+=1;q.allBuffers=B,ie(d,s,!0,s.length,q,"",o.finish),s.pendingcb++,s.lastBufferedRequest=null,o.next?(s.corkedRequestsFree=o.next,o.next=null):s.corkedRequestsFree=new T(s),s.bufferedRequestCount=0}else{for(;A;){var U=A.chunk,Y=A.encoding,j=A.callback,$=s.objectMode?1:U.length;if(ie(d,s,!1,$,U,Y,j),A=A.next,s.bufferedRequestCount--,s.writing)break}A===null&&(s.lastBufferedRequest=null)}s.bufferedRequest=A,s.bufferProcessing=!1}k.prototype._write=function(d,s,A){A(new m("_write()"))},k.prototype._writev=null,k.prototype.end=function(d,s,A){var O=this._writableState;return typeof d=="function"?(A=d,d=null,s=null):typeof s=="function"&&(A=s,s=null),d!=null&&this.write(d,s),O.corked&&(O.corked=1,this.uncork()),O.ending||pe(this,O,A),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function de(d){return d.ending&&d.length===0&&d.bufferedRequest===null&&!d.finished&&!d.writing}function J(d,s){d._final(function(A){s.pendingcb--,A&&N(d,A),s.prefinished=!0,d.emit("prefinish"),te(d,s)})}function Z(d,s){!s.prefinished&&!s.finalCalled&&(typeof d._final=="function"&&!s.destroyed?(s.pendingcb++,s.finalCalled=!0,H.nextTick(J,d,s)):(s.prefinished=!0,d.emit("prefinish")))}function te(d,s){var A=de(s);if(A&&(Z(d,s),s.pendingcb===0&&(s.finished=!0,d.emit("finish"),s.autoDestroy))){var O=d._readableState;(!O||O.autoDestroy&&O.endEmitted)&&d.destroy()}return A}function pe(d,s,A){s.ending=!0,te(d,s),A&&(s.finished?H.nextTick(A):d.once("finish",A)),s.ended=!0,d.writable=!1}function ye(d,s,A){var O=d.entry;for(d.entry=null;O;){var q=O.callback;s.pendingcb--,q(A),O=O.next}s.corkedRequestsFree.next=d}return Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(s){this._writableState&&(this._writableState.destroyed=s)}}),k.prototype.destroy=l.destroy,k.prototype._undestroy=l.undestroy,k.prototype._destroy=function(d,s){s(d)},qe}var je,hr;function _e(){if(hr)return je;hr=1;var T=Object.keys||function(S){var R=[];for(var h in S)R.push(h);return R};je=p;var w=Ir(),M=Tr();Ce(p,w);for(var _=T(M.prototype),L=0;L<_.length;L++){var E=_[L];p.prototype[E]||(p.prototype[E]=M.prototype[E])}function p(S){if(!(this instanceof p))return new p(S);w.call(this,S),M.call(this,S),this.allowHalfOpen=!0,S&&(S.readable===!1&&(this.readable=!1),S.writable===!1&&(this.writable=!1),S.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",i)))}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function i(){this._writableState.ended||H.nextTick(l,this)}function l(S){S.end()}return Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(R){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=R,this._writableState.destroyed=R)}}),je}var We={},cr;function dr(){if(cr)return We;cr=1;var T=Pr().Buffer,w=T.isEncoding||function(u){switch(u=""+u,u&&u.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 M(u){if(!u)return"utf8";for(var y;;)switch(u){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 u;default:if(y)return;u=(""+u).toLowerCase(),y=!0}}function _(u){var y=M(u);if(typeof y!="string"&&(T.isEncoding===w||!w(u)))throw new Error("Unknown encoding: "+u);return y||u}We.StringDecoder=L;function L(u){this.encoding=_(u);var y;switch(this.encoding){case"utf16le":this.text=h,this.end=g,y=4;break;case"utf8":this.fillLast=l,y=4;break;case"base64":this.text=m,this.end=b,y=3;break;default:this.write=F,this.end=x;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=T.allocUnsafe(y)}L.prototype.write=function(u){if(u.length===0)return"";var y,C;if(this.lastNeed){if(y=this.fillLast(u),y===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;return C<u.length?y?y+this.text(u,C):this.text(u,C):y||""},L.prototype.end=R,L.prototype.text=S,L.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length};function E(u){return u<=127?0:u>>5===6?2:u>>4===14?3:u>>3===30?4:u>>6===2?-1:-2}function p(u,y,C){var N=y.length-1;if(N<C)return 0;var I=E(y[N]);return I>=0?(I>0&&(u.lastNeed=I-1),I):--N<C||I===-2?0:(I=E(y[N]),I>=0?(I>0&&(u.lastNeed=I-2),I):--N<C||I===-2?0:(I=E(y[N]),I>=0?(I>0&&(I===2?I=0:u.lastNeed=I-3),I):0))}function i(u,y,C){if((y[0]&192)!==128)return u.lastNeed=0,"�";if(u.lastNeed>1&&y.length>1){if((y[1]&192)!==128)return u.lastNeed=1,"�";if(u.lastNeed>2&&y.length>2&&(y[2]&192)!==128)return u.lastNeed=2,"�"}}function l(u){var y=this.lastTotal-this.lastNeed,C=i(this,u);if(C!==void 0)return C;if(this.lastNeed<=u.length)return u.copy(this.lastChar,y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,y,0,u.length),this.lastNeed-=u.length}function S(u,y){var C=p(this,u,y);if(!this.lastNeed)return u.toString("utf8",y);this.lastTotal=C;var N=u.length-(C-this.lastNeed);return u.copy(this.lastChar,0,N),u.toString("utf8",y,N)}function R(u){var y=u&&u.length?this.write(u):"";return this.lastNeed?y+"�":y}function h(u,y){if((u.length-y)%2===0){var C=u.toString("utf16le",y);if(C){var N=C.charCodeAt(C.length-1);if(N>=55296&&N<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",y,u.length-1)}function g(u){var y=u&&u.length?this.write(u):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return y+this.lastChar.toString("utf16le",0,C)}return y}function m(u,y){var C=(u.length-y)%3;return C===0?u.toString("base64",y):(this.lastNeed=3-C,this.lastTotal=3,C===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",y,u.length-C))}function b(u){var y=u&&u.length?this.write(u):"";return this.lastNeed?y+this.lastChar.toString("base64",0,3-this.lastNeed):y}function F(u){return u.toString(this.encoding)}function x(u){return u&&u.length?this.write(u):""}return We}var $e,pr;function Ze(){if(pr)return $e;pr=1;var T=Ee().codes.ERR_STREAM_PREMATURE_CLOSE;function w(E){var p=!1;return function(){if(!p){p=!0;for(var i=arguments.length,l=new Array(i),S=0;S<i;S++)l[S]=arguments[S];E.apply(this,l)}}}function M(){}function _(E){return E.setHeader&&typeof E.abort=="function"}function L(E,p,i){if(typeof p=="function")return L(E,null,p);p||(p={}),i=w(i||M);var l=p.readable||p.readable!==!1&&E.readable,S=p.writable||p.writable!==!1&&E.writable,R=function(){E.writable||g()},h=E._writableState&&E._writableState.finished,g=function(){S=!1,h=!0,l||i.call(E)},m=E._readableState&&E._readableState.endEmitted,b=function(){l=!1,m=!0,S||i.call(E)},F=function(C){i.call(E,C)},x=function(){var C;if(l&&!m)return(!E._readableState||!E._readableState.ended)&&(C=new T),i.call(E,C);if(S&&!h)return(!E._writableState||!E._writableState.ended)&&(C=new T),i.call(E,C)},u=function(){E.req.on("finish",g)};return _(E)?(E.on("complete",g),E.on("abort",x),E.req?u():E.on("request",u)):S&&!E._writableState&&(E.on("end",R),E.on("close",R)),E.on("end",b),E.on("finish",g),p.error!==!1&&E.on("error",F),E.on("close",x),function(){E.removeListener("complete",g),E.removeListener("abort",x),E.removeListener("request",u),E.req&&E.req.removeListener("finish",g),E.removeListener("end",R),E.removeListener("close",R),E.removeListener("finish",g),E.removeListener("end",b),E.removeListener("error",F),E.removeListener("close",x)}}return $e=L,$e}var He,yr;function jr(){if(yr)return He;yr=1;var T;function w(C,N,I){return N=M(N),N in C?Object.defineProperty(C,N,{value:I,enumerable:!0,configurable:!0,writable:!0}):C[N]=I,C}function M(C){var N=_(C,"string");return typeof N=="symbol"?N:String(N)}function _(C,N){if(typeof C!="object"||C===null)return C;var I=C[Symbol.toPrimitive];if(I!==void 0){var D=I.call(C,N||"default");if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(N==="string"?String:Number)(C)}var L=Ze(),E=Symbol("lastResolve"),p=Symbol("lastReject"),i=Symbol("error"),l=Symbol("ended"),S=Symbol("lastPromise"),R=Symbol("handlePromise"),h=Symbol("stream");function g(C,N){return{value:C,done:N}}function m(C){var N=C[E];if(N!==null){var I=C[h].read();I!==null&&(C[S]=null,C[E]=null,C[p]=null,N(g(I,!1)))}}function b(C){H.nextTick(m,C)}function F(C,N){return function(I,D){C.then(function(){if(N[l]){I(g(void 0,!0));return}N[R](I,D)},D)}}var x=Object.getPrototypeOf(function(){}),u=Object.setPrototypeOf((T={get stream(){return this[h]},next:function(){var N=this,I=this[i];if(I!==null)return Promise.reject(I);if(this[l])return Promise.resolve(g(void 0,!0));if(this[h].destroyed)return new Promise(function(P,Q){H.nextTick(function(){N[i]?Q(N[i]):P(g(void 0,!0))})});var D=this[S],G;if(D)G=new Promise(F(D,this));else{var k=this[h].read();if(k!==null)return Promise.resolve(g(k,!1));G=new Promise(this[R])}return this[S]=G,G}},w(T,Symbol.asyncIterator,function(){return this}),w(T,"return",function(){var N=this;return new Promise(function(I,D){N[h].destroy(null,function(G){if(G){D(G);return}I(g(void 0,!0))})})}),T),x),y=function(N){var I,D=Object.create(u,(I={},w(I,h,{value:N,writable:!0}),w(I,E,{value:null,writable:!0}),w(I,p,{value:null,writable:!0}),w(I,i,{value:null,writable:!0}),w(I,l,{value:N._readableState.endEmitted,writable:!0}),w(I,R,{value:function(k,P){var Q=D[h].read();Q?(D[S]=null,D[E]=null,D[p]=null,k(g(Q,!1))):(D[E]=k,D[p]=P)},writable:!0}),I));return D[S]=null,L(N,function(G){if(G&&G.code!=="ERR_STREAM_PREMATURE_CLOSE"){var k=D[p];k!==null&&(D[S]=null,D[E]=null,D[p]=null,k(G)),D[i]=G;return}var P=D[E];P!==null&&(D[S]=null,D[E]=null,D[p]=null,P(g(void 0,!0))),D[l]=!0}),N.on("readable",b.bind(null,D)),D};return He=y,He}var Ge,gr;function Wr(){return gr||(gr=1,Ge=function(){throw new Error("Readable.from is not available in the browser")}),Ge}var Ve,wr;function Ir(){if(wr)return Ve;wr=1,Ve=P;var T;P.ReadableState=k,xr.EventEmitter;var w=function(a,B){return a.listeners(B).length},M=Br(),_=Ie().Buffer,L=(typeof be<"u"?be:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function E(o){return _.from(o)}function p(o){return _.isBuffer(o)||o instanceof L}var i=Cr,l;i&&i.debuglog?l=i.debuglog("stream"):l=function(){};var S=kr(),R=Fr(),h=Ar(),g=h.getHighWaterMark,m=Ee().codes,b=m.ERR_INVALID_ARG_TYPE,F=m.ERR_STREAM_PUSH_AFTER_EOF,x=m.ERR_METHOD_NOT_IMPLEMENTED,u=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y,C,N;Ce(P,M);var I=R.errorOrDestroy,D=["error","close","destroy","pause","resume"];function G(o,a,B){if(typeof o.prependListener=="function")return o.prependListener(a,B);!o._events||!o._events[a]?o.on(a,B):Array.isArray(o._events[a])?o._events[a].unshift(B):o._events[a]=[B,o._events[a]]}function k(o,a,B){T=T||_e(),o=o||{},typeof B!="boolean"&&(B=a instanceof T),this.objectMode=!!o.objectMode,B&&(this.objectMode=this.objectMode||!!o.readableObjectMode),this.highWaterMark=g(this,o,"readableHighWaterMark",B),this.buffer=new S,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=o.emitClose!==!1,this.autoDestroy=!!o.autoDestroy,this.destroyed=!1,this.defaultEncoding=o.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,o.encoding&&(y||(y=dr().StringDecoder),this.decoder=new y(o.encoding),this.encoding=o.encoding)}function P(o){if(T=T||_e(),!(this instanceof P))return new P(o);var a=this instanceof T;this._readableState=new k(o,this,a),this.readable=!0,o&&(typeof o.read=="function"&&(this._read=o.read),typeof o.destroy=="function"&&(this._destroy=o.destroy)),M.call(this)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(a){this._readableState&&(this._readableState.destroyed=a)}}),P.prototype.destroy=R.destroy,P.prototype._undestroy=R.undestroy,P.prototype._destroy=function(o,a){a(o)},P.prototype.push=function(o,a){var B=this._readableState,U;return B.objectMode?U=!0:typeof o=="string"&&(a=a||B.defaultEncoding,a!==B.encoding&&(o=_.from(o,a),a=""),U=!0),Q(this,o,a,!1,U)},P.prototype.unshift=function(o){return Q(this,o,null,!0,!1)};function Q(o,a,B,U,Y){l("readableAddChunk",a);var j=o._readableState;if(a===null)j.reading=!1,Re(o,j);else{var $;if(Y||($=me(j,a)),$)I(o,$);else if(j.objectMode||a&&a.length>0)if(typeof a!="string"&&!j.objectMode&&Object.getPrototypeOf(a)!==_.prototype&&(a=E(a)),U)j.endEmitted?I(o,new u):ue(o,j,a,!0);else if(j.ended)I(o,new F);else{if(j.destroyed)return!1;j.reading=!1,j.decoder&&!B?(a=j.decoder.write(a),j.objectMode||a.length!==0?ue(o,j,a,!1):oe(o,j)):ue(o,j,a,!1)}else U||(j.reading=!1,oe(o,j))}return!j.ended&&(j.length<j.highWaterMark||j.length===0)}function ue(o,a,B,U){a.flowing&&a.length===0&&!a.sync?(a.awaitDrain=0,o.emit("data",B)):(a.length+=a.objectMode?1:B.length,U?a.buffer.unshift(B):a.buffer.push(B),a.needReadable&&ne(o)),oe(o,a)}function me(o,a){var B;return!p(a)&&typeof a!="string"&&a!==void 0&&!o.objectMode&&(B=new b("chunk",["string","Buffer","Uint8Array"],a)),B}P.prototype.isPaused=function(){return this._readableState.flowing===!1},P.prototype.setEncoding=function(o){y||(y=dr().StringDecoder);var a=new y(o);this._readableState.decoder=a,this._readableState.encoding=this._readableState.decoder.encoding;for(var B=this._readableState.buffer.head,U="";B!==null;)U+=a.write(B.data),B=B.next;return this._readableState.buffer.clear(),U!==""&&this._readableState.buffer.push(U),this._readableState.length=U.length,this};var ie=1073741824;function he(o){return o>=ie?o=ie:(o--,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,o|=o>>>16,o++),o}function fe(o,a){return o<=0||a.length===0&&a.ended?0:a.objectMode?1:o!==o?a.flowing&&a.length?a.buffer.head.data.length:a.length:(o>a.highWaterMark&&(a.highWaterMark=he(o)),o<=a.length?o:a.ended?a.length:(a.needReadable=!0,0))}P.prototype.read=function(o){l("read",o),o=parseInt(o,10);var a=this._readableState,B=o;if(o!==0&&(a.emittedReadable=!1),o===0&&a.needReadable&&((a.highWaterMark!==0?a.length>=a.highWaterMark:a.length>0)||a.ended))return l("read: emitReadable",a.length,a.ended),a.length===0&&a.ended?A(this):ne(this),null;if(o=fe(o,a),o===0&&a.ended)return a.length===0&&A(this),null;var U=a.needReadable;l("need readable",U),(a.length===0||a.length-o<a.highWaterMark)&&(U=!0,l("length less than watermark",U)),a.ended||a.reading?(U=!1,l("reading or ended",U)):U&&(l("do read"),a.reading=!0,a.sync=!0,a.length===0&&(a.needReadable=!0),this._read(a.highWaterMark),a.sync=!1,a.reading||(o=fe(B,a)));var Y;return o>0?Y=s(o,a):Y=null,Y===null?(a.needReadable=a.length<=a.highWaterMark,o=0):(a.length-=o,a.awaitDrain=0),a.length===0&&(a.ended||(a.needReadable=!0),B!==o&&a.ended&&A(this)),Y!==null&&this.emit("data",Y),Y};function Re(o,a){if(l("onEofChunk"),!a.ended){if(a.decoder){var B=a.decoder.end();B&&B.length&&(a.buffer.push(B),a.length+=a.objectMode?1:B.length)}a.ended=!0,a.sync?ne(o):(a.needReadable=!1,a.emittedReadable||(a.emittedReadable=!0,ce(o)))}}function ne(o){var a=o._readableState;l("emitReadable",a.needReadable,a.emittedReadable),a.needReadable=!1,a.emittedReadable||(l("emitReadable",a.flowing),a.emittedReadable=!0,H.nextTick(ce,o))}function ce(o){var a=o._readableState;l("emitReadable_",a.destroyed,a.length,a.ended),!a.destroyed&&(a.length||a.ended)&&(o.emit("readable"),a.emittedReadable=!1),a.needReadable=!a.flowing&&!a.ended&&a.length<=a.highWaterMark,d(o)}function oe(o,a){a.readingMore||(a.readingMore=!0,H.nextTick(de,o,a))}function de(o,a){for(;!a.reading&&!a.ended&&(a.length<a.highWaterMark||a.flowing&&a.length===0);){var B=a.length;if(l("maybeReadMore read 0"),o.read(0),B===a.length)break}a.readingMore=!1}P.prototype._read=function(o){I(this,new x("_read()"))},P.prototype.pipe=function(o,a){var B=this,U=this._readableState;switch(U.pipesCount){case 0:U.pipes=o;break;case 1:U.pipes=[U.pipes,o];break;default:U.pipes.push(o);break}U.pipesCount+=1,l("pipe count=%d opts=%j",U.pipesCount,a);var Y=(!a||a.end!==!1)&&o!==H.stdout&&o!==H.stderr,j=Y?ae:se;U.endEmitted?H.nextTick(j):B.once("end",j),o.on("unpipe",$);function $(t,e){l("onunpipe"),t===B&&e&&e.hasUnpiped===!1&&(e.hasUnpiped=!0,we())}function ae(){l("onend"),o.end()}var ge=J(B);o.on("drain",ge);var ve=!1;function we(){l("cleanup"),o.removeListener("close",Se),o.removeListener("finish",re),o.removeListener("drain",ge),o.removeListener("error",le),o.removeListener("unpipe",$),B.removeListener("end",ae),B.removeListener("end",se),B.removeListener("data",ee),ve=!0,U.awaitDrain&&(!o._writableState||o._writableState.needDrain)&&ge()}B.on("data",ee);function ee(t){l("ondata");var e=o.write(t);l("dest.write",e),e===!1&&((U.pipesCount===1&&U.pipes===o||U.pipesCount>1&&q(U.pipes,o)!==-1)&&!ve&&(l("false write response, pause",U.awaitDrain),U.awaitDrain++),B.pause())}function le(t){l("onerror",t),se(),o.removeListener("error",le),w(o,"error")===0&&I(o,t)}G(o,"error",le);function Se(){o.removeListener("finish",re),se()}o.once("close",Se);function re(){l("onfinish"),o.removeListener("close",Se),se()}o.once("finish",re);function se(){l("unpipe"),B.unpipe(o)}return o.emit("pipe",B),U.flowing||(l("pipe resume"),B.resume()),o};function J(o){return function(){var B=o._readableState;l("pipeOnDrain",B.awaitDrain),B.awaitDrain&&B.awaitDrain--,B.awaitDrain===0&&w(o,"data")&&(B.flowing=!0,d(o))}}P.prototype.unpipe=function(o){var a=this._readableState,B={hasUnpiped:!1};if(a.pipesCount===0)return this;if(a.pipesCount===1)return o&&o!==a.pipes?this:(o||(o=a.pipes),a.pipes=null,a.pipesCount=0,a.flowing=!1,o&&o.emit("unpipe",this,B),this);if(!o){var U=a.pipes,Y=a.pipesCount;a.pipes=null,a.pipesCount=0,a.flowing=!1;for(var j=0;j<Y;j++)U[j].emit("unpipe",this,{hasUnpiped:!1});return this}var $=q(a.pipes,o);return $===-1?this:(a.pipes.splice($,1),a.pipesCount-=1,a.pipesCount===1&&(a.pipes=a.pipes[0]),o.emit("unpipe",this,B),this)},P.prototype.on=function(o,a){var B=M.prototype.on.call(this,o,a),U=this._readableState;return o==="data"?(U.readableListening=this.listenerCount("readable")>0,U.flowing!==!1&&this.resume()):o==="readable"&&!U.endEmitted&&!U.readableListening&&(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,l("on readable",U.length,U.reading),U.length?ne(this):U.reading||H.nextTick(te,this)),B},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(o,a){var B=M.prototype.removeListener.call(this,o,a);return o==="readable"&&H.nextTick(Z,this),B},P.prototype.removeAllListeners=function(o){var a=M.prototype.removeAllListeners.apply(this,arguments);return(o==="readable"||o===void 0)&&H.nextTick(Z,this),a};function Z(o){var a=o._readableState;a.readableListening=o.listenerCount("readable")>0,a.resumeScheduled&&!a.paused?a.flowing=!0:o.listenerCount("data")>0&&o.resume()}function te(o){l("readable nexttick read 0"),o.read(0)}P.prototype.resume=function(){var o=this._readableState;return o.flowing||(l("resume"),o.flowing=!o.readableListening,pe(this,o)),o.paused=!1,this};function pe(o,a){a.resumeScheduled||(a.resumeScheduled=!0,H.nextTick(ye,o,a))}function ye(o,a){l("resume",a.reading),a.reading||o.read(0),a.resumeScheduled=!1,o.emit("resume"),d(o),a.flowing&&!a.reading&&o.read(0)}P.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function d(o){var a=o._readableState;for(l("flow",a.flowing);a.flowing&&o.read()!==null;);}P.prototype.wrap=function(o){var a=this,B=this._readableState,U=!1;o.on("end",function(){if(l("wrapped end"),B.decoder&&!B.ended){var $=B.decoder.end();$&&$.length&&a.push($)}a.push(null)}),o.on("data",function($){if(l("wrapped data"),B.decoder&&($=B.decoder.write($)),!(B.objectMode&&$==null)&&!(!B.objectMode&&(!$||!$.length))){var ae=a.push($);ae||(U=!0,o.pause())}});for(var Y in o)this[Y]===void 0&&typeof o[Y]=="function"&&(this[Y]=function(ae){return function(){return o[ae].apply(o,arguments)}}(Y));for(var j=0;j<D.length;j++)o.on(D[j],this.emit.bind(this,D[j]));return this._read=function($){l("wrapped _read",$),U&&(U=!1,o.resume())},this},typeof Symbol=="function"&&(P.prototype[Symbol.asyncIterator]=function(){return C===void 0&&(C=jr()),C(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(a){this._readableState&&(this._readableState.flowing=a)}}),P._fromList=s,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function s(o,a){if(a.length===0)return null;var B;return a.objectMode?B=a.buffer.shift():!o||o>=a.length?(a.decoder?B=a.buffer.join(""):a.buffer.length===1?B=a.buffer.first():B=a.buffer.concat(a.length),a.buffer.clear()):B=a.buffer.consume(o,a.decoder),B}function A(o){var a=o._readableState;l("endReadable",a.endEmitted),a.endEmitted||(a.ended=!0,H.nextTick(O,a,o))}function O(o,a){if(l("endReadableNT",o.endEmitted,o.length),!o.endEmitted&&o.length===0&&(o.endEmitted=!0,a.readable=!1,a.emit("end"),o.autoDestroy)){var B=a._writableState;(!B||B.autoDestroy&&B.finished)&&a.destroy()}}typeof Symbol=="function"&&(P.from=function(o,a){return N===void 0&&(N=Wr()),N(P,o,a)});function q(o,a){for(var B=0,U=o.length;B<U;B++)if(o[B]===a)return B;return-1}return Ve}var Ye,br;function Mr(){if(br)return Ye;br=1,Ye=i;var T=Ee().codes,w=T.ERR_METHOD_NOT_IMPLEMENTED,M=T.ERR_MULTIPLE_CALLBACK,_=T.ERR_TRANSFORM_ALREADY_TRANSFORMING,L=T.ERR_TRANSFORM_WITH_LENGTH_0,E=_e();Ce(i,E);function p(R,h){var g=this._transformState;g.transforming=!1;var m=g.writecb;if(m===null)return this.emit("error",new M);g.writechunk=null,g.writecb=null,h!=null&&this.push(h),m(R);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function i(R){if(!(this instanceof i))return new i(R);E.call(this,R),this._transformState={afterTransform:p.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,R&&(typeof R.transform=="function"&&(this._transform=R.transform),typeof R.flush=="function"&&(this._flush=R.flush)),this.on("prefinish",l)}function l(){var R=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(h,g){S(R,h,g)}):S(this,null,null)}i.prototype.push=function(R,h){return this._transformState.needTransform=!1,E.prototype.push.call(this,R,h)},i.prototype._transform=function(R,h,g){g(new w("_transform()"))},i.prototype._write=function(R,h,g){var m=this._transformState;if(m.writecb=g,m.writechunk=R,m.writeencoding=h,!m.transforming){var b=this._readableState;(m.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},i.prototype._read=function(R){var h=this._transformState;h.writechunk!==null&&!h.transforming?(h.transforming=!0,this._transform(h.writechunk,h.writeencoding,h.afterTransform)):h.needTransform=!0},i.prototype._destroy=function(R,h){E.prototype._destroy.call(this,R,function(g){h(g)})};function S(R,h,g){if(h)return R.emit("error",h);if(g!=null&&R.push(g),R._writableState.length)throw new L;if(R._transformState.transforming)throw new _;return R.push(null)}return Ye}var Ke,_r;function $r(){if(_r)return Ke;_r=1,Ke=w;var T=Mr();Ce(w,T);function w(M){if(!(this instanceof w))return new w(M);T.call(this,M)}return w.prototype._transform=function(M,_,L){L(null,M)},Ke}var Je,Er;function Hr(){if(Er)return Je;Er=1;var T;function w(g){var m=!1;return function(){m||(m=!0,g.apply(void 0,arguments))}}var M=Ee().codes,_=M.ERR_MISSING_ARGS,L=M.ERR_STREAM_DESTROYED;function E(g){if(g)throw g}function p(g){return g.setHeader&&typeof g.abort=="function"}function i(g,m,b,F){F=w(F);var x=!1;g.on("close",function(){x=!0}),T===void 0&&(T=Ze()),T(g,{readable:m,writable:b},function(y){if(y)return F(y);x=!0,F()});var u=!1;return function(y){if(!x&&!u){if(u=!0,p(g))return g.abort();if(typeof g.destroy=="function")return g.destroy();F(y||new L("pipe"))}}}function l(g){g()}function S(g,m){return g.pipe(m)}function R(g){return!g.length||typeof g[g.length-1]!="function"?E:g.pop()}function h(){for(var g=arguments.length,m=new Array(g),b=0;b<g;b++)m[b]=arguments[b];var F=R(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new _("streams");var x,u=m.map(function(y,C){var N=C<m.length-1,I=C>0;return i(y,N,I,function(D){x||(x=D),D&&u.forEach(l),!N&&(u.forEach(l),F(x))})});return m.reduce(S)}return Je=h,Je}var mr;function zr(){return mr||(mr=1,function(T,w){w=T.exports=Ir(),w.Stream=w,w.Readable=w,w.Writable=Tr(),w.Duplex=_e(),w.Transform=Mr(),w.PassThrough=$r(),w.finished=Ze(),w.pipeline=Hr()}(Ae,Ae.exports)),Ae.exports}var Te={exports:{}},ze,Rr;function Gr(){if(Rr)return ze;Rr=1;var T=1e3,w=T*60,M=w*60,_=M*24,L=_*7,E=_*365.25;ze=function(R,h){h=h||{};var g=typeof R;if(g==="string"&&R.length>0)return p(R);if(g==="number"&&isFinite(R))return h.long?l(R):i(R);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(R))};function p(R){if(R=String(R),!(R.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(R);if(h){var g=parseFloat(h[1]),m=(h[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return g*E;case"weeks":case"week":case"w":return g*L;case"days":case"day":case"d":return g*_;case"hours":case"hour":case"hrs":case"hr":case"h":return g*M;case"minutes":case"minute":case"mins":case"min":case"m":return g*w;case"seconds":case"second":case"secs":case"sec":case"s":return g*T;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function i(R){var h=Math.abs(R);return h>=_?Math.round(R/_)+"d":h>=M?Math.round(R/M)+"h":h>=w?Math.round(R/w)+"m":h>=T?Math.round(R/T)+"s":R+"ms"}function l(R){var h=Math.abs(R);return h>=_?S(R,h,_,"day"):h>=M?S(R,h,M,"hour"):h>=w?S(R,h,w,"minute"):h>=T?S(R,h,T,"second"):R+" ms"}function S(R,h,g,m){var b=h>=g*1.5;return Math.round(R/g)+" "+m+(b?"s":"")}return ze}var Xe,vr;function Vr(){if(vr)return Xe;vr=1;function T(w){_.debug=_,_.default=_,_.coerce=S,_.disable=i,_.enable=E,_.enabled=l,_.humanize=Gr(),_.destroy=R,Object.keys(w).forEach(h=>{_[h]=w[h]}),_.names=[],_.skips=[],_.formatters={};function M(h){let g=0;for(let m=0;m<h.length;m++)g=(g<<5)-g+h.charCodeAt(m),g|=0;return _.colors[Math.abs(g)%_.colors.length]}_.selectColor=M;function _(h){let g,m=null,b,F;function x(...u){if(!x.enabled)return;const y=x,C=Number(new Date),N=C-(g||C);y.diff=N,y.prev=g,y.curr=C,g=C,u[0]=_.coerce(u[0]),typeof u[0]!="string"&&u.unshift("%O");let I=0;u[0]=u[0].replace(/%([a-zA-Z%])/g,(G,k)=>{if(G==="%%")return"%";I++;const P=_.formatters[k];if(typeof P=="function"){const Q=u[I];G=P.call(y,Q),u.splice(I,1),I--}return G}),_.formatArgs.call(y,u),(y.log||_.log).apply(y,u)}return x.namespace=h,x.useColors=_.useColors(),x.color=_.selectColor(h),x.extend=L,x.destroy=_.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(b!==_.namespaces&&(b=_.namespaces,F=_.enabled(h)),F),set:u=>{m=u}}),typeof _.init=="function"&&_.init(x),x}function L(h,g){const m=_(this.namespace+(typeof g>"u"?":":g)+h);return m.log=this.log,m}function E(h){_.save(h),_.namespaces=h,_.names=[],_.skips=[];const g=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const m of g)m[0]==="-"?_.skips.push(m.slice(1)):_.names.push(m)}function p(h,g){let m=0,b=0,F=-1,x=0;for(;m<h.length;)if(b<g.length&&(g[b]===h[m]||g[b]==="*"))g[b]==="*"?(F=b,x=m,b++):(m++,b++);else if(F!==-1)b=F+1,x++,m=x;else return!1;for(;b<g.length&&g[b]==="*";)b++;return b===g.length}function i(){const h=[..._.names,..._.skips.map(g=>"-"+g)].join(",");return _.enable(""),h}function l(h){for(const g of _.skips)if(p(h,g))return!1;for(const g of _.names)if(p(h,g))return!0;return!1}function S(h){return h instanceof Error?h.stack||h.message:h}function R(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return _.enable(_.load()),_}return Xe=T,Xe}var Sr;function Xr(){return Sr||(Sr=1,function(T,w){w.formatArgs=_,w.save=L,w.load=E,w.useColors=M,w.storage=p(),w.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),w.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function M(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let l;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function _(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+T.exports.humanize(this.diff),!this.useColors)return;const S="color: "+this.color;l.splice(1,0,S,"color: inherit");let R=0,h=0;l[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(R++,g==="%c"&&(h=R))}),l.splice(h,0,S)}w.log=console.debug||console.log||(()=>{});function L(l){try{l?w.storage.setItem("debug",l):w.storage.removeItem("debug")}catch{}}function E(){let l;try{l=w.storage.getItem("debug")||w.storage.getItem("DEBUG")}catch{}return!l&&typeof H<"u"&&"env"in H&&(l={}.DEBUG),l}function p(){try{return localStorage}catch{}}T.exports=Vr()(w);const{formatters:i}=T.exports;i.j=function(l){try{return JSON.stringify(l)}catch(S){return"[UnexpectedJSONParseError]: "+S.message}}}(Te,Te.exports)),Te.exports}const Zr=Lr(Ur);export{Ie as a,Jr as b,Pr as c,Xr as d,zr as e,Zr as r};
@@ -1,4 +1,4 @@
1
- import{N as b,t as _e,w as Be,l as Te,u as Ue,v as ze,n as f,a as ye,y as Ye,C as he,c as z,S as v,R as p,z as Z,B as J,D as Xe,F as te,b as de,E as M,G as ue,I as pe,M as R,J as Fe,d as A,r as se,i as x,x as l,h as Le,K as me,g as ke,e as qe,L as Y,O as y,s as He,A as le,T as Qe,P as Ze}from"./core-85d4a2c0.js";import{c as T,n as h,o as O,r as m,U as je}from"./index-94684a9b.js";import"./index-6c5c6262.js";import"./index-f10062b6.js";const j={getGasPriceInEther(e,t){const o=t*e;return Number(o)/1e18},getGasPriceInUSD(e,t,o){const n=j.getGasPriceInEther(t,o);return b.bigNumber(e).times(n).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:o,toTokenAmount:n}){const a=b.bigNumber(e).times(t),i=b.bigNumber(n).times(o);return a.minus(i).div(a).times(100).toNumber()},getMaxSlippage(e,t){const o=b.bigNumber(e).div(100);return b.multiply(t,o).toNumber()},getProviderFee(e,t=.0085){return b.bigNumber(e).times(t).toString()},isInsufficientNetworkTokenForGas(e,t){const o=t||"0";return b.bigNumber(e).eq(0)?!0:b.bigNumber(b.bigNumber(o)).gt(e)},isInsufficientSourceTokenForSwap(e,t,o){var i,s;const n=(s=(i=o==null?void 0:o.find(c=>c.address===t))==null?void 0:i.quantity)==null?void 0:s.numeric;return b.bigNumber(n||"0").lt(e)}},We=15e4,Je=6,S={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:Te.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},r=_e({...S}),we={state:r,subscribe(e){return Ue(r,()=>e(r))},subscribeKey(e,t){return ze(r,e,t)},getParams(){var d,w,g,P,E,F,L,H,Q;const e=f.state.activeChain,t=((d=f.getAccountData(e))==null?void 0:d.caipAddress)??f.state.activeCaipAddress,o=ye.getPlainAddress(t),n=Ye(),a=he.getConnectorId(f.state.activeChain);if(!o)throw new Error("No address found to swap the tokens from.");const i=!((w=r.toToken)!=null&&w.address)||!((g=r.toToken)!=null&&g.decimals),s=!((P=r.sourceToken)!=null&&P.address)||!((E=r.sourceToken)!=null&&E.decimals)||!b.bigNumber(r.sourceTokenAmount).gt(0),c=!r.sourceTokenAmount;return{networkAddress:n,fromAddress:o,fromCaipAddress:t,sourceTokenAddress:(F=r.sourceToken)==null?void 0:F.address,toTokenAddress:(L=r.toToken)==null?void 0:L.address,toTokenAmount:r.toTokenAmount,toTokenDecimals:(H=r.toToken)==null?void 0:H.decimals,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:(Q=r.sourceToken)==null?void 0:Q.decimals,invalidToToken:i,invalidSourceToken:s,invalidSourceTokenAmount:c,availableToSwap:t&&!i&&!s&&!c,isAuthConnector:a===z.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){r.sourceToken=e,r.sourceTokenAmount="",r.sourceTokenPriceInUSD=0;return}r.sourceToken=e,await u.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){r.sourceTokenAmount=e},async setToToken(e){if(!e){r.toToken=e,r.toTokenAmount="",r.toTokenPriceInUSD=0;return}r.toToken=e,await u.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){r.toTokenAmount=e?b.toFixed(e,Je):""},async setTokenPrice(e,t){let o=r.tokensPriceMap[e]||0;o||(r.loadingPrices=!0,o=await u.getAddressPrice(e)),t==="sourceToken"?r.sourceTokenPriceInUSD=o:t==="toToken"&&(r.toTokenPriceInUSD=o),r.loadingPrices&&(r.loadingPrices=!1),u.getParams().availableToSwap&&!r.switchingTokens&&u.swapTokens()},async switchTokens(){if(!(r.initializing||!r.initialized||r.switchingTokens)){r.switchingTokens=!0;try{const e=r.toToken?{...r.toToken}:void 0,t=r.sourceToken?{...r.sourceToken}:void 0,o=e&&r.toTokenAmount===""?"1":r.toTokenAmount;u.setSourceTokenAmount(o),u.setToTokenAmount(""),await u.setSourceToken(e),await u.setToToken(t),r.switchingTokens=!1,u.swapTokens()}catch(e){throw r.switchingTokens=!1,e}}},resetState(){r.myTokensWithBalance=S.myTokensWithBalance,r.tokensPriceMap=S.tokensPriceMap,r.initialized=S.initialized,r.initializing=S.initializing,r.switchingTokens=S.switchingTokens,r.sourceToken=S.sourceToken,r.sourceTokenAmount=S.sourceTokenAmount,r.sourceTokenPriceInUSD=S.sourceTokenPriceInUSD,r.toToken=S.toToken,r.toTokenAmount=S.toTokenAmount,r.toTokenPriceInUSD=S.toTokenPriceInUSD,r.networkPrice=S.networkPrice,r.networkTokenSymbol=S.networkTokenSymbol,r.networkBalanceInUSD=S.networkBalanceInUSD,r.inputError=S.inputError},resetValues(){var o;const{networkAddress:e}=u.getParams(),t=(o=r.tokens)==null?void 0:o.find(n=>n.address===e);u.setSourceToken(t),u.setToToken(void 0)},getApprovalLoadingState(){return r.loadingApprovalTransaction},clearError(){r.transactionError=void 0},async initializeState(){if(!r.initializing){if(r.initializing=!0,!r.initialized)try{await u.fetchTokens(),r.initialized=!0}catch{r.initialized=!1,v.showError("Failed to initialize swap"),p.goBack()}r.initializing=!1}},async fetchTokens(){var o;const{networkAddress:e}=u.getParams();await u.getNetworkTokenPrice(),await u.getMyTokensWithBalance();const t=(o=r.myTokensWithBalance)==null?void 0:o.find(n=>n.address===e);t&&(r.networkTokenSymbol=t.symbol,u.setSourceToken(t),u.setSourceTokenAmount("0"))},async getTokenList(){var t,o;const e=(t=f.state.activeCaipNetwork)==null?void 0:t.caipNetworkId;if(!(r.caipNetworkId===e&&r.tokens))try{r.tokensLoading=!0;const n=await Z.getTokenList(e);r.tokens=n,r.caipNetworkId=e,r.popularTokens=n.sort((d,w)=>d.symbol<w.symbol?-1:d.symbol>w.symbol?1:0);const i=(e&&((o=Te.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:o[e])||[]).map(d=>n.find(w=>w.symbol===d)).filter(d=>!!d),c=(Te.SWAP_SUGGESTED_TOKENS||[]).map(d=>n.find(w=>w.symbol===d)).filter(d=>!!d).filter(d=>!i.some(w=>w.address===d.address));r.suggestedTokens=[...i,...c]}catch{r.tokens=[],r.popularTokens=[],r.suggestedTokens=[]}finally{r.tokensLoading=!1}},async getAddressPrice(e){var d,w;const t=r.tokensPriceMap[e];if(t)return t;const o=await J.fetchTokenPrice({addresses:[e]}),n=(o==null?void 0:o.fungibles)||[],a=[...r.tokens||[],...r.myTokensWithBalance||[]],i=(d=a==null?void 0:a.find(g=>g.address===e))==null?void 0:d.symbol,s=((w=n.find(g=>g.symbol.toLowerCase()===(i==null?void 0:i.toLowerCase())))==null?void 0:w.price)||0,c=parseFloat(s.toString());return r.tokensPriceMap[e]=c,c},async getNetworkTokenPrice(){var a;const{networkAddress:e}=u.getParams(),o=(a=(await J.fetchTokenPrice({addresses:[e]}).catch(()=>(v.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:a[0],n=(o==null?void 0:o.price.toString())||"0";r.tokensPriceMap[e]=parseFloat(n),r.networkTokenSymbol=(o==null?void 0:o.symbol)||"",r.networkPrice=n},async getMyTokensWithBalance(e){const t=await Xe.getMyTokensWithBalance(e),o=Z.mapBalancesToSwapTokens(t);o&&(await u.getInitialGasPrice(),u.setBalances(o))},setBalances(e){const{networkAddress:t}=u.getParams(),o=f.state.activeCaipNetwork;if(!o)return;const n=e.find(a=>a.address===t);e.forEach(a=>{r.tokensPriceMap[a.address]=a.price||0}),r.myTokensWithBalance=e.filter(a=>a.address.startsWith(o.caipNetworkId)),r.networkBalanceInUSD=n?b.multiply(n.quantity.numeric,n.price).toString():"0"},async getInitialGasPrice(){var t,o;const e=await Z.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch((o=(t=f.state)==null?void 0:t.activeCaipNetwork)==null?void 0:o.chainNamespace){case z.CHAIN.SOLANA:return r.gasFee=e.standard??"0",r.gasPriceInUSD=b.multiply(e.standard,r.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(r.gasFee),gasPriceInUSD:Number(r.gasPriceInUSD)};case z.CHAIN.EVM:default:const n=e.standard??"0",a=BigInt(n),i=BigInt(We),s=j.getGasPriceInUSD(r.networkPrice,i,a);return r.gasFee=n,r.gasPriceInUSD=s,{gasPrice:a,gasPriceInUSD:s}}},async swapTokens(){var i,s,c;const e=(i=f.getAccountData())==null?void 0:i.address,t=r.sourceToken,o=r.toToken,n=b.bigNumber(r.sourceTokenAmount).gt(0);if(n||u.setToTokenAmount(""),!o||!t||r.loadingPrices||!n||!e)return;r.loadingQuote=!0;const a=b.bigNumber(r.sourceTokenAmount).times(10**t.decimals).round(0);try{const d=await J.fetchSwapQuote({userAddress:e,from:t.address,to:o.address,gasPrice:r.gasFee,amount:a.toString()});r.loadingQuote=!1;const w=(c=(s=d==null?void 0:d.quotes)==null?void 0:s[0])==null?void 0:c.toAmount;if(!w){te.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const g=b.bigNumber(w).div(10**o.decimals).toString();u.setToTokenAmount(g),u.hasInsufficientToken(r.sourceTokenAmount,t.address)?r.inputError="Insufficient balance":(r.inputError=void 0,u.setTransactionDetails())}catch(d){const w=await Z.handleSwapError(d);r.loadingQuote=!1,r.inputError=w||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:e,availableToSwap:t}=u.getParams(),o=r.sourceToken,n=r.toToken;if(!(!e||!t||!o||!n||r.loadingQuote))try{r.loadingBuildTransaction=!0;const a=await Z.fetchSwapAllowance({userAddress:e,tokenAddress:o.address,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:o.decimals});let i;return a?i=await u.createSwapTransaction():i=await u.createAllowanceTransaction(),r.loadingBuildTransaction=!1,r.fetchError=!1,i}catch{p.goBack(),v.showError("Failed to check allowance"),r.loadingBuildTransaction=!1,r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:e,sourceTokenAddress:t,toTokenAddress:o}=u.getParams();if(!(!e||!o)){if(!t)throw new Error("createAllowanceTransaction - No source token address found.");try{const n=await J.generateApproveCalldata({from:t,to:o,userAddress:e}),a=ye.getPlainAddress(n.tx.from);if(!a)throw new Error("SwapController:createAllowanceTransaction - address is required");const i={data:n.tx.data,to:a,gasPrice:BigInt(n.tx.eip155.gasPrice),value:BigInt(n.tx.value),toAmount:r.toTokenAmount};return r.swapTransaction=void 0,r.approvalTransaction={data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount},{data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount}}catch{p.goBack(),v.showError("Failed to create approval transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}}},async createSwapTransaction(){var s;const{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:o}=u.getParams(),n=r.sourceToken,a=r.toToken;if(!t||!o||!n||!a)return;const i=(s=de.parseUnits(o,n.decimals))==null?void 0:s.toString();try{const c=await J.generateSwapCalldata({userAddress:t,from:n.address,to:a.address,amount:i,disableEstimate:!0}),d=n.address===e,w=BigInt(c.tx.eip155.gas),g=BigInt(c.tx.eip155.gasPrice),P=ye.getPlainAddress(c.tx.to);if(!P)throw new Error("SwapController:createSwapTransaction - address is required");const E={data:c.tx.data,to:P,gas:w,gasPrice:g,value:BigInt(d?i??"0":"0"),toAmount:r.toTokenAmount};return r.gasPriceInUSD=j.getGasPriceInUSD(r.networkPrice,w,g),r.approvalTransaction=void 0,r.swapTransaction=E,E}catch{p.goBack(),v.showError("Failed to create transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){v.showLoading("Approve limit increase in your wallet"),p.replace("SwapPreview")},async sendTransactionForApproval(e){var a,i,s;const{fromAddress:t,isAuthConnector:o}=u.getParams();r.loadingApprovalTransaction=!0;const n="Approve limit increase in your wallet";o?p.pushTransactionStack({onSuccess:u.onEmbeddedWalletApprovalSuccess}):v.showLoading(n);try{await de.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:z.CHAIN.EVM}),await u.swapTokens(),await u.getTransaction(),r.approvalTransaction=void 0,r.loadingApprovalTransaction=!1}catch(c){const d=c;r.transactionError=d==null?void 0:d.displayMessage,r.loadingApprovalTransaction=!1,v.showError((d==null?void 0:d.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(d==null?void 0:d.displayMessage)||(d==null?void 0:d.message)||"Unknown",network:((a=f.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)||"",swapFromToken:((i=u.state.sourceToken)==null?void 0:i.symbol)||"",swapToToken:((s=u.state.toToken)==null?void 0:s.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){var s,c,d,w,g,P,E,F,L,H,Q,Ee;if(!e)return;const{fromAddress:t,toTokenAmount:o,isAuthConnector:n}=u.getParams();r.loadingTransaction=!0;const a=`Swapping ${(s=r.sourceToken)==null?void 0:s.symbol} to ${b.formatNumberToLocalString(o,3)} ${(c=r.toToken)==null?void 0:c.symbol}`,i=`Swapped ${(d=r.sourceToken)==null?void 0:d.symbol} to ${b.formatNumberToLocalString(o,3)} ${(w=r.toToken)==null?void 0:w.symbol}`;n?p.pushTransactionStack({onSuccess(){p.replace("Account"),v.showLoading(a),we.resetState()}}):v.showLoading("Confirm transaction in your wallet");try{const ve=[(g=r.sourceToken)==null?void 0:g.address,(P=r.toToken)==null?void 0:P.address].join(","),$=await de.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:z.CHAIN.EVM});return r.loadingTransaction=!1,v.showSuccess(i),M.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((E=f.state.activeCaipNetwork)==null?void 0:E.caipNetworkId)||"",swapFromToken:((F=u.state.sourceToken)==null?void 0:F.symbol)||"",swapToToken:((L=u.state.toToken)==null?void 0:L.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}}),we.resetState(),n||p.replace("Account"),we.getMyTokensWithBalance(ve),$}catch(ve){const $=ve;r.transactionError=$==null?void 0:$.displayMessage,r.loadingTransaction=!1,v.showError(($==null?void 0:$.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:($==null?void 0:$.displayMessage)||($==null?void 0:$.message)||"Unknown",network:((H=f.state.activeCaipNetwork)==null?void 0:H.caipNetworkId)||"",swapFromToken:((Q=u.state.sourceToken)==null?void 0:Q.symbol)||"",swapToToken:((Ee=u.state.toToken)==null?void 0:Ee.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(e,t){return j.isInsufficientSourceTokenForSwap(e,t,r.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:e,toTokenDecimals:t}=u.getParams();!e||!t||(r.gasPriceInUSD=j.getGasPriceInUSD(r.networkPrice,BigInt(r.gasFee),BigInt(We)),r.priceImpact=j.getPriceImpact({sourceTokenAmount:r.sourceTokenAmount,sourceTokenPriceInUSD:r.sourceTokenPriceInUSD,toTokenPriceInUSD:r.toTokenPriceInUSD,toTokenAmount:r.toTokenAmount}),r.maxSlippage=j.getMaxSlippage(r.slippage,r.toTokenAmount),r.providerFee=j.getProviderFee(r.sourceTokenAmount))}},u=Be(we),W=_e({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),et={state:W,subscribe(e){return Ue(W,()=>e(W))},subscribeKey(e,t){return ze(W,e,t)},showTooltip({message:e,triggerRect:t,variant:o}){W.open=!0,W.message=e,W.triggerRect=t,W.variant=o},hide(){W.open=!1,W.message="",W.triggerRect={width:0,height:0,top:0,left:0}}},ee=Be(et),Me={isUnsupportedChainView(){return p.state.view==="UnsupportedChain"||p.state.view==="SwitchNetwork"&&p.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){R.shake();return}if(await Fe.isSIWXCloseDisabled()){R.shake();return}(p.state.view==="DataCapture"||p.state.view==="DataCaptureOtpConfirm")&&de.disconnect(),R.close()}},tt=A`
1
+ import{N as b,t as _e,w as Be,l as Te,u as Ue,v as ze,n as f,a as ye,y as Ye,C as he,c as z,S as v,R as p,z as Z,B as J,D as Xe,F as te,b as de,E as M,G as ue,I as pe,M as R,J as Fe,d as A,r as se,i as x,x as l,h as Le,K as me,g as ke,e as qe,L as Y,O as y,s as He,A as le,T as Qe,P as Ze}from"./core-806d78ea.js";import{c as T,n as h,o as O,r as m,U as je}from"./index-372705ba.js";import"./index-2ef9f1d1.js";import"./index-74e34dfb.js";import"./index-c1c8440f.js";const j={getGasPriceInEther(e,t){const o=t*e;return Number(o)/1e18},getGasPriceInUSD(e,t,o){const n=j.getGasPriceInEther(t,o);return b.bigNumber(e).times(n).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:o,toTokenAmount:n}){const a=b.bigNumber(e).times(t),i=b.bigNumber(n).times(o);return a.minus(i).div(a).times(100).toNumber()},getMaxSlippage(e,t){const o=b.bigNumber(e).div(100);return b.multiply(t,o).toNumber()},getProviderFee(e,t=.0085){return b.bigNumber(e).times(t).toString()},isInsufficientNetworkTokenForGas(e,t){const o=t||"0";return b.bigNumber(e).eq(0)?!0:b.bigNumber(b.bigNumber(o)).gt(e)},isInsufficientSourceTokenForSwap(e,t,o){var i,s;const n=(s=(i=o==null?void 0:o.find(c=>c.address===t))==null?void 0:i.quantity)==null?void 0:s.numeric;return b.bigNumber(n||"0").lt(e)}},We=15e4,Je=6,S={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:Te.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},r=_e({...S}),we={state:r,subscribe(e){return Ue(r,()=>e(r))},subscribeKey(e,t){return ze(r,e,t)},getParams(){var d,w,g,P,E,F,L,H,Q;const e=f.state.activeChain,t=((d=f.getAccountData(e))==null?void 0:d.caipAddress)??f.state.activeCaipAddress,o=ye.getPlainAddress(t),n=Ye(),a=he.getConnectorId(f.state.activeChain);if(!o)throw new Error("No address found to swap the tokens from.");const i=!((w=r.toToken)!=null&&w.address)||!((g=r.toToken)!=null&&g.decimals),s=!((P=r.sourceToken)!=null&&P.address)||!((E=r.sourceToken)!=null&&E.decimals)||!b.bigNumber(r.sourceTokenAmount).gt(0),c=!r.sourceTokenAmount;return{networkAddress:n,fromAddress:o,fromCaipAddress:t,sourceTokenAddress:(F=r.sourceToken)==null?void 0:F.address,toTokenAddress:(L=r.toToken)==null?void 0:L.address,toTokenAmount:r.toTokenAmount,toTokenDecimals:(H=r.toToken)==null?void 0:H.decimals,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:(Q=r.sourceToken)==null?void 0:Q.decimals,invalidToToken:i,invalidSourceToken:s,invalidSourceTokenAmount:c,availableToSwap:t&&!i&&!s&&!c,isAuthConnector:a===z.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){r.sourceToken=e,r.sourceTokenAmount="",r.sourceTokenPriceInUSD=0;return}r.sourceToken=e,await u.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){r.sourceTokenAmount=e},async setToToken(e){if(!e){r.toToken=e,r.toTokenAmount="",r.toTokenPriceInUSD=0;return}r.toToken=e,await u.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){r.toTokenAmount=e?b.toFixed(e,Je):""},async setTokenPrice(e,t){let o=r.tokensPriceMap[e]||0;o||(r.loadingPrices=!0,o=await u.getAddressPrice(e)),t==="sourceToken"?r.sourceTokenPriceInUSD=o:t==="toToken"&&(r.toTokenPriceInUSD=o),r.loadingPrices&&(r.loadingPrices=!1),u.getParams().availableToSwap&&!r.switchingTokens&&u.swapTokens()},async switchTokens(){if(!(r.initializing||!r.initialized||r.switchingTokens)){r.switchingTokens=!0;try{const e=r.toToken?{...r.toToken}:void 0,t=r.sourceToken?{...r.sourceToken}:void 0,o=e&&r.toTokenAmount===""?"1":r.toTokenAmount;u.setSourceTokenAmount(o),u.setToTokenAmount(""),await u.setSourceToken(e),await u.setToToken(t),r.switchingTokens=!1,u.swapTokens()}catch(e){throw r.switchingTokens=!1,e}}},resetState(){r.myTokensWithBalance=S.myTokensWithBalance,r.tokensPriceMap=S.tokensPriceMap,r.initialized=S.initialized,r.initializing=S.initializing,r.switchingTokens=S.switchingTokens,r.sourceToken=S.sourceToken,r.sourceTokenAmount=S.sourceTokenAmount,r.sourceTokenPriceInUSD=S.sourceTokenPriceInUSD,r.toToken=S.toToken,r.toTokenAmount=S.toTokenAmount,r.toTokenPriceInUSD=S.toTokenPriceInUSD,r.networkPrice=S.networkPrice,r.networkTokenSymbol=S.networkTokenSymbol,r.networkBalanceInUSD=S.networkBalanceInUSD,r.inputError=S.inputError},resetValues(){var o;const{networkAddress:e}=u.getParams(),t=(o=r.tokens)==null?void 0:o.find(n=>n.address===e);u.setSourceToken(t),u.setToToken(void 0)},getApprovalLoadingState(){return r.loadingApprovalTransaction},clearError(){r.transactionError=void 0},async initializeState(){if(!r.initializing){if(r.initializing=!0,!r.initialized)try{await u.fetchTokens(),r.initialized=!0}catch{r.initialized=!1,v.showError("Failed to initialize swap"),p.goBack()}r.initializing=!1}},async fetchTokens(){var o;const{networkAddress:e}=u.getParams();await u.getNetworkTokenPrice(),await u.getMyTokensWithBalance();const t=(o=r.myTokensWithBalance)==null?void 0:o.find(n=>n.address===e);t&&(r.networkTokenSymbol=t.symbol,u.setSourceToken(t),u.setSourceTokenAmount("0"))},async getTokenList(){var t,o;const e=(t=f.state.activeCaipNetwork)==null?void 0:t.caipNetworkId;if(!(r.caipNetworkId===e&&r.tokens))try{r.tokensLoading=!0;const n=await Z.getTokenList(e);r.tokens=n,r.caipNetworkId=e,r.popularTokens=n.sort((d,w)=>d.symbol<w.symbol?-1:d.symbol>w.symbol?1:0);const i=(e&&((o=Te.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:o[e])||[]).map(d=>n.find(w=>w.symbol===d)).filter(d=>!!d),c=(Te.SWAP_SUGGESTED_TOKENS||[]).map(d=>n.find(w=>w.symbol===d)).filter(d=>!!d).filter(d=>!i.some(w=>w.address===d.address));r.suggestedTokens=[...i,...c]}catch{r.tokens=[],r.popularTokens=[],r.suggestedTokens=[]}finally{r.tokensLoading=!1}},async getAddressPrice(e){var d,w;const t=r.tokensPriceMap[e];if(t)return t;const o=await J.fetchTokenPrice({addresses:[e]}),n=(o==null?void 0:o.fungibles)||[],a=[...r.tokens||[],...r.myTokensWithBalance||[]],i=(d=a==null?void 0:a.find(g=>g.address===e))==null?void 0:d.symbol,s=((w=n.find(g=>g.symbol.toLowerCase()===(i==null?void 0:i.toLowerCase())))==null?void 0:w.price)||0,c=parseFloat(s.toString());return r.tokensPriceMap[e]=c,c},async getNetworkTokenPrice(){var a;const{networkAddress:e}=u.getParams(),o=(a=(await J.fetchTokenPrice({addresses:[e]}).catch(()=>(v.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:a[0],n=(o==null?void 0:o.price.toString())||"0";r.tokensPriceMap[e]=parseFloat(n),r.networkTokenSymbol=(o==null?void 0:o.symbol)||"",r.networkPrice=n},async getMyTokensWithBalance(e){const t=await Xe.getMyTokensWithBalance(e),o=Z.mapBalancesToSwapTokens(t);o&&(await u.getInitialGasPrice(),u.setBalances(o))},setBalances(e){const{networkAddress:t}=u.getParams(),o=f.state.activeCaipNetwork;if(!o)return;const n=e.find(a=>a.address===t);e.forEach(a=>{r.tokensPriceMap[a.address]=a.price||0}),r.myTokensWithBalance=e.filter(a=>a.address.startsWith(o.caipNetworkId)),r.networkBalanceInUSD=n?b.multiply(n.quantity.numeric,n.price).toString():"0"},async getInitialGasPrice(){var t,o;const e=await Z.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch((o=(t=f.state)==null?void 0:t.activeCaipNetwork)==null?void 0:o.chainNamespace){case z.CHAIN.SOLANA:return r.gasFee=e.standard??"0",r.gasPriceInUSD=b.multiply(e.standard,r.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(r.gasFee),gasPriceInUSD:Number(r.gasPriceInUSD)};case z.CHAIN.EVM:default:const n=e.standard??"0",a=BigInt(n),i=BigInt(We),s=j.getGasPriceInUSD(r.networkPrice,i,a);return r.gasFee=n,r.gasPriceInUSD=s,{gasPrice:a,gasPriceInUSD:s}}},async swapTokens(){var i,s,c;const e=(i=f.getAccountData())==null?void 0:i.address,t=r.sourceToken,o=r.toToken,n=b.bigNumber(r.sourceTokenAmount).gt(0);if(n||u.setToTokenAmount(""),!o||!t||r.loadingPrices||!n||!e)return;r.loadingQuote=!0;const a=b.bigNumber(r.sourceTokenAmount).times(10**t.decimals).round(0);try{const d=await J.fetchSwapQuote({userAddress:e,from:t.address,to:o.address,gasPrice:r.gasFee,amount:a.toString()});r.loadingQuote=!1;const w=(c=(s=d==null?void 0:d.quotes)==null?void 0:s[0])==null?void 0:c.toAmount;if(!w){te.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const g=b.bigNumber(w).div(10**o.decimals).toString();u.setToTokenAmount(g),u.hasInsufficientToken(r.sourceTokenAmount,t.address)?r.inputError="Insufficient balance":(r.inputError=void 0,u.setTransactionDetails())}catch(d){const w=await Z.handleSwapError(d);r.loadingQuote=!1,r.inputError=w||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:e,availableToSwap:t}=u.getParams(),o=r.sourceToken,n=r.toToken;if(!(!e||!t||!o||!n||r.loadingQuote))try{r.loadingBuildTransaction=!0;const a=await Z.fetchSwapAllowance({userAddress:e,tokenAddress:o.address,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:o.decimals});let i;return a?i=await u.createSwapTransaction():i=await u.createAllowanceTransaction(),r.loadingBuildTransaction=!1,r.fetchError=!1,i}catch{p.goBack(),v.showError("Failed to check allowance"),r.loadingBuildTransaction=!1,r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:e,sourceTokenAddress:t,toTokenAddress:o}=u.getParams();if(!(!e||!o)){if(!t)throw new Error("createAllowanceTransaction - No source token address found.");try{const n=await J.generateApproveCalldata({from:t,to:o,userAddress:e}),a=ye.getPlainAddress(n.tx.from);if(!a)throw new Error("SwapController:createAllowanceTransaction - address is required");const i={data:n.tx.data,to:a,gasPrice:BigInt(n.tx.eip155.gasPrice),value:BigInt(n.tx.value),toAmount:r.toTokenAmount};return r.swapTransaction=void 0,r.approvalTransaction={data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount},{data:i.data,to:i.to,gasPrice:i.gasPrice,value:i.value,toAmount:i.toAmount}}catch{p.goBack(),v.showError("Failed to create approval transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}}},async createSwapTransaction(){var s;const{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:o}=u.getParams(),n=r.sourceToken,a=r.toToken;if(!t||!o||!n||!a)return;const i=(s=de.parseUnits(o,n.decimals))==null?void 0:s.toString();try{const c=await J.generateSwapCalldata({userAddress:t,from:n.address,to:a.address,amount:i,disableEstimate:!0}),d=n.address===e,w=BigInt(c.tx.eip155.gas),g=BigInt(c.tx.eip155.gasPrice),P=ye.getPlainAddress(c.tx.to);if(!P)throw new Error("SwapController:createSwapTransaction - address is required");const E={data:c.tx.data,to:P,gas:w,gasPrice:g,value:BigInt(d?i??"0":"0"),toAmount:r.toTokenAmount};return r.gasPriceInUSD=j.getGasPriceInUSD(r.networkPrice,w,g),r.approvalTransaction=void 0,r.swapTransaction=E,E}catch{p.goBack(),v.showError("Failed to create transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){v.showLoading("Approve limit increase in your wallet"),p.replace("SwapPreview")},async sendTransactionForApproval(e){var a,i,s;const{fromAddress:t,isAuthConnector:o}=u.getParams();r.loadingApprovalTransaction=!0;const n="Approve limit increase in your wallet";o?p.pushTransactionStack({onSuccess:u.onEmbeddedWalletApprovalSuccess}):v.showLoading(n);try{await de.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:z.CHAIN.EVM}),await u.swapTokens(),await u.getTransaction(),r.approvalTransaction=void 0,r.loadingApprovalTransaction=!1}catch(c){const d=c;r.transactionError=d==null?void 0:d.displayMessage,r.loadingApprovalTransaction=!1,v.showError((d==null?void 0:d.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(d==null?void 0:d.displayMessage)||(d==null?void 0:d.message)||"Unknown",network:((a=f.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)||"",swapFromToken:((i=u.state.sourceToken)==null?void 0:i.symbol)||"",swapToToken:((s=u.state.toToken)==null?void 0:s.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){var s,c,d,w,g,P,E,F,L,H,Q,Ee;if(!e)return;const{fromAddress:t,toTokenAmount:o,isAuthConnector:n}=u.getParams();r.loadingTransaction=!0;const a=`Swapping ${(s=r.sourceToken)==null?void 0:s.symbol} to ${b.formatNumberToLocalString(o,3)} ${(c=r.toToken)==null?void 0:c.symbol}`,i=`Swapped ${(d=r.sourceToken)==null?void 0:d.symbol} to ${b.formatNumberToLocalString(o,3)} ${(w=r.toToken)==null?void 0:w.symbol}`;n?p.pushTransactionStack({onSuccess(){p.replace("Account"),v.showLoading(a),we.resetState()}}):v.showLoading("Confirm transaction in your wallet");try{const ve=[(g=r.sourceToken)==null?void 0:g.address,(P=r.toToken)==null?void 0:P.address].join(","),$=await de.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:z.CHAIN.EVM});return r.loadingTransaction=!1,v.showSuccess(i),M.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((E=f.state.activeCaipNetwork)==null?void 0:E.caipNetworkId)||"",swapFromToken:((F=u.state.sourceToken)==null?void 0:F.symbol)||"",swapToToken:((L=u.state.toToken)==null?void 0:L.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}}),we.resetState(),n||p.replace("Account"),we.getMyTokensWithBalance(ve),$}catch(ve){const $=ve;r.transactionError=$==null?void 0:$.displayMessage,r.loadingTransaction=!1,v.showError(($==null?void 0:$.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:($==null?void 0:$.displayMessage)||($==null?void 0:$.message)||"Unknown",network:((H=f.state.activeCaipNetwork)==null?void 0:H.caipNetworkId)||"",swapFromToken:((Q=u.state.sourceToken)==null?void 0:Q.symbol)||"",swapToToken:((Ee=u.state.toToken)==null?void 0:Ee.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(e,t){return j.isInsufficientSourceTokenForSwap(e,t,r.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:e,toTokenDecimals:t}=u.getParams();!e||!t||(r.gasPriceInUSD=j.getGasPriceInUSD(r.networkPrice,BigInt(r.gasFee),BigInt(We)),r.priceImpact=j.getPriceImpact({sourceTokenAmount:r.sourceTokenAmount,sourceTokenPriceInUSD:r.sourceTokenPriceInUSD,toTokenPriceInUSD:r.toTokenPriceInUSD,toTokenAmount:r.toTokenAmount}),r.maxSlippage=j.getMaxSlippage(r.slippage,r.toTokenAmount),r.providerFee=j.getProviderFee(r.sourceTokenAmount))}},u=Be(we),W=_e({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),et={state:W,subscribe(e){return Ue(W,()=>e(W))},subscribeKey(e,t){return ze(W,e,t)},showTooltip({message:e,triggerRect:t,variant:o}){W.open=!0,W.message=e,W.triggerRect=t,W.variant=o},hide(){W.open=!1,W.message="",W.triggerRect={width:0,height:0,top:0,left:0}}},ee=Be(et),Me={isUnsupportedChainView(){return p.state.view==="UnsupportedChain"||p.state.view==="SwitchNetwork"&&p.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){R.shake();return}if(await Fe.isSIWXCloseDisabled()){R.shake();return}(p.state.view==="DataCapture"||p.state.view==="DataCaptureOtpConfirm")&&de.disconnect(),R.close()}},tt=A`
2
2
  :host {
3
3
  display: block;
4
4
  border-radius: clamp(0px, ${({borderRadius:e})=>e[8]}, 44px);
package/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/governance-site/1.15.1-20105651460.commit-7620061/favicon.ico" />
5
+ <link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/governance-site/2.0.0/favicon.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <link
8
8
  href="https://fonts.googleapis.com/css?family=Inconsolata&display=swap"
@@ -14,7 +14,7 @@
14
14
  title="Sitemap"
15
15
  href="/sitemap.xml"
16
16
  />
17
- <link rel="manifest" href="https://cdn.decentraland.org/@dcl/governance-site/1.15.1-20105651460.commit-7620061/manifest.json" />
17
+ <link rel="manifest" href="https://cdn.decentraland.org/@dcl/governance-site/2.0.0/manifest.json" />
18
18
  <meta name="theme-color" content="#000000" />
19
19
  <title>Decentraland DAO</title>
20
20
  <meta name="description" content="The governance hub for Decentraland. Create and vote on proposals that help shape the future of the metaverse." />
@@ -25,8 +25,8 @@
25
25
  <meta property="twitter:description" content="The governance hub for Decentraland. Create and vote on proposals that help shape the future of the metaverse." >
26
26
  <meta property="twitter:image" content="https://decentraland.org/images/decentraland.png" >
27
27
  <meta property="twitter:card" content="summary" >
28
- <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/governance-site/1.15.1-20105651460.commit-7620061/assets/index-6c5c6262.js"></script>
29
- <link rel="stylesheet" href="https://cdn.decentraland.org/@dcl/governance-site/1.15.1-20105651460.commit-7620061/assets/index-3632219d.css">
28
+ <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/governance-site/2.0.0/assets/index-2ef9f1d1.js"></script>
29
+ <link rel="stylesheet" href="https://cdn.decentraland.org/@dcl/governance-site/2.0.0/assets/index-a8255d1c.css">
30
30
  </head>
31
31
  <body>
32
32
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/governance-site",
3
- "version": "1.15.1-20105651460.commit-7620061",
3
+ "version": "2.0.0",
4
4
  "description": "Governance website",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,6 @@
17
17
  "type": "git",
18
18
  "url": "https://github.com/decentraland/governance-ui.git"
19
19
  },
20
- "homepage": "https://cdn.decentraland.org/@dcl/governance-site/1.15.1-20105651460.commit-7620061",
21
- "commit": "76200615e306d010531afa14d66a44bbbccd15a8"
20
+ "homepage": "https://cdn.decentraland.org/@dcl/governance-site/2.0.0",
21
+ "commit": "ad8dc42a6f9b4eae3e8571449097a08800dade1b"
22
22
  }
@@ -1 +0,0 @@
1
- import{c as l,g as na,f as oa,p as U,r as v,d as ia,a as sa,u as la,b as p,j as S}from"./index-6c5c6262.js";function ua(r){return{all:r=r||new Map,on:function(t,a){var e=r.get(t);e?e.push(a):r.set(t,[a])},off:function(t,a){var e=r.get(t);e&&(a?e.splice(e.indexOf(a)>>>0,1):r.set(t,[]))},emit:function(t,a){var e=r.get(t);e&&e.slice().map(function(n){n(a)}),(e=r.get("*"))&&e.slice().map(function(n){n(t,a)})}}}const ca=Object.freeze(Object.defineProperty({__proto__:null,default:ua},Symbol.toStringTag,{value:"Module"}));var O={},h={},fa=l&&l.__spreadArray||function(r,t,a){if(a||arguments.length===2)for(var e=0,n=t.length,i;e<n;e++)(i||!(e in t))&&(i||(i=Array.prototype.slice.call(t,0,e)),i[e]=t[e]);return r.concat(i||Array.prototype.slice.call(t))};Object.defineProperty(h,"__esModule",{value:!0});h.createDebounce=void 0;function da(){var r=null;return function(t,a){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];r&&clearTimeout(r),r=setTimeout.apply(void 0,fa([t,a],e,!1))}}h.createDebounce=da;var w={};const pa=na(ca);var R=l&&l.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(w,"__esModule",{value:!0});w.createController=void 0;var ma=R(pa),va=R(oa),g=U,j=new Map,_=new Map;window.onmessage=function(t){if(t.data&&t.data.type)switch(t.data.type){case g.PreviewMessageType.CONTROLLER_RESPONSE:{var a=t.data.payload,e=a.id,n=j.get(e);n&&(a.ok?n.resolve(a.result):a.ok===!1&&n.reject(new Error(a.error)));break}case g.PreviewMessageType.EMOTE_EVENT:{var a=t.data.payload,i=a.type,s=a.payload,u=_.get(t.source);u&&i&&u.emit(i,s);break}}};var A=0;function ba(r){return function(a,e,n){var i=document.getElementById(r),s=r+"-"+A,u=(0,va.default)();j.set(s,u);var f=g.PreviewMessageType.CONTROLLER_REQUEST,d={id:s,namespace:a,method:e,params:n};return(0,g.sendMessage)(i.contentWindow,f,d),A++,u}}function Pa(r){var t,a=document.getElementById(r);if(!a)throw new Error('Could not find an iframe with id="'.concat(r,'"'));var e=(t=_.get(a.contentWindow))!==null&&t!==void 0?t:(0,ma.default)();_.set(a.contentWindow,e);var n=ba(r);return{scene:{getScreenshot:function(i,s){return n("scene","getScreenshot",[i,s])},getMetrics:function(){return n("scene","getMetrics",[])},changeZoom:function(i){return n("scene","changeZoom",[i])},panCamera:function(i){return n("scene","panCamera",[i])},changeCameraPosition:function(i){return n("scene","changeCameraPosition",[i])},setUsername:function(i){return n("scene","setUsername",[i])},cleanup:function(){return n("scene","cleanup",[])}},emote:{getLength:function(){return n("emote","getLength",[])},isPlaying:function(){return n("emote","isPlaying",[])},goTo:function(i){return n("emote","goTo",[i])},play:function(){return n("emote","play",[])},pause:function(){return n("emote","pause",[])},stop:function(){return n("emote","stop",[])},enableSound:function(){return n("emote","enableSound",[])},disableSound:function(){return n("emote","disableSound",[])},hasSound:function(){return n("emote","hasSound",[])},events:e}}}w.createController=Pa;var ga=l&&l.__extends||function(){var r=function(t,a){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},r(t,a)};return function(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");r(t,a);function e(){this.constructor=t}t.prototype=a===null?Object.create(a):(e.prototype=a.prototype,new e)}}(),ha=l&&l.__createBinding||(Object.create?function(r,t,a,e){e===void 0&&(e=a);var n=Object.getOwnPropertyDescriptor(t,a);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[a]}}),Object.defineProperty(r,e,n)}:function(r,t,a,e){e===void 0&&(e=a),r[e]=t[a]}),wa=l&&l.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),ya=l&&l.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var a in r)a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)&&ha(t,r,a);return wa(t,r),t},_a=l&&l.__rest||function(r,t){var a={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&t.indexOf(e)<0&&(a[e]=r[e]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(r);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(r,e[n])&&(a[e[n]]=r[e[n]]);return a},Ea=l&&l.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(O,"__esModule",{value:!0});var E=O.WearablePreview=void 0,M=ya(v),Oa=Ea(ia),m=U,Sa=h,Aa=w,Ma=sa,Ua=(0,Sa.createDebounce)(),o=function(r,t){return t==null||t===""?"":Array.isArray(t)?t.length>0?t.map(function(a){return"".concat(r,"=").concat(encodeURIComponent(String(a)))}).join("&"):"":"".concat(r,"=").concat(encodeURIComponent(String(t)))},Ra=function(r){ga(t,r);function t(){var a=r!==null&&r.apply(this,arguments)||this;return a.state={isReady:!1,pendingOptions:null,lastOptions:null},a.iframe=null,a.getUrl=function(){var e=a.props,n=e.contractAddress,i=e.tokenId,s=e.itemId,u=e.profile,f=e.urns,d=e.urls,c=e.base64s,b=e.skin,y=e.hair,P=e.eyes,C=e.bodyShape,D=e.emote,k=e.camera,T=e.projection,B=e.zoom,W=e.background,I=e.offsetX,L=e.offsetY,F=e.offsetZ,Z=e.cameraX,x=e.cameraY,Y=e.cameraZ,N=e.wheelZoom,X=e.wheelPrecision,$=e.wheelStart,q=e.disableBackground,z=e.disableAutoRotate,V=e.disableAutoCenter,G=e.disableFace,H=e.disableDefaultWearables,Q=e.disableDefaultEmotes,J=e.disableFadeEffect,K=e.showSceneBoundaries,ee=e.showThumbnailBoundaries,ae=e.panning,re=e.lockAlpha,te=e.lockBeta,ne=e.lockRadius,oe=e.dev,ie=e.baseUrl,se=e.peerUrl,le=e.nftServerUrl,ue=e.type,ce=e.unity,fe=e.unityMode,de=o("contract",n),pe=o("token",i),me=o("item",s),ve=o("profile",u),be=o("urn",f),Pe=o("url",d),ge=o("base64",c),he=o("skin",b),we=o("hair",y),ye=o("eyes",P),_e=o("bodyShape",C),Ee=o("emote",D),Oe=o("camera",k),Se=o("projection",T),Ae=o("zoom",B),Me=o("background",W),Ue=o("offsetX",I),Re=o("offsetY",L),je=o("offsetZ",F),Ce=o("cameraX",Z),De=o("cameraY",x),ke=o("cameraZ",Y),Te=o("wheelZoom",N),Be=o("wheelPrecision",X),We=o("wheelStart",$),Ie=o("disableBackground",q),Le=o("disableAutoRotate",z),Fe=o("disableAutoCenter",V),Ze=o("disableFace",G),xe=o("disableDefaultWearables",H),Ye=o("disableDefaultEmotes",Q),Ne=o("disableFadeEffect",J),Xe=o("showSceneBoundaries",K),$e=o("showThumbnailBoundaries",ee),qe=o("peerUrl",se),ze=o("nftServerUrl",le),Ve=o("type",ue),Ge=o("panning",ae),He=o("lockAlpha",re),Qe=o("lockBeta",te),Je=o("lockRadius",ne),Ke=o("env",oe?"dev":void 0),ea=o("unity",ce),aa=o("mode",fe),ra=ie+"?"+[de,pe,me,ve,be,Pe,ge,he,we,ye,_e,Ee,Oe,Se,Ae,Me,Ue,Re,je,Ce,De,ke,Te,Be,We,Ie,Le,Fe,Ze,xe,Ye,Ne,Xe,$e,qe,ze,Ve,Ge,He,Qe,Je,Ke,ea,aa].filter(function(ta){return!!ta}).join("&");return ra},a.getOptions=function(){var e=a.props;e.dev;var n=_a(e,["dev"]),i={};for(var s in n)typeof n[s]!="function"&&(i[s]=n[s]);return i},a.handleMessage=function(e){var n=a.props,i=n.baseUrl,s=n.onLoad,u=n.onError,f=e.origin;if(f===i&&e.data&&e.data.type){var d=e.data.type;switch(d){case m.PreviewMessageType.LOAD:{var c=e.data.payload;s(c==null?void 0:c.renderer);break}case m.PreviewMessageType.ERROR:{var c=e.data.payload;u(new Error(c.message));break}case m.PreviewMessageType.READY:{var b=a.state,y=b.isReady,P=b.pendingOptions;if(y)return;P!==null?(a.sendUpdate(P),a.setState({isReady:!0,pendingOptions:null})):a.setState({isReady:!0});break}}}},a.handleUpdate=function(){if(a.iframe){if(window){var e=a.getOptions();a.state.isReady?a.sendUpdate(e):a.setState({pendingPreviewOptions:e})}}else console.warn("Could not send update, iframe is not referenced")},a.sendUpdate=function(e){var n=a.state.lastOptions;if(!n||!(0,Oa.default)(e,n)){(0,m.sendMessage)(a.iframe.contentWindow,m.PreviewMessageType.UPDATE,{options:e});var i=a.props.onUpdate;i(e),a.setState({lastOptions:e})}},a.refIframe=function(e){a.iframe=e},a}return t.createController=function(a){return(0,Aa.createController)(a)},t.prototype.componentDidMount=function(){window.addEventListener("message",this.handleMessage,!1),this.setState({url:this.getUrl()}),this.props.blob&&this.handleUpdate()},t.prototype.componentWillUnmount=function(){window.removeEventListener("message",this.handleMessage,!1)},t.prototype.componentDidUpdate=function(){Ua(this.handleUpdate,500)},t.prototype.render=function(){return this.props.tokenId&&this.props.itemId&&console.warn("You should NOT use `tokenId` and `itemId` props simultaneously"),M.createElement("iframe",{id:this.props.id,className:"WearablePreview",src:this.state.url,width:"100%",height:"100%",frameBorder:"0",ref:this.refIframe,allow:"autoplay"})},t.defaultProps={dev:!1,baseUrl:Ma.config.get("WEARABLE_PREVIEW_URL"),unity:!1,onLoad:function(){},onError:function(){},onUpdate:function(){}},t}(M.PureComponent);E=O.WearablePreview=Ra;function Ca({address:r}){const[t,a]=v.useState(),{profile:e}=la(r),n=v.useCallback(()=>{a(E.createController("wearable-preview"))},[]),i=v.useMemo(()=>{const s=[p.PreviewEmote.DAB,p.PreviewEmote.FIST_PUMP,p.PreviewEmote.DANCE,p.PreviewEmote.HEAD_EXPLODE];return s[Math.random()*s.length|0]},[]);return v.useEffect(()=>{const s=setInterval(()=>{t&&t.emote.play()},2e4);return()=>clearInterval(s)},[t]),!r||!e.hasCustomAvatar?null:S.jsx("div",{className:"UserAvatar__Container",children:S.jsx(E,{id:"wearable-preview",profile:r,onLoad:n,background:"FFFFFF",emote:i,disableAutoRotate:!0,camera:p.PreviewCamera.STATIC})})}export{Ca as default};