flagmint-js-sdk 1.2.2 → 1.2.3

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.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(h){const n=Rn,s=g0,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.Buffer=y,h.SlowBuffer=$,h.INSPECT_MAX_BYTES=50;const m=2147483647;h.kMaxLength=m,y.TYPED_ARRAY_SUPPORT=f(),!y.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const E=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(E,w),E.foo()===42}catch(E){return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function g(E){if(E>m)throw new RangeError('The value "'+E+'" is invalid for option "size"');const w=new Uint8Array(E);return Object.setPrototypeOf(w,y.prototype),w}function y(E,w,A){if(typeof E=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(E)}return S(E,w,A)}y.poolSize=8192;function S(E,w,A){if(typeof E=="string")return I(E,w);if(ArrayBuffer.isView(E))return D(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(dt(E,ArrayBuffer)||E&&dt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(dt(E,SharedArrayBuffer)||E&&dt(E.buffer,SharedArrayBuffer)))return L(E,w,A);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=E.valueOf&&E.valueOf();if(T!=null&&T!==E)return y.from(T,w,A);const F=W(E);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return y.from(E[Symbol.toPrimitive]("string"),w,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}y.from=function(E,w,A){return S(E,w,A)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function B(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function M(E,w,A){return B(E),E<=0?g(E):w!==void 0?typeof A=="string"?g(E).fill(w,A):g(E).fill(w):g(E)}y.alloc=function(E,w,A){return M(E,w,A)};function x(E){return B(E),g(E<0?0:z(E)|0)}y.allocUnsafe=function(E){return x(E)},y.allocUnsafeSlow=function(E){return x(E)};function I(E,w){if((typeof w!="string"||w==="")&&(w="utf8"),!y.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const A=lt(E,w)|0;let T=g(A);const F=T.write(E,w);return F!==A&&(T=T.slice(0,F)),T}function k(E){const w=E.length<0?0:z(E.length)|0,A=g(w);for(let T=0;T<w;T+=1)A[T]=E[T]&255;return A}function D(E){if(dt(E,Uint8Array)){const w=new Uint8Array(E);return L(w.buffer,w.byteOffset,w.byteLength)}return k(E)}function L(E,w,A){if(w<0||E.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<w+(A||0))throw new RangeError('"length" is outside of buffer bounds');let T;return w===void 0&&A===void 0?T=new Uint8Array(E):A===void 0?T=new Uint8Array(E,w):T=new Uint8Array(E,w,A),Object.setPrototypeOf(T,y.prototype),T}function W(E){if(y.isBuffer(E)){const w=z(E.length)|0,A=g(w);return A.length===0||E.copy(A,0,0,w),A}if(E.length!==void 0)return typeof E.length!="number"||qt(E.length)?g(0):k(E);if(E.type==="Buffer"&&Array.isArray(E.data))return k(E.data)}function z(E){if(E>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return E|0}function $(E){return+E!=E&&(E=0),y.alloc(+E)}y.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==y.prototype},y.compare=function(w,A){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),dt(A,Uint8Array)&&(A=y.from(A,A.offset,A.byteLength)),!y.isBuffer(w)||!y.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===A)return 0;let T=w.length,F=A.length;for(let V=0,U=Math.min(T,F);V<U;++V)if(w[V]!==A[V]){T=w[V],F=A[V];break}return T<F?-1:F<T?1:0},y.isEncoding=function(w){switch(String(w).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}},y.concat=function(w,A){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return y.alloc(0);let T;if(A===void 0)for(A=0,T=0;T<w.length;++T)A+=w[T].length;const F=y.allocUnsafe(A);let V=0;for(T=0;T<w.length;++T){let U=w[T];if(dt(U,Uint8Array))V+U.length>F.length?(y.isBuffer(U)||(U=y.from(U)),U.copy(F,V)):Uint8Array.prototype.set.call(F,U,V);else if(y.isBuffer(U))U.copy(F,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=U.length}return F};function lt(E,w){if(y.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||dt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const A=E.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&A===0)return 0;let F=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Dt(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Pt(E).length;default:if(F)return T?-1:Dt(E).length;w=(""+w).toLowerCase(),F=!0}}y.byteLength=lt;function H(E,w,A){let T=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,w>>>=0,A<=w))return"";for(E||(E="utf8");;)switch(E){case"hex":return u(this,w,A);case"utf8":case"utf-8":return i(this,w,A);case"ascii":return c(this,w,A);case"latin1":case"binary":return v(this,w,A);case"base64":return r(this,w,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e(this,w,A);default:if(T)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),T=!0}}y.prototype._isBuffer=!0;function At(E,w,A){const T=E[w];E[w]=E[A],E[A]=T}y.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<w;A+=2)At(this,A,A+1);return this},y.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<w;A+=4)At(this,A,A+3),At(this,A+1,A+2);return this},y.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<w;A+=8)At(this,A,A+7),At(this,A+1,A+6),At(this,A+2,A+5),At(this,A+3,A+4);return this},y.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?i(this,0,w):H.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(w){if(!y.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:y.compare(this,w)===0},y.prototype.inspect=function(){let w="";const A=h.INSPECT_MAX_BYTES;return w=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(w+=" ... "),"<Buffer "+w+">"},o&&(y.prototype[o]=y.prototype.inspect),y.prototype.compare=function(w,A,T,F,V){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),!y.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(A===void 0&&(A=0),T===void 0&&(T=w?w.length:0),F===void 0&&(F=0),V===void 0&&(V=this.length),A<0||T>w.length||F<0||V>this.length)throw new RangeError("out of range index");if(F>=V&&A>=T)return 0;if(F>=V)return-1;if(A>=T)return 1;if(A>>>=0,T>>>=0,F>>>=0,V>>>=0,this===w)return 0;let U=V-F,X=T-A;const Tt=Math.min(U,X),G=this.slice(F,V),rt=w.slice(A,T);for(let Rt=0;Rt<Tt;++Rt)if(G[Rt]!==rt[Rt]){U=G[Rt],X=rt[Rt];break}return U<X?-1:X<U?1:0};function Bt(E,w,A,T,F){if(E.length===0)return-1;if(typeof A=="string"?(T=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,qt(A)&&(A=F?0:E.length-1),A<0&&(A=E.length+A),A>=E.length){if(F)return-1;A=E.length-1}else if(A<0)if(F)A=0;else return-1;if(typeof w=="string"&&(w=y.from(w,T)),y.isBuffer(w))return w.length===0?-1:Ct(E,w,A,T,F);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(E,w,A):Uint8Array.prototype.lastIndexOf.call(E,w,A):Ct(E,[w],A,T,F);throw new TypeError("val must be string, number or Buffer")}function Ct(E,w,A,T,F){let V=1,U=E.length,X=w.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(E.length<2||w.length<2)return-1;V=2,U/=2,X/=2,A/=2}function Tt(rt,Rt){return V===1?rt[Rt]:rt.readUInt16BE(Rt*V)}let G;if(F){let rt=-1;for(G=A;G<U;G++)if(Tt(E,G)===Tt(w,rt===-1?0:G-rt)){if(rt===-1&&(rt=G),G-rt+1===X)return rt*V}else rt!==-1&&(G-=G-rt),rt=-1}else for(A+X>U&&(A=U-X),G=A;G>=0;G--){let rt=!0;for(let Rt=0;Rt<X;Rt++)if(Tt(E,G+Rt)!==Tt(w,Rt)){rt=!1;break}if(rt)return G}return-1}y.prototype.includes=function(w,A,T){return this.indexOf(w,A,T)!==-1},y.prototype.indexOf=function(w,A,T){return Bt(this,w,A,T,!0)},y.prototype.lastIndexOf=function(w,A,T){return Bt(this,w,A,T,!1)};function Et(E,w,A,T){A=Number(A)||0;const F=E.length-A;T?(T=Number(T),T>F&&(T=F)):T=F;const V=w.length;T>V/2&&(T=V/2);let U;for(U=0;U<T;++U){const X=parseInt(w.substr(U*2,2),16);if(qt(X))return U;E[A+U]=X}return U}function Y(E,w,A,T){return j(Dt(w,E.length-A),E,A,T)}function It(E,w,A,T){return j(et(w),E,A,T)}function p(E,w,A,T){return j(Pt(w),E,A,T)}function t(E,w,A,T){return j(pt(w,E.length-A),E,A,T)}y.prototype.write=function(w,A,T,F){if(A===void 0)F="utf8",T=this.length,A=0;else if(T===void 0&&typeof A=="string")F=A,T=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(T)?(T=T>>>0,F===void 0&&(F="utf8")):(F=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-A;if((T===void 0||T>V)&&(T=V),w.length>0&&(T<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let U=!1;for(;;)switch(F){case"hex":return Et(this,w,A,T);case"utf8":case"utf-8":return Y(this,w,A,T);case"ascii":case"latin1":case"binary":return It(this,w,A,T);case"base64":return p(this,w,A,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t(this,w,A,T);default:if(U)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),U=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function r(E,w,A){return w===0&&A===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(w,A))}function i(E,w,A){A=Math.min(E.length,A);const T=[];let F=w;for(;F<A;){const V=E[F];let U=null,X=V>239?4:V>223?3:V>191?2:1;if(F+X<=A){let Tt,G,rt,Rt;switch(X){case 1:V<128&&(U=V);break;case 2:Tt=E[F+1],(Tt&192)===128&&(Rt=(V&31)<<6|Tt&63,Rt>127&&(U=Rt));break;case 3:Tt=E[F+1],G=E[F+2],(Tt&192)===128&&(G&192)===128&&(Rt=(V&15)<<12|(Tt&63)<<6|G&63,Rt>2047&&(Rt<55296||Rt>57343)&&(U=Rt));break;case 4:Tt=E[F+1],G=E[F+2],rt=E[F+3],(Tt&192)===128&&(G&192)===128&&(rt&192)===128&&(Rt=(V&15)<<18|(Tt&63)<<12|(G&63)<<6|rt&63,Rt>65535&&Rt<1114112&&(U=Rt))}}U===null?(U=65533,X=1):U>65535&&(U-=65536,T.push(U>>>10&1023|55296),U=56320|U&1023),T.push(U),F+=X}return d(T)}const a=4096;function d(E){const w=E.length;if(w<=a)return String.fromCharCode.apply(String,E);let A="",T=0;for(;T<w;)A+=String.fromCharCode.apply(String,E.slice(T,T+=a));return A}function c(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]&127);return T}function v(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]);return T}function u(E,w,A){const T=E.length;(!w||w<0)&&(w=0),(!A||A<0||A>T)&&(A=T);let F="";for(let V=w;V<A;++V)F+=Q[E[V]];return F}function e(E,w,A){const T=E.slice(w,A);let F="";for(let V=0;V<T.length-1;V+=2)F+=String.fromCharCode(T[V]+T[V+1]*256);return F}y.prototype.slice=function(w,A){const T=this.length;w=~~w,A=A===void 0?T:~~A,w<0?(w+=T,w<0&&(w=0)):w>T&&(w=T),A<0?(A+=T,A<0&&(A=0)):A>T&&(A=T),A<w&&(A=w);const F=this.subarray(w,A);return Object.setPrototypeOf(F,y.prototype),F};function l(E,w,A){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+w>A)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return F},y.prototype.readUintBE=y.prototype.readUIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w+--A],V=1;for(;A>0&&(V*=256);)F+=this[w+--A]*V;return F},y.prototype.readUint8=y.prototype.readUInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]|this[w+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]<<8|this[w+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},y.prototype.readBigUInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24),V=this[++w]+this[++w]*pe(2,8)+this[++w]*pe(2,16)+T*pe(2,24);return BigInt(F)+(BigInt(V)<<BigInt(32))}),y.prototype.readBigUInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w],V=this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T;return(BigInt(F)<<BigInt(32))+BigInt(V)}),y.prototype.readIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return V*=128,F>=V&&(F-=Math.pow(2,8*A)),F},y.prototype.readIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=A,V=1,U=this[w+--F];for(;F>0&&(V*=256);)U+=this[w+--F]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*A)),U},y.prototype.readInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},y.prototype.readInt16LE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w]|this[w+1]<<8;return T&32768?T|4294901760:T},y.prototype.readInt16BE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w+1]|this[w]<<8;return T&32768?T|4294901760:T},y.prototype.readInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},y.prototype.readInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},y.prototype.readBigInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=this[w+4]+this[w+5]*pe(2,8)+this[w+6]*pe(2,16)+(T<<24);return(BigInt(F)<<BigInt(32))+BigInt(A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24))}),y.prototype.readBigInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=(A<<24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w];return(BigInt(F)<<BigInt(32))+BigInt(this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T)}),y.prototype.readFloatLE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!0,23,4)},y.prototype.readFloatBE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!1,23,4)},y.prototype.readDoubleLE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!0,52,8)},y.prototype.readDoubleBE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!1,52,8)};function b(E,w,A,T,F,V){if(!y.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>F||w<V)throw new RangeError('"value" argument is out of bounds');if(A+T>E.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=1,U=0;for(this[A]=w&255;++U<T&&(V*=256);)this[A+U]=w/V&255;return A+T},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=T-1,U=1;for(this[A+V]=w&255;--V>=0&&(U*=256);)this[A+V]=w/U&255;return A+T},y.prototype.writeUint8=y.prototype.writeUInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,255,0),this[A]=w&255,A+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A+3]=w>>>24,this[A+2]=w>>>16,this[A+1]=w>>>8,this[A]=w&255,A+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4};function _(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,A}function C(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A+7]=V,V=V>>8,E[A+6]=V,V=V>>8,E[A+5]=V,V=V>>8,E[A+4]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A+3]=U,U=U>>8,E[A+2]=U,U=U>>8,E[A+1]=U,U=U>>8,E[A]=U,A+8}y.prototype.writeBigUInt64LE=ct(function(w,A=0){return _(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=ct(function(w,A=0){return C(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=0,U=1,X=0;for(this[A]=w&255;++V<T&&(U*=256);)w<0&&X===0&&this[A+V-1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=T-1,U=1,X=0;for(this[A+V]=w&255;--V>=0&&(U*=256);)w<0&&X===0&&this[A+V+1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,127,-128),w<0&&(w=255+w+1),this[A]=w&255,A+1},y.prototype.writeInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),this[A]=w&255,this[A+1]=w>>>8,this[A+2]=w>>>16,this[A+3]=w>>>24,A+4},y.prototype.writeInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4},y.prototype.writeBigInt64LE=ct(function(w,A=0){return _(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=ct(function(w,A=0){return C(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function q(E,w,A,T,F,V){if(A+T>E.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function O(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,4),s.write(E,w,A,T,23,4),A+4}y.prototype.writeFloatLE=function(w,A,T){return O(this,w,A,!0,T)},y.prototype.writeFloatBE=function(w,A,T){return O(this,w,A,!1,T)};function R(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,8),s.write(E,w,A,T,52,8),A+8}y.prototype.writeDoubleLE=function(w,A,T){return R(this,w,A,!0,T)},y.prototype.writeDoubleBE=function(w,A,T){return R(this,w,A,!1,T)},y.prototype.copy=function(w,A,T,F){if(!y.isBuffer(w))throw new TypeError("argument should be a Buffer");if(T||(T=0),!F&&F!==0&&(F=this.length),A>=w.length&&(A=w.length),A||(A=0),F>0&&F<T&&(F=T),F===T||w.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=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),w.length-A<F-T&&(F=w.length-A+T);const V=F-T;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(A,T,F):Uint8Array.prototype.set.call(w,this.subarray(T,F),A),V},y.prototype.fill=function(w,A,T,F){if(typeof w=="string"){if(typeof A=="string"?(F=A,A=0,T=this.length):typeof T=="string"&&(F=T,T=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!y.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(w.length===1){const U=w.charCodeAt(0);(F==="utf8"&&U<128||F==="latin1")&&(w=U)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(A<0||this.length<A||this.length<T)throw new RangeError("Out of range index");if(T<=A)return this;A=A>>>0,T=T===void 0?this.length:T>>>0,w||(w=0);let V;if(typeof w=="number")for(V=A;V<T;++V)this[V]=w;else{const U=y.isBuffer(w)?w:y.from(w,F),X=U.length;if(X===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(V=0;V<T-A;++V)this[V+A]=U[V%X]}return this};const P={};function N(E,w,A){P[E]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(E,w){return`The "${E}" argument must be of type number. Received type ${typeof w}`},TypeError),N("ERR_OUT_OF_RANGE",function(E,w,A){let T=`The value of "${E}" is out of range.`,F=A;return Number.isInteger(A)&&Math.abs(A)>pe(2,32)?F=K(String(A)):typeof A=="bigint"&&(F=String(A),(A>pe(BigInt(2),BigInt(32))||A<-pe(BigInt(2),BigInt(32)))&&(F=K(F)),F+="n"),T+=` It must be ${w}. Received ${F}`,T},RangeError);function K(E){let w="",A=E.length;const T=E[0]==="-"?1:0;for(;A>=T+4;A-=3)w=`_${E.slice(A-3,A)}${w}`;return`${E.slice(0,A)}${w}`}function kt(E,w,A){J(w,"offset"),(E[w]===void 0||E[w+A]===void 0)&&Ft(w,E.length-(A+1))}function Z(E,w,A,T,F,V){if(E>A||E<w){const U=typeof w=="bigint"?"n":"";let X;throw V>3?w===0||w===BigInt(0)?X=`>= 0${U} and < 2${U} ** ${(V+1)*8}${U}`:X=`>= -(2${U} ** ${(V+1)*8-1}${U}) and < 2 ** ${(V+1)*8-1}${U}`:X=`>= ${w}${U} and <= ${A}${U}`,new P.ERR_OUT_OF_RANGE("value",X,E)}kt(T,F,V)}function J(E,w){if(typeof E!="number")throw new P.ERR_INVALID_ARG_TYPE(w,"number",E)}function Ft(E,w,A){throw Math.floor(E)!==E?(J(E,A),new P.ERR_OUT_OF_RANGE(A||"offset","an integer",E)):w<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${w}`,E)}const tt=/[^+/0-9A-Za-z-_]/g;function vt(E){if(E=E.split("=")[0],E=E.trim().replace(tt,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Dt(E,w){w=w||1/0;let A;const T=E.length;let F=null;const V=[];for(let U=0;U<T;++U){if(A=E.charCodeAt(U),A>55295&&A<57344){if(!F){if(A>56319){(w-=3)>-1&&V.push(239,191,189);continue}else if(U+1===T){(w-=3)>-1&&V.push(239,191,189);continue}F=A;continue}if(A<56320){(w-=3)>-1&&V.push(239,191,189),F=A;continue}A=(F-55296<<10|A-56320)+65536}else F&&(w-=3)>-1&&V.push(239,191,189);if(F=null,A<128){if((w-=1)<0)break;V.push(A)}else if(A<2048){if((w-=2)<0)break;V.push(A>>6|192,A&63|128)}else if(A<65536){if((w-=3)<0)break;V.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((w-=4)<0)break;V.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return V}function et(E){const w=[];for(let A=0;A<E.length;++A)w.push(E.charCodeAt(A)&255);return w}function pt(E,w){let A,T,F;const V=[];for(let U=0;U<E.length&&!((w-=2)<0);++U)A=E.charCodeAt(U),T=A>>8,F=A%256,V.push(F),V.push(T);return V}function Pt(E){return n.toByteArray(vt(E))}function j(E,w,A,T){let F;for(F=0;F<T&&!(F+A>=w.length||F>=E.length);++F)w[F+A]=E[F];return F}function dt(E,w){return E instanceof w||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===w.name}function qt(E){return E!==E}const Q=function(){const E="0123456789abcdef",w=new Array(256);for(let A=0;A<16;++A){const T=A*16;for(let F=0;F<16;++F)w[T+F]=E[A]+E[F]}return w}();function ct(E){return typeof BigInt=="undefined"?Lt:E}function Lt(){throw new Error("BigInt not supported")}})(gr);class xh{constructor(n,s,o,m={}){this.endpoint=n,this.apiKey=s,this.isStopped=!1,this.pollTimeoutId=null,this.currentFlags={},this.consecutiveErrors=0,this.currentBackoffMs=0,this.pollIntervalMs=m.pollIntervalMs||1e4,this.maxBackoffMs=m.maxBackoffMs||6e4,this.backoffMultiplier=m.backoffMultiplier||2,this.currentContext=o}init(){return ke(this,null,function*(){try{this.currentFlags=yield this.fetchFlags(this.currentContext),this.consecutiveErrors=0,console.log("[LongPollingTransport] Initial fetch complete")}catch(n){console.error("[LongPollingTransport] Initial fetch failed:",n)}this.scheduleNextPoll()})}scheduleNextPoll(){if(this.isStopped)return;const n=this.pollIntervalMs+this.currentBackoffMs;console.log(`[LongPollingTransport] Next poll in ${n}ms`+(this.currentBackoffMs>0?` (backoff: ${this.currentBackoffMs}ms)`:"")),this.pollTimeoutId=setTimeout(()=>ke(this,null,function*(){yield this.poll(),this.scheduleNextPoll()}),n)}poll(){return ke(this,null,function*(){var n;try{const s=yield this.fetchFlags(this.currentContext);this.consecutiveErrors>0&&(console.log("[LongPollingTransport] ✅ Recovered from errors"),this.consecutiveErrors=0,this.currentBackoffMs=0),this.flagsChanged(s)&&(console.log("[LongPollingTransport] Flags changed, notifying..."),this.currentFlags=s,(n=this.onUpdateCallback)==null||n.call(this,s))}catch(s){console.error("[LongPollingTransport] ❌ Poll error:",s),this.consecutiveErrors++,this.applyBackoff()}})}applyBackoff(){if(this.consecutiveErrors===1)this.currentBackoffMs=0;else{const n=this.pollIntervalMs*Math.pow(this.backoffMultiplier,this.consecutiveErrors-2);this.currentBackoffMs=Math.min(n,this.maxBackoffMs),console.warn(`[LongPollingTransport] Backing off ${this.currentBackoffMs}ms (${this.consecutiveErrors} consecutive errors)`)}}flagsChanged(n){return JSON.stringify(n)!==JSON.stringify(this.currentFlags)}fetchFlags(n){return ke(this,null,function*(){this.currentContext=n;const s=yield fetch(this.endpoint,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify({context:n})});if(s.status===401||s.status===403)throw new Error("Unauthorized: Invalid API key");if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);return(yield s.json()).data})}onFlagsUpdated(n){this.onUpdateCallback=n}destroy(){console.log("[LongPollingTransport] Destroying..."),this.isStopped=!0,this.pollTimeoutId!==null&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null),this.onUpdateCallback=void 0}}class _h{constructor(n,s,o=5,m=1e3){this.wsUrl=n,this.apiKey=s,this.maxRetries=o,this.initialBackoffMs=m,this.socket=null,this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.retries=0,this.reconnectTimeoutId=null,this.heartbeatIntervalId=null,this.lastHeartbeatTime=0,this.heartbeatTimeoutMs=3e4}init(){return ke(this,null,function*(){yield this.connectWithRetry(),yield this.waitForInitialFlags()})}waitForInitialFlags(){return this.initialFlagsReceived?Promise.resolve():(this.initialFlagsPromise||(this.initialFlagsPromise=new Promise(n=>{const s=setInterval(()=>{this.initialFlagsReceived&&(clearInterval(s),n())},50);setTimeout(()=>{clearInterval(s),console.warn("[WebSocketTransport] Initial flags timeout"),n()},5e3)})),this.initialFlagsPromise)}connectWithRetry(){return new Promise((n,s)=>{const o=()=>{try{this.cleanupSocket(),this.setConnectionState("connecting");const m=this.getWebSocketImplementation();this.socket=new m(`${this.wsUrl}?apiKey=${this.apiKey}`),this.socket.onopen=()=>{console.log("[WebSocketTransport] Connected"),this.isReady=!0,this.retries=0,this.setConnectionState("connected"),this.context&&this.sendContext(this.context),this.startHeartbeat(),n()},this.socket.onmessage=f=>{var g;this.lastHeartbeatTime=Date.now();try{const y=JSON.parse(f.data);if(console.log("[WebSocketTransport] Message received:",y),y.type==="ping"){this.socket&&this.socket.readyState===1?this.socket.send(JSON.stringify({type:"pong"})):console.warn("[WebSocketTransport] Cannot send pong: socket not ready");return}y.type==="flags"&&(console.log("[WebSocketTransport] Flags update received"),this.flags=y.flags,this.initialFlagsReceived=!0,(g=this.onFlagsUpdatedCallback)==null||g.call(this,this.flags))}catch(y){console.warn("[WebSocketTransport] Failed to parse message:",y)}},this.socket.onerror=f=>{console.error("[WebSocketTransport] Error:",f)},this.socket.onclose=f=>{if(console.log("[WebSocketTransport] Connection closed:",f.code),this.isReady=!1,this.stopHeartbeat(),this.setConnectionState("disconnected"),f.code===1008||f.code===4001){this.setConnectionState("failed"),s(new Error("Unauthorized: Invalid API key"));return}if(this.retries<this.maxRetries){const g=this.initialBackoffMs*Math.pow(2,this.retries);console.warn(`[WebSocketTransport] Reconnecting in ${g}ms (attempt ${this.retries+1})`),this.setConnectionState("reconnecting"),this.reconnectTimeoutId=setTimeout(o,g),this.retries++}else this.setConnectionState("failed"),s(new Error(`WebSocket failed after ${this.retries} retries`))}}catch(m){console.error("[WebSocketTransport] Failed to create socket:",m),this.setConnectionState("failed"),s(m)}};o()})}cleanupSocket(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===1&&this.socket.close(),this.socket=null)}startHeartbeat(){this.lastHeartbeatTime=Date.now(),this.heartbeatIntervalId=setInterval(()=>{var s,o;if(Date.now()-this.lastHeartbeatTime>this.heartbeatTimeoutMs){console.warn("[WebSocketTransport] Heartbeat timeout, reconnecting..."),(s=this.socket)==null||s.close();return}((o=this.socket)==null?void 0:o.readyState)===1&&this.socket.send(JSON.stringify({type:"ping"}))},1e4)}stopHeartbeat(){this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}setConnectionState(n){var s;(s=this.onConnectionStateCallback)==null||s.call(this,n)}getWebSocketImplementation(){if(typeof WebSocket!="undefined")return WebSocket;try{const n=require("ws");return n.default||n}catch(n){throw new Error('WebSocket not available. Install "ws" package for Node.js: npm install ws')}}fetchFlags(n){return ke(this,null,function*(){var s;return this.context=n,this.isReady&&((s=this.socket)==null?void 0:s.readyState)===1&&this.sendContext(n),this.flags})}onFlagsUpdated(n){this.onFlagsUpdatedCallback=n}onConnectionStateChanged(n){this.onConnectionStateCallback=n}destroy(){console.log("[WebSocketTransport] Destroying..."),this.stopHeartbeat(),this.reconnectTimeoutId!==null&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null),this.cleanupSocket(),this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.onFlagsUpdatedCallback=void 0,this.onConnectionStateCallback=void 0,this.retries=0}sendContext(n){if(!this.socket||this.socket.readyState!==1){console.warn("[WebSocketTransport] Socket not ready, cannot send context");return}const s=JSON.stringify({type:"context",context:n});this.socket.send(s)}}function Sh(h,n){if(h.type!=="rule")return!1;const s=h.attribute.split(".").reduce((o,m)=>o==null?void 0:o[m],n);switch(h.operator){case"eq":return s===h.value;case"neq":return s!==h.value;case"in":return Array.isArray(h.value)&&h.value.includes(s);case"nin":return Array.isArray(h.value)&&!h.value.includes(s);case"gt":return typeof s=="number"&&typeof h.value=="number"&&s>h.value;case"lt":return typeof s=="number"&&typeof h.value=="number"&&s<h.value;case"exists":return s!=null;case"not_exists":return s==null;default:return!1}}function _u(h,n){return h.rules.every(s=>Sh(s,n))}var Ut={};const Li=typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{};function Ah(){throw new Error("setTimeout has not been defined")}function Bh(){throw new Error("clearTimeout has not been defined")}var Cr=Ah,Fr=Bh;typeof Li.setTimeout=="function"&&(Cr=setTimeout);typeof Li.clearTimeout=="function"&&(Fr=clearTimeout);function Eh(h){if(Cr===setTimeout)return setTimeout(h,0);if((Cr===Ah||!Cr)&&setTimeout)return Cr=setTimeout,setTimeout(h,0);try{return Cr(h,0)}catch(n){try{return Cr.call(null,h,0)}catch(s){return Cr.call(this,h,0)}}}function Su(h){if(Fr===clearTimeout)return clearTimeout(h);if((Fr===Bh||!Fr)&&clearTimeout)return Fr=clearTimeout,clearTimeout(h);try{return Fr(h)}catch(n){try{return Fr.call(null,h)}catch(s){return Fr.call(this,h)}}}var Mr=[],hi=!1,Zr,mn=-1;function Au(){!hi||!Zr||(hi=!1,Zr.length?Mr=Zr.concat(Mr):mn=-1,Mr.length&&kh())}function kh(){if(!hi){var h=Eh(Au);hi=!0;for(var n=Mr.length;n;){for(Zr=Mr,Mr=[];++mn<n;)Zr&&Zr[mn].run();mn=-1,n=Mr.length}Zr=null,hi=!1,Su(h)}}function Bu(h){var n=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)n[s-1]=arguments[s];Mr.push(new Ih(h,n)),Mr.length===1&&!hi&&Eh(kh)}function Ih(h,n){this.fun=h,this.array=n}Ih.prototype.run=function(){this.fun.apply(null,this.array)};var Eu="browser",ku="browser",Iu=!0,Ru={},Tu=[],Cu="",Fu={},qu={},Pu={};function Qr(){}var Du=Qr,Nu=Qr,$u=Qr,Uu=Qr,Lu=Qr,Ou=Qr,zu=Qr;function Ku(h){throw new Error("process.binding is not supported")}function Hu(){return"/"}function Zu(h){throw new Error("process.chdir is not supported")}function Wu(){return 0}var fi=Li.performance||{},Vu=fi.now||fi.mozNow||fi.msNow||fi.oNow||fi.webkitNow||function(){return new Date().getTime()};function Yu(h){var n=Vu.call(fi)*.001,s=Math.floor(n),o=Math.floor(n%1*1e9);return h&&(s=s-h[0],o=o-h[1],o<0&&(s--,o+=1e9)),[s,o]}var Ju=new Date;function Gu(){var h=new Date,n=h-Ju;return n/1e3}var ye={nextTick:Bu,title:Eu,browser:Iu,env:Ru,argv:Tu,version:Cu,versions:Fu,on:Du,addListener:Nu,once:$u,off:Uu,removeListener:Lu,removeAllListeners:Ou,emit:zu,binding:Ku,cwd:Hu,chdir:Zu,umask:Wu,hrtime:Yu,platform:ku,release:qu,config:Pu,uptime:Gu},Xf={exports:{}},jf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}f.prototype=Object.create(o.prototype),m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(jf,jf.exports);var Ot=jf.exports,df=65536,Xu=4294967295;function ju(){throw new Error(`Secure random number generation is not supported by this browser.
6
+ */(function(h){const n=Rn,s=g0,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.Buffer=y,h.SlowBuffer=$,h.INSPECT_MAX_BYTES=50;const m=2147483647;h.kMaxLength=m,y.TYPED_ARRAY_SUPPORT=f(),!y.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const E=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(E,w),E.foo()===42}catch(E){return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function g(E){if(E>m)throw new RangeError('The value "'+E+'" is invalid for option "size"');const w=new Uint8Array(E);return Object.setPrototypeOf(w,y.prototype),w}function y(E,w,A){if(typeof E=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(E)}return S(E,w,A)}y.poolSize=8192;function S(E,w,A){if(typeof E=="string")return I(E,w);if(ArrayBuffer.isView(E))return D(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(dt(E,ArrayBuffer)||E&&dt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(dt(E,SharedArrayBuffer)||E&&dt(E.buffer,SharedArrayBuffer)))return L(E,w,A);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=E.valueOf&&E.valueOf();if(T!=null&&T!==E)return y.from(T,w,A);const F=W(E);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return y.from(E[Symbol.toPrimitive]("string"),w,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}y.from=function(E,w,A){return S(E,w,A)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function B(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function M(E,w,A){return B(E),E<=0?g(E):w!==void 0?typeof A=="string"?g(E).fill(w,A):g(E).fill(w):g(E)}y.alloc=function(E,w,A){return M(E,w,A)};function x(E){return B(E),g(E<0?0:z(E)|0)}y.allocUnsafe=function(E){return x(E)},y.allocUnsafeSlow=function(E){return x(E)};function I(E,w){if((typeof w!="string"||w==="")&&(w="utf8"),!y.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const A=lt(E,w)|0;let T=g(A);const F=T.write(E,w);return F!==A&&(T=T.slice(0,F)),T}function k(E){const w=E.length<0?0:z(E.length)|0,A=g(w);for(let T=0;T<w;T+=1)A[T]=E[T]&255;return A}function D(E){if(dt(E,Uint8Array)){const w=new Uint8Array(E);return L(w.buffer,w.byteOffset,w.byteLength)}return k(E)}function L(E,w,A){if(w<0||E.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<w+(A||0))throw new RangeError('"length" is outside of buffer bounds');let T;return w===void 0&&A===void 0?T=new Uint8Array(E):A===void 0?T=new Uint8Array(E,w):T=new Uint8Array(E,w,A),Object.setPrototypeOf(T,y.prototype),T}function W(E){if(y.isBuffer(E)){const w=z(E.length)|0,A=g(w);return A.length===0||E.copy(A,0,0,w),A}if(E.length!==void 0)return typeof E.length!="number"||qt(E.length)?g(0):k(E);if(E.type==="Buffer"&&Array.isArray(E.data))return k(E.data)}function z(E){if(E>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return E|0}function $(E){return+E!=E&&(E=0),y.alloc(+E)}y.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==y.prototype},y.compare=function(w,A){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),dt(A,Uint8Array)&&(A=y.from(A,A.offset,A.byteLength)),!y.isBuffer(w)||!y.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===A)return 0;let T=w.length,F=A.length;for(let V=0,U=Math.min(T,F);V<U;++V)if(w[V]!==A[V]){T=w[V],F=A[V];break}return T<F?-1:F<T?1:0},y.isEncoding=function(w){switch(String(w).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}},y.concat=function(w,A){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return y.alloc(0);let T;if(A===void 0)for(A=0,T=0;T<w.length;++T)A+=w[T].length;const F=y.allocUnsafe(A);let V=0;for(T=0;T<w.length;++T){let U=w[T];if(dt(U,Uint8Array))V+U.length>F.length?(y.isBuffer(U)||(U=y.from(U)),U.copy(F,V)):Uint8Array.prototype.set.call(F,U,V);else if(y.isBuffer(U))U.copy(F,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=U.length}return F};function lt(E,w){if(y.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||dt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const A=E.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&A===0)return 0;let F=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Dt(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Pt(E).length;default:if(F)return T?-1:Dt(E).length;w=(""+w).toLowerCase(),F=!0}}y.byteLength=lt;function H(E,w,A){let T=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,w>>>=0,A<=w))return"";for(E||(E="utf8");;)switch(E){case"hex":return u(this,w,A);case"utf8":case"utf-8":return i(this,w,A);case"ascii":return c(this,w,A);case"latin1":case"binary":return v(this,w,A);case"base64":return r(this,w,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e(this,w,A);default:if(T)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),T=!0}}y.prototype._isBuffer=!0;function At(E,w,A){const T=E[w];E[w]=E[A],E[A]=T}y.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<w;A+=2)At(this,A,A+1);return this},y.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<w;A+=4)At(this,A,A+3),At(this,A+1,A+2);return this},y.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<w;A+=8)At(this,A,A+7),At(this,A+1,A+6),At(this,A+2,A+5),At(this,A+3,A+4);return this},y.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?i(this,0,w):H.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(w){if(!y.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:y.compare(this,w)===0},y.prototype.inspect=function(){let w="";const A=h.INSPECT_MAX_BYTES;return w=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(w+=" ... "),"<Buffer "+w+">"},o&&(y.prototype[o]=y.prototype.inspect),y.prototype.compare=function(w,A,T,F,V){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),!y.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(A===void 0&&(A=0),T===void 0&&(T=w?w.length:0),F===void 0&&(F=0),V===void 0&&(V=this.length),A<0||T>w.length||F<0||V>this.length)throw new RangeError("out of range index");if(F>=V&&A>=T)return 0;if(F>=V)return-1;if(A>=T)return 1;if(A>>>=0,T>>>=0,F>>>=0,V>>>=0,this===w)return 0;let U=V-F,X=T-A;const Tt=Math.min(U,X),G=this.slice(F,V),rt=w.slice(A,T);for(let Rt=0;Rt<Tt;++Rt)if(G[Rt]!==rt[Rt]){U=G[Rt],X=rt[Rt];break}return U<X?-1:X<U?1:0};function Bt(E,w,A,T,F){if(E.length===0)return-1;if(typeof A=="string"?(T=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,qt(A)&&(A=F?0:E.length-1),A<0&&(A=E.length+A),A>=E.length){if(F)return-1;A=E.length-1}else if(A<0)if(F)A=0;else return-1;if(typeof w=="string"&&(w=y.from(w,T)),y.isBuffer(w))return w.length===0?-1:Ct(E,w,A,T,F);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(E,w,A):Uint8Array.prototype.lastIndexOf.call(E,w,A):Ct(E,[w],A,T,F);throw new TypeError("val must be string, number or Buffer")}function Ct(E,w,A,T,F){let V=1,U=E.length,X=w.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(E.length<2||w.length<2)return-1;V=2,U/=2,X/=2,A/=2}function Tt(rt,Rt){return V===1?rt[Rt]:rt.readUInt16BE(Rt*V)}let G;if(F){let rt=-1;for(G=A;G<U;G++)if(Tt(E,G)===Tt(w,rt===-1?0:G-rt)){if(rt===-1&&(rt=G),G-rt+1===X)return rt*V}else rt!==-1&&(G-=G-rt),rt=-1}else for(A+X>U&&(A=U-X),G=A;G>=0;G--){let rt=!0;for(let Rt=0;Rt<X;Rt++)if(Tt(E,G+Rt)!==Tt(w,Rt)){rt=!1;break}if(rt)return G}return-1}y.prototype.includes=function(w,A,T){return this.indexOf(w,A,T)!==-1},y.prototype.indexOf=function(w,A,T){return Bt(this,w,A,T,!0)},y.prototype.lastIndexOf=function(w,A,T){return Bt(this,w,A,T,!1)};function Et(E,w,A,T){A=Number(A)||0;const F=E.length-A;T?(T=Number(T),T>F&&(T=F)):T=F;const V=w.length;T>V/2&&(T=V/2);let U;for(U=0;U<T;++U){const X=parseInt(w.substr(U*2,2),16);if(qt(X))return U;E[A+U]=X}return U}function Y(E,w,A,T){return j(Dt(w,E.length-A),E,A,T)}function It(E,w,A,T){return j(et(w),E,A,T)}function p(E,w,A,T){return j(Pt(w),E,A,T)}function t(E,w,A,T){return j(pt(w,E.length-A),E,A,T)}y.prototype.write=function(w,A,T,F){if(A===void 0)F="utf8",T=this.length,A=0;else if(T===void 0&&typeof A=="string")F=A,T=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(T)?(T=T>>>0,F===void 0&&(F="utf8")):(F=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-A;if((T===void 0||T>V)&&(T=V),w.length>0&&(T<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let U=!1;for(;;)switch(F){case"hex":return Et(this,w,A,T);case"utf8":case"utf-8":return Y(this,w,A,T);case"ascii":case"latin1":case"binary":return It(this,w,A,T);case"base64":return p(this,w,A,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t(this,w,A,T);default:if(U)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),U=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function r(E,w,A){return w===0&&A===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(w,A))}function i(E,w,A){A=Math.min(E.length,A);const T=[];let F=w;for(;F<A;){const V=E[F];let U=null,X=V>239?4:V>223?3:V>191?2:1;if(F+X<=A){let Tt,G,rt,Rt;switch(X){case 1:V<128&&(U=V);break;case 2:Tt=E[F+1],(Tt&192)===128&&(Rt=(V&31)<<6|Tt&63,Rt>127&&(U=Rt));break;case 3:Tt=E[F+1],G=E[F+2],(Tt&192)===128&&(G&192)===128&&(Rt=(V&15)<<12|(Tt&63)<<6|G&63,Rt>2047&&(Rt<55296||Rt>57343)&&(U=Rt));break;case 4:Tt=E[F+1],G=E[F+2],rt=E[F+3],(Tt&192)===128&&(G&192)===128&&(rt&192)===128&&(Rt=(V&15)<<18|(Tt&63)<<12|(G&63)<<6|rt&63,Rt>65535&&Rt<1114112&&(U=Rt))}}U===null?(U=65533,X=1):U>65535&&(U-=65536,T.push(U>>>10&1023|55296),U=56320|U&1023),T.push(U),F+=X}return d(T)}const a=4096;function d(E){const w=E.length;if(w<=a)return String.fromCharCode.apply(String,E);let A="",T=0;for(;T<w;)A+=String.fromCharCode.apply(String,E.slice(T,T+=a));return A}function c(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]&127);return T}function v(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]);return T}function u(E,w,A){const T=E.length;(!w||w<0)&&(w=0),(!A||A<0||A>T)&&(A=T);let F="";for(let V=w;V<A;++V)F+=Q[E[V]];return F}function e(E,w,A){const T=E.slice(w,A);let F="";for(let V=0;V<T.length-1;V+=2)F+=String.fromCharCode(T[V]+T[V+1]*256);return F}y.prototype.slice=function(w,A){const T=this.length;w=~~w,A=A===void 0?T:~~A,w<0?(w+=T,w<0&&(w=0)):w>T&&(w=T),A<0?(A+=T,A<0&&(A=0)):A>T&&(A=T),A<w&&(A=w);const F=this.subarray(w,A);return Object.setPrototypeOf(F,y.prototype),F};function l(E,w,A){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+w>A)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return F},y.prototype.readUintBE=y.prototype.readUIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w+--A],V=1;for(;A>0&&(V*=256);)F+=this[w+--A]*V;return F},y.prototype.readUint8=y.prototype.readUInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]|this[w+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]<<8|this[w+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},y.prototype.readBigUInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24),V=this[++w]+this[++w]*pe(2,8)+this[++w]*pe(2,16)+T*pe(2,24);return BigInt(F)+(BigInt(V)<<BigInt(32))}),y.prototype.readBigUInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w],V=this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T;return(BigInt(F)<<BigInt(32))+BigInt(V)}),y.prototype.readIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return V*=128,F>=V&&(F-=Math.pow(2,8*A)),F},y.prototype.readIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=A,V=1,U=this[w+--F];for(;F>0&&(V*=256);)U+=this[w+--F]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*A)),U},y.prototype.readInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},y.prototype.readInt16LE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w]|this[w+1]<<8;return T&32768?T|4294901760:T},y.prototype.readInt16BE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w+1]|this[w]<<8;return T&32768?T|4294901760:T},y.prototype.readInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},y.prototype.readInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},y.prototype.readBigInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=this[w+4]+this[w+5]*pe(2,8)+this[w+6]*pe(2,16)+(T<<24);return(BigInt(F)<<BigInt(32))+BigInt(A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24))}),y.prototype.readBigInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=(A<<24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w];return(BigInt(F)<<BigInt(32))+BigInt(this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T)}),y.prototype.readFloatLE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!0,23,4)},y.prototype.readFloatBE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!1,23,4)},y.prototype.readDoubleLE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!0,52,8)},y.prototype.readDoubleBE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!1,52,8)};function b(E,w,A,T,F,V){if(!y.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>F||w<V)throw new RangeError('"value" argument is out of bounds');if(A+T>E.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=1,U=0;for(this[A]=w&255;++U<T&&(V*=256);)this[A+U]=w/V&255;return A+T},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=T-1,U=1;for(this[A+V]=w&255;--V>=0&&(U*=256);)this[A+V]=w/U&255;return A+T},y.prototype.writeUint8=y.prototype.writeUInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,255,0),this[A]=w&255,A+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A+3]=w>>>24,this[A+2]=w>>>16,this[A+1]=w>>>8,this[A]=w&255,A+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4};function _(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,A}function C(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A+7]=V,V=V>>8,E[A+6]=V,V=V>>8,E[A+5]=V,V=V>>8,E[A+4]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A+3]=U,U=U>>8,E[A+2]=U,U=U>>8,E[A+1]=U,U=U>>8,E[A]=U,A+8}y.prototype.writeBigUInt64LE=ct(function(w,A=0){return _(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=ct(function(w,A=0){return C(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=0,U=1,X=0;for(this[A]=w&255;++V<T&&(U*=256);)w<0&&X===0&&this[A+V-1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=T-1,U=1,X=0;for(this[A+V]=w&255;--V>=0&&(U*=256);)w<0&&X===0&&this[A+V+1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,127,-128),w<0&&(w=255+w+1),this[A]=w&255,A+1},y.prototype.writeInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),this[A]=w&255,this[A+1]=w>>>8,this[A+2]=w>>>16,this[A+3]=w>>>24,A+4},y.prototype.writeInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4},y.prototype.writeBigInt64LE=ct(function(w,A=0){return _(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=ct(function(w,A=0){return C(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function q(E,w,A,T,F,V){if(A+T>E.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function O(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,4),s.write(E,w,A,T,23,4),A+4}y.prototype.writeFloatLE=function(w,A,T){return O(this,w,A,!0,T)},y.prototype.writeFloatBE=function(w,A,T){return O(this,w,A,!1,T)};function R(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,8),s.write(E,w,A,T,52,8),A+8}y.prototype.writeDoubleLE=function(w,A,T){return R(this,w,A,!0,T)},y.prototype.writeDoubleBE=function(w,A,T){return R(this,w,A,!1,T)},y.prototype.copy=function(w,A,T,F){if(!y.isBuffer(w))throw new TypeError("argument should be a Buffer");if(T||(T=0),!F&&F!==0&&(F=this.length),A>=w.length&&(A=w.length),A||(A=0),F>0&&F<T&&(F=T),F===T||w.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=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),w.length-A<F-T&&(F=w.length-A+T);const V=F-T;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(A,T,F):Uint8Array.prototype.set.call(w,this.subarray(T,F),A),V},y.prototype.fill=function(w,A,T,F){if(typeof w=="string"){if(typeof A=="string"?(F=A,A=0,T=this.length):typeof T=="string"&&(F=T,T=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!y.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(w.length===1){const U=w.charCodeAt(0);(F==="utf8"&&U<128||F==="latin1")&&(w=U)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(A<0||this.length<A||this.length<T)throw new RangeError("Out of range index");if(T<=A)return this;A=A>>>0,T=T===void 0?this.length:T>>>0,w||(w=0);let V;if(typeof w=="number")for(V=A;V<T;++V)this[V]=w;else{const U=y.isBuffer(w)?w:y.from(w,F),X=U.length;if(X===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(V=0;V<T-A;++V)this[V+A]=U[V%X]}return this};const P={};function N(E,w,A){P[E]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(E,w){return`The "${E}" argument must be of type number. Received type ${typeof w}`},TypeError),N("ERR_OUT_OF_RANGE",function(E,w,A){let T=`The value of "${E}" is out of range.`,F=A;return Number.isInteger(A)&&Math.abs(A)>pe(2,32)?F=K(String(A)):typeof A=="bigint"&&(F=String(A),(A>pe(BigInt(2),BigInt(32))||A<-pe(BigInt(2),BigInt(32)))&&(F=K(F)),F+="n"),T+=` It must be ${w}. Received ${F}`,T},RangeError);function K(E){let w="",A=E.length;const T=E[0]==="-"?1:0;for(;A>=T+4;A-=3)w=`_${E.slice(A-3,A)}${w}`;return`${E.slice(0,A)}${w}`}function kt(E,w,A){J(w,"offset"),(E[w]===void 0||E[w+A]===void 0)&&Ft(w,E.length-(A+1))}function Z(E,w,A,T,F,V){if(E>A||E<w){const U=typeof w=="bigint"?"n":"";let X;throw V>3?w===0||w===BigInt(0)?X=`>= 0${U} and < 2${U} ** ${(V+1)*8}${U}`:X=`>= -(2${U} ** ${(V+1)*8-1}${U}) and < 2 ** ${(V+1)*8-1}${U}`:X=`>= ${w}${U} and <= ${A}${U}`,new P.ERR_OUT_OF_RANGE("value",X,E)}kt(T,F,V)}function J(E,w){if(typeof E!="number")throw new P.ERR_INVALID_ARG_TYPE(w,"number",E)}function Ft(E,w,A){throw Math.floor(E)!==E?(J(E,A),new P.ERR_OUT_OF_RANGE(A||"offset","an integer",E)):w<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${w}`,E)}const tt=/[^+/0-9A-Za-z-_]/g;function vt(E){if(E=E.split("=")[0],E=E.trim().replace(tt,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Dt(E,w){w=w||1/0;let A;const T=E.length;let F=null;const V=[];for(let U=0;U<T;++U){if(A=E.charCodeAt(U),A>55295&&A<57344){if(!F){if(A>56319){(w-=3)>-1&&V.push(239,191,189);continue}else if(U+1===T){(w-=3)>-1&&V.push(239,191,189);continue}F=A;continue}if(A<56320){(w-=3)>-1&&V.push(239,191,189),F=A;continue}A=(F-55296<<10|A-56320)+65536}else F&&(w-=3)>-1&&V.push(239,191,189);if(F=null,A<128){if((w-=1)<0)break;V.push(A)}else if(A<2048){if((w-=2)<0)break;V.push(A>>6|192,A&63|128)}else if(A<65536){if((w-=3)<0)break;V.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((w-=4)<0)break;V.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return V}function et(E){const w=[];for(let A=0;A<E.length;++A)w.push(E.charCodeAt(A)&255);return w}function pt(E,w){let A,T,F;const V=[];for(let U=0;U<E.length&&!((w-=2)<0);++U)A=E.charCodeAt(U),T=A>>8,F=A%256,V.push(F),V.push(T);return V}function Pt(E){return n.toByteArray(vt(E))}function j(E,w,A,T){let F;for(F=0;F<T&&!(F+A>=w.length||F>=E.length);++F)w[F+A]=E[F];return F}function dt(E,w){return E instanceof w||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===w.name}function qt(E){return E!==E}const Q=function(){const E="0123456789abcdef",w=new Array(256);for(let A=0;A<16;++A){const T=A*16;for(let F=0;F<16;++F)w[T+F]=E[A]+E[F]}return w}();function ct(E){return typeof BigInt=="undefined"?Lt:E}function Lt(){throw new Error("BigInt not supported")}})(gr);class xh{constructor(n,s,o,m={}){this.endpoint=n,this.apiKey=s,this.isStopped=!1,this.pollTimeoutId=null,this.currentFlags={},this.consecutiveErrors=0,this.currentBackoffMs=0,this.pollIntervalMs=m.pollIntervalMs||1e4,this.maxBackoffMs=m.maxBackoffMs||6e4,this.backoffMultiplier=m.backoffMultiplier||2,this.currentContext=o}init(){return ke(this,null,function*(){try{this.currentFlags=yield this.fetchFlags(this.currentContext),this.consecutiveErrors=0,console.log("[LongPollingTransport] Initial fetch complete")}catch(n){console.error("[LongPollingTransport] Initial fetch failed:",n)}this.scheduleNextPoll()})}scheduleNextPoll(){if(this.isStopped)return;const n=this.pollIntervalMs+this.currentBackoffMs;console.log(`[LongPollingTransport] Next poll in ${n}ms`+(this.currentBackoffMs>0?` (backoff: ${this.currentBackoffMs}ms)`:"")),this.pollTimeoutId=setTimeout(()=>ke(this,null,function*(){yield this.poll(),this.scheduleNextPoll()}),n)}poll(){return ke(this,null,function*(){var n;try{const s=yield this.fetchFlags(this.currentContext);this.consecutiveErrors>0&&(console.log("[LongPollingTransport] ✅ Recovered from errors"),this.consecutiveErrors=0,this.currentBackoffMs=0),this.flagsChanged(s)&&(console.log("[LongPollingTransport] Flags changed, notifying..."),this.currentFlags=s,(n=this.onUpdateCallback)==null||n.call(this,s))}catch(s){console.error("[LongPollingTransport] ❌ Poll error:",s),this.consecutiveErrors++,this.applyBackoff()}})}applyBackoff(){if(this.consecutiveErrors===1)this.currentBackoffMs=0;else{const n=this.pollIntervalMs*Math.pow(this.backoffMultiplier,this.consecutiveErrors-2);this.currentBackoffMs=Math.min(n,this.maxBackoffMs),console.warn(`[LongPollingTransport] Backing off ${this.currentBackoffMs}ms (${this.consecutiveErrors} consecutive errors)`)}}flagsChanged(n){return JSON.stringify(n)!==JSON.stringify(this.currentFlags)}fetchFlags(n){return ke(this,null,function*(){this.currentContext=n;const s=yield fetch(this.endpoint,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify({context:n})});if(s.status===401||s.status===403)throw new Error("Unauthorized: Invalid API key");if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);return(yield s.json()).data})}onFlagsUpdated(n){this.onUpdateCallback=n}destroy(){console.log("[LongPollingTransport] Destroying..."),this.isStopped=!0,this.pollTimeoutId!==null&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null),this.onUpdateCallback=void 0}}class _h{constructor(n,s,o=5,m=1e3){this.wsUrl=n,this.apiKey=s,this.maxRetries=o,this.initialBackoffMs=m,this.socket=null,this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.retries=0,this.reconnectTimeoutId=null,this.heartbeatIntervalId=null,this.lastHeartbeatTime=0,this.heartbeatTimeoutMs=3e4}init(){return ke(this,null,function*(){yield this.connectWithRetry(),yield this.waitForInitialFlags()})}waitForInitialFlags(){return this.initialFlagsReceived?Promise.resolve():(this.initialFlagsPromise||(this.initialFlagsPromise=new Promise(n=>{const s=setInterval(()=>{this.initialFlagsReceived&&(clearInterval(s),n())},50);setTimeout(()=>{clearInterval(s),console.warn("[WebSocketTransport] Initial flags timeout"),n()},5e3)})),this.initialFlagsPromise)}connectWithRetry(){return new Promise((n,s)=>{const o=()=>{try{this.cleanupSocket(),this.setConnectionState("connecting");const m=this.getWebSocketImplementation();this.socket=new m(`${this.wsUrl}?apiKey=${this.apiKey}`),this.socket.onopen=()=>{console.log("[WebSocketTransport] Connected"),this.isReady=!0,this.retries=0,this.setConnectionState("connected"),this.context&&this.sendContext(this.context),this.startHeartbeat(),n()},this.socket.onmessage=f=>{var g;this.lastHeartbeatTime=Date.now();try{const y=JSON.parse(f.data);if(console.log("[WebSocketTransport] Message received:",y),y.type==="ping"){this.socket&&this.socket.readyState===1&&this.socket.send(JSON.stringify({type:"pong"}));return}if(y.type==="pong"){console.log("[WebSocketTransport] Pong received");return}y.type==="flags"&&(console.log("[WebSocketTransport] Flags update received"),this.flags=y.flags,this.initialFlagsReceived=!0,(g=this.onFlagsUpdatedCallback)==null||g.call(this,this.flags))}catch(y){console.warn("[WebSocketTransport] Failed to parse message:",y)}},this.socket.onerror=f=>{console.error("[WebSocketTransport] Error:",f)},this.socket.onclose=f=>{if(console.log("[WebSocketTransport] Connection closed:",f.code),this.isReady=!1,this.stopHeartbeat(),this.setConnectionState("disconnected"),f.code===1008||f.code===4001){this.setConnectionState("failed"),s(new Error("Unauthorized: Invalid API key"));return}if(this.retries<this.maxRetries){const g=this.initialBackoffMs*Math.pow(2,this.retries);console.warn(`[WebSocketTransport] Reconnecting in ${g}ms (attempt ${this.retries+1})`),this.setConnectionState("reconnecting"),this.reconnectTimeoutId=setTimeout(o,g),this.retries++}else this.setConnectionState("failed"),s(new Error(`WebSocket failed after ${this.retries} retries`))}}catch(m){console.error("[WebSocketTransport] Failed to create socket:",m),this.setConnectionState("failed"),s(m)}};o()})}cleanupSocket(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===1&&this.socket.close(),this.socket=null)}startHeartbeat(){this.lastHeartbeatTime=Date.now(),this.heartbeatIntervalId=setInterval(()=>{var s,o;if(Date.now()-this.lastHeartbeatTime>this.heartbeatTimeoutMs){console.warn("[WebSocketTransport] Heartbeat timeout, reconnecting..."),(s=this.socket)==null||s.close();return}((o=this.socket)==null?void 0:o.readyState)===1&&this.socket.send(JSON.stringify({type:"ping"}))},1e4)}stopHeartbeat(){this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}setConnectionState(n){var s;(s=this.onConnectionStateCallback)==null||s.call(this,n)}getWebSocketImplementation(){if(typeof WebSocket!="undefined")return WebSocket;try{const n=require("ws");return n.default||n}catch(n){throw new Error('WebSocket not available. Install "ws" package for Node.js: npm install ws')}}fetchFlags(n){return ke(this,null,function*(){var s;return this.context=n,this.isReady&&((s=this.socket)==null?void 0:s.readyState)===1&&this.sendContext(n),this.flags})}onFlagsUpdated(n){this.onFlagsUpdatedCallback=n}onConnectionStateChanged(n){this.onConnectionStateCallback=n}destroy(){console.log("[WebSocketTransport] Destroying..."),this.stopHeartbeat(),this.reconnectTimeoutId!==null&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null),this.cleanupSocket(),this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.onFlagsUpdatedCallback=void 0,this.onConnectionStateCallback=void 0,this.retries=0}sendContext(n){if(!this.socket||this.socket.readyState!==1){console.warn("[WebSocketTransport] Socket not ready, cannot send context");return}const s=JSON.stringify({type:"context",context:n});this.socket.send(s)}}function Sh(h,n){if(h.type!=="rule")return!1;const s=h.attribute.split(".").reduce((o,m)=>o==null?void 0:o[m],n);switch(h.operator){case"eq":return s===h.value;case"neq":return s!==h.value;case"in":return Array.isArray(h.value)&&h.value.includes(s);case"nin":return Array.isArray(h.value)&&!h.value.includes(s);case"gt":return typeof s=="number"&&typeof h.value=="number"&&s>h.value;case"lt":return typeof s=="number"&&typeof h.value=="number"&&s<h.value;case"exists":return s!=null;case"not_exists":return s==null;default:return!1}}function _u(h,n){return h.rules.every(s=>Sh(s,n))}var Ut={};const Li=typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{};function Ah(){throw new Error("setTimeout has not been defined")}function Bh(){throw new Error("clearTimeout has not been defined")}var Cr=Ah,Fr=Bh;typeof Li.setTimeout=="function"&&(Cr=setTimeout);typeof Li.clearTimeout=="function"&&(Fr=clearTimeout);function Eh(h){if(Cr===setTimeout)return setTimeout(h,0);if((Cr===Ah||!Cr)&&setTimeout)return Cr=setTimeout,setTimeout(h,0);try{return Cr(h,0)}catch(n){try{return Cr.call(null,h,0)}catch(s){return Cr.call(this,h,0)}}}function Su(h){if(Fr===clearTimeout)return clearTimeout(h);if((Fr===Bh||!Fr)&&clearTimeout)return Fr=clearTimeout,clearTimeout(h);try{return Fr(h)}catch(n){try{return Fr.call(null,h)}catch(s){return Fr.call(this,h)}}}var Mr=[],hi=!1,Zr,mn=-1;function Au(){!hi||!Zr||(hi=!1,Zr.length?Mr=Zr.concat(Mr):mn=-1,Mr.length&&kh())}function kh(){if(!hi){var h=Eh(Au);hi=!0;for(var n=Mr.length;n;){for(Zr=Mr,Mr=[];++mn<n;)Zr&&Zr[mn].run();mn=-1,n=Mr.length}Zr=null,hi=!1,Su(h)}}function Bu(h){var n=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)n[s-1]=arguments[s];Mr.push(new Ih(h,n)),Mr.length===1&&!hi&&Eh(kh)}function Ih(h,n){this.fun=h,this.array=n}Ih.prototype.run=function(){this.fun.apply(null,this.array)};var Eu="browser",ku="browser",Iu=!0,Ru={},Tu=[],Cu="",Fu={},qu={},Pu={};function Qr(){}var Du=Qr,Nu=Qr,$u=Qr,Uu=Qr,Lu=Qr,Ou=Qr,zu=Qr;function Ku(h){throw new Error("process.binding is not supported")}function Hu(){return"/"}function Zu(h){throw new Error("process.chdir is not supported")}function Wu(){return 0}var fi=Li.performance||{},Vu=fi.now||fi.mozNow||fi.msNow||fi.oNow||fi.webkitNow||function(){return new Date().getTime()};function Yu(h){var n=Vu.call(fi)*.001,s=Math.floor(n),o=Math.floor(n%1*1e9);return h&&(s=s-h[0],o=o-h[1],o<0&&(s--,o+=1e9)),[s,o]}var Ju=new Date;function Gu(){var h=new Date,n=h-Ju;return n/1e3}var ye={nextTick:Bu,title:Eu,browser:Iu,env:Ru,argv:Tu,version:Cu,versions:Fu,on:Du,addListener:Nu,once:$u,off:Uu,removeListener:Lu,removeAllListeners:Ou,emit:zu,binding:Ku,cwd:Hu,chdir:Zu,umask:Wu,hrtime:Yu,platform:ku,release:qu,config:Pu,uptime:Gu},Xf={exports:{}},jf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}f.prototype=Object.create(o.prototype),m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(jf,jf.exports);var Ot=jf.exports,df=65536,Xu=4294967295;function ju(){throw new Error(`Secure random number generation is not supported by this browser.
7
7
  Use Chrome, Firefox or Internet Explorer 11`)}var Qu=Ot.Buffer,Mn=Gt.crypto||Gt.msCrypto;Mn&&Mn.getRandomValues?Xf.exports=tl:Xf.exports=ju;function tl(h,n){if(h>Xu)throw new RangeError("requested too many random bytes");var s=Qu.allocUnsafe(h);if(h>0)if(h>df)for(var o=0;o<h;o+=df)Mn.getRandomValues(s.slice(o,o+df));else Mn.getRandomValues(s);return typeof n=="function"?ye.nextTick(function(){n(null,s)}):s}var gi=Xf.exports,Qf={exports:{}};typeof Object.create=="function"?Qf.exports=function(n,s){s&&(n.super_=s,n.prototype=Object.create(s.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:Qf.exports=function(n,s){if(s){n.super_=s;var o=function(){};o.prototype=s.prototype,n.prototype=new o,n.prototype.constructor=n}};var Jt=Qf.exports;const el={},rl=Object.freeze(Object.defineProperty({__proto__:null,default:el},Symbol.toStringTag,{value:"Module"})),De=vu(rl);var fr=Ot.Buffer,Rh=De.Transform,il=Jt;function Nr(h){Rh.call(this),this._block=fr.allocUnsafe(h),this._blockSize=h,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}il(Nr,Rh);Nr.prototype._transform=function(h,n,s){var o=null;try{this.update(h,n)}catch(m){o=m}s(o)};Nr.prototype._flush=function(h){var n=null;try{this.push(this.digest())}catch(s){n=s}h(n)};var nl=typeof Uint8Array!="undefined",fl=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&ArrayBuffer.isView&&(fr.prototype instanceof Uint8Array||fr.TYPED_ARRAY_SUPPORT);function al(h,n){if(h instanceof fr)return h;if(typeof h=="string")return fr.from(h,n);if(fl&&ArrayBuffer.isView(h)){if(h.byteLength===0)return fr.alloc(0);var s=fr.from(h.buffer,h.byteOffset,h.byteLength);if(s.byteLength===h.byteLength)return s}if(nl&&h instanceof Uint8Array||fr.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return fr.from(h);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Nr.prototype.update=function(h,n){if(this._finalized)throw new Error("Digest already called");h=al(h,n);for(var s=this._block,o=0;this._blockOffset+h.length-o>=this._blockSize;){for(var m=this._blockOffset;m<this._blockSize;)s[m++]=h[o++];this._update(),this._blockOffset=0}for(;o<h.length;)s[this._blockOffset++]=h[o++];for(var f=0,g=h.length*8;g>0;++f)this._length[f]+=g,g=this._length[f]/4294967296|0,g>0&&(this._length[f]-=4294967296*g);return this};Nr.prototype._update=function(){throw new Error("_update is not implemented")};Nr.prototype.digest=function(h){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var n=this._digest();h!==void 0&&(n=n.toString(h)),this._block.fill(0),this._blockOffset=0;for(var s=0;s<4;++s)this._length[s]=0;return n};Nr.prototype._digest=function(){throw new Error("_digest is not implemented")};var Th=Nr,hl=Jt,Ch=Th,sl=Ot.Buffer,ol=new Array(16);function Tn(){Ch.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}hl(Tn,Ch);Tn.prototype._update=function(){for(var h=ol,n=0;n<16;++n)h[n]=this._block.readInt32LE(n*4);var s=this._a,o=this._b,m=this._c,f=this._d;s=Ie(s,o,m,f,h[0],3614090360,7),f=Ie(f,s,o,m,h[1],3905402710,12),m=Ie(m,f,s,o,h[2],606105819,17),o=Ie(o,m,f,s,h[3],3250441966,22),s=Ie(s,o,m,f,h[4],4118548399,7),f=Ie(f,s,o,m,h[5],1200080426,12),m=Ie(m,f,s,o,h[6],2821735955,17),o=Ie(o,m,f,s,h[7],4249261313,22),s=Ie(s,o,m,f,h[8],1770035416,7),f=Ie(f,s,o,m,h[9],2336552879,12),m=Ie(m,f,s,o,h[10],4294925233,17),o=Ie(o,m,f,s,h[11],2304563134,22),s=Ie(s,o,m,f,h[12],1804603682,7),f=Ie(f,s,o,m,h[13],4254626195,12),m=Ie(m,f,s,o,h[14],2792965006,17),o=Ie(o,m,f,s,h[15],1236535329,22),s=Re(s,o,m,f,h[1],4129170786,5),f=Re(f,s,o,m,h[6],3225465664,9),m=Re(m,f,s,o,h[11],643717713,14),o=Re(o,m,f,s,h[0],3921069994,20),s=Re(s,o,m,f,h[5],3593408605,5),f=Re(f,s,o,m,h[10],38016083,9),m=Re(m,f,s,o,h[15],3634488961,14),o=Re(o,m,f,s,h[4],3889429448,20),s=Re(s,o,m,f,h[9],568446438,5),f=Re(f,s,o,m,h[14],3275163606,9),m=Re(m,f,s,o,h[3],4107603335,14),o=Re(o,m,f,s,h[8],1163531501,20),s=Re(s,o,m,f,h[13],2850285829,5),f=Re(f,s,o,m,h[2],4243563512,9),m=Re(m,f,s,o,h[7],1735328473,14),o=Re(o,m,f,s,h[12],2368359562,20),s=Te(s,o,m,f,h[5],4294588738,4),f=Te(f,s,o,m,h[8],2272392833,11),m=Te(m,f,s,o,h[11],1839030562,16),o=Te(o,m,f,s,h[14],4259657740,23),s=Te(s,o,m,f,h[1],2763975236,4),f=Te(f,s,o,m,h[4],1272893353,11),m=Te(m,f,s,o,h[7],4139469664,16),o=Te(o,m,f,s,h[10],3200236656,23),s=Te(s,o,m,f,h[13],681279174,4),f=Te(f,s,o,m,h[0],3936430074,11),m=Te(m,f,s,o,h[3],3572445317,16),o=Te(o,m,f,s,h[6],76029189,23),s=Te(s,o,m,f,h[9],3654602809,4),f=Te(f,s,o,m,h[12],3873151461,11),m=Te(m,f,s,o,h[15],530742520,16),o=Te(o,m,f,s,h[2],3299628645,23),s=Ce(s,o,m,f,h[0],4096336452,6),f=Ce(f,s,o,m,h[7],1126891415,10),m=Ce(m,f,s,o,h[14],2878612391,15),o=Ce(o,m,f,s,h[5],4237533241,21),s=Ce(s,o,m,f,h[12],1700485571,6),f=Ce(f,s,o,m,h[3],2399980690,10),m=Ce(m,f,s,o,h[10],4293915773,15),o=Ce(o,m,f,s,h[1],2240044497,21),s=Ce(s,o,m,f,h[8],1873313359,6),f=Ce(f,s,o,m,h[15],4264355552,10),m=Ce(m,f,s,o,h[6],2734768916,15),o=Ce(o,m,f,s,h[13],1309151649,21),s=Ce(s,o,m,f,h[4],4149444226,6),f=Ce(f,s,o,m,h[11],3174756917,10),m=Ce(m,f,s,o,h[2],718787259,15),o=Ce(o,m,f,s,h[9],3951481745,21),this._a=this._a+s|0,this._b=this._b+o|0,this._c=this._c+m|0,this._d=this._d+f|0};Tn.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var h=sl.allocUnsafe(16);return h.writeInt32LE(this._a,0),h.writeInt32LE(this._b,4),h.writeInt32LE(this._c,8),h.writeInt32LE(this._d,12),h};function Cn(h,n){return h<<n|h>>>32-n}function Ie(h,n,s,o,m,f,g){return Cn(h+(n&s|~n&o)+m+f|0,g)+n|0}function Re(h,n,s,o,m,f,g){return Cn(h+(n&o|s&~o)+m+f|0,g)+n|0}function Te(h,n,s,o,m,f,g){return Cn(h+(n^s^o)+m+f|0,g)+n|0}function Ce(h,n,s,o,m,f,g){return Cn(h+(s^(n|~o))+m+f|0,g)+n|0}var b0=Tn,cf=gr.Buffer,ul=Jt,Fh=Th,ll=new Array(16),Bi=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ei=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],ki=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Ii=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Ri=[0,1518500249,1859775393,2400959708,2840853838],Ti=[1352829926,1548603684,1836072691,2053994217,0];function Fn(){Fh.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}ul(Fn,Fh);Fn.prototype._update=function(){for(var h=ll,n=0;n<16;++n)h[n]=this._block.readInt32LE(n*4);for(var s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=this._a|0,S=this._b|0,B=this._c|0,M=this._d|0,x=this._e|0,I=0;I<80;I+=1){var k,D;I<16?(k=ea(s,o,m,f,g,h[Bi[I]],Ri[0],ki[I]),D=fa(y,S,B,M,x,h[Ei[I]],Ti[0],Ii[I])):I<32?(k=ra(s,o,m,f,g,h[Bi[I]],Ri[1],ki[I]),D=na(y,S,B,M,x,h[Ei[I]],Ti[1],Ii[I])):I<48?(k=ia(s,o,m,f,g,h[Bi[I]],Ri[2],ki[I]),D=ia(y,S,B,M,x,h[Ei[I]],Ti[2],Ii[I])):I<64?(k=na(s,o,m,f,g,h[Bi[I]],Ri[3],ki[I]),D=ra(y,S,B,M,x,h[Ei[I]],Ti[3],Ii[I])):(k=fa(s,o,m,f,g,h[Bi[I]],Ri[4],ki[I]),D=ea(y,S,B,M,x,h[Ei[I]],Ti[4],Ii[I])),s=g,g=f,f=Gr(m,10),m=o,o=k,y=x,x=M,M=Gr(B,10),B=S,S=D}var L=this._b+m+M|0;this._b=this._c+f+x|0,this._c=this._d+g+y|0,this._d=this._e+s+S|0,this._e=this._a+o+B|0,this._a=L};Fn.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var h=cf.alloc?cf.alloc(20):new cf(20);return h.writeInt32LE(this._a,0),h.writeInt32LE(this._b,4),h.writeInt32LE(this._c,8),h.writeInt32LE(this._d,12),h.writeInt32LE(this._e,16),h};function Gr(h,n){return h<<n|h>>>32-n}function ea(h,n,s,o,m,f,g,y){return Gr(h+(n^s^o)+f+g|0,y)+m|0}function ra(h,n,s,o,m,f,g,y){return Gr(h+(n&s|~n&o)+f+g|0,y)+m|0}function ia(h,n,s,o,m,f,g,y){return Gr(h+((n|~s)^o)+f+g|0,y)+m|0}function na(h,n,s,o,m,f,g,y){return Gr(h+(n&o|s&~o)+f+g|0,y)+m|0}function fa(h,n,s,o,m,f,g,y){return Gr(h+(n^(s|~o))+f+g|0,y)+m|0}var y0=Fn,qh={exports:{}},Ph=Ot.Buffer;function qn(h,n){this._block=Ph.alloc(h),this._finalSize=n,this._blockSize=h,this._len=0}qn.prototype.update=function(h,n){typeof h=="string"&&(n=n||"utf8",h=Ph.from(h,n));for(var s=this._block,o=this._blockSize,m=h.length,f=this._len,g=0;g<m;){for(var y=f%o,S=Math.min(m-g,o-y),B=0;B<S;B++)s[y+B]=h[g+B];f+=S,g+=S,f%o===0&&this._update(s)}return this._len+=m,this};qn.prototype.digest=function(h){var n=this._len%this._blockSize;this._block[n]=128,this._block.fill(0,n+1),n>=this._finalSize&&(this._update(this._block),this._block.fill(0));var s=this._len*8;if(s<=4294967295)this._block.writeUInt32BE(s,this._blockSize-4);else{var o=(s&4294967295)>>>0,m=(s-o)/4294967296;this._block.writeUInt32BE(m,this._blockSize-8),this._block.writeUInt32BE(o,this._blockSize-4)}this._update(this._block);var f=this._hash();return h?f.toString(h):f};qn.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var bi=qn,dl=Jt,Dh=bi,cl=Ot.Buffer,vl=[1518500249,1859775393,-1894007588,-899497514],pl=new Array(80);function Zi(){this.init(),this._w=pl,Dh.call(this,64,56)}dl(Zi,Dh);Zi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ml(h){return h<<5|h>>>27}function gl(h){return h<<30|h>>>2}function bl(h,n,s,o){return h===0?n&s|~n&o:h===2?n&s|n&o|s&o:n^s^o}Zi.prototype._update=function(h){for(var n=this._w,s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=0;y<16;++y)n[y]=h.readInt32BE(y*4);for(;y<80;++y)n[y]=n[y-3]^n[y-8]^n[y-14]^n[y-16];for(var S=0;S<80;++S){var B=~~(S/20),M=ml(s)+bl(B,o,m,f)+g+n[S]+vl[B]|0;g=f,f=m,m=gl(o),o=s,s=M}this._a=s+this._a|0,this._b=o+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0};Zi.prototype._hash=function(){var h=cl.allocUnsafe(20);return h.writeInt32BE(this._a|0,0),h.writeInt32BE(this._b|0,4),h.writeInt32BE(this._c|0,8),h.writeInt32BE(this._d|0,12),h.writeInt32BE(this._e|0,16),h};var yl=Zi,wl=Jt,Nh=bi,Ml=Ot.Buffer,xl=[1518500249,1859775393,-1894007588,-899497514],_l=new Array(80);function Wi(){this.init(),this._w=_l,Nh.call(this,64,56)}wl(Wi,Nh);Wi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Sl(h){return h<<1|h>>>31}function Al(h){return h<<5|h>>>27}function Bl(h){return h<<30|h>>>2}function El(h,n,s,o){return h===0?n&s|~n&o:h===2?n&s|n&o|s&o:n^s^o}Wi.prototype._update=function(h){for(var n=this._w,s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=0;y<16;++y)n[y]=h.readInt32BE(y*4);for(;y<80;++y)n[y]=Sl(n[y-3]^n[y-8]^n[y-14]^n[y-16]);for(var S=0;S<80;++S){var B=~~(S/20),M=Al(s)+El(B,o,m,f)+g+n[S]+xl[B]|0;g=f,f=m,m=Bl(o),o=s,s=M}this._a=s+this._a|0,this._b=o+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0};Wi.prototype._hash=function(){var h=Ml.allocUnsafe(20);return h.writeInt32BE(this._a|0,0),h.writeInt32BE(this._b|0,4),h.writeInt32BE(this._c|0,8),h.writeInt32BE(this._d|0,12),h.writeInt32BE(this._e|0,16),h};var kl=Wi,Il=Jt,$h=bi,Rl=Ot.Buffer,Tl=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Cl=new Array(64);function Vi(){this.init(),this._w=Cl,$h.call(this,64,56)}Il(Vi,$h);Vi.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Fl(h,n,s){return s^h&(n^s)}function ql(h,n,s){return h&n|s&(h|n)}function Pl(h){return(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10)}function Dl(h){return(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7)}function Nl(h){return(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3}function $l(h){return(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10}Vi.prototype._update=function(h){for(var n=this._w,s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=this._f|0,S=this._g|0,B=this._h|0,M=0;M<16;++M)n[M]=h.readInt32BE(M*4);for(;M<64;++M)n[M]=$l(n[M-2])+n[M-7]+Nl(n[M-15])+n[M-16]|0;for(var x=0;x<64;++x){var I=B+Dl(g)+Fl(g,y,S)+Tl[x]+n[x]|0,k=Pl(s)+ql(s,o,m)|0;B=S,S=y,y=g,g=f+I|0,f=m,m=o,o=s,s=I+k|0}this._a=s+this._a|0,this._b=o+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0,this._f=y+this._f|0,this._g=S+this._g|0,this._h=B+this._h|0};Vi.prototype._hash=function(){var h=Rl.allocUnsafe(32);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h.writeInt32BE(this._h,28),h};var Uh=Vi,Ul=Jt,Ll=Uh,Ol=bi,zl=Ot.Buffer,Kl=new Array(64);function Pn(){this.init(),this._w=Kl,Ol.call(this,64,56)}Ul(Pn,Ll);Pn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Pn.prototype._hash=function(){var h=zl.allocUnsafe(28);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h};var Hl=Pn,Zl=Jt,Lh=bi,Wl=Ot.Buffer,aa=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Vl=new Array(160);function Yi(){this.init(),this._w=Vl,Lh.call(this,128,112)}Zl(Yi,Lh);Yi.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function ha(h,n,s){return s^h&(n^s)}function sa(h,n,s){return h&n|s&(h|n)}function oa(h,n){return(h>>>28|n<<4)^(n>>>2|h<<30)^(n>>>7|h<<25)}function ua(h,n){return(h>>>14|n<<18)^(h>>>18|n<<14)^(n>>>9|h<<23)}function Yl(h,n){return(h>>>1|n<<31)^(h>>>8|n<<24)^h>>>7}function Jl(h,n){return(h>>>1|n<<31)^(h>>>8|n<<24)^(h>>>7|n<<25)}function Gl(h,n){return(h>>>19|n<<13)^(n>>>29|h<<3)^h>>>6}function Xl(h,n){return(h>>>19|n<<13)^(n>>>29|h<<3)^(h>>>6|n<<26)}function xe(h,n){return h>>>0<n>>>0?1:0}Yi.prototype._update=function(h){for(var n=this._w,s=this._ah|0,o=this._bh|0,m=this._ch|0,f=this._dh|0,g=this._eh|0,y=this._fh|0,S=this._gh|0,B=this._hh|0,M=this._al|0,x=this._bl|0,I=this._cl|0,k=this._dl|0,D=this._el|0,L=this._fl|0,W=this._gl|0,z=this._hl|0,$=0;$<32;$+=2)n[$]=h.readInt32BE($*4),n[$+1]=h.readInt32BE($*4+4);for(;$<160;$+=2){var lt=n[$-30],H=n[$-15*2+1],At=Yl(lt,H),Bt=Jl(H,lt);lt=n[$-2*2],H=n[$-2*2+1];var Ct=Gl(lt,H),Et=Xl(H,lt),Y=n[$-7*2],It=n[$-7*2+1],p=n[$-16*2],t=n[$-16*2+1],r=Bt+It|0,i=At+Y+xe(r,Bt)|0;r=r+Et|0,i=i+Ct+xe(r,Et)|0,r=r+t|0,i=i+p+xe(r,t)|0,n[$]=i,n[$+1]=r}for(var a=0;a<160;a+=2){i=n[a],r=n[a+1];var d=sa(s,o,m),c=sa(M,x,I),v=oa(s,M),u=oa(M,s),e=ua(g,D),l=ua(D,g),b=aa[a],_=aa[a+1],C=ha(g,y,S),q=ha(D,L,W),O=z+l|0,R=B+e+xe(O,z)|0;O=O+q|0,R=R+C+xe(O,q)|0,O=O+_|0,R=R+b+xe(O,_)|0,O=O+r|0,R=R+i+xe(O,r)|0;var P=u+c|0,N=v+d+xe(P,u)|0;B=S,z=W,S=y,W=L,y=g,L=D,D=k+O|0,g=f+R+xe(D,k)|0,f=m,k=I,m=o,I=x,o=s,x=M,M=O+P|0,s=R+N+xe(M,O)|0}this._al=this._al+M|0,this._bl=this._bl+x|0,this._cl=this._cl+I|0,this._dl=this._dl+k|0,this._el=this._el+D|0,this._fl=this._fl+L|0,this._gl=this._gl+W|0,this._hl=this._hl+z|0,this._ah=this._ah+s+xe(this._al,M)|0,this._bh=this._bh+o+xe(this._bl,x)|0,this._ch=this._ch+m+xe(this._cl,I)|0,this._dh=this._dh+f+xe(this._dl,k)|0,this._eh=this._eh+g+xe(this._el,D)|0,this._fh=this._fh+y+xe(this._fl,L)|0,this._gh=this._gh+S+xe(this._gl,W)|0,this._hh=this._hh+B+xe(this._hl,z)|0};Yi.prototype._hash=function(){var h=Wl.allocUnsafe(64);function n(s,o,m){h.writeInt32BE(s,m),h.writeInt32BE(o,m+4)}return n(this._ah,this._al,0),n(this._bh,this._bl,8),n(this._ch,this._cl,16),n(this._dh,this._dl,24),n(this._eh,this._el,32),n(this._fh,this._fl,40),n(this._gh,this._gl,48),n(this._hh,this._hl,56),h};var Oh=Yi,jl=Jt,Ql=Oh,td=bi,ed=Ot.Buffer,rd=new Array(160);function Dn(){this.init(),this._w=rd,td.call(this,128,112)}jl(Dn,Ql);Dn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Dn.prototype._hash=function(){var h=ed.allocUnsafe(48);function n(s,o,m){h.writeInt32BE(s,m),h.writeInt32BE(o,m+4)}return n(this._ah,this._al,0),n(this._bh,this._bl,8),n(this._ch,this._cl,16),n(this._dh,this._dl,24),n(this._eh,this._el,32),n(this._fh,this._fl,40),h};var id=Dn,ti=qh.exports=function(n){n=n.toLowerCase();var s=ti[n];if(!s)throw new Error(n+" is not supported (we accept pull requests)");return new s};ti.sha=yl;ti.sha1=kl;ti.sha224=Hl;ti.sha256=Uh;ti.sha384=id;ti.sha512=Oh;var w0=qh.exports,xn={},t0={exports:{}};(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(t0,t0.exports);var nd=t0.exports,M0=nd.Buffer,la=M0.isEncoding||function(h){switch(h=""+h,h&&h.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 fd(h){if(!h)return"utf8";for(var n;;)switch(h){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 h;default:if(n)return;h=(""+h).toLowerCase(),n=!0}}function ad(h){var n=fd(h);if(typeof n!="string"&&(M0.isEncoding===la||!la(h)))throw new Error("Unknown encoding: "+h);return n||h}xn.StringDecoder=Ji;function Ji(h){this.encoding=ad(h);var n;switch(this.encoding){case"utf16le":this.text=dd,this.end=cd,n=4;break;case"utf8":this.fillLast=od,n=4;break;case"base64":this.text=vd,this.end=pd,n=3;break;default:this.write=md,this.end=gd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=M0.allocUnsafe(n)}Ji.prototype.write=function(h){if(h.length===0)return"";var n,s;if(this.lastNeed){if(n=this.fillLast(h),n===void 0)return"";s=this.lastNeed,this.lastNeed=0}else s=0;return s<h.length?n?n+this.text(h,s):this.text(h,s):n||""};Ji.prototype.end=ld;Ji.prototype.text=ud;Ji.prototype.fillLast=function(h){if(this.lastNeed<=h.length)return h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,h.length),this.lastNeed-=h.length};function vf(h){return h<=127?0:h>>5===6?2:h>>4===14?3:h>>3===30?4:h>>6===2?-1:-2}function hd(h,n,s){var o=n.length-1;if(o<s)return 0;var m=vf(n[o]);return m>=0?(m>0&&(h.lastNeed=m-1),m):--o<s||m===-2?0:(m=vf(n[o]),m>=0?(m>0&&(h.lastNeed=m-2),m):--o<s||m===-2?0:(m=vf(n[o]),m>=0?(m>0&&(m===2?m=0:h.lastNeed=m-3),m):0))}function sd(h,n,s){if((n[0]&192)!==128)return h.lastNeed=0,"�";if(h.lastNeed>1&&n.length>1){if((n[1]&192)!==128)return h.lastNeed=1,"�";if(h.lastNeed>2&&n.length>2&&(n[2]&192)!==128)return h.lastNeed=2,"�"}}function od(h){var n=this.lastTotal-this.lastNeed,s=sd(this,h);if(s!==void 0)return s;if(this.lastNeed<=h.length)return h.copy(this.lastChar,n,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,n,0,h.length),this.lastNeed-=h.length}function ud(h,n){var s=hd(this,h,n);if(!this.lastNeed)return h.toString("utf8",n);this.lastTotal=s;var o=h.length-(s-this.lastNeed);return h.copy(this.lastChar,0,o),h.toString("utf8",n,o)}function ld(h){var n=h&&h.length?this.write(h):"";return this.lastNeed?n+"�":n}function dd(h,n){if((h.length-n)%2===0){var s=h.toString("utf16le",n);if(s){var o=s.charCodeAt(s.length-1);if(o>=55296&&o<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=h[h.length-1],h.toString("utf16le",n,h.length-1)}function cd(h){var n=h&&h.length?this.write(h):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return n+this.lastChar.toString("utf16le",0,s)}return n}function vd(h,n){var s=(h.length-n)%3;return s===0?h.toString("base64",n):(this.lastNeed=3-s,this.lastTotal=3,s===1?this.lastChar[0]=h[h.length-1]:(this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1]),h.toString("base64",n,h.length-s))}function pd(h){var n=h&&h.length?this.write(h):"";return this.lastNeed?n+this.lastChar.toString("base64",0,3-this.lastNeed):n}function md(h){return h.toString(this.encoding)}function gd(h){return h&&h.length?this.write(h):""}var ar=Ot.Buffer,zh=De.Transform,bd=xn.StringDecoder,yd=Jt;function er(h){zh.call(this),this.hashMode=typeof h=="string",this.hashMode?this[h]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}yd(er,zh);var wd=typeof Uint8Array!="undefined",Md=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&ArrayBuffer.isView&&(ar.prototype instanceof Uint8Array||ar.TYPED_ARRAY_SUPPORT);function xd(h,n){if(h instanceof ar)return h;if(typeof h=="string")return ar.from(h,n);if(Md&&ArrayBuffer.isView(h)){if(h.byteLength===0)return ar.alloc(0);var s=ar.from(h.buffer,h.byteOffset,h.byteLength);if(s.byteLength===h.byteLength)return s}if(wd&&h instanceof Uint8Array||ar.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return ar.from(h);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}er.prototype.update=function(h,n,s){var o=xd(h,n),m=this._update(o);return this.hashMode?this:(s&&(m=this._toString(m,s)),m)};er.prototype.setAutoPadding=function(){};er.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};er.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};er.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};er.prototype._transform=function(h,n,s){var o;try{this.hashMode?this._update(h):this.push(this._update(h))}catch(m){o=m}finally{s(o)}};er.prototype._flush=function(h){var n;try{this.push(this.__final())}catch(s){n=s}h(n)};er.prototype._finalOrDigest=function(h){var n=this.__final()||ar.alloc(0);return h&&(n=this._toString(n,h,!0)),n};er.prototype._toString=function(h,n,s){if(this._decoder||(this._decoder=new bd(n),this._encoding=n),this._encoding!==n)throw new Error("can’t switch encodings");var o=this._decoder.write(h);return s&&(o+=this._decoder.end()),o};var $r=er,_d=Jt,Sd=b0,Ad=y0,Bd=w0,Kh=$r;function Nn(h){Kh.call(this,"digest"),this._hash=h}_d(Nn,Kh);Nn.prototype._update=function(h){this._hash.update(h)};Nn.prototype._final=function(){return this._hash.digest()};var Gi=function(n){return n=n.toLowerCase(),n==="md5"?new Sd:n==="rmd160"||n==="ripemd160"?new Ad:new Nn(Bd(n))},Ed=Jt,Wr=Ot.Buffer,Hh=$r,kd=Wr.alloc(128),ni=64;function $n(h,n){Hh.call(this,"digest"),typeof n=="string"&&(n=Wr.from(n)),this._alg=h,this._key=n,n.length>ni?n=h(n):n.length<ni&&(n=Wr.concat([n,kd],ni));for(var s=this._ipad=Wr.allocUnsafe(ni),o=this._opad=Wr.allocUnsafe(ni),m=0;m<ni;m++)s[m]=n[m]^54,o[m]=n[m]^92;this._hash=[s]}Ed($n,Hh);$n.prototype._update=function(h){this._hash.push(h)};$n.prototype._final=function(){var h=this._alg(Wr.concat(this._hash));return this._alg(Wr.concat([this._opad,h]))};var Id=$n,Rd=b0,Zh=function(h){return new Rd().update(h).digest()},Td=Jt,Cd=Id,Wh=$r,Pi=Ot.Buffer,Fd=Zh,e0=y0,r0=w0,qd=Pi.alloc(128);function Oi(h,n){Wh.call(this,"digest"),typeof n=="string"&&(n=Pi.from(n));var s=h==="sha512"||h==="sha384"?128:64;if(this._alg=h,this._key=n,n.length>s){var o=h==="rmd160"?new e0:r0(h);n=o.update(n).digest()}else n.length<s&&(n=Pi.concat([n,qd],s));for(var m=this._ipad=Pi.allocUnsafe(s),f=this._opad=Pi.allocUnsafe(s),g=0;g<s;g++)m[g]=n[g]^54,f[g]=n[g]^92;this._hash=h==="rmd160"?new e0:r0(h),this._hash.update(m)}Td(Oi,Wh);Oi.prototype._update=function(h){this._hash.update(h)};Oi.prototype._final=function(){var h=this._hash.digest(),n=this._alg==="rmd160"?new e0:r0(this._alg);return n.update(this._opad).update(h).digest()};var Vh=function(n,s){return n=n.toLowerCase(),n==="rmd160"||n==="ripemd160"?new Oi("rmd160",s):n==="md5"?new Cd(Fd,s):new Oi(n,s)};const Pd={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},Dd={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},Nd={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},$d={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},Ud={sign:"ecdsa",hash:"sha256",id:""},Ld={sign:"ecdsa",hash:"sha224",id:""},Od={sign:"ecdsa",hash:"sha384",id:""},zd={sign:"ecdsa",hash:"sha512",id:""},Kd={sign:"dsa",hash:"sha1",id:""},Hd={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},Zd={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},Yh={sha224WithRSAEncryption:Pd,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:Dd,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:Nd,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:$d,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:Ud,sha224:Ld,sha384:Od,sha512:zd,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:Kd,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:Hd,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:Zd,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var Wd=Yh,Un={},Vd=Math.pow(2,30)-1,Jh=function(h,n){if(typeof h!="number")throw new TypeError("Iterations not a number");if(h<0)throw new TypeError("Bad iterations");if(typeof n!="number")throw new TypeError("Key length not a number");if(n<0||n>Vd||n!==n)throw new TypeError("Bad key length")},gn;if(Gt.process&&Gt.process.browser)gn="utf-8";else if(Gt.process&&Gt.process.version){var Yd=parseInt(ye.version.split(".")[0].slice(1),10);gn=Yd>=6?"utf-8":"binary"}else gn="utf-8";var Gh=gn,pf=Ot.Buffer,Xh=function(h,n,s){if(pf.isBuffer(h))return h;if(typeof h=="string")return pf.from(h,n);if(ArrayBuffer.isView(h))return pf.from(h.buffer);throw new TypeError(s+" must be a string, a Buffer, a typed array or a DataView")},Jd=Zh,Gd=y0,Xd=w0,Vr=Ot.Buffer,jd=Jh,da=Gh,ca=Xh,Qd=Vr.alloc(128),bn={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function jh(h,n,s){var o=tc(h),m=h==="sha512"||h==="sha384"?128:64;n.length>m?n=o(n):n.length<m&&(n=Vr.concat([n,Qd],m));for(var f=Vr.allocUnsafe(m+bn[h]),g=Vr.allocUnsafe(m+bn[h]),y=0;y<m;y++)f[y]=n[y]^54,g[y]=n[y]^92;var S=Vr.allocUnsafe(m+s+4);f.copy(S,0,0,m),this.ipad1=S,this.ipad2=f,this.opad=g,this.alg=h,this.blocksize=m,this.hash=o,this.size=bn[h]}jh.prototype.run=function(h,n){h.copy(n,this.blocksize);var s=this.hash(n);return s.copy(this.opad,this.blocksize),this.hash(this.opad)};function tc(h){function n(o){return Xd(h).update(o).digest()}function s(o){return new Gd().update(o).digest()}return h==="rmd160"||h==="ripemd160"?s:h==="md5"?Jd:n}function ec(h,n,s,o,m){jd(s,o),h=ca(h,da,"Password"),n=ca(n,da,"Salt"),m=m||"sha1";var f=new jh(m,h,n.length),g=Vr.allocUnsafe(o),y=Vr.allocUnsafe(n.length+4);n.copy(y,0,0,n.length);for(var S=0,B=bn[m],M=Math.ceil(o/B),x=1;x<=M;x++){y.writeUInt32BE(x,n.length);for(var I=f.run(y,f.ipad1),k=I,D=1;D<s;D++){k=f.run(k,f.ipad2);for(var L=0;L<B;L++)I[L]^=k[L]}I.copy(g,S),S+=B}return g}var Qh=ec,ts=Ot.Buffer,rc=Jh,va=Gh,pa=Qh,ma=Xh,sn,$i=Gt.crypto&&Gt.crypto.subtle,ic={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},mf=[];function nc(h){if(Gt.process&&!Gt.process.browser||!$i||!$i.importKey||!$i.deriveBits)return Promise.resolve(!1);if(mf[h]!==void 0)return mf[h];sn=sn||ts.alloc(8);var n=es(sn,sn,10,128,h).then(function(){return!0}).catch(function(){return!1});return mf[h]=n,n}var Lr;function i0(){return Lr||(Gt.process&&Gt.process.nextTick?Lr=Gt.process.nextTick:Gt.queueMicrotask?Lr=Gt.queueMicrotask:Gt.setImmediate?Lr=Gt.setImmediate:Lr=Gt.setTimeout,Lr)}function es(h,n,s,o,m){return $i.importKey("raw",h,{name:"PBKDF2"},!1,["deriveBits"]).then(function(f){return $i.deriveBits({name:"PBKDF2",salt:n,iterations:s,hash:{name:m}},f,o<<3)}).then(function(f){return ts.from(f)})}function fc(h,n){h.then(function(s){i0()(function(){n(null,s)})},function(s){i0()(function(){n(s)})})}var ac=function(h,n,s,o,m,f){typeof m=="function"&&(f=m,m=void 0),m=m||"sha1";var g=ic[m.toLowerCase()];if(!g||typeof Gt.Promise!="function"){i0()(function(){var y;try{y=pa(h,n,s,o,m)}catch(S){return f(S)}f(null,y)});return}if(rc(s,o),h=ma(h,va,"Password"),n=ma(n,va,"Salt"),typeof f!="function")throw new Error("No callback provided to pbkdf2");fc(nc(g).then(function(y){return y?es(h,n,s,o,g):pa(h,n,s,o,m)}),f)};Un.pbkdf2=ac;Un.pbkdf2Sync=Qh;var Qe={},yi={},Oe={};Oe.readUInt32BE=function(n,s){var o=n[0+s]<<24|n[1+s]<<16|n[2+s]<<8|n[3+s];return o>>>0};Oe.writeUInt32BE=function(n,s,o){n[0+o]=s>>>24,n[1+o]=s>>>16&255,n[2+o]=s>>>8&255,n[3+o]=s&255};Oe.ip=function(n,s,o,m){for(var f=0,g=0,y=6;y>=0;y-=2){for(var S=0;S<=24;S+=8)f<<=1,f|=s>>>S+y&1;for(var S=0;S<=24;S+=8)f<<=1,f|=n>>>S+y&1}for(var y=6;y>=0;y-=2){for(var S=1;S<=25;S+=8)g<<=1,g|=s>>>S+y&1;for(var S=1;S<=25;S+=8)g<<=1,g|=n>>>S+y&1}o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.rip=function(n,s,o,m){for(var f=0,g=0,y=0;y<4;y++)for(var S=24;S>=0;S-=8)f<<=1,f|=s>>>S+y&1,f<<=1,f|=n>>>S+y&1;for(var y=4;y<8;y++)for(var S=24;S>=0;S-=8)g<<=1,g|=s>>>S+y&1,g<<=1,g|=n>>>S+y&1;o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.pc1=function(n,s,o,m){for(var f=0,g=0,y=7;y>=5;y--){for(var S=0;S<=24;S+=8)f<<=1,f|=s>>S+y&1;for(var S=0;S<=24;S+=8)f<<=1,f|=n>>S+y&1}for(var S=0;S<=24;S+=8)f<<=1,f|=s>>S+y&1;for(var y=1;y<=3;y++){for(var S=0;S<=24;S+=8)g<<=1,g|=s>>S+y&1;for(var S=0;S<=24;S+=8)g<<=1,g|=n>>S+y&1}for(var S=0;S<=24;S+=8)g<<=1,g|=n>>S+y&1;o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.r28shl=function(n,s){return n<<s&268435455|n>>>28-s};var on=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];Oe.pc2=function(n,s,o,m){for(var f=0,g=0,y=on.length>>>1,S=0;S<y;S++)f<<=1,f|=n>>>on[S]&1;for(var S=y;S<on.length;S++)g<<=1,g|=s>>>on[S]&1;o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.expand=function(n,s,o){var m=0,f=0;m=(n&1)<<5|n>>>27;for(var g=23;g>=15;g-=4)m<<=6,m|=n>>>g&63;for(var g=11;g>=3;g-=4)f|=n>>>g&63,f<<=6;f|=(n&31)<<1|n>>>31,s[o+0]=m>>>0,s[o+1]=f>>>0};var ga=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];Oe.substitute=function(n,s){for(var o=0,m=0;m<4;m++){var f=n>>>18-m*6&63,g=ga[m*64+f];o<<=4,o|=g}for(var m=0;m<4;m++){var f=s>>>18-m*6&63,g=ga[4*64+m*64+f];o<<=4,o|=g}return o>>>0};var ba=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];Oe.permute=function(n){for(var s=0,o=0;o<ba.length;o++)s<<=1,s|=n>>>ba[o]&1;return s>>>0};Oe.padSplit=function(n,s,o){for(var m=n.toString(2);m.length<s;)m="0"+m;for(var f=[],g=0;g<s;g+=o)f.push(m.slice(g,g+o));return f.join(" ")};var We=rs;function rs(h,n){if(!h)throw new Error(n||"Assertion failed")}rs.equal=function(n,s,o){if(n!=s)throw new Error(o||"Assertion failed: "+n+" != "+s)};var hc=We;function Ve(h){this.options=h,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=h.padding!==!1}var x0=Ve;Ve.prototype._init=function(){};Ve.prototype.update=function(n){return n.length===0?[]:this.type==="decrypt"?this._updateDecrypt(n):this._updateEncrypt(n)};Ve.prototype._buffer=function(n,s){for(var o=Math.min(this.buffer.length-this.bufferOff,n.length-s),m=0;m<o;m++)this.buffer[this.bufferOff+m]=n[s+m];return this.bufferOff+=o,o};Ve.prototype._flushBuffer=function(n,s){return this._update(this.buffer,0,n,s),this.bufferOff=0,this.blockSize};Ve.prototype._updateEncrypt=function(n){var s=0,o=0,m=(this.bufferOff+n.length)/this.blockSize|0,f=new Array(m*this.blockSize);this.bufferOff!==0&&(s+=this._buffer(n,s),this.bufferOff===this.buffer.length&&(o+=this._flushBuffer(f,o)));for(var g=n.length-(n.length-s)%this.blockSize;s<g;s+=this.blockSize)this._update(n,s,f,o),o+=this.blockSize;for(;s<n.length;s++,this.bufferOff++)this.buffer[this.bufferOff]=n[s];return f};Ve.prototype._updateDecrypt=function(n){for(var s=0,o=0,m=Math.ceil((this.bufferOff+n.length)/this.blockSize)-1,f=new Array(m*this.blockSize);m>0;m--)s+=this._buffer(n,s),o+=this._flushBuffer(f,o);return s+=this._buffer(n,s),f};Ve.prototype.final=function(n){var s;n&&(s=this.update(n));var o;return this.type==="encrypt"?o=this._finalEncrypt():o=this._finalDecrypt(),s?s.concat(o):o};Ve.prototype._pad=function(n,s){if(s===0)return!1;for(;s<n.length;)n[s++]=0;return!0};Ve.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var n=new Array(this.blockSize);return this._update(this.buffer,0,n,0),n};Ve.prototype._unpad=function(n){return n};Ve.prototype._finalDecrypt=function(){hc.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var n=new Array(this.blockSize);return this._flushBuffer(n,0),this._unpad(n)};var is=We,sc=Jt,Me=Oe,ns=x0;function oc(){this.tmp=new Array(2),this.keys=null}function dr(h){ns.call(this,h);var n=new oc;this._desState=n,this.deriveKeys(n,h.key)}sc(dr,ns);var fs=dr;dr.create=function(n){return new dr(n)};var uc=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];dr.prototype.deriveKeys=function(n,s){n.keys=new Array(16*2),is.equal(s.length,this.blockSize,"Invalid key length");var o=Me.readUInt32BE(s,0),m=Me.readUInt32BE(s,4);Me.pc1(o,m,n.tmp,0),o=n.tmp[0],m=n.tmp[1];for(var f=0;f<n.keys.length;f+=2){var g=uc[f>>>1];o=Me.r28shl(o,g),m=Me.r28shl(m,g),Me.pc2(o,m,n.keys,f)}};dr.prototype._update=function(n,s,o,m){var f=this._desState,g=Me.readUInt32BE(n,s),y=Me.readUInt32BE(n,s+4);Me.ip(g,y,f.tmp,0),g=f.tmp[0],y=f.tmp[1],this.type==="encrypt"?this._encrypt(f,g,y,f.tmp,0):this._decrypt(f,g,y,f.tmp,0),g=f.tmp[0],y=f.tmp[1],Me.writeUInt32BE(o,g,m),Me.writeUInt32BE(o,y,m+4)};dr.prototype._pad=function(n,s){if(this.padding===!1)return!1;for(var o=n.length-s,m=s;m<n.length;m++)n[m]=o;return!0};dr.prototype._unpad=function(n){if(this.padding===!1)return n;for(var s=n[n.length-1],o=n.length-s;o<n.length;o++)is.equal(n[o],s);return n.slice(0,n.length-s)};dr.prototype._encrypt=function(n,s,o,m,f){for(var g=s,y=o,S=0;S<n.keys.length;S+=2){var B=n.keys[S],M=n.keys[S+1];Me.expand(y,n.tmp,0),B^=n.tmp[0],M^=n.tmp[1];var x=Me.substitute(B,M),I=Me.permute(x),k=y;y=(g^I)>>>0,g=k}Me.rip(y,g,m,f)};dr.prototype._decrypt=function(n,s,o,m,f){for(var g=o,y=s,S=n.keys.length-2;S>=0;S-=2){var B=n.keys[S],M=n.keys[S+1];Me.expand(g,n.tmp,0),B^=n.tmp[0],M^=n.tmp[1];var x=Me.substitute(B,M),I=Me.permute(x),k=g;g=(y^I)>>>0,y=k}Me.rip(g,y,m,f)};var as={},lc=We,dc=Jt,_n={};function cc(h){lc.equal(h.length,8,"Invalid IV length"),this.iv=new Array(8);for(var n=0;n<this.iv.length;n++)this.iv[n]=h[n]}function vc(h){function n(f){h.call(this,f),this._cbcInit()}dc(n,h);for(var s=Object.keys(_n),o=0;o<s.length;o++){var m=s[o];n.prototype[m]=_n[m]}return n.create=function(g){return new n(g)},n}as.instantiate=vc;_n._cbcInit=function(){var n=new cc(this.options.iv);this._cbcState=n};_n._update=function(n,s,o,m){var f=this._cbcState,g=this.constructor.super_.prototype,y=f.iv;if(this.type==="encrypt"){for(var S=0;S<this.blockSize;S++)y[S]^=n[s+S];g._update.call(this,y,0,o,m);for(var S=0;S<this.blockSize;S++)y[S]=o[m+S]}else{g._update.call(this,n,s,o,m);for(var S=0;S<this.blockSize;S++)o[m+S]^=y[S];for(var S=0;S<this.blockSize;S++)y[S]=n[s+S]}};var pc=We,mc=Jt,hs=x0,qr=fs;function gc(h,n){pc.equal(n.length,24,"Invalid key length");var s=n.slice(0,8),o=n.slice(8,16),m=n.slice(16,24);h==="encrypt"?this.ciphers=[qr.create({type:"encrypt",key:s}),qr.create({type:"decrypt",key:o}),qr.create({type:"encrypt",key:m})]:this.ciphers=[qr.create({type:"decrypt",key:m}),qr.create({type:"encrypt",key:o}),qr.create({type:"decrypt",key:s})]}function Xr(h){hs.call(this,h);var n=new gc(this.type,this.options.key);this._edeState=n}mc(Xr,hs);var bc=Xr;Xr.create=function(n){return new Xr(n)};Xr.prototype._update=function(n,s,o,m){var f=this._edeState;f.ciphers[0]._update(n,s,o,m),f.ciphers[1]._update(o,m,o,m),f.ciphers[2]._update(o,m,o,m)};Xr.prototype._pad=qr.prototype._pad;Xr.prototype._unpad=qr.prototype._unpad;yi.utils=Oe;yi.Cipher=x0;yi.DES=fs;yi.CBC=as;yi.EDE=bc;var ss=$r,wr=yi,yc=Jt,Hr=Ot.Buffer,zi={"des-ede3-cbc":wr.CBC.instantiate(wr.EDE),"des-ede3":wr.EDE,"des-ede-cbc":wr.CBC.instantiate(wr.EDE),"des-ede":wr.EDE,"des-cbc":wr.CBC.instantiate(wr.DES),"des-ecb":wr.DES};zi.des=zi["des-cbc"];zi.des3=zi["des-ede3-cbc"];var wc=Ln;yc(Ln,ss);function Ln(h){ss.call(this);var n=h.mode.toLowerCase(),s=zi[n],o;h.decrypt?o="decrypt":o="encrypt";var m=h.key;Hr.isBuffer(m)||(m=Hr.from(m)),(n==="des-ede"||n==="des-ede-cbc")&&(m=Hr.concat([m,m.slice(0,8)]));var f=h.iv;Hr.isBuffer(f)||(f=Hr.from(f)),this._des=s.create({key:m,iv:f,type:o})}Ln.prototype._update=function(h){return Hr.from(this._des.update(h))};Ln.prototype._final=function(){return Hr.from(this._des.final())};var Le={},_0={},S0={};S0.encrypt=function(h,n){return h._cipher.encryptBlock(n)};S0.decrypt=function(h,n){return h._cipher.decryptBlock(n)};var A0={},sr=[],He=[],Mc=typeof Uint8Array!="undefined"?Uint8Array:Array,B0=!1;function os(){B0=!0;for(var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=h.length;n<s;++n)sr[n]=h[n],He[h.charCodeAt(n)]=n;He["-".charCodeAt(0)]=62,He["_".charCodeAt(0)]=63}function xc(h){B0||os();var n,s,o,m,f,g,y=h.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=h[y-2]==="="?2:h[y-1]==="="?1:0,g=new Mc(y*3/4-f),o=f>0?y-4:y;var S=0;for(n=0,s=0;n<o;n+=4,s+=3)m=He[h.charCodeAt(n)]<<18|He[h.charCodeAt(n+1)]<<12|He[h.charCodeAt(n+2)]<<6|He[h.charCodeAt(n+3)],g[S++]=m>>16&255,g[S++]=m>>8&255,g[S++]=m&255;return f===2?(m=He[h.charCodeAt(n)]<<2|He[h.charCodeAt(n+1)]>>4,g[S++]=m&255):f===1&&(m=He[h.charCodeAt(n)]<<10|He[h.charCodeAt(n+1)]<<4|He[h.charCodeAt(n+2)]>>2,g[S++]=m>>8&255,g[S++]=m&255),g}function _c(h){return sr[h>>18&63]+sr[h>>12&63]+sr[h>>6&63]+sr[h&63]}function Sc(h,n,s){for(var o,m=[],f=n;f<s;f+=3)o=(h[f]<<16)+(h[f+1]<<8)+h[f+2],m.push(_c(o));return m.join("")}function ya(h){B0||os();for(var n,s=h.length,o=s%3,m="",f=[],g=16383,y=0,S=s-o;y<S;y+=g)f.push(Sc(h,y,y+g>S?S:y+g));return o===1?(n=h[s-1],m+=sr[n>>2],m+=sr[n<<4&63],m+="=="):o===2&&(n=(h[s-2]<<8)+h[s-1],m+=sr[n>>10],m+=sr[n>>4&63],m+=sr[n<<2&63],m+="="),f.push(m),f.join("")}function On(h,n,s,o,m){var f,g,y=m*8-o-1,S=(1<<y)-1,B=S>>1,M=-7,x=s?m-1:0,I=s?-1:1,k=h[n+x];for(x+=I,f=k&(1<<-M)-1,k>>=-M,M+=y;M>0;f=f*256+h[n+x],x+=I,M-=8);for(g=f&(1<<-M)-1,f>>=-M,M+=o;M>0;g=g*256+h[n+x],x+=I,M-=8);if(f===0)f=1-B;else{if(f===S)return g?NaN:(k?-1:1)*(1/0);g=g+Math.pow(2,o),f=f-B}return(k?-1:1)*g*Math.pow(2,f-o)}function us(h,n,s,o,m,f){var g,y,S,B=f*8-m-1,M=(1<<B)-1,x=M>>1,I=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=o?0:f-1,D=o?1:-1,L=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(y=isNaN(n)?1:0,g=M):(g=Math.floor(Math.log(n)/Math.LN2),n*(S=Math.pow(2,-g))<1&&(g--,S*=2),g+x>=1?n+=I/S:n+=I*Math.pow(2,1-x),n*S>=2&&(g++,S/=2),g+x>=M?(y=0,g=M):g+x>=1?(y=(n*S-1)*Math.pow(2,m),g=g+x):(y=n*Math.pow(2,x-1)*Math.pow(2,m),g=0));m>=8;h[s+k]=y&255,k+=D,y/=256,m-=8);for(g=g<<m|y,B+=m;B>0;h[s+k]=g&255,k+=D,g/=256,B-=8);h[s+k-D]|=L*128}var Ac={}.toString,ls=Array.isArray||function(h){return Ac.call(h)=="[object Array]"};/*!
8
8
  * The buffer module from node.js, for the browser.
9
9
  *
@@ -1209,7 +1209,11 @@ class yu {
1209
1209
  try {
1210
1210
  const y = JSON.parse(f.data);
1211
1211
  if (console.log("[WebSocketTransport] Message received:", y), y.type === "ping") {
1212
- this.socket && this.socket.readyState === 1 ? this.socket.send(JSON.stringify({ type: "pong" })) : console.warn("[WebSocketTransport] Cannot send pong: socket not ready");
1212
+ this.socket && this.socket.readyState === 1 && this.socket.send(JSON.stringify({ type: "pong" }));
1213
+ return;
1214
+ }
1215
+ if (y.type === "pong") {
1216
+ console.log("[WebSocketTransport] Pong received");
1213
1217
  return;
1214
1218
  }
1215
1219
  y.type === "flags" && (console.log("[WebSocketTransport] Flags update received"), this.flags = y.flags, this.initialFlagsReceived = !0, (g = this.onFlagsUpdatedCallback) == null || g.call(this, this.flags));
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(h){const n=hi,o=vf,s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.Buffer=y,h.SlowBuffer=$,h.INSPECT_MAX_BYTES=50;const m=2147483647;h.kMaxLength=m,y.TYPED_ARRAY_SUPPORT=f(),!y.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const E=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(E,w),E.foo()===42}catch(E){return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function g(E){if(E>m)throw new RangeError('The value "'+E+'" is invalid for option "size"');const w=new Uint8Array(E);return Object.setPrototypeOf(w,y.prototype),w}function y(E,w,A){if(typeof E=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(E)}return S(E,w,A)}y.poolSize=8192;function S(E,w,A){if(typeof E=="string")return I(E,w);if(ArrayBuffer.isView(E))return D(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(dt(E,ArrayBuffer)||E&&dt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(dt(E,SharedArrayBuffer)||E&&dt(E.buffer,SharedArrayBuffer)))return L(E,w,A);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=E.valueOf&&E.valueOf();if(T!=null&&T!==E)return y.from(T,w,A);const F=W(E);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return y.from(E[Symbol.toPrimitive]("string"),w,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}y.from=function(E,w,A){return S(E,w,A)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function B(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function M(E,w,A){return B(E),E<=0?g(E):w!==void 0?typeof A=="string"?g(E).fill(w,A):g(E).fill(w):g(E)}y.alloc=function(E,w,A){return M(E,w,A)};function x(E){return B(E),g(E<0?0:z(E)|0)}y.allocUnsafe=function(E){return x(E)},y.allocUnsafeSlow=function(E){return x(E)};function I(E,w){if((typeof w!="string"||w==="")&&(w="utf8"),!y.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const A=lt(E,w)|0;let T=g(A);const F=T.write(E,w);return F!==A&&(T=T.slice(0,F)),T}function k(E){const w=E.length<0?0:z(E.length)|0,A=g(w);for(let T=0;T<w;T+=1)A[T]=E[T]&255;return A}function D(E){if(dt(E,Uint8Array)){const w=new Uint8Array(E);return L(w.buffer,w.byteOffset,w.byteLength)}return k(E)}function L(E,w,A){if(w<0||E.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<w+(A||0))throw new RangeError('"length" is outside of buffer bounds');let T;return w===void 0&&A===void 0?T=new Uint8Array(E):A===void 0?T=new Uint8Array(E,w):T=new Uint8Array(E,w,A),Object.setPrototypeOf(T,y.prototype),T}function W(E){if(y.isBuffer(E)){const w=z(E.length)|0,A=g(w);return A.length===0||E.copy(A,0,0,w),A}if(E.length!==void 0)return typeof E.length!="number"||Pt(E.length)?g(0):k(E);if(E.type==="Buffer"&&Array.isArray(E.data))return k(E.data)}function z(E){if(E>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return E|0}function $(E){return+E!=E&&(E=0),y.alloc(+E)}y.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==y.prototype},y.compare=function(w,A){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),dt(A,Uint8Array)&&(A=y.from(A,A.offset,A.byteLength)),!y.isBuffer(w)||!y.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===A)return 0;let T=w.length,F=A.length;for(let V=0,U=Math.min(T,F);V<U;++V)if(w[V]!==A[V]){T=w[V],F=A[V];break}return T<F?-1:F<T?1:0},y.isEncoding=function(w){switch(String(w).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}},y.concat=function(w,A){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return y.alloc(0);let T;if(A===void 0)for(A=0,T=0;T<w.length;++T)A+=w[T].length;const F=y.allocUnsafe(A);let V=0;for(T=0;T<w.length;++T){let U=w[T];if(dt(U,Uint8Array))V+U.length>F.length?(y.isBuffer(U)||(U=y.from(U)),U.copy(F,V)):Uint8Array.prototype.set.call(F,U,V);else if(y.isBuffer(U))U.copy(F,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=U.length}return F};function lt(E,w){if(y.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||dt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const A=E.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&A===0)return 0;let F=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Nt(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Dt(E).length;default:if(F)return T?-1:Nt(E).length;w=(""+w).toLowerCase(),F=!0}}y.byteLength=lt;function H(E,w,A){let T=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,w>>>=0,A<=w))return"";for(E||(E="utf8");;)switch(E){case"hex":return u(this,w,A);case"utf8":case"utf-8":return i(this,w,A);case"ascii":return c(this,w,A);case"latin1":case"binary":return v(this,w,A);case"base64":return r(this,w,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e(this,w,A);default:if(T)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),T=!0}}y.prototype._isBuffer=!0;function At(E,w,A){const T=E[w];E[w]=E[A],E[A]=T}y.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<w;A+=2)At(this,A,A+1);return this},y.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<w;A+=4)At(this,A,A+3),At(this,A+1,A+2);return this},y.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<w;A+=8)At(this,A,A+7),At(this,A+1,A+6),At(this,A+2,A+5),At(this,A+3,A+4);return this},y.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?i(this,0,w):H.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(w){if(!y.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:y.compare(this,w)===0},y.prototype.inspect=function(){let w="";const A=h.INSPECT_MAX_BYTES;return w=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(w+=" ... "),"<Buffer "+w+">"},s&&(y.prototype[s]=y.prototype.inspect),y.prototype.compare=function(w,A,T,F,V){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),!y.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(A===void 0&&(A=0),T===void 0&&(T=w?w.length:0),F===void 0&&(F=0),V===void 0&&(V=this.length),A<0||T>w.length||F<0||V>this.length)throw new RangeError("out of range index");if(F>=V&&A>=T)return 0;if(F>=V)return-1;if(A>=T)return 1;if(A>>>=0,T>>>=0,F>>>=0,V>>>=0,this===w)return 0;let U=V-F,X=T-A;const Tt=Math.min(U,X),G=this.slice(F,V),rt=w.slice(A,T);for(let Rt=0;Rt<Tt;++Rt)if(G[Rt]!==rt[Rt]){U=G[Rt],X=rt[Rt];break}return U<X?-1:X<U?1:0};function Bt(E,w,A,T,F){if(E.length===0)return-1;if(typeof A=="string"?(T=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,Pt(A)&&(A=F?0:E.length-1),A<0&&(A=E.length+A),A>=E.length){if(F)return-1;A=E.length-1}else if(A<0)if(F)A=0;else return-1;if(typeof w=="string"&&(w=y.from(w,T)),y.isBuffer(w))return w.length===0?-1:Ct(E,w,A,T,F);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(E,w,A):Uint8Array.prototype.lastIndexOf.call(E,w,A):Ct(E,[w],A,T,F);throw new TypeError("val must be string, number or Buffer")}function Ct(E,w,A,T,F){let V=1,U=E.length,X=w.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(E.length<2||w.length<2)return-1;V=2,U/=2,X/=2,A/=2}function Tt(rt,Rt){return V===1?rt[Rt]:rt.readUInt16BE(Rt*V)}let G;if(F){let rt=-1;for(G=A;G<U;G++)if(Tt(E,G)===Tt(w,rt===-1?0:G-rt)){if(rt===-1&&(rt=G),G-rt+1===X)return rt*V}else rt!==-1&&(G-=G-rt),rt=-1}else for(A+X>U&&(A=U-X),G=A;G>=0;G--){let rt=!0;for(let Rt=0;Rt<X;Rt++)if(Tt(E,G+Rt)!==Tt(w,Rt)){rt=!1;break}if(rt)return G}return-1}y.prototype.includes=function(w,A,T){return this.indexOf(w,A,T)!==-1},y.prototype.indexOf=function(w,A,T){return Bt(this,w,A,T,!0)},y.prototype.lastIndexOf=function(w,A,T){return Bt(this,w,A,T,!1)};function Et(E,w,A,T){A=Number(A)||0;const F=E.length-A;T?(T=Number(T),T>F&&(T=F)):T=F;const V=w.length;T>V/2&&(T=V/2);let U;for(U=0;U<T;++U){const X=parseInt(w.substr(U*2,2),16);if(Pt(X))return U;E[A+U]=X}return U}function Y(E,w,A,T){return j(Nt(w,E.length-A),E,A,T)}function It(E,w,A,T){return j(et(w),E,A,T)}function p(E,w,A,T){return j(Dt(w),E,A,T)}function t(E,w,A,T){return j(pt(w,E.length-A),E,A,T)}y.prototype.write=function(w,A,T,F){if(A===void 0)F="utf8",T=this.length,A=0;else if(T===void 0&&typeof A=="string")F=A,T=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(T)?(T=T>>>0,F===void 0&&(F="utf8")):(F=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-A;if((T===void 0||T>V)&&(T=V),w.length>0&&(T<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let U=!1;for(;;)switch(F){case"hex":return Et(this,w,A,T);case"utf8":case"utf-8":return Y(this,w,A,T);case"ascii":case"latin1":case"binary":return It(this,w,A,T);case"base64":return p(this,w,A,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t(this,w,A,T);default:if(U)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),U=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function r(E,w,A){return w===0&&A===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(w,A))}function i(E,w,A){A=Math.min(E.length,A);const T=[];let F=w;for(;F<A;){const V=E[F];let U=null,X=V>239?4:V>223?3:V>191?2:1;if(F+X<=A){let Tt,G,rt,Rt;switch(X){case 1:V<128&&(U=V);break;case 2:Tt=E[F+1],(Tt&192)===128&&(Rt=(V&31)<<6|Tt&63,Rt>127&&(U=Rt));break;case 3:Tt=E[F+1],G=E[F+2],(Tt&192)===128&&(G&192)===128&&(Rt=(V&15)<<12|(Tt&63)<<6|G&63,Rt>2047&&(Rt<55296||Rt>57343)&&(U=Rt));break;case 4:Tt=E[F+1],G=E[F+2],rt=E[F+3],(Tt&192)===128&&(G&192)===128&&(rt&192)===128&&(Rt=(V&15)<<18|(Tt&63)<<12|(G&63)<<6|rt&63,Rt>65535&&Rt<1114112&&(U=Rt))}}U===null?(U=65533,X=1):U>65535&&(U-=65536,T.push(U>>>10&1023|55296),U=56320|U&1023),T.push(U),F+=X}return d(T)}const a=4096;function d(E){const w=E.length;if(w<=a)return String.fromCharCode.apply(String,E);let A="",T=0;for(;T<w;)A+=String.fromCharCode.apply(String,E.slice(T,T+=a));return A}function c(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]&127);return T}function v(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]);return T}function u(E,w,A){const T=E.length;(!w||w<0)&&(w=0),(!A||A<0||A>T)&&(A=T);let F="";for(let V=w;V<A;++V)F+=Q[E[V]];return F}function e(E,w,A){const T=E.slice(w,A);let F="";for(let V=0;V<T.length-1;V+=2)F+=String.fromCharCode(T[V]+T[V+1]*256);return F}y.prototype.slice=function(w,A){const T=this.length;w=~~w,A=A===void 0?T:~~A,w<0?(w+=T,w<0&&(w=0)):w>T&&(w=T),A<0?(A+=T,A<0&&(A=0)):A>T&&(A=T),A<w&&(A=w);const F=this.subarray(w,A);return Object.setPrototypeOf(F,y.prototype),F};function l(E,w,A){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+w>A)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return F},y.prototype.readUintBE=y.prototype.readUIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w+--A],V=1;for(;A>0&&(V*=256);)F+=this[w+--A]*V;return F},y.prototype.readUint8=y.prototype.readUInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]|this[w+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]<<8|this[w+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},y.prototype.readBigUInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=A+this[++w]*me(2,8)+this[++w]*me(2,16)+this[++w]*me(2,24),V=this[++w]+this[++w]*me(2,8)+this[++w]*me(2,16)+T*me(2,24);return BigInt(F)+(BigInt(V)<<BigInt(32))}),y.prototype.readBigUInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=A*me(2,24)+this[++w]*me(2,16)+this[++w]*me(2,8)+this[++w],V=this[++w]*me(2,24)+this[++w]*me(2,16)+this[++w]*me(2,8)+T;return(BigInt(F)<<BigInt(32))+BigInt(V)}),y.prototype.readIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return V*=128,F>=V&&(F-=Math.pow(2,8*A)),F},y.prototype.readIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=A,V=1,U=this[w+--F];for(;F>0&&(V*=256);)U+=this[w+--F]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*A)),U},y.prototype.readInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},y.prototype.readInt16LE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w]|this[w+1]<<8;return T&32768?T|4294901760:T},y.prototype.readInt16BE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w+1]|this[w]<<8;return T&32768?T|4294901760:T},y.prototype.readInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},y.prototype.readInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},y.prototype.readBigInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=this[w+4]+this[w+5]*me(2,8)+this[w+6]*me(2,16)+(T<<24);return(BigInt(F)<<BigInt(32))+BigInt(A+this[++w]*me(2,8)+this[++w]*me(2,16)+this[++w]*me(2,24))}),y.prototype.readBigInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=(A<<24)+this[++w]*me(2,16)+this[++w]*me(2,8)+this[++w];return(BigInt(F)<<BigInt(32))+BigInt(this[++w]*me(2,24)+this[++w]*me(2,16)+this[++w]*me(2,8)+T)}),y.prototype.readFloatLE=function(w,A){return w=w>>>0,A||l(w,4,this.length),o.read(this,w,!0,23,4)},y.prototype.readFloatBE=function(w,A){return w=w>>>0,A||l(w,4,this.length),o.read(this,w,!1,23,4)},y.prototype.readDoubleLE=function(w,A){return w=w>>>0,A||l(w,8,this.length),o.read(this,w,!0,52,8)},y.prototype.readDoubleBE=function(w,A){return w=w>>>0,A||l(w,8,this.length),o.read(this,w,!1,52,8)};function b(E,w,A,T,F,V){if(!y.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>F||w<V)throw new RangeError('"value" argument is out of bounds');if(A+T>E.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=1,U=0;for(this[A]=w&255;++U<T&&(V*=256);)this[A+U]=w/V&255;return A+T},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=T-1,U=1;for(this[A+V]=w&255;--V>=0&&(U*=256);)this[A+V]=w/U&255;return A+T},y.prototype.writeUint8=y.prototype.writeUInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,255,0),this[A]=w&255,A+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A+3]=w>>>24,this[A+2]=w>>>16,this[A+1]=w>>>8,this[A]=w&255,A+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4};function _(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,A}function C(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A+7]=V,V=V>>8,E[A+6]=V,V=V>>8,E[A+5]=V,V=V>>8,E[A+4]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A+3]=U,U=U>>8,E[A+2]=U,U=U>>8,E[A+1]=U,U=U>>8,E[A]=U,A+8}y.prototype.writeBigUInt64LE=ct(function(w,A=0){return _(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=ct(function(w,A=0){return C(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=0,U=1,X=0;for(this[A]=w&255;++V<T&&(U*=256);)w<0&&X===0&&this[A+V-1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=T-1,U=1,X=0;for(this[A+V]=w&255;--V>=0&&(U*=256);)w<0&&X===0&&this[A+V+1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,127,-128),w<0&&(w=255+w+1),this[A]=w&255,A+1},y.prototype.writeInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),this[A]=w&255,this[A+1]=w>>>8,this[A+2]=w>>>16,this[A+3]=w>>>24,A+4},y.prototype.writeInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4},y.prototype.writeBigInt64LE=ct(function(w,A=0){return _(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=ct(function(w,A=0){return C(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function q(E,w,A,T,F,V){if(A+T>E.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function O(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,4),o.write(E,w,A,T,23,4),A+4}y.prototype.writeFloatLE=function(w,A,T){return O(this,w,A,!0,T)},y.prototype.writeFloatBE=function(w,A,T){return O(this,w,A,!1,T)};function R(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,8),o.write(E,w,A,T,52,8),A+8}y.prototype.writeDoubleLE=function(w,A,T){return R(this,w,A,!0,T)},y.prototype.writeDoubleBE=function(w,A,T){return R(this,w,A,!1,T)},y.prototype.copy=function(w,A,T,F){if(!y.isBuffer(w))throw new TypeError("argument should be a Buffer");if(T||(T=0),!F&&F!==0&&(F=this.length),A>=w.length&&(A=w.length),A||(A=0),F>0&&F<T&&(F=T),F===T||w.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=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),w.length-A<F-T&&(F=w.length-A+T);const V=F-T;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(A,T,F):Uint8Array.prototype.set.call(w,this.subarray(T,F),A),V},y.prototype.fill=function(w,A,T,F){if(typeof w=="string"){if(typeof A=="string"?(F=A,A=0,T=this.length):typeof T=="string"&&(F=T,T=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!y.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(w.length===1){const U=w.charCodeAt(0);(F==="utf8"&&U<128||F==="latin1")&&(w=U)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(A<0||this.length<A||this.length<T)throw new RangeError("Out of range index");if(T<=A)return this;A=A>>>0,T=T===void 0?this.length:T>>>0,w||(w=0);let V;if(typeof w=="number")for(V=A;V<T;++V)this[V]=w;else{const U=y.isBuffer(w)?w:y.from(w,F),X=U.length;if(X===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(V=0;V<T-A;++V)this[V+A]=U[V%X]}return this};const P={};function N(E,w,A){P[E]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(E,w){return`The "${E}" argument must be of type number. Received type ${typeof w}`},TypeError),N("ERR_OUT_OF_RANGE",function(E,w,A){let T=`The value of "${E}" is out of range.`,F=A;return Number.isInteger(A)&&Math.abs(A)>me(2,32)?F=K(String(A)):typeof A=="bigint"&&(F=String(A),(A>me(BigInt(2),BigInt(32))||A<-me(BigInt(2),BigInt(32)))&&(F=K(F)),F+="n"),T+=` It must be ${w}. Received ${F}`,T},RangeError);function K(E){let w="",A=E.length;const T=E[0]==="-"?1:0;for(;A>=T+4;A-=3)w=`_${E.slice(A-3,A)}${w}`;return`${E.slice(0,A)}${w}`}function kt(E,w,A){J(w,"offset"),(E[w]===void 0||E[w+A]===void 0)&&qt(w,E.length-(A+1))}function Z(E,w,A,T,F,V){if(E>A||E<w){const U=typeof w=="bigint"?"n":"";let X;throw V>3?w===0||w===BigInt(0)?X=`>= 0${U} and < 2${U} ** ${(V+1)*8}${U}`:X=`>= -(2${U} ** ${(V+1)*8-1}${U}) and < 2 ** ${(V+1)*8-1}${U}`:X=`>= ${w}${U} and <= ${A}${U}`,new P.ERR_OUT_OF_RANGE("value",X,E)}kt(T,F,V)}function J(E,w){if(typeof E!="number")throw new P.ERR_INVALID_ARG_TYPE(w,"number",E)}function qt(E,w,A){throw Math.floor(E)!==E?(J(E,A),new P.ERR_OUT_OF_RANGE(A||"offset","an integer",E)):w<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${w}`,E)}const tt=/[^+/0-9A-Za-z-_]/g;function vt(E){if(E=E.split("=")[0],E=E.trim().replace(tt,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Nt(E,w){w=w||1/0;let A;const T=E.length;let F=null;const V=[];for(let U=0;U<T;++U){if(A=E.charCodeAt(U),A>55295&&A<57344){if(!F){if(A>56319){(w-=3)>-1&&V.push(239,191,189);continue}else if(U+1===T){(w-=3)>-1&&V.push(239,191,189);continue}F=A;continue}if(A<56320){(w-=3)>-1&&V.push(239,191,189),F=A;continue}A=(F-55296<<10|A-56320)+65536}else F&&(w-=3)>-1&&V.push(239,191,189);if(F=null,A<128){if((w-=1)<0)break;V.push(A)}else if(A<2048){if((w-=2)<0)break;V.push(A>>6|192,A&63|128)}else if(A<65536){if((w-=3)<0)break;V.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((w-=4)<0)break;V.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return V}function et(E){const w=[];for(let A=0;A<E.length;++A)w.push(E.charCodeAt(A)&255);return w}function pt(E,w){let A,T,F;const V=[];for(let U=0;U<E.length&&!((w-=2)<0);++U)A=E.charCodeAt(U),T=A>>8,F=A%256,V.push(F),V.push(T);return V}function Dt(E){return n.toByteArray(vt(E))}function j(E,w,A,T){let F;for(F=0;F<T&&!(F+A>=w.length||F>=E.length);++F)w[F+A]=E[F];return F}function dt(E,w){return E instanceof w||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===w.name}function Pt(E){return E!==E}const Q=function(){const E="0123456789abcdef",w=new Array(256);for(let A=0;A<16;++A){const T=A*16;for(let F=0;F<16;++F)w[T+F]=E[A]+E[F]}return w}();function ct(E){return typeof BigInt=="undefined"?Ot:E}function Ot(){throw new Error("BigInt not supported")}})(Ke);class na{constructor(n,o,s,m={}){this.endpoint=n,this.apiKey=o,this.isStopped=!1,this.pollTimeoutId=null,this.currentFlags={},this.consecutiveErrors=0,this.currentBackoffMs=0,this.pollIntervalMs=m.pollIntervalMs||1e4,this.maxBackoffMs=m.maxBackoffMs||6e4,this.backoffMultiplier=m.backoffMultiplier||2,this.currentContext=s}init(){return De(this,null,function*(){try{this.currentFlags=yield this.fetchFlags(this.currentContext),this.consecutiveErrors=0,console.log("[LongPollingTransport] Initial fetch complete")}catch(n){console.error("[LongPollingTransport] Initial fetch failed:",n)}this.scheduleNextPoll()})}scheduleNextPoll(){if(this.isStopped)return;const n=this.pollIntervalMs+this.currentBackoffMs;console.log(`[LongPollingTransport] Next poll in ${n}ms`+(this.currentBackoffMs>0?` (backoff: ${this.currentBackoffMs}ms)`:"")),this.pollTimeoutId=setTimeout(()=>De(this,null,function*(){yield this.poll(),this.scheduleNextPoll()}),n)}poll(){return De(this,null,function*(){var n;try{const o=yield this.fetchFlags(this.currentContext);this.consecutiveErrors>0&&(console.log("[LongPollingTransport] ✅ Recovered from errors"),this.consecutiveErrors=0,this.currentBackoffMs=0),this.flagsChanged(o)&&(console.log("[LongPollingTransport] Flags changed, notifying..."),this.currentFlags=o,(n=this.onUpdateCallback)==null||n.call(this,o))}catch(o){console.error("[LongPollingTransport] ❌ Poll error:",o),this.consecutiveErrors++,this.applyBackoff()}})}applyBackoff(){if(this.consecutiveErrors===1)this.currentBackoffMs=0;else{const n=this.pollIntervalMs*Math.pow(this.backoffMultiplier,this.consecutiveErrors-2);this.currentBackoffMs=Math.min(n,this.maxBackoffMs),console.warn(`[LongPollingTransport] Backing off ${this.currentBackoffMs}ms (${this.consecutiveErrors} consecutive errors)`)}}flagsChanged(n){return JSON.stringify(n)!==JSON.stringify(this.currentFlags)}fetchFlags(n){return De(this,null,function*(){this.currentContext=n;const o=yield fetch(this.endpoint,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify({context:n})});if(o.status===401||o.status===403)throw new Error("Unauthorized: Invalid API key");if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return(yield o.json()).data})}onFlagsUpdated(n){this.onUpdateCallback=n}destroy(){console.log("[LongPollingTransport] Destroying..."),this.isStopped=!0,this.pollTimeoutId!==null&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null),this.onUpdateCallback=void 0}}class fa{constructor(n,o,s=5,m=1e3){this.wsUrl=n,this.apiKey=o,this.maxRetries=s,this.initialBackoffMs=m,this.socket=null,this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.retries=0,this.reconnectTimeoutId=null,this.heartbeatIntervalId=null,this.lastHeartbeatTime=0,this.heartbeatTimeoutMs=3e4}init(){return De(this,null,function*(){yield this.connectWithRetry(),yield this.waitForInitialFlags()})}waitForInitialFlags(){return this.initialFlagsReceived?Promise.resolve():(this.initialFlagsPromise||(this.initialFlagsPromise=new Promise(n=>{const o=setInterval(()=>{this.initialFlagsReceived&&(clearInterval(o),n())},50);setTimeout(()=>{clearInterval(o),console.warn("[WebSocketTransport] Initial flags timeout"),n()},5e3)})),this.initialFlagsPromise)}connectWithRetry(){return new Promise((n,o)=>{const s=()=>{try{this.cleanupSocket(),this.setConnectionState("connecting");const m=this.getWebSocketImplementation();this.socket=new m(`${this.wsUrl}?apiKey=${this.apiKey}`),this.socket.onopen=()=>{console.log("[WebSocketTransport] Connected"),this.isReady=!0,this.retries=0,this.setConnectionState("connected"),this.context&&this.sendContext(this.context),this.startHeartbeat(),n()},this.socket.onmessage=f=>{var g;this.lastHeartbeatTime=Date.now();try{const y=JSON.parse(f.data);if(console.log("[WebSocketTransport] Message received:",y),y.type==="ping"){this.socket&&this.socket.readyState===1?this.socket.send(JSON.stringify({type:"pong"})):console.warn("[WebSocketTransport] Cannot send pong: socket not ready");return}y.type==="flags"&&(console.log("[WebSocketTransport] Flags update received"),this.flags=y.flags,this.initialFlagsReceived=!0,(g=this.onFlagsUpdatedCallback)==null||g.call(this,this.flags))}catch(y){console.warn("[WebSocketTransport] Failed to parse message:",y)}},this.socket.onerror=f=>{console.error("[WebSocketTransport] Error:",f)},this.socket.onclose=f=>{if(console.log("[WebSocketTransport] Connection closed:",f.code),this.isReady=!1,this.stopHeartbeat(),this.setConnectionState("disconnected"),f.code===1008||f.code===4001){this.setConnectionState("failed"),o(new Error("Unauthorized: Invalid API key"));return}if(this.retries<this.maxRetries){const g=this.initialBackoffMs*Math.pow(2,this.retries);console.warn(`[WebSocketTransport] Reconnecting in ${g}ms (attempt ${this.retries+1})`),this.setConnectionState("reconnecting"),this.reconnectTimeoutId=setTimeout(s,g),this.retries++}else this.setConnectionState("failed"),o(new Error(`WebSocket failed after ${this.retries} retries`))}}catch(m){console.error("[WebSocketTransport] Failed to create socket:",m),this.setConnectionState("failed"),o(m)}};s()})}cleanupSocket(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===1&&this.socket.close(),this.socket=null)}startHeartbeat(){this.lastHeartbeatTime=Date.now(),this.heartbeatIntervalId=setInterval(()=>{var o,s;if(Date.now()-this.lastHeartbeatTime>this.heartbeatTimeoutMs){console.warn("[WebSocketTransport] Heartbeat timeout, reconnecting..."),(o=this.socket)==null||o.close();return}((s=this.socket)==null?void 0:s.readyState)===1&&this.socket.send(JSON.stringify({type:"ping"}))},1e4)}stopHeartbeat(){this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}setConnectionState(n){var o;(o=this.onConnectionStateCallback)==null||o.call(this,n)}getWebSocketImplementation(){if(typeof WebSocket!="undefined")return WebSocket;try{const n=require("ws");return n.default||n}catch(n){throw new Error('WebSocket not available. Install "ws" package for Node.js: npm install ws')}}fetchFlags(n){return De(this,null,function*(){var o;return this.context=n,this.isReady&&((o=this.socket)==null?void 0:o.readyState)===1&&this.sendContext(n),this.flags})}onFlagsUpdated(n){this.onFlagsUpdatedCallback=n}onConnectionStateChanged(n){this.onConnectionStateCallback=n}destroy(){console.log("[WebSocketTransport] Destroying..."),this.stopHeartbeat(),this.reconnectTimeoutId!==null&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null),this.cleanupSocket(),this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.onFlagsUpdatedCallback=void 0,this.onConnectionStateCallback=void 0,this.retries=0}sendContext(n){if(!this.socket||this.socket.readyState!==1){console.warn("[WebSocketTransport] Socket not ready, cannot send context");return}const o=JSON.stringify({type:"context",context:n});this.socket.send(o)}}function aa(h,n){if(h.type!=="rule")return!1;const o=h.attribute.split(".").reduce((s,m)=>s==null?void 0:s[m],n);switch(h.operator){case"eq":return o===h.value;case"neq":return o!==h.value;case"in":return Array.isArray(h.value)&&h.value.includes(o);case"nin":return Array.isArray(h.value)&&!h.value.includes(o);case"gt":return typeof o=="number"&&typeof h.value=="number"&&o>h.value;case"lt":return typeof o=="number"&&typeof h.value=="number"&&o<h.value;case"exists":return o!=null;case"not_exists":return o==null;default:return!1}}function Mu(h,n){return h.rules.every(o=>aa(o,n))}var Lt={};const Ti=typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{};function ha(){throw new Error("setTimeout has not been defined")}function sa(){throw new Error("clearTimeout has not been defined")}var qr=ha,Pr=sa;typeof Ti.setTimeout=="function"&&(qr=setTimeout),typeof Ti.clearTimeout=="function"&&(Pr=clearTimeout);function oa(h){if(qr===setTimeout)return setTimeout(h,0);if((qr===ha||!qr)&&setTimeout)return qr=setTimeout,setTimeout(h,0);try{return qr(h,0)}catch(n){try{return qr.call(null,h,0)}catch(o){return qr.call(this,h,0)}}}function xu(h){if(Pr===clearTimeout)return clearTimeout(h);if((Pr===sa||!Pr)&&clearTimeout)return Pr=clearTimeout,clearTimeout(h);try{return Pr(h)}catch(n){try{return Pr.call(null,h)}catch(o){return Pr.call(this,h)}}}var _r=[],oi=!1,Hr,dn=-1;function _u(){!oi||!Hr||(oi=!1,Hr.length?_r=Hr.concat(_r):dn=-1,_r.length&&ua())}function ua(){if(!oi){var h=oa(_u);oi=!0;for(var n=_r.length;n;){for(Hr=_r,_r=[];++dn<n;)Hr&&Hr[dn].run();dn=-1,n=_r.length}Hr=null,oi=!1,xu(h)}}function Su(h){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];_r.push(new la(h,n)),_r.length===1&&!oi&&oa(ua)}function la(h,n){this.fun=h,this.array=n}la.prototype.run=function(){this.fun.apply(null,this.array)};var Au="browser",Bu="browser",Eu=!0,ku={},Iu=[],Ru="",Tu={},Cu={},Fu={};function Zr(){}var qu=Zr,Pu=Zr,Du=Zr,Nu=Zr,$u=Zr,Uu=Zr,Lu=Zr;function Ou(h){throw new Error("process.binding is not supported")}function zu(){return"/"}function Ku(h){throw new Error("process.chdir is not supported")}function Hu(){return 0}var ui=Ti.performance||{},Zu=ui.now||ui.mozNow||ui.msNow||ui.oNow||ui.webkitNow||function(){return new Date().getTime()};function Wu(h){var n=Zu.call(ui)*.001,o=Math.floor(n),s=Math.floor(n%1*1e9);return h&&(o=o-h[0],s=s-h[1],s<0&&(o--,s+=1e9)),[o,s]}var Vu=new Date;function Yu(){var h=new Date,n=h-Vu;return n/1e3}var ye={nextTick:Su,title:Au,browser:Eu,env:ku,argv:Iu,version:Ru,versions:Tu,on:qu,addListener:Pu,once:Du,off:Nu,removeListener:$u,removeAllListeners:Uu,emit:Lu,binding:Ou,cwd:zu,chdir:Ku,umask:Hu,hrtime:Wu,platform:Bu,release:Cu,config:Fu,uptime:Yu},pf={exports:{}},mf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(h,n){var o=Ke,s=o.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?h.exports=o:(m(o,n),n.Buffer=f);function f(g,y,S){return s(g,y,S)}f.prototype=Object.create(s.prototype),m(s,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return s(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=s(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o.SlowBuffer(g)}})(mf,mf.exports);var zt=mf.exports,gf=65536,Ju=4294967295;function Gu(){throw new Error(`Secure random number generation is not supported by this browser.
6
+ */(function(h){const n=hi,o=vf,s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.Buffer=y,h.SlowBuffer=$,h.INSPECT_MAX_BYTES=50;const m=2147483647;h.kMaxLength=m,y.TYPED_ARRAY_SUPPORT=f(),!y.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const E=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(E,w),E.foo()===42}catch(E){return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function g(E){if(E>m)throw new RangeError('The value "'+E+'" is invalid for option "size"');const w=new Uint8Array(E);return Object.setPrototypeOf(w,y.prototype),w}function y(E,w,A){if(typeof E=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(E)}return S(E,w,A)}y.poolSize=8192;function S(E,w,A){if(typeof E=="string")return I(E,w);if(ArrayBuffer.isView(E))return D(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(dt(E,ArrayBuffer)||E&&dt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(dt(E,SharedArrayBuffer)||E&&dt(E.buffer,SharedArrayBuffer)))return L(E,w,A);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=E.valueOf&&E.valueOf();if(T!=null&&T!==E)return y.from(T,w,A);const F=W(E);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return y.from(E[Symbol.toPrimitive]("string"),w,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}y.from=function(E,w,A){return S(E,w,A)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function B(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function M(E,w,A){return B(E),E<=0?g(E):w!==void 0?typeof A=="string"?g(E).fill(w,A):g(E).fill(w):g(E)}y.alloc=function(E,w,A){return M(E,w,A)};function x(E){return B(E),g(E<0?0:z(E)|0)}y.allocUnsafe=function(E){return x(E)},y.allocUnsafeSlow=function(E){return x(E)};function I(E,w){if((typeof w!="string"||w==="")&&(w="utf8"),!y.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const A=lt(E,w)|0;let T=g(A);const F=T.write(E,w);return F!==A&&(T=T.slice(0,F)),T}function k(E){const w=E.length<0?0:z(E.length)|0,A=g(w);for(let T=0;T<w;T+=1)A[T]=E[T]&255;return A}function D(E){if(dt(E,Uint8Array)){const w=new Uint8Array(E);return L(w.buffer,w.byteOffset,w.byteLength)}return k(E)}function L(E,w,A){if(w<0||E.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<w+(A||0))throw new RangeError('"length" is outside of buffer bounds');let T;return w===void 0&&A===void 0?T=new Uint8Array(E):A===void 0?T=new Uint8Array(E,w):T=new Uint8Array(E,w,A),Object.setPrototypeOf(T,y.prototype),T}function W(E){if(y.isBuffer(E)){const w=z(E.length)|0,A=g(w);return A.length===0||E.copy(A,0,0,w),A}if(E.length!==void 0)return typeof E.length!="number"||Pt(E.length)?g(0):k(E);if(E.type==="Buffer"&&Array.isArray(E.data))return k(E.data)}function z(E){if(E>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return E|0}function $(E){return+E!=E&&(E=0),y.alloc(+E)}y.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==y.prototype},y.compare=function(w,A){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),dt(A,Uint8Array)&&(A=y.from(A,A.offset,A.byteLength)),!y.isBuffer(w)||!y.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===A)return 0;let T=w.length,F=A.length;for(let V=0,U=Math.min(T,F);V<U;++V)if(w[V]!==A[V]){T=w[V],F=A[V];break}return T<F?-1:F<T?1:0},y.isEncoding=function(w){switch(String(w).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}},y.concat=function(w,A){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return y.alloc(0);let T;if(A===void 0)for(A=0,T=0;T<w.length;++T)A+=w[T].length;const F=y.allocUnsafe(A);let V=0;for(T=0;T<w.length;++T){let U=w[T];if(dt(U,Uint8Array))V+U.length>F.length?(y.isBuffer(U)||(U=y.from(U)),U.copy(F,V)):Uint8Array.prototype.set.call(F,U,V);else if(y.isBuffer(U))U.copy(F,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=U.length}return F};function lt(E,w){if(y.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||dt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const A=E.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&A===0)return 0;let F=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Nt(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Dt(E).length;default:if(F)return T?-1:Nt(E).length;w=(""+w).toLowerCase(),F=!0}}y.byteLength=lt;function H(E,w,A){let T=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,w>>>=0,A<=w))return"";for(E||(E="utf8");;)switch(E){case"hex":return u(this,w,A);case"utf8":case"utf-8":return i(this,w,A);case"ascii":return c(this,w,A);case"latin1":case"binary":return v(this,w,A);case"base64":return r(this,w,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e(this,w,A);default:if(T)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),T=!0}}y.prototype._isBuffer=!0;function At(E,w,A){const T=E[w];E[w]=E[A],E[A]=T}y.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<w;A+=2)At(this,A,A+1);return this},y.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<w;A+=4)At(this,A,A+3),At(this,A+1,A+2);return this},y.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<w;A+=8)At(this,A,A+7),At(this,A+1,A+6),At(this,A+2,A+5),At(this,A+3,A+4);return this},y.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?i(this,0,w):H.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(w){if(!y.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:y.compare(this,w)===0},y.prototype.inspect=function(){let w="";const A=h.INSPECT_MAX_BYTES;return w=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(w+=" ... "),"<Buffer "+w+">"},s&&(y.prototype[s]=y.prototype.inspect),y.prototype.compare=function(w,A,T,F,V){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),!y.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(A===void 0&&(A=0),T===void 0&&(T=w?w.length:0),F===void 0&&(F=0),V===void 0&&(V=this.length),A<0||T>w.length||F<0||V>this.length)throw new RangeError("out of range index");if(F>=V&&A>=T)return 0;if(F>=V)return-1;if(A>=T)return 1;if(A>>>=0,T>>>=0,F>>>=0,V>>>=0,this===w)return 0;let U=V-F,X=T-A;const Tt=Math.min(U,X),G=this.slice(F,V),rt=w.slice(A,T);for(let Rt=0;Rt<Tt;++Rt)if(G[Rt]!==rt[Rt]){U=G[Rt],X=rt[Rt];break}return U<X?-1:X<U?1:0};function Bt(E,w,A,T,F){if(E.length===0)return-1;if(typeof A=="string"?(T=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,Pt(A)&&(A=F?0:E.length-1),A<0&&(A=E.length+A),A>=E.length){if(F)return-1;A=E.length-1}else if(A<0)if(F)A=0;else return-1;if(typeof w=="string"&&(w=y.from(w,T)),y.isBuffer(w))return w.length===0?-1:Ct(E,w,A,T,F);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(E,w,A):Uint8Array.prototype.lastIndexOf.call(E,w,A):Ct(E,[w],A,T,F);throw new TypeError("val must be string, number or Buffer")}function Ct(E,w,A,T,F){let V=1,U=E.length,X=w.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(E.length<2||w.length<2)return-1;V=2,U/=2,X/=2,A/=2}function Tt(rt,Rt){return V===1?rt[Rt]:rt.readUInt16BE(Rt*V)}let G;if(F){let rt=-1;for(G=A;G<U;G++)if(Tt(E,G)===Tt(w,rt===-1?0:G-rt)){if(rt===-1&&(rt=G),G-rt+1===X)return rt*V}else rt!==-1&&(G-=G-rt),rt=-1}else for(A+X>U&&(A=U-X),G=A;G>=0;G--){let rt=!0;for(let Rt=0;Rt<X;Rt++)if(Tt(E,G+Rt)!==Tt(w,Rt)){rt=!1;break}if(rt)return G}return-1}y.prototype.includes=function(w,A,T){return this.indexOf(w,A,T)!==-1},y.prototype.indexOf=function(w,A,T){return Bt(this,w,A,T,!0)},y.prototype.lastIndexOf=function(w,A,T){return Bt(this,w,A,T,!1)};function Et(E,w,A,T){A=Number(A)||0;const F=E.length-A;T?(T=Number(T),T>F&&(T=F)):T=F;const V=w.length;T>V/2&&(T=V/2);let U;for(U=0;U<T;++U){const X=parseInt(w.substr(U*2,2),16);if(Pt(X))return U;E[A+U]=X}return U}function Y(E,w,A,T){return j(Nt(w,E.length-A),E,A,T)}function It(E,w,A,T){return j(et(w),E,A,T)}function p(E,w,A,T){return j(Dt(w),E,A,T)}function t(E,w,A,T){return j(pt(w,E.length-A),E,A,T)}y.prototype.write=function(w,A,T,F){if(A===void 0)F="utf8",T=this.length,A=0;else if(T===void 0&&typeof A=="string")F=A,T=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(T)?(T=T>>>0,F===void 0&&(F="utf8")):(F=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-A;if((T===void 0||T>V)&&(T=V),w.length>0&&(T<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let U=!1;for(;;)switch(F){case"hex":return Et(this,w,A,T);case"utf8":case"utf-8":return Y(this,w,A,T);case"ascii":case"latin1":case"binary":return It(this,w,A,T);case"base64":return p(this,w,A,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t(this,w,A,T);default:if(U)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),U=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function r(E,w,A){return w===0&&A===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(w,A))}function i(E,w,A){A=Math.min(E.length,A);const T=[];let F=w;for(;F<A;){const V=E[F];let U=null,X=V>239?4:V>223?3:V>191?2:1;if(F+X<=A){let Tt,G,rt,Rt;switch(X){case 1:V<128&&(U=V);break;case 2:Tt=E[F+1],(Tt&192)===128&&(Rt=(V&31)<<6|Tt&63,Rt>127&&(U=Rt));break;case 3:Tt=E[F+1],G=E[F+2],(Tt&192)===128&&(G&192)===128&&(Rt=(V&15)<<12|(Tt&63)<<6|G&63,Rt>2047&&(Rt<55296||Rt>57343)&&(U=Rt));break;case 4:Tt=E[F+1],G=E[F+2],rt=E[F+3],(Tt&192)===128&&(G&192)===128&&(rt&192)===128&&(Rt=(V&15)<<18|(Tt&63)<<12|(G&63)<<6|rt&63,Rt>65535&&Rt<1114112&&(U=Rt))}}U===null?(U=65533,X=1):U>65535&&(U-=65536,T.push(U>>>10&1023|55296),U=56320|U&1023),T.push(U),F+=X}return d(T)}const a=4096;function d(E){const w=E.length;if(w<=a)return String.fromCharCode.apply(String,E);let A="",T=0;for(;T<w;)A+=String.fromCharCode.apply(String,E.slice(T,T+=a));return A}function c(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]&127);return T}function v(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]);return T}function u(E,w,A){const T=E.length;(!w||w<0)&&(w=0),(!A||A<0||A>T)&&(A=T);let F="";for(let V=w;V<A;++V)F+=Q[E[V]];return F}function e(E,w,A){const T=E.slice(w,A);let F="";for(let V=0;V<T.length-1;V+=2)F+=String.fromCharCode(T[V]+T[V+1]*256);return F}y.prototype.slice=function(w,A){const T=this.length;w=~~w,A=A===void 0?T:~~A,w<0?(w+=T,w<0&&(w=0)):w>T&&(w=T),A<0?(A+=T,A<0&&(A=0)):A>T&&(A=T),A<w&&(A=w);const F=this.subarray(w,A);return Object.setPrototypeOf(F,y.prototype),F};function l(E,w,A){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+w>A)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return F},y.prototype.readUintBE=y.prototype.readUIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w+--A],V=1;for(;A>0&&(V*=256);)F+=this[w+--A]*V;return F},y.prototype.readUint8=y.prototype.readUInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]|this[w+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]<<8|this[w+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},y.prototype.readBigUInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=A+this[++w]*me(2,8)+this[++w]*me(2,16)+this[++w]*me(2,24),V=this[++w]+this[++w]*me(2,8)+this[++w]*me(2,16)+T*me(2,24);return BigInt(F)+(BigInt(V)<<BigInt(32))}),y.prototype.readBigUInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=A*me(2,24)+this[++w]*me(2,16)+this[++w]*me(2,8)+this[++w],V=this[++w]*me(2,24)+this[++w]*me(2,16)+this[++w]*me(2,8)+T;return(BigInt(F)<<BigInt(32))+BigInt(V)}),y.prototype.readIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return V*=128,F>=V&&(F-=Math.pow(2,8*A)),F},y.prototype.readIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=A,V=1,U=this[w+--F];for(;F>0&&(V*=256);)U+=this[w+--F]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*A)),U},y.prototype.readInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},y.prototype.readInt16LE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w]|this[w+1]<<8;return T&32768?T|4294901760:T},y.prototype.readInt16BE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w+1]|this[w]<<8;return T&32768?T|4294901760:T},y.prototype.readInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},y.prototype.readInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},y.prototype.readBigInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=this[w+4]+this[w+5]*me(2,8)+this[w+6]*me(2,16)+(T<<24);return(BigInt(F)<<BigInt(32))+BigInt(A+this[++w]*me(2,8)+this[++w]*me(2,16)+this[++w]*me(2,24))}),y.prototype.readBigInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&qt(w,this.length-8);const F=(A<<24)+this[++w]*me(2,16)+this[++w]*me(2,8)+this[++w];return(BigInt(F)<<BigInt(32))+BigInt(this[++w]*me(2,24)+this[++w]*me(2,16)+this[++w]*me(2,8)+T)}),y.prototype.readFloatLE=function(w,A){return w=w>>>0,A||l(w,4,this.length),o.read(this,w,!0,23,4)},y.prototype.readFloatBE=function(w,A){return w=w>>>0,A||l(w,4,this.length),o.read(this,w,!1,23,4)},y.prototype.readDoubleLE=function(w,A){return w=w>>>0,A||l(w,8,this.length),o.read(this,w,!0,52,8)},y.prototype.readDoubleBE=function(w,A){return w=w>>>0,A||l(w,8,this.length),o.read(this,w,!1,52,8)};function b(E,w,A,T,F,V){if(!y.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>F||w<V)throw new RangeError('"value" argument is out of bounds');if(A+T>E.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=1,U=0;for(this[A]=w&255;++U<T&&(V*=256);)this[A+U]=w/V&255;return A+T},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=T-1,U=1;for(this[A+V]=w&255;--V>=0&&(U*=256);)this[A+V]=w/U&255;return A+T},y.prototype.writeUint8=y.prototype.writeUInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,255,0),this[A]=w&255,A+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A+3]=w>>>24,this[A+2]=w>>>16,this[A+1]=w>>>8,this[A]=w&255,A+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4};function _(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,A}function C(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A+7]=V,V=V>>8,E[A+6]=V,V=V>>8,E[A+5]=V,V=V>>8,E[A+4]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A+3]=U,U=U>>8,E[A+2]=U,U=U>>8,E[A+1]=U,U=U>>8,E[A]=U,A+8}y.prototype.writeBigUInt64LE=ct(function(w,A=0){return _(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=ct(function(w,A=0){return C(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=0,U=1,X=0;for(this[A]=w&255;++V<T&&(U*=256);)w<0&&X===0&&this[A+V-1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=T-1,U=1,X=0;for(this[A+V]=w&255;--V>=0&&(U*=256);)w<0&&X===0&&this[A+V+1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,127,-128),w<0&&(w=255+w+1),this[A]=w&255,A+1},y.prototype.writeInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),this[A]=w&255,this[A+1]=w>>>8,this[A+2]=w>>>16,this[A+3]=w>>>24,A+4},y.prototype.writeInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4},y.prototype.writeBigInt64LE=ct(function(w,A=0){return _(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=ct(function(w,A=0){return C(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function q(E,w,A,T,F,V){if(A+T>E.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function O(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,4),o.write(E,w,A,T,23,4),A+4}y.prototype.writeFloatLE=function(w,A,T){return O(this,w,A,!0,T)},y.prototype.writeFloatBE=function(w,A,T){return O(this,w,A,!1,T)};function R(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,8),o.write(E,w,A,T,52,8),A+8}y.prototype.writeDoubleLE=function(w,A,T){return R(this,w,A,!0,T)},y.prototype.writeDoubleBE=function(w,A,T){return R(this,w,A,!1,T)},y.prototype.copy=function(w,A,T,F){if(!y.isBuffer(w))throw new TypeError("argument should be a Buffer");if(T||(T=0),!F&&F!==0&&(F=this.length),A>=w.length&&(A=w.length),A||(A=0),F>0&&F<T&&(F=T),F===T||w.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=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),w.length-A<F-T&&(F=w.length-A+T);const V=F-T;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(A,T,F):Uint8Array.prototype.set.call(w,this.subarray(T,F),A),V},y.prototype.fill=function(w,A,T,F){if(typeof w=="string"){if(typeof A=="string"?(F=A,A=0,T=this.length):typeof T=="string"&&(F=T,T=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!y.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(w.length===1){const U=w.charCodeAt(0);(F==="utf8"&&U<128||F==="latin1")&&(w=U)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(A<0||this.length<A||this.length<T)throw new RangeError("Out of range index");if(T<=A)return this;A=A>>>0,T=T===void 0?this.length:T>>>0,w||(w=0);let V;if(typeof w=="number")for(V=A;V<T;++V)this[V]=w;else{const U=y.isBuffer(w)?w:y.from(w,F),X=U.length;if(X===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(V=0;V<T-A;++V)this[V+A]=U[V%X]}return this};const P={};function N(E,w,A){P[E]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(E,w){return`The "${E}" argument must be of type number. Received type ${typeof w}`},TypeError),N("ERR_OUT_OF_RANGE",function(E,w,A){let T=`The value of "${E}" is out of range.`,F=A;return Number.isInteger(A)&&Math.abs(A)>me(2,32)?F=K(String(A)):typeof A=="bigint"&&(F=String(A),(A>me(BigInt(2),BigInt(32))||A<-me(BigInt(2),BigInt(32)))&&(F=K(F)),F+="n"),T+=` It must be ${w}. Received ${F}`,T},RangeError);function K(E){let w="",A=E.length;const T=E[0]==="-"?1:0;for(;A>=T+4;A-=3)w=`_${E.slice(A-3,A)}${w}`;return`${E.slice(0,A)}${w}`}function kt(E,w,A){J(w,"offset"),(E[w]===void 0||E[w+A]===void 0)&&qt(w,E.length-(A+1))}function Z(E,w,A,T,F,V){if(E>A||E<w){const U=typeof w=="bigint"?"n":"";let X;throw V>3?w===0||w===BigInt(0)?X=`>= 0${U} and < 2${U} ** ${(V+1)*8}${U}`:X=`>= -(2${U} ** ${(V+1)*8-1}${U}) and < 2 ** ${(V+1)*8-1}${U}`:X=`>= ${w}${U} and <= ${A}${U}`,new P.ERR_OUT_OF_RANGE("value",X,E)}kt(T,F,V)}function J(E,w){if(typeof E!="number")throw new P.ERR_INVALID_ARG_TYPE(w,"number",E)}function qt(E,w,A){throw Math.floor(E)!==E?(J(E,A),new P.ERR_OUT_OF_RANGE(A||"offset","an integer",E)):w<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${w}`,E)}const tt=/[^+/0-9A-Za-z-_]/g;function vt(E){if(E=E.split("=")[0],E=E.trim().replace(tt,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Nt(E,w){w=w||1/0;let A;const T=E.length;let F=null;const V=[];for(let U=0;U<T;++U){if(A=E.charCodeAt(U),A>55295&&A<57344){if(!F){if(A>56319){(w-=3)>-1&&V.push(239,191,189);continue}else if(U+1===T){(w-=3)>-1&&V.push(239,191,189);continue}F=A;continue}if(A<56320){(w-=3)>-1&&V.push(239,191,189),F=A;continue}A=(F-55296<<10|A-56320)+65536}else F&&(w-=3)>-1&&V.push(239,191,189);if(F=null,A<128){if((w-=1)<0)break;V.push(A)}else if(A<2048){if((w-=2)<0)break;V.push(A>>6|192,A&63|128)}else if(A<65536){if((w-=3)<0)break;V.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((w-=4)<0)break;V.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return V}function et(E){const w=[];for(let A=0;A<E.length;++A)w.push(E.charCodeAt(A)&255);return w}function pt(E,w){let A,T,F;const V=[];for(let U=0;U<E.length&&!((w-=2)<0);++U)A=E.charCodeAt(U),T=A>>8,F=A%256,V.push(F),V.push(T);return V}function Dt(E){return n.toByteArray(vt(E))}function j(E,w,A,T){let F;for(F=0;F<T&&!(F+A>=w.length||F>=E.length);++F)w[F+A]=E[F];return F}function dt(E,w){return E instanceof w||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===w.name}function Pt(E){return E!==E}const Q=function(){const E="0123456789abcdef",w=new Array(256);for(let A=0;A<16;++A){const T=A*16;for(let F=0;F<16;++F)w[T+F]=E[A]+E[F]}return w}();function ct(E){return typeof BigInt=="undefined"?Ot:E}function Ot(){throw new Error("BigInt not supported")}})(Ke);class na{constructor(n,o,s,m={}){this.endpoint=n,this.apiKey=o,this.isStopped=!1,this.pollTimeoutId=null,this.currentFlags={},this.consecutiveErrors=0,this.currentBackoffMs=0,this.pollIntervalMs=m.pollIntervalMs||1e4,this.maxBackoffMs=m.maxBackoffMs||6e4,this.backoffMultiplier=m.backoffMultiplier||2,this.currentContext=s}init(){return De(this,null,function*(){try{this.currentFlags=yield this.fetchFlags(this.currentContext),this.consecutiveErrors=0,console.log("[LongPollingTransport] Initial fetch complete")}catch(n){console.error("[LongPollingTransport] Initial fetch failed:",n)}this.scheduleNextPoll()})}scheduleNextPoll(){if(this.isStopped)return;const n=this.pollIntervalMs+this.currentBackoffMs;console.log(`[LongPollingTransport] Next poll in ${n}ms`+(this.currentBackoffMs>0?` (backoff: ${this.currentBackoffMs}ms)`:"")),this.pollTimeoutId=setTimeout(()=>De(this,null,function*(){yield this.poll(),this.scheduleNextPoll()}),n)}poll(){return De(this,null,function*(){var n;try{const o=yield this.fetchFlags(this.currentContext);this.consecutiveErrors>0&&(console.log("[LongPollingTransport] ✅ Recovered from errors"),this.consecutiveErrors=0,this.currentBackoffMs=0),this.flagsChanged(o)&&(console.log("[LongPollingTransport] Flags changed, notifying..."),this.currentFlags=o,(n=this.onUpdateCallback)==null||n.call(this,o))}catch(o){console.error("[LongPollingTransport] ❌ Poll error:",o),this.consecutiveErrors++,this.applyBackoff()}})}applyBackoff(){if(this.consecutiveErrors===1)this.currentBackoffMs=0;else{const n=this.pollIntervalMs*Math.pow(this.backoffMultiplier,this.consecutiveErrors-2);this.currentBackoffMs=Math.min(n,this.maxBackoffMs),console.warn(`[LongPollingTransport] Backing off ${this.currentBackoffMs}ms (${this.consecutiveErrors} consecutive errors)`)}}flagsChanged(n){return JSON.stringify(n)!==JSON.stringify(this.currentFlags)}fetchFlags(n){return De(this,null,function*(){this.currentContext=n;const o=yield fetch(this.endpoint,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify({context:n})});if(o.status===401||o.status===403)throw new Error("Unauthorized: Invalid API key");if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return(yield o.json()).data})}onFlagsUpdated(n){this.onUpdateCallback=n}destroy(){console.log("[LongPollingTransport] Destroying..."),this.isStopped=!0,this.pollTimeoutId!==null&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null),this.onUpdateCallback=void 0}}class fa{constructor(n,o,s=5,m=1e3){this.wsUrl=n,this.apiKey=o,this.maxRetries=s,this.initialBackoffMs=m,this.socket=null,this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.retries=0,this.reconnectTimeoutId=null,this.heartbeatIntervalId=null,this.lastHeartbeatTime=0,this.heartbeatTimeoutMs=3e4}init(){return De(this,null,function*(){yield this.connectWithRetry(),yield this.waitForInitialFlags()})}waitForInitialFlags(){return this.initialFlagsReceived?Promise.resolve():(this.initialFlagsPromise||(this.initialFlagsPromise=new Promise(n=>{const o=setInterval(()=>{this.initialFlagsReceived&&(clearInterval(o),n())},50);setTimeout(()=>{clearInterval(o),console.warn("[WebSocketTransport] Initial flags timeout"),n()},5e3)})),this.initialFlagsPromise)}connectWithRetry(){return new Promise((n,o)=>{const s=()=>{try{this.cleanupSocket(),this.setConnectionState("connecting");const m=this.getWebSocketImplementation();this.socket=new m(`${this.wsUrl}?apiKey=${this.apiKey}`),this.socket.onopen=()=>{console.log("[WebSocketTransport] Connected"),this.isReady=!0,this.retries=0,this.setConnectionState("connected"),this.context&&this.sendContext(this.context),this.startHeartbeat(),n()},this.socket.onmessage=f=>{var g;this.lastHeartbeatTime=Date.now();try{const y=JSON.parse(f.data);if(console.log("[WebSocketTransport] Message received:",y),y.type==="ping"){this.socket&&this.socket.readyState===1&&this.socket.send(JSON.stringify({type:"pong"}));return}if(y.type==="pong"){console.log("[WebSocketTransport] Pong received");return}y.type==="flags"&&(console.log("[WebSocketTransport] Flags update received"),this.flags=y.flags,this.initialFlagsReceived=!0,(g=this.onFlagsUpdatedCallback)==null||g.call(this,this.flags))}catch(y){console.warn("[WebSocketTransport] Failed to parse message:",y)}},this.socket.onerror=f=>{console.error("[WebSocketTransport] Error:",f)},this.socket.onclose=f=>{if(console.log("[WebSocketTransport] Connection closed:",f.code),this.isReady=!1,this.stopHeartbeat(),this.setConnectionState("disconnected"),f.code===1008||f.code===4001){this.setConnectionState("failed"),o(new Error("Unauthorized: Invalid API key"));return}if(this.retries<this.maxRetries){const g=this.initialBackoffMs*Math.pow(2,this.retries);console.warn(`[WebSocketTransport] Reconnecting in ${g}ms (attempt ${this.retries+1})`),this.setConnectionState("reconnecting"),this.reconnectTimeoutId=setTimeout(s,g),this.retries++}else this.setConnectionState("failed"),o(new Error(`WebSocket failed after ${this.retries} retries`))}}catch(m){console.error("[WebSocketTransport] Failed to create socket:",m),this.setConnectionState("failed"),o(m)}};s()})}cleanupSocket(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===1&&this.socket.close(),this.socket=null)}startHeartbeat(){this.lastHeartbeatTime=Date.now(),this.heartbeatIntervalId=setInterval(()=>{var o,s;if(Date.now()-this.lastHeartbeatTime>this.heartbeatTimeoutMs){console.warn("[WebSocketTransport] Heartbeat timeout, reconnecting..."),(o=this.socket)==null||o.close();return}((s=this.socket)==null?void 0:s.readyState)===1&&this.socket.send(JSON.stringify({type:"ping"}))},1e4)}stopHeartbeat(){this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}setConnectionState(n){var o;(o=this.onConnectionStateCallback)==null||o.call(this,n)}getWebSocketImplementation(){if(typeof WebSocket!="undefined")return WebSocket;try{const n=require("ws");return n.default||n}catch(n){throw new Error('WebSocket not available. Install "ws" package for Node.js: npm install ws')}}fetchFlags(n){return De(this,null,function*(){var o;return this.context=n,this.isReady&&((o=this.socket)==null?void 0:o.readyState)===1&&this.sendContext(n),this.flags})}onFlagsUpdated(n){this.onFlagsUpdatedCallback=n}onConnectionStateChanged(n){this.onConnectionStateCallback=n}destroy(){console.log("[WebSocketTransport] Destroying..."),this.stopHeartbeat(),this.reconnectTimeoutId!==null&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null),this.cleanupSocket(),this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.onFlagsUpdatedCallback=void 0,this.onConnectionStateCallback=void 0,this.retries=0}sendContext(n){if(!this.socket||this.socket.readyState!==1){console.warn("[WebSocketTransport] Socket not ready, cannot send context");return}const o=JSON.stringify({type:"context",context:n});this.socket.send(o)}}function aa(h,n){if(h.type!=="rule")return!1;const o=h.attribute.split(".").reduce((s,m)=>s==null?void 0:s[m],n);switch(h.operator){case"eq":return o===h.value;case"neq":return o!==h.value;case"in":return Array.isArray(h.value)&&h.value.includes(o);case"nin":return Array.isArray(h.value)&&!h.value.includes(o);case"gt":return typeof o=="number"&&typeof h.value=="number"&&o>h.value;case"lt":return typeof o=="number"&&typeof h.value=="number"&&o<h.value;case"exists":return o!=null;case"not_exists":return o==null;default:return!1}}function Mu(h,n){return h.rules.every(o=>aa(o,n))}var Lt={};const Ti=typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{};function ha(){throw new Error("setTimeout has not been defined")}function sa(){throw new Error("clearTimeout has not been defined")}var qr=ha,Pr=sa;typeof Ti.setTimeout=="function"&&(qr=setTimeout),typeof Ti.clearTimeout=="function"&&(Pr=clearTimeout);function oa(h){if(qr===setTimeout)return setTimeout(h,0);if((qr===ha||!qr)&&setTimeout)return qr=setTimeout,setTimeout(h,0);try{return qr(h,0)}catch(n){try{return qr.call(null,h,0)}catch(o){return qr.call(this,h,0)}}}function xu(h){if(Pr===clearTimeout)return clearTimeout(h);if((Pr===sa||!Pr)&&clearTimeout)return Pr=clearTimeout,clearTimeout(h);try{return Pr(h)}catch(n){try{return Pr.call(null,h)}catch(o){return Pr.call(this,h)}}}var _r=[],oi=!1,Hr,dn=-1;function _u(){!oi||!Hr||(oi=!1,Hr.length?_r=Hr.concat(_r):dn=-1,_r.length&&ua())}function ua(){if(!oi){var h=oa(_u);oi=!0;for(var n=_r.length;n;){for(Hr=_r,_r=[];++dn<n;)Hr&&Hr[dn].run();dn=-1,n=_r.length}Hr=null,oi=!1,xu(h)}}function Su(h){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];_r.push(new la(h,n)),_r.length===1&&!oi&&oa(ua)}function la(h,n){this.fun=h,this.array=n}la.prototype.run=function(){this.fun.apply(null,this.array)};var Au="browser",Bu="browser",Eu=!0,ku={},Iu=[],Ru="",Tu={},Cu={},Fu={};function Zr(){}var qu=Zr,Pu=Zr,Du=Zr,Nu=Zr,$u=Zr,Uu=Zr,Lu=Zr;function Ou(h){throw new Error("process.binding is not supported")}function zu(){return"/"}function Ku(h){throw new Error("process.chdir is not supported")}function Hu(){return 0}var ui=Ti.performance||{},Zu=ui.now||ui.mozNow||ui.msNow||ui.oNow||ui.webkitNow||function(){return new Date().getTime()};function Wu(h){var n=Zu.call(ui)*.001,o=Math.floor(n),s=Math.floor(n%1*1e9);return h&&(o=o-h[0],s=s-h[1],s<0&&(o--,s+=1e9)),[o,s]}var Vu=new Date;function Yu(){var h=new Date,n=h-Vu;return n/1e3}var ye={nextTick:Su,title:Au,browser:Eu,env:ku,argv:Iu,version:Ru,versions:Tu,on:qu,addListener:Pu,once:Du,off:Nu,removeListener:$u,removeAllListeners:Uu,emit:Lu,binding:Ou,cwd:zu,chdir:Ku,umask:Hu,hrtime:Wu,platform:Bu,release:Cu,config:Fu,uptime:Yu},pf={exports:{}},mf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(h,n){var o=Ke,s=o.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?h.exports=o:(m(o,n),n.Buffer=f);function f(g,y,S){return s(g,y,S)}f.prototype=Object.create(s.prototype),m(s,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return s(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=s(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o.SlowBuffer(g)}})(mf,mf.exports);var zt=mf.exports,gf=65536,Ju=4294967295;function Gu(){throw new Error(`Secure random number generation is not supported by this browser.
7
7
  Use Chrome, Firefox or Internet Explorer 11`)}var Xu=zt.Buffer,cn=Ft.crypto||Ft.msCrypto;cn&&cn.getRandomValues?pf.exports=ju:pf.exports=Gu;function ju(h,n){if(h>Ju)throw new RangeError("requested too many random bytes");var o=Xu.allocUnsafe(h);if(h>0)if(h>gf)for(var s=0;s<h;s+=gf)cn.getRandomValues(o.slice(s,s+gf));else cn.getRandomValues(o);return typeof n=="function"?ye.nextTick(function(){n(null,o)}):o}var li=pf.exports,bf={exports:{}};typeof Object.create=="function"?bf.exports=function(n,o){o&&(n.super_=o,n.prototype=Object.create(o.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:bf.exports=function(n,o){if(o){n.super_=o;var s=function(){};s.prototype=o.prototype,n.prototype=new s,n.prototype.constructor=n}};var Kt=bf.exports;const Ne=cf(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var or=zt.Buffer,da=Ne.Transform,Qu=Kt;function Dr(h){da.call(this),this._block=or.allocUnsafe(h),this._blockSize=h,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}Qu(Dr,da),Dr.prototype._transform=function(h,n,o){var s=null;try{this.update(h,n)}catch(m){s=m}o(s)},Dr.prototype._flush=function(h){var n=null;try{this.push(this.digest())}catch(o){n=o}h(n)};var tl=typeof Uint8Array!="undefined",el=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&ArrayBuffer.isView&&(or.prototype instanceof Uint8Array||or.TYPED_ARRAY_SUPPORT);function rl(h,n){if(h instanceof or)return h;if(typeof h=="string")return or.from(h,n);if(el&&ArrayBuffer.isView(h)){if(h.byteLength===0)return or.alloc(0);var o=or.from(h.buffer,h.byteOffset,h.byteLength);if(o.byteLength===h.byteLength)return o}if(tl&&h instanceof Uint8Array||or.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return or.from(h);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Dr.prototype.update=function(h,n){if(this._finalized)throw new Error("Digest already called");h=rl(h,n);for(var o=this._block,s=0;this._blockOffset+h.length-s>=this._blockSize;){for(var m=this._blockOffset;m<this._blockSize;)o[m++]=h[s++];this._update(),this._blockOffset=0}for(;s<h.length;)o[this._blockOffset++]=h[s++];for(var f=0,g=h.length*8;g>0;++f)this._length[f]+=g,g=this._length[f]/4294967296|0,g>0&&(this._length[f]-=4294967296*g);return this},Dr.prototype._update=function(){throw new Error("_update is not implemented")},Dr.prototype.digest=function(h){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var n=this._digest();h!==void 0&&(n=n.toString(h)),this._block.fill(0),this._blockOffset=0;for(var o=0;o<4;++o)this._length[o]=0;return n},Dr.prototype._digest=function(){throw new Error("_digest is not implemented")};var ca=Dr,il=Kt,va=ca,nl=zt.Buffer,fl=new Array(16);function vn(){va.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}il(vn,va),vn.prototype._update=function(){for(var h=fl,n=0;n<16;++n)h[n]=this._block.readInt32LE(n*4);var o=this._a,s=this._b,m=this._c,f=this._d;o=Te(o,s,m,f,h[0],3614090360,7),f=Te(f,o,s,m,h[1],3905402710,12),m=Te(m,f,o,s,h[2],606105819,17),s=Te(s,m,f,o,h[3],3250441966,22),o=Te(o,s,m,f,h[4],4118548399,7),f=Te(f,o,s,m,h[5],1200080426,12),m=Te(m,f,o,s,h[6],2821735955,17),s=Te(s,m,f,o,h[7],4249261313,22),o=Te(o,s,m,f,h[8],1770035416,7),f=Te(f,o,s,m,h[9],2336552879,12),m=Te(m,f,o,s,h[10],4294925233,17),s=Te(s,m,f,o,h[11],2304563134,22),o=Te(o,s,m,f,h[12],1804603682,7),f=Te(f,o,s,m,h[13],4254626195,12),m=Te(m,f,o,s,h[14],2792965006,17),s=Te(s,m,f,o,h[15],1236535329,22),o=Ce(o,s,m,f,h[1],4129170786,5),f=Ce(f,o,s,m,h[6],3225465664,9),m=Ce(m,f,o,s,h[11],643717713,14),s=Ce(s,m,f,o,h[0],3921069994,20),o=Ce(o,s,m,f,h[5],3593408605,5),f=Ce(f,o,s,m,h[10],38016083,9),m=Ce(m,f,o,s,h[15],3634488961,14),s=Ce(s,m,f,o,h[4],3889429448,20),o=Ce(o,s,m,f,h[9],568446438,5),f=Ce(f,o,s,m,h[14],3275163606,9),m=Ce(m,f,o,s,h[3],4107603335,14),s=Ce(s,m,f,o,h[8],1163531501,20),o=Ce(o,s,m,f,h[13],2850285829,5),f=Ce(f,o,s,m,h[2],4243563512,9),m=Ce(m,f,o,s,h[7],1735328473,14),s=Ce(s,m,f,o,h[12],2368359562,20),o=Fe(o,s,m,f,h[5],4294588738,4),f=Fe(f,o,s,m,h[8],2272392833,11),m=Fe(m,f,o,s,h[11],1839030562,16),s=Fe(s,m,f,o,h[14],4259657740,23),o=Fe(o,s,m,f,h[1],2763975236,4),f=Fe(f,o,s,m,h[4],1272893353,11),m=Fe(m,f,o,s,h[7],4139469664,16),s=Fe(s,m,f,o,h[10],3200236656,23),o=Fe(o,s,m,f,h[13],681279174,4),f=Fe(f,o,s,m,h[0],3936430074,11),m=Fe(m,f,o,s,h[3],3572445317,16),s=Fe(s,m,f,o,h[6],76029189,23),o=Fe(o,s,m,f,h[9],3654602809,4),f=Fe(f,o,s,m,h[12],3873151461,11),m=Fe(m,f,o,s,h[15],530742520,16),s=Fe(s,m,f,o,h[2],3299628645,23),o=qe(o,s,m,f,h[0],4096336452,6),f=qe(f,o,s,m,h[7],1126891415,10),m=qe(m,f,o,s,h[14],2878612391,15),s=qe(s,m,f,o,h[5],4237533241,21),o=qe(o,s,m,f,h[12],1700485571,6),f=qe(f,o,s,m,h[3],2399980690,10),m=qe(m,f,o,s,h[10],4293915773,15),s=qe(s,m,f,o,h[1],2240044497,21),o=qe(o,s,m,f,h[8],1873313359,6),f=qe(f,o,s,m,h[15],4264355552,10),m=qe(m,f,o,s,h[6],2734768916,15),s=qe(s,m,f,o,h[13],1309151649,21),o=qe(o,s,m,f,h[4],4149444226,6),f=qe(f,o,s,m,h[11],3174756917,10),m=qe(m,f,o,s,h[2],718787259,15),s=qe(s,m,f,o,h[9],3951481745,21),this._a=this._a+o|0,this._b=this._b+s|0,this._c=this._c+m|0,this._d=this._d+f|0},vn.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var h=nl.allocUnsafe(16);return h.writeInt32LE(this._a,0),h.writeInt32LE(this._b,4),h.writeInt32LE(this._c,8),h.writeInt32LE(this._d,12),h};function pn(h,n){return h<<n|h>>>32-n}function Te(h,n,o,s,m,f,g){return pn(h+(n&o|~n&s)+m+f|0,g)+n|0}function Ce(h,n,o,s,m,f,g){return pn(h+(n&s|o&~s)+m+f|0,g)+n|0}function Fe(h,n,o,s,m,f,g){return pn(h+(n^o^s)+m+f|0,g)+n|0}function qe(h,n,o,s,m,f,g){return pn(h+(o^(n|~s))+m+f|0,g)+n|0}var yf=vn,wf=Ke.Buffer,al=Kt,pa=ca,hl=new Array(16),Ci=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Fi=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],qi=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Pi=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Di=[0,1518500249,1859775393,2400959708,2840853838],Ni=[1352829926,1548603684,1836072691,2053994217,0];function mn(){pa.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}al(mn,pa),mn.prototype._update=function(){for(var h=hl,n=0;n<16;++n)h[n]=this._block.readInt32LE(n*4);for(var o=this._a|0,s=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=this._a|0,S=this._b|0,B=this._c|0,M=this._d|0,x=this._e|0,I=0;I<80;I+=1){var k,D;I<16?(k=ma(o,s,m,f,g,h[Ci[I]],Di[0],qi[I]),D=wa(y,S,B,M,x,h[Fi[I]],Ni[0],Pi[I])):I<32?(k=ga(o,s,m,f,g,h[Ci[I]],Di[1],qi[I]),D=ya(y,S,B,M,x,h[Fi[I]],Ni[1],Pi[I])):I<48?(k=ba(o,s,m,f,g,h[Ci[I]],Di[2],qi[I]),D=ba(y,S,B,M,x,h[Fi[I]],Ni[2],Pi[I])):I<64?(k=ya(o,s,m,f,g,h[Ci[I]],Di[3],qi[I]),D=ga(y,S,B,M,x,h[Fi[I]],Ni[3],Pi[I])):(k=wa(o,s,m,f,g,h[Ci[I]],Di[4],qi[I]),D=ma(y,S,B,M,x,h[Fi[I]],Ni[4],Pi[I])),o=g,g=f,f=Wr(m,10),m=s,s=k,y=x,x=M,M=Wr(B,10),B=S,S=D}var L=this._b+m+M|0;this._b=this._c+f+x|0,this._c=this._d+g+y|0,this._d=this._e+o+S|0,this._e=this._a+s+B|0,this._a=L},mn.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var h=wf.alloc?wf.alloc(20):new wf(20);return h.writeInt32LE(this._a,0),h.writeInt32LE(this._b,4),h.writeInt32LE(this._c,8),h.writeInt32LE(this._d,12),h.writeInt32LE(this._e,16),h};function Wr(h,n){return h<<n|h>>>32-n}function ma(h,n,o,s,m,f,g,y){return Wr(h+(n^o^s)+f+g|0,y)+m|0}function ga(h,n,o,s,m,f,g,y){return Wr(h+(n&o|~n&s)+f+g|0,y)+m|0}function ba(h,n,o,s,m,f,g,y){return Wr(h+((n|~o)^s)+f+g|0,y)+m|0}function ya(h,n,o,s,m,f,g,y){return Wr(h+(n&s|o&~s)+f+g|0,y)+m|0}function wa(h,n,o,s,m,f,g,y){return Wr(h+(n^(o|~s))+f+g|0,y)+m|0}var Mf=mn,Ma={exports:{}},xa=zt.Buffer;function gn(h,n){this._block=xa.alloc(h),this._finalSize=n,this._blockSize=h,this._len=0}gn.prototype.update=function(h,n){typeof h=="string"&&(n=n||"utf8",h=xa.from(h,n));for(var o=this._block,s=this._blockSize,m=h.length,f=this._len,g=0;g<m;){for(var y=f%s,S=Math.min(m-g,s-y),B=0;B<S;B++)o[y+B]=h[g+B];f+=S,g+=S,f%s===0&&this._update(o)}return this._len+=m,this},gn.prototype.digest=function(h){var n=this._len%this._blockSize;this._block[n]=128,this._block.fill(0,n+1),n>=this._finalSize&&(this._update(this._block),this._block.fill(0));var o=this._len*8;if(o<=4294967295)this._block.writeUInt32BE(o,this._blockSize-4);else{var s=(o&4294967295)>>>0,m=(o-s)/4294967296;this._block.writeUInt32BE(m,this._blockSize-8),this._block.writeUInt32BE(s,this._blockSize-4)}this._update(this._block);var f=this._hash();return h?f.toString(h):f},gn.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var di=gn,sl=Kt,_a=di,ol=zt.Buffer,ul=[1518500249,1859775393,-1894007588,-899497514],ll=new Array(80);function $i(){this.init(),this._w=ll,_a.call(this,64,56)}sl($i,_a),$i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function dl(h){return h<<5|h>>>27}function cl(h){return h<<30|h>>>2}function vl(h,n,o,s){return h===0?n&o|~n&s:h===2?n&o|n&s|o&s:n^o^s}$i.prototype._update=function(h){for(var n=this._w,o=this._a|0,s=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=0;y<16;++y)n[y]=h.readInt32BE(y*4);for(;y<80;++y)n[y]=n[y-3]^n[y-8]^n[y-14]^n[y-16];for(var S=0;S<80;++S){var B=~~(S/20),M=dl(o)+vl(B,s,m,f)+g+n[S]+ul[B]|0;g=f,f=m,m=cl(s),s=o,o=M}this._a=o+this._a|0,this._b=s+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0},$i.prototype._hash=function(){var h=ol.allocUnsafe(20);return h.writeInt32BE(this._a|0,0),h.writeInt32BE(this._b|0,4),h.writeInt32BE(this._c|0,8),h.writeInt32BE(this._d|0,12),h.writeInt32BE(this._e|0,16),h};var pl=$i,ml=Kt,Sa=di,gl=zt.Buffer,bl=[1518500249,1859775393,-1894007588,-899497514],yl=new Array(80);function Ui(){this.init(),this._w=yl,Sa.call(this,64,56)}ml(Ui,Sa),Ui.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function wl(h){return h<<1|h>>>31}function Ml(h){return h<<5|h>>>27}function xl(h){return h<<30|h>>>2}function _l(h,n,o,s){return h===0?n&o|~n&s:h===2?n&o|n&s|o&s:n^o^s}Ui.prototype._update=function(h){for(var n=this._w,o=this._a|0,s=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=0;y<16;++y)n[y]=h.readInt32BE(y*4);for(;y<80;++y)n[y]=wl(n[y-3]^n[y-8]^n[y-14]^n[y-16]);for(var S=0;S<80;++S){var B=~~(S/20),M=Ml(o)+_l(B,s,m,f)+g+n[S]+bl[B]|0;g=f,f=m,m=xl(s),s=o,o=M}this._a=o+this._a|0,this._b=s+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0},Ui.prototype._hash=function(){var h=gl.allocUnsafe(20);return h.writeInt32BE(this._a|0,0),h.writeInt32BE(this._b|0,4),h.writeInt32BE(this._c|0,8),h.writeInt32BE(this._d|0,12),h.writeInt32BE(this._e|0,16),h};var Sl=Ui,Al=Kt,Aa=di,Bl=zt.Buffer,El=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],kl=new Array(64);function Li(){this.init(),this._w=kl,Aa.call(this,64,56)}Al(Li,Aa),Li.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Il(h,n,o){return o^h&(n^o)}function Rl(h,n,o){return h&n|o&(h|n)}function Tl(h){return(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10)}function Cl(h){return(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7)}function Fl(h){return(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3}function ql(h){return(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10}Li.prototype._update=function(h){for(var n=this._w,o=this._a|0,s=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=this._f|0,S=this._g|0,B=this._h|0,M=0;M<16;++M)n[M]=h.readInt32BE(M*4);for(;M<64;++M)n[M]=ql(n[M-2])+n[M-7]+Fl(n[M-15])+n[M-16]|0;for(var x=0;x<64;++x){var I=B+Cl(g)+Il(g,y,S)+El[x]+n[x]|0,k=Tl(o)+Rl(o,s,m)|0;B=S,S=y,y=g,g=f+I|0,f=m,m=s,s=o,o=I+k|0}this._a=o+this._a|0,this._b=s+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0,this._f=y+this._f|0,this._g=S+this._g|0,this._h=B+this._h|0},Li.prototype._hash=function(){var h=Bl.allocUnsafe(32);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h.writeInt32BE(this._h,28),h};var Ba=Li,Pl=Kt,Dl=Ba,Nl=di,$l=zt.Buffer,Ul=new Array(64);function bn(){this.init(),this._w=Ul,Nl.call(this,64,56)}Pl(bn,Dl),bn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},bn.prototype._hash=function(){var h=$l.allocUnsafe(28);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h};var Ll=bn,Ol=Kt,Ea=di,zl=zt.Buffer,ka=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Kl=new Array(160);function Oi(){this.init(),this._w=Kl,Ea.call(this,128,112)}Ol(Oi,Ea),Oi.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ia(h,n,o){return o^h&(n^o)}function Ra(h,n,o){return h&n|o&(h|n)}function Ta(h,n){return(h>>>28|n<<4)^(n>>>2|h<<30)^(n>>>7|h<<25)}function Ca(h,n){return(h>>>14|n<<18)^(h>>>18|n<<14)^(n>>>9|h<<23)}function Hl(h,n){return(h>>>1|n<<31)^(h>>>8|n<<24)^h>>>7}function Zl(h,n){return(h>>>1|n<<31)^(h>>>8|n<<24)^(h>>>7|n<<25)}function Wl(h,n){return(h>>>19|n<<13)^(n>>>29|h<<3)^h>>>6}function Vl(h,n){return(h>>>19|n<<13)^(n>>>29|h<<3)^(h>>>6|n<<26)}function _e(h,n){return h>>>0<n>>>0?1:0}Oi.prototype._update=function(h){for(var n=this._w,o=this._ah|0,s=this._bh|0,m=this._ch|0,f=this._dh|0,g=this._eh|0,y=this._fh|0,S=this._gh|0,B=this._hh|0,M=this._al|0,x=this._bl|0,I=this._cl|0,k=this._dl|0,D=this._el|0,L=this._fl|0,W=this._gl|0,z=this._hl|0,$=0;$<32;$+=2)n[$]=h.readInt32BE($*4),n[$+1]=h.readInt32BE($*4+4);for(;$<160;$+=2){var lt=n[$-30],H=n[$-15*2+1],At=Hl(lt,H),Bt=Zl(H,lt);lt=n[$-2*2],H=n[$-2*2+1];var Ct=Wl(lt,H),Et=Vl(H,lt),Y=n[$-7*2],It=n[$-7*2+1],p=n[$-16*2],t=n[$-16*2+1],r=Bt+It|0,i=At+Y+_e(r,Bt)|0;r=r+Et|0,i=i+Ct+_e(r,Et)|0,r=r+t|0,i=i+p+_e(r,t)|0,n[$]=i,n[$+1]=r}for(var a=0;a<160;a+=2){i=n[a],r=n[a+1];var d=Ra(o,s,m),c=Ra(M,x,I),v=Ta(o,M),u=Ta(M,o),e=Ca(g,D),l=Ca(D,g),b=ka[a],_=ka[a+1],C=Ia(g,y,S),q=Ia(D,L,W),O=z+l|0,R=B+e+_e(O,z)|0;O=O+q|0,R=R+C+_e(O,q)|0,O=O+_|0,R=R+b+_e(O,_)|0,O=O+r|0,R=R+i+_e(O,r)|0;var P=u+c|0,N=v+d+_e(P,u)|0;B=S,z=W,S=y,W=L,y=g,L=D,D=k+O|0,g=f+R+_e(D,k)|0,f=m,k=I,m=s,I=x,s=o,x=M,M=O+P|0,o=R+N+_e(M,O)|0}this._al=this._al+M|0,this._bl=this._bl+x|0,this._cl=this._cl+I|0,this._dl=this._dl+k|0,this._el=this._el+D|0,this._fl=this._fl+L|0,this._gl=this._gl+W|0,this._hl=this._hl+z|0,this._ah=this._ah+o+_e(this._al,M)|0,this._bh=this._bh+s+_e(this._bl,x)|0,this._ch=this._ch+m+_e(this._cl,I)|0,this._dh=this._dh+f+_e(this._dl,k)|0,this._eh=this._eh+g+_e(this._el,D)|0,this._fh=this._fh+y+_e(this._fl,L)|0,this._gh=this._gh+S+_e(this._gl,W)|0,this._hh=this._hh+B+_e(this._hl,z)|0},Oi.prototype._hash=function(){var h=zl.allocUnsafe(64);function n(o,s,m){h.writeInt32BE(o,m),h.writeInt32BE(s,m+4)}return n(this._ah,this._al,0),n(this._bh,this._bl,8),n(this._ch,this._cl,16),n(this._dh,this._dl,24),n(this._eh,this._el,32),n(this._fh,this._fl,40),n(this._gh,this._gl,48),n(this._hh,this._hl,56),h};var Fa=Oi,Yl=Kt,Jl=Fa,Gl=di,Xl=zt.Buffer,jl=new Array(160);function yn(){this.init(),this._w=jl,Gl.call(this,128,112)}Yl(yn,Jl),yn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},yn.prototype._hash=function(){var h=Xl.allocUnsafe(48);function n(o,s,m){h.writeInt32BE(o,m),h.writeInt32BE(s,m+4)}return n(this._ah,this._al,0),n(this._bh,this._bl,8),n(this._ch,this._cl,16),n(this._dh,this._dl,24),n(this._eh,this._el,32),n(this._fh,this._fl,40),h};var Ql=yn,Vr=Ma.exports=function(n){n=n.toLowerCase();var o=Vr[n];if(!o)throw new Error(n+" is not supported (we accept pull requests)");return new o};Vr.sha=pl,Vr.sha1=Sl,Vr.sha224=Ll,Vr.sha256=Ba,Vr.sha384=Ql,Vr.sha512=Fa;var xf=Ma.exports,wn={},_f={exports:{}};(function(h,n){var o=Ke,s=o.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?h.exports=o:(m(o,n),n.Buffer=f);function f(g,y,S){return s(g,y,S)}m(s,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return s(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=s(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o.SlowBuffer(g)}})(_f,_f.exports);var td=_f.exports,Sf=td.Buffer,qa=Sf.isEncoding||function(h){switch(h=""+h,h&&h.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 ed(h){if(!h)return"utf8";for(var n;;)switch(h){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 h;default:if(n)return;h=(""+h).toLowerCase(),n=!0}}function rd(h){var n=ed(h);if(typeof n!="string"&&(Sf.isEncoding===qa||!qa(h)))throw new Error("Unknown encoding: "+h);return n||h}wn.StringDecoder=zi;function zi(h){this.encoding=rd(h);var n;switch(this.encoding){case"utf16le":this.text=sd,this.end=od,n=4;break;case"utf8":this.fillLast=fd,n=4;break;case"base64":this.text=ud,this.end=ld,n=3;break;default:this.write=dd,this.end=cd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Sf.allocUnsafe(n)}zi.prototype.write=function(h){if(h.length===0)return"";var n,o;if(this.lastNeed){if(n=this.fillLast(h),n===void 0)return"";o=this.lastNeed,this.lastNeed=0}else o=0;return o<h.length?n?n+this.text(h,o):this.text(h,o):n||""},zi.prototype.end=hd,zi.prototype.text=ad,zi.prototype.fillLast=function(h){if(this.lastNeed<=h.length)return h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,h.length),this.lastNeed-=h.length};function Af(h){return h<=127?0:h>>5===6?2:h>>4===14?3:h>>3===30?4:h>>6===2?-1:-2}function id(h,n,o){var s=n.length-1;if(s<o)return 0;var m=Af(n[s]);return m>=0?(m>0&&(h.lastNeed=m-1),m):--s<o||m===-2?0:(m=Af(n[s]),m>=0?(m>0&&(h.lastNeed=m-2),m):--s<o||m===-2?0:(m=Af(n[s]),m>=0?(m>0&&(m===2?m=0:h.lastNeed=m-3),m):0))}function nd(h,n,o){if((n[0]&192)!==128)return h.lastNeed=0,"�";if(h.lastNeed>1&&n.length>1){if((n[1]&192)!==128)return h.lastNeed=1,"�";if(h.lastNeed>2&&n.length>2&&(n[2]&192)!==128)return h.lastNeed=2,"�"}}function fd(h){var n=this.lastTotal-this.lastNeed,o=nd(this,h);if(o!==void 0)return o;if(this.lastNeed<=h.length)return h.copy(this.lastChar,n,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,n,0,h.length),this.lastNeed-=h.length}function ad(h,n){var o=id(this,h,n);if(!this.lastNeed)return h.toString("utf8",n);this.lastTotal=o;var s=h.length-(o-this.lastNeed);return h.copy(this.lastChar,0,s),h.toString("utf8",n,s)}function hd(h){var n=h&&h.length?this.write(h):"";return this.lastNeed?n+"�":n}function sd(h,n){if((h.length-n)%2===0){var o=h.toString("utf16le",n);if(o){var s=o.charCodeAt(o.length-1);if(s>=55296&&s<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1],o.slice(0,-1)}return o}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=h[h.length-1],h.toString("utf16le",n,h.length-1)}function od(h){var n=h&&h.length?this.write(h):"";if(this.lastNeed){var o=this.lastTotal-this.lastNeed;return n+this.lastChar.toString("utf16le",0,o)}return n}function ud(h,n){var o=(h.length-n)%3;return o===0?h.toString("base64",n):(this.lastNeed=3-o,this.lastTotal=3,o===1?this.lastChar[0]=h[h.length-1]:(this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1]),h.toString("base64",n,h.length-o))}function ld(h){var n=h&&h.length?this.write(h):"";return this.lastNeed?n+this.lastChar.toString("base64",0,3-this.lastNeed):n}function dd(h){return h.toString(this.encoding)}function cd(h){return h&&h.length?this.write(h):""}var ur=zt.Buffer,Pa=Ne.Transform,vd=wn.StringDecoder,pd=Kt;function er(h){Pa.call(this),this.hashMode=typeof h=="string",this.hashMode?this[h]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}pd(er,Pa);var md=typeof Uint8Array!="undefined",gd=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&ArrayBuffer.isView&&(ur.prototype instanceof Uint8Array||ur.TYPED_ARRAY_SUPPORT);function bd(h,n){if(h instanceof ur)return h;if(typeof h=="string")return ur.from(h,n);if(gd&&ArrayBuffer.isView(h)){if(h.byteLength===0)return ur.alloc(0);var o=ur.from(h.buffer,h.byteOffset,h.byteLength);if(o.byteLength===h.byteLength)return o}if(md&&h instanceof Uint8Array||ur.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return ur.from(h);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}er.prototype.update=function(h,n,o){var s=bd(h,n),m=this._update(s);return this.hashMode?this:(o&&(m=this._toString(m,o)),m)},er.prototype.setAutoPadding=function(){},er.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},er.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},er.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},er.prototype._transform=function(h,n,o){var s;try{this.hashMode?this._update(h):this.push(this._update(h))}catch(m){s=m}finally{o(s)}},er.prototype._flush=function(h){var n;try{this.push(this.__final())}catch(o){n=o}h(n)},er.prototype._finalOrDigest=function(h){var n=this.__final()||ur.alloc(0);return h&&(n=this._toString(n,h,!0)),n},er.prototype._toString=function(h,n,o){if(this._decoder||(this._decoder=new vd(n),this._encoding=n),this._encoding!==n)throw new Error("can’t switch encodings");var s=this._decoder.write(h);return o&&(s+=this._decoder.end()),s};var Nr=er,yd=Kt,wd=yf,Md=Mf,xd=xf,Da=Nr;function Mn(h){Da.call(this,"digest"),this._hash=h}yd(Mn,Da),Mn.prototype._update=function(h){this._hash.update(h)},Mn.prototype._final=function(){return this._hash.digest()};var Ki=function(n){return n=n.toLowerCase(),n==="md5"?new wd:n==="rmd160"||n==="ripemd160"?new Md:new Mn(xd(n))},_d=Kt,Yr=zt.Buffer,Na=Nr,Sd=Yr.alloc(128),ci=64;function xn(h,n){Na.call(this,"digest"),typeof n=="string"&&(n=Yr.from(n)),this._alg=h,this._key=n,n.length>ci?n=h(n):n.length<ci&&(n=Yr.concat([n,Sd],ci));for(var o=this._ipad=Yr.allocUnsafe(ci),s=this._opad=Yr.allocUnsafe(ci),m=0;m<ci;m++)o[m]=n[m]^54,s[m]=n[m]^92;this._hash=[o]}_d(xn,Na),xn.prototype._update=function(h){this._hash.push(h)},xn.prototype._final=function(){var h=this._alg(Yr.concat(this._hash));return this._alg(Yr.concat([this._opad,h]))};var Ad=xn,Bd=yf,$a=function(h){return new Bd().update(h).digest()},Ed=Kt,kd=Ad,Ua=Nr,Hi=zt.Buffer,Id=$a,Bf=Mf,Ef=xf,Rd=Hi.alloc(128);function Zi(h,n){Ua.call(this,"digest"),typeof n=="string"&&(n=Hi.from(n));var o=h==="sha512"||h==="sha384"?128:64;if(this._alg=h,this._key=n,n.length>o){var s=h==="rmd160"?new Bf:Ef(h);n=s.update(n).digest()}else n.length<o&&(n=Hi.concat([n,Rd],o));for(var m=this._ipad=Hi.allocUnsafe(o),f=this._opad=Hi.allocUnsafe(o),g=0;g<o;g++)m[g]=n[g]^54,f[g]=n[g]^92;this._hash=h==="rmd160"?new Bf:Ef(h),this._hash.update(m)}Ed(Zi,Ua),Zi.prototype._update=function(h){this._hash.update(h)},Zi.prototype._final=function(){var h=this._hash.digest(),n=this._alg==="rmd160"?new Bf:Ef(this._alg);return n.update(this._opad).update(h).digest()};var La=function(n,o){return n=n.toLowerCase(),n==="rmd160"||n==="ripemd160"?new Zi("rmd160",o):n==="md5"?new kd(Id,o):new Zi(n,o)};const Oa={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var Td=Oa,_n={},Cd=Math.pow(2,30)-1,za=function(h,n){if(typeof h!="number")throw new TypeError("Iterations not a number");if(h<0)throw new TypeError("Bad iterations");if(typeof n!="number")throw new TypeError("Key length not a number");if(n<0||n>Cd||n!==n)throw new TypeError("Bad key length")},Sn;if(Ft.process&&Ft.process.browser)Sn="utf-8";else if(Ft.process&&Ft.process.version){var Fd=parseInt(ye.version.split(".")[0].slice(1),10);Sn=Fd>=6?"utf-8":"binary"}else Sn="utf-8";var Ka=Sn,kf=zt.Buffer,Ha=function(h,n,o){if(kf.isBuffer(h))return h;if(typeof h=="string")return kf.from(h,n);if(ArrayBuffer.isView(h))return kf.from(h.buffer);throw new TypeError(o+" must be a string, a Buffer, a typed array or a DataView")},qd=$a,Pd=Mf,Dd=xf,Jr=zt.Buffer,Nd=za,Za=Ka,Wa=Ha,$d=Jr.alloc(128),An={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Va(h,n,o){var s=Ud(h),m=h==="sha512"||h==="sha384"?128:64;n.length>m?n=s(n):n.length<m&&(n=Jr.concat([n,$d],m));for(var f=Jr.allocUnsafe(m+An[h]),g=Jr.allocUnsafe(m+An[h]),y=0;y<m;y++)f[y]=n[y]^54,g[y]=n[y]^92;var S=Jr.allocUnsafe(m+o+4);f.copy(S,0,0,m),this.ipad1=S,this.ipad2=f,this.opad=g,this.alg=h,this.blocksize=m,this.hash=s,this.size=An[h]}Va.prototype.run=function(h,n){h.copy(n,this.blocksize);var o=this.hash(n);return o.copy(this.opad,this.blocksize),this.hash(this.opad)};function Ud(h){function n(s){return Dd(h).update(s).digest()}function o(s){return new Pd().update(s).digest()}return h==="rmd160"||h==="ripemd160"?o:h==="md5"?qd:n}function Ld(h,n,o,s,m){Nd(o,s),h=Wa(h,Za,"Password"),n=Wa(n,Za,"Salt"),m=m||"sha1";var f=new Va(m,h,n.length),g=Jr.allocUnsafe(s),y=Jr.allocUnsafe(n.length+4);n.copy(y,0,0,n.length);for(var S=0,B=An[m],M=Math.ceil(s/B),x=1;x<=M;x++){y.writeUInt32BE(x,n.length);for(var I=f.run(y,f.ipad1),k=I,D=1;D<o;D++){k=f.run(k,f.ipad2);for(var L=0;L<B;L++)I[L]^=k[L]}I.copy(g,S),S+=B}return g}var Ya=Ld,Ja=zt.Buffer,Od=za,Ga=Ka,Xa=Ya,ja=Ha,Bn,Wi=Ft.crypto&&Ft.crypto.subtle,zd={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},If=[];function Kd(h){if(Ft.process&&!Ft.process.browser||!Wi||!Wi.importKey||!Wi.deriveBits)return Promise.resolve(!1);if(If[h]!==void 0)return If[h];Bn=Bn||Ja.alloc(8);var n=Qa(Bn,Bn,10,128,h).then(function(){return!0}).catch(function(){return!1});return If[h]=n,n}var Gr;function Rf(){return Gr||(Ft.process&&Ft.process.nextTick?Gr=Ft.process.nextTick:Ft.queueMicrotask?Gr=Ft.queueMicrotask:Ft.setImmediate?Gr=Ft.setImmediate:Gr=Ft.setTimeout,Gr)}function Qa(h,n,o,s,m){return Wi.importKey("raw",h,{name:"PBKDF2"},!1,["deriveBits"]).then(function(f){return Wi.deriveBits({name:"PBKDF2",salt:n,iterations:o,hash:{name:m}},f,s<<3)}).then(function(f){return Ja.from(f)})}function Hd(h,n){h.then(function(o){Rf()(function(){n(null,o)})},function(o){Rf()(function(){n(o)})})}var Zd=function(h,n,o,s,m,f){typeof m=="function"&&(f=m,m=void 0),m=m||"sha1";var g=zd[m.toLowerCase()];if(!g||typeof Ft.Promise!="function"){Rf()(function(){var y;try{y=Xa(h,n,o,s,m)}catch(S){return f(S)}f(null,y)});return}if(Od(o,s),h=ja(h,Ga,"Password"),n=ja(n,Ga,"Salt"),typeof f!="function")throw new Error("No callback provided to pbkdf2");Hd(Kd(g).then(function(y){return y?Qa(h,n,o,s,g):Xa(h,n,o,s,m)}),f)};_n.pbkdf2=Zd,_n.pbkdf2Sync=Ya;var rr={},vi={},He={};He.readUInt32BE=function(n,o){var s=n[0+o]<<24|n[1+o]<<16|n[2+o]<<8|n[3+o];return s>>>0},He.writeUInt32BE=function(n,o,s){n[0+s]=o>>>24,n[1+s]=o>>>16&255,n[2+s]=o>>>8&255,n[3+s]=o&255},He.ip=function(n,o,s,m){for(var f=0,g=0,y=6;y>=0;y-=2){for(var S=0;S<=24;S+=8)f<<=1,f|=o>>>S+y&1;for(var S=0;S<=24;S+=8)f<<=1,f|=n>>>S+y&1}for(var y=6;y>=0;y-=2){for(var S=1;S<=25;S+=8)g<<=1,g|=o>>>S+y&1;for(var S=1;S<=25;S+=8)g<<=1,g|=n>>>S+y&1}s[m+0]=f>>>0,s[m+1]=g>>>0},He.rip=function(n,o,s,m){for(var f=0,g=0,y=0;y<4;y++)for(var S=24;S>=0;S-=8)f<<=1,f|=o>>>S+y&1,f<<=1,f|=n>>>S+y&1;for(var y=4;y<8;y++)for(var S=24;S>=0;S-=8)g<<=1,g|=o>>>S+y&1,g<<=1,g|=n>>>S+y&1;s[m+0]=f>>>0,s[m+1]=g>>>0},He.pc1=function(n,o,s,m){for(var f=0,g=0,y=7;y>=5;y--){for(var S=0;S<=24;S+=8)f<<=1,f|=o>>S+y&1;for(var S=0;S<=24;S+=8)f<<=1,f|=n>>S+y&1}for(var S=0;S<=24;S+=8)f<<=1,f|=o>>S+y&1;for(var y=1;y<=3;y++){for(var S=0;S<=24;S+=8)g<<=1,g|=o>>S+y&1;for(var S=0;S<=24;S+=8)g<<=1,g|=n>>S+y&1}for(var S=0;S<=24;S+=8)g<<=1,g|=n>>S+y&1;s[m+0]=f>>>0,s[m+1]=g>>>0},He.r28shl=function(n,o){return n<<o&268435455|n>>>28-o};var En=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];He.pc2=function(n,o,s,m){for(var f=0,g=0,y=En.length>>>1,S=0;S<y;S++)f<<=1,f|=n>>>En[S]&1;for(var S=y;S<En.length;S++)g<<=1,g|=o>>>En[S]&1;s[m+0]=f>>>0,s[m+1]=g>>>0},He.expand=function(n,o,s){var m=0,f=0;m=(n&1)<<5|n>>>27;for(var g=23;g>=15;g-=4)m<<=6,m|=n>>>g&63;for(var g=11;g>=3;g-=4)f|=n>>>g&63,f<<=6;f|=(n&31)<<1|n>>>31,o[s+0]=m>>>0,o[s+1]=f>>>0};var th=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];He.substitute=function(n,o){for(var s=0,m=0;m<4;m++){var f=n>>>18-m*6&63,g=th[m*64+f];s<<=4,s|=g}for(var m=0;m<4;m++){var f=o>>>18-m*6&63,g=th[4*64+m*64+f];s<<=4,s|=g}return s>>>0};var eh=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];He.permute=function(n){for(var o=0,s=0;s<eh.length;s++)o<<=1,o|=n>>>eh[s]&1;return o>>>0},He.padSplit=function(n,o,s){for(var m=n.toString(2);m.length<o;)m="0"+m;for(var f=[],g=0;g<o;g+=s)f.push(m.slice(g,g+s));return f.join(" ")};var Ye=rh;function rh(h,n){if(!h)throw new Error(n||"Assertion failed")}rh.equal=function(n,o,s){if(n!=o)throw new Error(s||"Assertion failed: "+n+" != "+o)};var Wd=Ye;function Je(h){this.options=h,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=h.padding!==!1}var Tf=Je;Je.prototype._init=function(){},Je.prototype.update=function(n){return n.length===0?[]:this.type==="decrypt"?this._updateDecrypt(n):this._updateEncrypt(n)},Je.prototype._buffer=function(n,o){for(var s=Math.min(this.buffer.length-this.bufferOff,n.length-o),m=0;m<s;m++)this.buffer[this.bufferOff+m]=n[o+m];return this.bufferOff+=s,s},Je.prototype._flushBuffer=function(n,o){return this._update(this.buffer,0,n,o),this.bufferOff=0,this.blockSize},Je.prototype._updateEncrypt=function(n){var o=0,s=0,m=(this.bufferOff+n.length)/this.blockSize|0,f=new Array(m*this.blockSize);this.bufferOff!==0&&(o+=this._buffer(n,o),this.bufferOff===this.buffer.length&&(s+=this._flushBuffer(f,s)));for(var g=n.length-(n.length-o)%this.blockSize;o<g;o+=this.blockSize)this._update(n,o,f,s),s+=this.blockSize;for(;o<n.length;o++,this.bufferOff++)this.buffer[this.bufferOff]=n[o];return f},Je.prototype._updateDecrypt=function(n){for(var o=0,s=0,m=Math.ceil((this.bufferOff+n.length)/this.blockSize)-1,f=new Array(m*this.blockSize);m>0;m--)o+=this._buffer(n,o),s+=this._flushBuffer(f,s);return o+=this._buffer(n,o),f},Je.prototype.final=function(n){var o;n&&(o=this.update(n));var s;return this.type==="encrypt"?s=this._finalEncrypt():s=this._finalDecrypt(),o?o.concat(s):s},Je.prototype._pad=function(n,o){if(o===0)return!1;for(;o<n.length;)n[o++]=0;return!0},Je.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var n=new Array(this.blockSize);return this._update(this.buffer,0,n,0),n},Je.prototype._unpad=function(n){return n},Je.prototype._finalDecrypt=function(){Wd.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var n=new Array(this.blockSize);return this._flushBuffer(n,0),this._unpad(n)};var ih=Ye,Vd=Kt,xe=He,nh=Tf;function Yd(){this.tmp=new Array(2),this.keys=null}function lr(h){nh.call(this,h);var n=new Yd;this._desState=n,this.deriveKeys(n,h.key)}Vd(lr,nh);var fh=lr;lr.create=function(n){return new lr(n)};var Jd=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];lr.prototype.deriveKeys=function(n,o){n.keys=new Array(16*2),ih.equal(o.length,this.blockSize,"Invalid key length");var s=xe.readUInt32BE(o,0),m=xe.readUInt32BE(o,4);xe.pc1(s,m,n.tmp,0),s=n.tmp[0],m=n.tmp[1];for(var f=0;f<n.keys.length;f+=2){var g=Jd[f>>>1];s=xe.r28shl(s,g),m=xe.r28shl(m,g),xe.pc2(s,m,n.keys,f)}},lr.prototype._update=function(n,o,s,m){var f=this._desState,g=xe.readUInt32BE(n,o),y=xe.readUInt32BE(n,o+4);xe.ip(g,y,f.tmp,0),g=f.tmp[0],y=f.tmp[1],this.type==="encrypt"?this._encrypt(f,g,y,f.tmp,0):this._decrypt(f,g,y,f.tmp,0),g=f.tmp[0],y=f.tmp[1],xe.writeUInt32BE(s,g,m),xe.writeUInt32BE(s,y,m+4)},lr.prototype._pad=function(n,o){if(this.padding===!1)return!1;for(var s=n.length-o,m=o;m<n.length;m++)n[m]=s;return!0},lr.prototype._unpad=function(n){if(this.padding===!1)return n;for(var o=n[n.length-1],s=n.length-o;s<n.length;s++)ih.equal(n[s],o);return n.slice(0,n.length-o)},lr.prototype._encrypt=function(n,o,s,m,f){for(var g=o,y=s,S=0;S<n.keys.length;S+=2){var B=n.keys[S],M=n.keys[S+1];xe.expand(y,n.tmp,0),B^=n.tmp[0],M^=n.tmp[1];var x=xe.substitute(B,M),I=xe.permute(x),k=y;y=(g^I)>>>0,g=k}xe.rip(y,g,m,f)},lr.prototype._decrypt=function(n,o,s,m,f){for(var g=s,y=o,S=n.keys.length-2;S>=0;S-=2){var B=n.keys[S],M=n.keys[S+1];xe.expand(g,n.tmp,0),B^=n.tmp[0],M^=n.tmp[1];var x=xe.substitute(B,M),I=xe.permute(x),k=g;g=(y^I)>>>0,y=k}xe.rip(g,y,m,f)};var ah={},Gd=Ye,Xd=Kt,kn={};function jd(h){Gd.equal(h.length,8,"Invalid IV length"),this.iv=new Array(8);for(var n=0;n<this.iv.length;n++)this.iv[n]=h[n]}function Qd(h){function n(f){h.call(this,f),this._cbcInit()}Xd(n,h);for(var o=Object.keys(kn),s=0;s<o.length;s++){var m=o[s];n.prototype[m]=kn[m]}return n.create=function(g){return new n(g)},n}ah.instantiate=Qd,kn._cbcInit=function(){var n=new jd(this.options.iv);this._cbcState=n},kn._update=function(n,o,s,m){var f=this._cbcState,g=this.constructor.super_.prototype,y=f.iv;if(this.type==="encrypt"){for(var S=0;S<this.blockSize;S++)y[S]^=n[o+S];g._update.call(this,y,0,s,m);for(var S=0;S<this.blockSize;S++)y[S]=s[m+S]}else{g._update.call(this,n,o,s,m);for(var S=0;S<this.blockSize;S++)s[m+S]^=y[S];for(var S=0;S<this.blockSize;S++)y[S]=n[o+S]}};var tc=Ye,ec=Kt,hh=Tf,$r=fh;function rc(h,n){tc.equal(n.length,24,"Invalid key length");var o=n.slice(0,8),s=n.slice(8,16),m=n.slice(16,24);h==="encrypt"?this.ciphers=[$r.create({type:"encrypt",key:o}),$r.create({type:"decrypt",key:s}),$r.create({type:"encrypt",key:m})]:this.ciphers=[$r.create({type:"decrypt",key:m}),$r.create({type:"encrypt",key:s}),$r.create({type:"decrypt",key:o})]}function Xr(h){hh.call(this,h);var n=new rc(this.type,this.options.key);this._edeState=n}ec(Xr,hh);var ic=Xr;Xr.create=function(n){return new Xr(n)},Xr.prototype._update=function(n,o,s,m){var f=this._edeState;f.ciphers[0]._update(n,o,s,m),f.ciphers[1]._update(s,m,s,m),f.ciphers[2]._update(s,m,s,m)},Xr.prototype._pad=$r.prototype._pad,Xr.prototype._unpad=$r.prototype._unpad,vi.utils=He,vi.Cipher=Tf,vi.DES=fh,vi.CBC=ah,vi.EDE=ic;var sh=Nr,Sr=vi,nc=Kt,jr=zt.Buffer,Vi={"des-ede3-cbc":Sr.CBC.instantiate(Sr.EDE),"des-ede3":Sr.EDE,"des-ede-cbc":Sr.CBC.instantiate(Sr.EDE),"des-ede":Sr.EDE,"des-cbc":Sr.CBC.instantiate(Sr.DES),"des-ecb":Sr.DES};Vi.des=Vi["des-cbc"],Vi.des3=Vi["des-ede3-cbc"];var fc=In;nc(In,sh);function In(h){sh.call(this);var n=h.mode.toLowerCase(),o=Vi[n],s;h.decrypt?s="decrypt":s="encrypt";var m=h.key;jr.isBuffer(m)||(m=jr.from(m)),(n==="des-ede"||n==="des-ede-cbc")&&(m=jr.concat([m,m.slice(0,8)]));var f=h.iv;jr.isBuffer(f)||(f=jr.from(f)),this._des=o.create({key:m,iv:f,type:s})}In.prototype._update=function(h){return jr.from(this._des.update(h))},In.prototype._final=function(){return jr.from(this._des.final())};var Ze={},Cf={},Ff={};Ff.encrypt=function(h,n){return h._cipher.encryptBlock(n)},Ff.decrypt=function(h,n){return h._cipher.decryptBlock(n)};var qf={},dr=[],Ge=[],ac=typeof Uint8Array!="undefined"?Uint8Array:Array,Pf=!1;function oh(){Pf=!0;for(var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=h.length;n<o;++n)dr[n]=h[n],Ge[h.charCodeAt(n)]=n;Ge["-".charCodeAt(0)]=62,Ge["_".charCodeAt(0)]=63}function hc(h){Pf||oh();var n,o,s,m,f,g,y=h.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=h[y-2]==="="?2:h[y-1]==="="?1:0,g=new ac(y*3/4-f),s=f>0?y-4:y;var S=0;for(n=0,o=0;n<s;n+=4,o+=3)m=Ge[h.charCodeAt(n)]<<18|Ge[h.charCodeAt(n+1)]<<12|Ge[h.charCodeAt(n+2)]<<6|Ge[h.charCodeAt(n+3)],g[S++]=m>>16&255,g[S++]=m>>8&255,g[S++]=m&255;return f===2?(m=Ge[h.charCodeAt(n)]<<2|Ge[h.charCodeAt(n+1)]>>4,g[S++]=m&255):f===1&&(m=Ge[h.charCodeAt(n)]<<10|Ge[h.charCodeAt(n+1)]<<4|Ge[h.charCodeAt(n+2)]>>2,g[S++]=m>>8&255,g[S++]=m&255),g}function sc(h){return dr[h>>18&63]+dr[h>>12&63]+dr[h>>6&63]+dr[h&63]}function oc(h,n,o){for(var s,m=[],f=n;f<o;f+=3)s=(h[f]<<16)+(h[f+1]<<8)+h[f+2],m.push(sc(s));return m.join("")}function uh(h){Pf||oh();for(var n,o=h.length,s=o%3,m="",f=[],g=16383,y=0,S=o-s;y<S;y+=g)f.push(oc(h,y,y+g>S?S:y+g));return s===1?(n=h[o-1],m+=dr[n>>2],m+=dr[n<<4&63],m+="=="):s===2&&(n=(h[o-2]<<8)+h[o-1],m+=dr[n>>10],m+=dr[n>>4&63],m+=dr[n<<2&63],m+="="),f.push(m),f.join("")}function Rn(h,n,o,s,m){var f,g,y=m*8-s-1,S=(1<<y)-1,B=S>>1,M=-7,x=o?m-1:0,I=o?-1:1,k=h[n+x];for(x+=I,f=k&(1<<-M)-1,k>>=-M,M+=y;M>0;f=f*256+h[n+x],x+=I,M-=8);for(g=f&(1<<-M)-1,f>>=-M,M+=s;M>0;g=g*256+h[n+x],x+=I,M-=8);if(f===0)f=1-B;else{if(f===S)return g?NaN:(k?-1:1)*(1/0);g=g+Math.pow(2,s),f=f-B}return(k?-1:1)*g*Math.pow(2,f-s)}function lh(h,n,o,s,m,f){var g,y,S,B=f*8-m-1,M=(1<<B)-1,x=M>>1,I=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=s?0:f-1,D=s?1:-1,L=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(y=isNaN(n)?1:0,g=M):(g=Math.floor(Math.log(n)/Math.LN2),n*(S=Math.pow(2,-g))<1&&(g--,S*=2),g+x>=1?n+=I/S:n+=I*Math.pow(2,1-x),n*S>=2&&(g++,S/=2),g+x>=M?(y=0,g=M):g+x>=1?(y=(n*S-1)*Math.pow(2,m),g=g+x):(y=n*Math.pow(2,x-1)*Math.pow(2,m),g=0));m>=8;h[o+k]=y&255,k+=D,y/=256,m-=8);for(g=g<<m|y,B+=m;B>0;h[o+k]=g&255,k+=D,g/=256,B-=8);h[o+k-D]|=L*128}var uc={}.toString,dh=Array.isArray||function(h){return uc.call(h)=="[object Array]"};/*!
8
8
  * The buffer module from node.js, for the browser.
9
9
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flagmint-js-sdk",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Framework-agnostic JavaScript SDK for managing feature flags in Flagmint applications.",
5
5
  "author": "Flagmint Team",
6
6
  "license": "MIT",