hm-tracking-sdk 0.2.2 → 0.2.4

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,18 +3,18 @@
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */(function(r){const f=base64Js,d=ieee754,m=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=b,r.SlowBuffer=X,r.INSPECT_MAX_BYTES=50;const v=2147483647;r.kMaxLength=v;const{Uint8Array:g,ArrayBuffer:w,SharedArrayBuffer:x}=globalThis;b.TYPED_ARRAY_SUPPORT=S(),!b.TYPED_ARRAY_SUPPORT&&typeof console<"u";function S(){try{const le=new g(1),Z={foo:function(){return 42}};return Object.setPrototypeOf(Z,g.prototype),Object.setPrototypeOf(le,Z),le.foo()===42}catch{return!1}}Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});function _(le){if(le>v)throw new RangeError('The value "'+le+'" is invalid for option "size"');const Z=new g(le);return Object.setPrototypeOf(Z,b.prototype),Z}function b(le,Z,J){if(typeof le=="number"){if(typeof Z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(le)}return C(le,Z,J)}b.poolSize=8192;function C(le,Z,J){if(typeof le=="string")return T(le,Z);if(w.isView(le))return O(le);if(le==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le);if(ut(le,w)||le&&ut(le.buffer,w)||typeof x<"u"&&(ut(le,x)||le&&ut(le.buffer,x)))return N(le,Z,J);if(typeof le=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ge=le.valueOf&&le.valueOf();if(ge!=null&&ge!==le)return b.from(ge,Z,J);const Ee=H(le);if(Ee)return Ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof le[Symbol.toPrimitive]=="function")return b.from(le[Symbol.toPrimitive]("string"),Z,J);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le)}b.from=function(le,Z,J){return C(le,Z,J)},Object.setPrototypeOf(b.prototype,g.prototype),Object.setPrototypeOf(b,g);function E(le){if(typeof le!="number")throw new TypeError('"size" argument must be of type number');if(le<0)throw new RangeError('The value "'+le+'" is invalid for option "size"')}function M(le,Z,J){return E(le),le<=0?_(le):Z!==void 0?typeof J=="string"?_(le).fill(Z,J):_(le).fill(Z):_(le)}b.alloc=function(le,Z,J){return M(le,Z,J)};function A(le){return E(le),_(le<0?0:V(le)|0)}b.allocUnsafe=function(le){return A(le)},b.allocUnsafeSlow=function(le){return A(le)};function T(le,Z){if((typeof Z!="string"||Z==="")&&(Z="utf8"),!b.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);const J=oe(le,Z)|0;let ge=_(J);const Ee=ge.write(le,Z);return Ee!==J&&(ge=ge.slice(0,Ee)),ge}function L(le){const Z=le.length<0?0:V(le.length)|0,J=_(Z);for(let ge=0;ge<Z;ge+=1)J[ge]=le[ge]&255;return J}function O(le){if(ut(le,g)){const Z=new g(le);return N(Z.buffer,Z.byteOffset,Z.byteLength)}return L(le)}function N(le,Z,J){if(Z<0||le.byteLength<Z)throw new RangeError('"offset" is outside of buffer bounds');if(le.byteLength<Z+(J||0))throw new RangeError('"length" is outside of buffer bounds');let ge;return Z===void 0&&J===void 0?ge=new g(le):J===void 0?ge=new g(le,Z):ge=new g(le,Z,J),Object.setPrototypeOf(ge,b.prototype),ge}function H(le){if(b.isBuffer(le)){const Z=V(le.length)|0,J=_(Z);return J.length===0||le.copy(J,0,0,Z),J}if(le.length!==void 0)return typeof le.length!="number"||gt(le.length)?_(0):L(le);if(le.type==="Buffer"&&Array.isArray(le.data))return L(le.data)}function V(le){if(le>=v)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+v.toString(16)+" bytes");return le|0}function X(le){return+le!=le&&(le=0),b.alloc(+le)}b.isBuffer=function(Z){return Z!=null&&Z._isBuffer===!0&&Z!==b.prototype},b.compare=function(Z,J){if(ut(Z,g)&&(Z=b.from(Z,Z.offset,Z.byteLength)),ut(J,g)&&(J=b.from(J,J.offset,J.byteLength)),!b.isBuffer(Z)||!b.isBuffer(J))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Z===J)return 0;let ge=Z.length,Ee=J.length;for(let Re=0,ke=Math.min(ge,Ee);Re<ke;++Re)if(Z[Re]!==J[Re]){ge=Z[Re],Ee=J[Re];break}return ge<Ee?-1:Ee<ge?1:0},b.isEncoding=function(Z){switch(String(Z).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}},b.concat=function(Z,J){if(!Array.isArray(Z))throw new TypeError('"list" argument must be an Array of Buffers');if(Z.length===0)return b.alloc(0);let ge;if(J===void 0)for(J=0,ge=0;ge<Z.length;++ge)J+=Z[ge].length;const Ee=b.allocUnsafe(J);let Re=0;for(ge=0;ge<Z.length;++ge){let ke=Z[ge];if(ut(ke,g))Re+ke.length>Ee.length?(b.isBuffer(ke)||(ke=b.from(ke)),ke.copy(Ee,Re)):g.prototype.set.call(Ee,ke,Re);else if(b.isBuffer(ke))ke.copy(Ee,Re);else throw new TypeError('"list" argument must be an Array of Buffers');Re+=ke.length}return Ee};function oe(le,Z){if(b.isBuffer(le))return le.length;if(w.isView(le)||ut(le,w))return le.byteLength;if(typeof le!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof le);const J=le.length,ge=arguments.length>2&&arguments[2]===!0;if(!ge&&J===0)return 0;let Ee=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return J;case"utf8":case"utf-8":return je(le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J*2;case"hex":return J>>>1;case"base64":return Je(le).length;default:if(Ee)return ge?-1:je(le).length;Z=(""+Z).toLowerCase(),Ee=!0}}b.byteLength=oe;function se(le,Z,J){let ge=!1;if((Z===void 0||Z<0)&&(Z=0),Z>this.length||((J===void 0||J>this.length)&&(J=this.length),J<=0)||(J>>>=0,Z>>>=0,J<=Z))return"";for(le||(le="utf8");;)switch(le){case"hex":return R(this,Z,J);case"utf8":case"utf-8":return I(this,Z,J);case"ascii":return D(this,Z,J);case"latin1":case"binary":return W(this,Z,J);case"base64":return $(this,Z,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,Z,J);default:if(ge)throw new TypeError("Unknown encoding: "+le);le=(le+"").toLowerCase(),ge=!0}}b.prototype._isBuffer=!0;function de(le,Z,J){const ge=le[Z];le[Z]=le[J],le[J]=ge}b.prototype.swap16=function(){const Z=this.length;if(Z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let J=0;J<Z;J+=2)de(this,J,J+1);return this},b.prototype.swap32=function(){const Z=this.length;if(Z%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let J=0;J<Z;J+=4)de(this,J,J+3),de(this,J+1,J+2);return this},b.prototype.swap64=function(){const Z=this.length;if(Z%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let J=0;J<Z;J+=8)de(this,J,J+7),de(this,J+1,J+6),de(this,J+2,J+5),de(this,J+3,J+4);return this},b.prototype.toString=function(){const Z=this.length;return Z===0?"":arguments.length===0?I(this,0,Z):se.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(Z){if(!b.isBuffer(Z))throw new TypeError("Argument must be a Buffer");return this===Z?!0:b.compare(this,Z)===0},b.prototype.inspect=function(){let Z="";const J=r.INSPECT_MAX_BYTES;return Z=this.toString("hex",0,J).replace(/(.{2})/g,"$1 ").trim(),this.length>J&&(Z+=" ... "),"<Buffer "+Z+">"},m&&(b.prototype[m]=b.prototype.inspect),b.prototype.compare=function(Z,J,ge,Ee,Re){if(ut(Z,g)&&(Z=b.from(Z,Z.offset,Z.byteLength)),!b.isBuffer(Z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Z);if(J===void 0&&(J=0),ge===void 0&&(ge=Z?Z.length:0),Ee===void 0&&(Ee=0),Re===void 0&&(Re=this.length),J<0||ge>Z.length||Ee<0||Re>this.length)throw new RangeError("out of range index");if(Ee>=Re&&J>=ge)return 0;if(Ee>=Re)return-1;if(J>=ge)return 1;if(J>>>=0,ge>>>=0,Ee>>>=0,Re>>>=0,this===Z)return 0;let ke=Re-Ee,Xe=ge-J;const He=Math.min(ke,Xe),Ze=this.slice(Ee,Re),xt=Z.slice(J,ge);for(let tt=0;tt<He;++tt)if(Ze[tt]!==xt[tt]){ke=Ze[tt],Xe=xt[tt];break}return ke<Xe?-1:Xe<ke?1:0};function he(le,Z,J,ge,Ee){if(le.length===0)return-1;if(typeof J=="string"?(ge=J,J=0):J>2147483647?J=2147483647:J<-2147483648&&(J=-2147483648),J=+J,gt(J)&&(J=Ee?0:le.length-1),J<0&&(J=le.length+J),J>=le.length){if(Ee)return-1;J=le.length-1}else if(J<0)if(Ee)J=0;else return-1;if(typeof Z=="string"&&(Z=b.from(Z,ge)),b.isBuffer(Z))return Z.length===0?-1:we(le,Z,J,ge,Ee);if(typeof Z=="number")return Z=Z&255,typeof g.prototype.indexOf=="function"?Ee?g.prototype.indexOf.call(le,Z,J):g.prototype.lastIndexOf.call(le,Z,J):we(le,[Z],J,ge,Ee);throw new TypeError("val must be string, number or Buffer")}function we(le,Z,J,ge,Ee){let Re=1,ke=le.length,Xe=Z.length;if(ge!==void 0&&(ge=String(ge).toLowerCase(),ge==="ucs2"||ge==="ucs-2"||ge==="utf16le"||ge==="utf-16le")){if(le.length<2||Z.length<2)return-1;Re=2,ke/=2,Xe/=2,J/=2}function He(xt,tt){return Re===1?xt[tt]:xt.readUInt16BE(tt*Re)}let Ze;if(Ee){let xt=-1;for(Ze=J;Ze<ke;Ze++)if(He(le,Ze)===He(Z,xt===-1?0:Ze-xt)){if(xt===-1&&(xt=Ze),Ze-xt+1===Xe)return xt*Re}else xt!==-1&&(Ze-=Ze-xt),xt=-1}else for(J+Xe>ke&&(J=ke-Xe),Ze=J;Ze>=0;Ze--){let xt=!0;for(let tt=0;tt<Xe;tt++)if(He(le,Ze+tt)!==He(Z,tt)){xt=!1;break}if(xt)return Ze}return-1}b.prototype.includes=function(Z,J,ge){return this.indexOf(Z,J,ge)!==-1},b.prototype.indexOf=function(Z,J,ge){return he(this,Z,J,ge,!0)},b.prototype.lastIndexOf=function(Z,J,ge){return he(this,Z,J,ge,!1)};function te(le,Z,J,ge){J=Number(J)||0;const Ee=le.length-J;ge?(ge=Number(ge),ge>Ee&&(ge=Ee)):ge=Ee;const Re=Z.length;ge>Re/2&&(ge=Re/2);let ke;for(ke=0;ke<ge;++ke){const Xe=parseInt(Z.substr(ke*2,2),16);if(gt(Xe))return ke;le[J+ke]=Xe}return ke}function k(le,Z,J,ge){return Ge(je(Z,le.length-J),le,J,ge)}function q(le,Z,J,ge){return Ge(Ye(Z),le,J,ge)}function y(le,Z,J,ge){return Ge(Je(Z),le,J,ge)}function B(le,Z,J,ge){return Ge(st(Z,le.length-J),le,J,ge)}b.prototype.write=function(Z,J,ge,Ee){if(J===void 0)Ee="utf8",ge=this.length,J=0;else if(ge===void 0&&typeof J=="string")Ee=J,ge=this.length,J=0;else if(isFinite(J))J=J>>>0,isFinite(ge)?(ge=ge>>>0,Ee===void 0&&(Ee="utf8")):(Ee=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Re=this.length-J;if((ge===void 0||ge>Re)&&(ge=Re),Z.length>0&&(ge<0||J<0)||J>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");let ke=!1;for(;;)switch(Ee){case"hex":return te(this,Z,J,ge);case"utf8":case"utf-8":return k(this,Z,J,ge);case"ascii":case"latin1":case"binary":return q(this,Z,J,ge);case"base64":return y(this,Z,J,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,Z,J,ge);default:if(ke)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),ke=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(le,Z,J){return Z===0&&J===le.length?f.fromByteArray(le):f.fromByteArray(le.slice(Z,J))}function I(le,Z,J){J=Math.min(le.length,J);const ge=[];let Ee=Z;for(;Ee<J;){const Re=le[Ee];let ke=null,Xe=Re>239?4:Re>223?3:Re>191?2:1;if(Ee+Xe<=J){let He,Ze,xt,tt;switch(Xe){case 1:Re<128&&(ke=Re);break;case 2:He=le[Ee+1],(He&192)===128&&(tt=(Re&31)<<6|He&63,tt>127&&(ke=tt));break;case 3:He=le[Ee+1],Ze=le[Ee+2],(He&192)===128&&(Ze&192)===128&&(tt=(Re&15)<<12|(He&63)<<6|Ze&63,tt>2047&&(tt<55296||tt>57343)&&(ke=tt));break;case 4:He=le[Ee+1],Ze=le[Ee+2],xt=le[Ee+3],(He&192)===128&&(Ze&192)===128&&(xt&192)===128&&(tt=(Re&15)<<18|(He&63)<<12|(Ze&63)<<6|xt&63,tt>65535&&tt<1114112&&(ke=tt))}}ke===null?(ke=65533,Xe=1):ke>65535&&(ke-=65536,ge.push(ke>>>10&1023|55296),ke=56320|ke&1023),ge.push(ke),Ee+=Xe}return j(ge)}const F=4096;function j(le){const Z=le.length;if(Z<=F)return String.fromCharCode.apply(String,le);let J="",ge=0;for(;ge<Z;)J+=String.fromCharCode.apply(String,le.slice(ge,ge+=F));return J}function D(le,Z,J){let ge="";J=Math.min(le.length,J);for(let Ee=Z;Ee<J;++Ee)ge+=String.fromCharCode(le[Ee]&127);return ge}function W(le,Z,J){let ge="";J=Math.min(le.length,J);for(let Ee=Z;Ee<J;++Ee)ge+=String.fromCharCode(le[Ee]);return ge}function R(le,Z,J){const ge=le.length;(!Z||Z<0)&&(Z=0),(!J||J<0||J>ge)&&(J=ge);let Ee="";for(let Re=Z;Re<J;++Re)Ee+=rt[le[Re]];return Ee}function z(le,Z,J){const ge=le.slice(Z,J);let Ee="";for(let Re=0;Re<ge.length-1;Re+=2)Ee+=String.fromCharCode(ge[Re]+ge[Re+1]*256);return Ee}b.prototype.slice=function(Z,J){const ge=this.length;Z=~~Z,J=J===void 0?ge:~~J,Z<0?(Z+=ge,Z<0&&(Z=0)):Z>ge&&(Z=ge),J<0?(J+=ge,J<0&&(J=0)):J>ge&&(J=ge),J<Z&&(J=Z);const Ee=this.subarray(Z,J);return Object.setPrototypeOf(Ee,b.prototype),Ee};function ye(le,Z,J){if(le%1!==0||le<0)throw new RangeError("offset is not uint");if(le+Z>J)throw new RangeError("Trying to access beyond buffer length")}b.prototype.readUintLE=b.prototype.readUIntLE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z],Re=1,ke=0;for(;++ke<J&&(Re*=256);)Ee+=this[Z+ke]*Re;return Ee},b.prototype.readUintBE=b.prototype.readUIntBE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z+--J],Re=1;for(;J>0&&(Re*=256);)Ee+=this[Z+--J]*Re;return Ee},b.prototype.readUint8=b.prototype.readUInt8=function(Z,J){return Z=Z>>>0,J||ye(Z,1,this.length),this[Z]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(Z,J){return Z=Z>>>0,J||ye(Z,2,this.length),this[Z]|this[Z+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(Z,J){return Z=Z>>>0,J||ye(Z,2,this.length),this[Z]<<8|this[Z+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),(this[Z]|this[Z+1]<<8|this[Z+2]<<16)+this[Z+3]*16777216},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]*16777216+(this[Z+1]<<16|this[Z+2]<<8|this[Z+3])},b.prototype.readBigUInt64LE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24,Re=this[++Z]+this[++Z]*2**8+this[++Z]*2**16+ge*2**24;return BigInt(Ee)+(BigInt(Re)<<BigInt(32))}),b.prototype.readBigUInt64BE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=J*2**24+this[++Z]*2**16+this[++Z]*2**8+this[++Z],Re=this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ge;return(BigInt(Ee)<<BigInt(32))+BigInt(Re)}),b.prototype.readIntLE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z],Re=1,ke=0;for(;++ke<J&&(Re*=256);)Ee+=this[Z+ke]*Re;return Re*=128,Ee>=Re&&(Ee-=Math.pow(2,8*J)),Ee},b.prototype.readIntBE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=J,Re=1,ke=this[Z+--Ee];for(;Ee>0&&(Re*=256);)ke+=this[Z+--Ee]*Re;return Re*=128,ke>=Re&&(ke-=Math.pow(2,8*J)),ke},b.prototype.readInt8=function(Z,J){return Z=Z>>>0,J||ye(Z,1,this.length),this[Z]&128?(255-this[Z]+1)*-1:this[Z]},b.prototype.readInt16LE=function(Z,J){Z=Z>>>0,J||ye(Z,2,this.length);const ge=this[Z]|this[Z+1]<<8;return ge&32768?ge|4294901760:ge},b.prototype.readInt16BE=function(Z,J){Z=Z>>>0,J||ye(Z,2,this.length);const ge=this[Z+1]|this[Z]<<8;return ge&32768?ge|4294901760:ge},b.prototype.readInt32LE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]|this[Z+1]<<8|this[Z+2]<<16|this[Z+3]<<24},b.prototype.readInt32BE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]<<24|this[Z+1]<<16|this[Z+2]<<8|this[Z+3]},b.prototype.readBigInt64LE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=this[Z+4]+this[Z+5]*2**8+this[Z+6]*2**16+(ge<<24);return(BigInt(Ee)<<BigInt(32))+BigInt(J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24)}),b.prototype.readBigInt64BE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Ue(Z,this.length-8);const Ee=(J<<24)+this[++Z]*2**16+this[++Z]*2**8+this[++Z];return(BigInt(Ee)<<BigInt(32))+BigInt(this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ge)}),b.prototype.readFloatLE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),d.read(this,Z,!0,23,4)},b.prototype.readFloatBE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),d.read(this,Z,!1,23,4)},b.prototype.readDoubleLE=function(Z,J){return Z=Z>>>0,J||ye(Z,8,this.length),d.read(this,Z,!0,52,8)},b.prototype.readDoubleBE=function(Z,J){return Z=Z>>>0,J||ye(Z,8,this.length),d.read(this,Z,!1,52,8)};function Ce(le,Z,J,ge,Ee,Re){if(!b.isBuffer(le))throw new TypeError('"buffer" argument must be a Buffer instance');if(Z>Ee||Z<Re)throw new RangeError('"value" argument is out of bounds');if(J+ge>le.length)throw new RangeError("Index out of range")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,ge=ge>>>0,!Ee){const Xe=Math.pow(2,8*ge)-1;Ce(this,Z,J,ge,Xe,0)}let Re=1,ke=0;for(this[J]=Z&255;++ke<ge&&(Re*=256);)this[J+ke]=Z/Re&255;return J+ge},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,ge=ge>>>0,!Ee){const Xe=Math.pow(2,8*ge)-1;Ce(this,Z,J,ge,Xe,0)}let Re=ge-1,ke=1;for(this[J+Re]=Z&255;--Re>=0&&(ke*=256);)this[J+Re]=Z/ke&255;return J+ge},b.prototype.writeUint8=b.prototype.writeUInt8=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,1,255,0),this[J]=Z&255,J+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,65535,0),this[J]=Z&255,this[J+1]=Z>>>8,J+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,65535,0),this[J]=Z>>>8,this[J+1]=Z&255,J+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,4294967295,0),this[J+3]=Z>>>24,this[J+2]=Z>>>16,this[J+1]=Z>>>8,this[J]=Z&255,J+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,4294967295,0),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4};function me(le,Z,J,ge,Ee){Ie(Z,ge,Ee,le,J,7);let Re=Number(Z&BigInt(4294967295));le[J++]=Re,Re=Re>>8,le[J++]=Re,Re=Re>>8,le[J++]=Re,Re=Re>>8,le[J++]=Re;let ke=Number(Z>>BigInt(32)&BigInt(4294967295));return le[J++]=ke,ke=ke>>8,le[J++]=ke,ke=ke>>8,le[J++]=ke,ke=ke>>8,le[J++]=ke,J}function ie(le,Z,J,ge,Ee){Ie(Z,ge,Ee,le,J,7);let Re=Number(Z&BigInt(4294967295));le[J+7]=Re,Re=Re>>8,le[J+6]=Re,Re=Re>>8,le[J+5]=Re,Re=Re>>8,le[J+4]=Re;let ke=Number(Z>>BigInt(32)&BigInt(4294967295));return le[J+3]=ke,ke=ke>>8,le[J+2]=ke,ke=ke>>8,le[J+1]=ke,ke=ke>>8,le[J]=ke,J+8}b.prototype.writeBigUInt64LE=wt(function(Z,J=0){return me(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=wt(function(Z,J=0){return ie(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,!Ee){const He=Math.pow(2,8*ge-1);Ce(this,Z,J,ge,He-1,-He)}let Re=0,ke=1,Xe=0;for(this[J]=Z&255;++Re<ge&&(ke*=256);)Z<0&&Xe===0&&this[J+Re-1]!==0&&(Xe=1),this[J+Re]=(Z/ke>>0)-Xe&255;return J+ge},b.prototype.writeIntBE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,!Ee){const He=Math.pow(2,8*ge-1);Ce(this,Z,J,ge,He-1,-He)}let Re=ge-1,ke=1,Xe=0;for(this[J+Re]=Z&255;--Re>=0&&(ke*=256);)Z<0&&Xe===0&&this[J+Re+1]!==0&&(Xe=1),this[J+Re]=(Z/ke>>0)-Xe&255;return J+ge},b.prototype.writeInt8=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,1,127,-128),Z<0&&(Z=255+Z+1),this[J]=Z&255,J+1},b.prototype.writeInt16LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,32767,-32768),this[J]=Z&255,this[J+1]=Z>>>8,J+2},b.prototype.writeInt16BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,32767,-32768),this[J]=Z>>>8,this[J+1]=Z&255,J+2},b.prototype.writeInt32LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,2147483647,-2147483648),this[J]=Z&255,this[J+1]=Z>>>8,this[J+2]=Z>>>16,this[J+3]=Z>>>24,J+4},b.prototype.writeInt32BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,2147483647,-2147483648),Z<0&&(Z=4294967295+Z+1),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4},b.prototype.writeBigInt64LE=wt(function(Z,J=0){return me(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=wt(function(Z,J=0){return ie(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(le,Z,J,ge,Ee,Re){if(J+ge>le.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("Index out of range")}function pe(le,Z,J,ge,Ee){return Z=+Z,J=J>>>0,Ee||ee(le,Z,J,4),d.write(le,Z,J,ge,23,4),J+4}b.prototype.writeFloatLE=function(Z,J,ge){return pe(this,Z,J,!0,ge)},b.prototype.writeFloatBE=function(Z,J,ge){return pe(this,Z,J,!1,ge)};function be(le,Z,J,ge,Ee){return Z=+Z,J=J>>>0,Ee||ee(le,Z,J,8),d.write(le,Z,J,ge,52,8),J+8}b.prototype.writeDoubleLE=function(Z,J,ge){return be(this,Z,J,!0,ge)},b.prototype.writeDoubleBE=function(Z,J,ge){return be(this,Z,J,!1,ge)},b.prototype.copy=function(Z,J,ge,Ee){if(!b.isBuffer(Z))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),!Ee&&Ee!==0&&(Ee=this.length),J>=Z.length&&(J=Z.length),J||(J=0),Ee>0&&Ee<ge&&(Ee=ge),Ee===ge||Z.length===0||this.length===0)return 0;if(J<0)throw new RangeError("targetStart out of bounds");if(ge<0||ge>=this.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),Z.length-J<Ee-ge&&(Ee=Z.length-J+ge);const Re=Ee-ge;return this===Z&&typeof g.prototype.copyWithin=="function"?this.copyWithin(J,ge,Ee):g.prototype.set.call(Z,this.subarray(ge,Ee),J),Re},b.prototype.fill=function(Z,J,ge,Ee){if(typeof Z=="string"){if(typeof J=="string"?(Ee=J,J=0,ge=this.length):typeof ge=="string"&&(Ee=ge,ge=this.length),Ee!==void 0&&typeof Ee!="string")throw new TypeError("encoding must be a string");if(typeof Ee=="string"&&!b.isEncoding(Ee))throw new TypeError("Unknown encoding: "+Ee);if(Z.length===1){const ke=Z.charCodeAt(0);(Ee==="utf8"&&ke<128||Ee==="latin1")&&(Z=ke)}}else typeof Z=="number"?Z=Z&255:typeof Z=="boolean"&&(Z=Number(Z));if(J<0||this.length<J||this.length<ge)throw new RangeError("Out of range index");if(ge<=J)return this;J=J>>>0,ge=ge===void 0?this.length:ge>>>0,Z||(Z=0);let Re;if(typeof Z=="number")for(Re=J;Re<ge;++Re)this[Re]=Z;else{const ke=b.isBuffer(Z)?Z:b.from(Z,Ee),Xe=ke.length;if(Xe===0)throw new TypeError('The value "'+Z+'" is invalid for argument "value"');for(Re=0;Re<ge-J;++Re)this[Re+J]=ke[Re%Xe]}return this};const ae={};function ne(le,Z,J){ae[le]=class extends J{constructor(){super(),Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${le}]`,this.stack,delete this.name}get code(){return le}set code(Ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ee,writable:!0})}toString(){return`${this.name} [${le}]: ${this.message}`}}}ne("ERR_BUFFER_OUT_OF_BOUNDS",function(le){return le?`${le} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ne("ERR_INVALID_ARG_TYPE",function(le,Z){return`The "${le}" argument must be of type number. Received type ${typeof Z}`},TypeError),ne("ERR_OUT_OF_RANGE",function(le,Z,J){let ge=`The value of "${le}" is out of range.`,Ee=J;return Number.isInteger(J)&&Math.abs(J)>2**32?Ee=Se(String(J)):typeof J=="bigint"&&(Ee=String(J),(J>BigInt(2)**BigInt(32)||J<-(BigInt(2)**BigInt(32)))&&(Ee=Se(Ee)),Ee+="n"),ge+=` It must be ${Z}. Received ${Ee}`,ge},RangeError);function Se(le){let Z="",J=le.length;const ge=le[0]==="-"?1:0;for(;J>=ge+4;J-=3)Z=`_${le.slice(J-3,J)}${Z}`;return`${le.slice(0,J)}${Z}`}function qe(le,Z,J){Oe(Z,"offset"),(le[Z]===void 0||le[Z+J]===void 0)&&Ue(Z,le.length-(J+1))}function Ie(le,Z,J,ge,Ee,Re){if(le>J||le<Z){const ke=typeof Z=="bigint"?"n":"";let Xe;throw Z===0||Z===BigInt(0)?Xe=`>= 0${ke} and < 2${ke} ** ${(Re+1)*8}${ke}`:Xe=`>= -(2${ke} ** ${(Re+1)*8-1}${ke}) and < 2 ** ${(Re+1)*8-1}${ke}`,new ae.ERR_OUT_OF_RANGE("value",Xe,le)}qe(ge,Ee,Re)}function Oe(le,Z){if(typeof le!="number")throw new ae.ERR_INVALID_ARG_TYPE(Z,"number",le)}function Ue(le,Z,J){throw Math.floor(le)!==le?(Oe(le,J),new ae.ERR_OUT_OF_RANGE("offset","an integer",le)):Z<0?new ae.ERR_BUFFER_OUT_OF_BOUNDS:new ae.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Z}`,le)}const De=/[^+/0-9A-Za-z-_]/g;function $e(le){if(le=le.split("=")[0],le=le.trim().replace(De,""),le.length<2)return"";for(;le.length%4!==0;)le=le+"=";return le}function je(le,Z){Z=Z||1/0;let J;const ge=le.length;let Ee=null;const Re=[];for(let ke=0;ke<ge;++ke){if(J=le.charCodeAt(ke),J>55295&&J<57344){if(!Ee){if(J>56319){(Z-=3)>-1&&Re.push(239,191,189);continue}else if(ke+1===ge){(Z-=3)>-1&&Re.push(239,191,189);continue}Ee=J;continue}if(J<56320){(Z-=3)>-1&&Re.push(239,191,189),Ee=J;continue}J=(Ee-55296<<10|J-56320)+65536}else Ee&&(Z-=3)>-1&&Re.push(239,191,189);if(Ee=null,J<128){if((Z-=1)<0)break;Re.push(J)}else if(J<2048){if((Z-=2)<0)break;Re.push(J>>6|192,J&63|128)}else if(J<65536){if((Z-=3)<0)break;Re.push(J>>12|224,J>>6&63|128,J&63|128)}else if(J<1114112){if((Z-=4)<0)break;Re.push(J>>18|240,J>>12&63|128,J>>6&63|128,J&63|128)}else throw new Error("Invalid code point")}return Re}function Ye(le){const Z=[];for(let J=0;J<le.length;++J)Z.push(le.charCodeAt(J)&255);return Z}function st(le,Z){let J,ge,Ee;const Re=[];for(let ke=0;ke<le.length&&!((Z-=2)<0);++ke)J=le.charCodeAt(ke),ge=J>>8,Ee=J%256,Re.push(Ee),Re.push(ge);return Re}function Je(le){return f.toByteArray($e(le))}function Ge(le,Z,J,ge){let Ee;for(Ee=0;Ee<ge&&!(Ee+J>=Z.length||Ee>=le.length);++Ee)Z[Ee+J]=le[Ee];return Ee}function ut(le,Z){return le instanceof Z||le!=null&&le.constructor!=null&&le.constructor.name!=null&&le.constructor.name===Z.name}function gt(le){return le!==le}const rt=(function(){const le="0123456789abcdef",Z=new Array(256);for(let J=0;J<16;++J){const ge=J*16;for(let Ee=0;Ee<16;++Ee)Z[ge+Ee]=le[J]+le[Ee]}return Z})();function wt(le){return typeof BigInt>"u"?bt:le}function bt(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer=buffer$1.Buffer,Buffer$1=buffer$1.Buffer;function getDefaultExportFromCjs$1(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var browser$c={exports:{}},process=browser$c.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(r){if(cachedSetTimeout===setTimeout)return setTimeout(r,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(r,0);try{return cachedSetTimeout(r,0)}catch{try{return cachedSetTimeout.call(null,r,0)}catch{return cachedSetTimeout.call(this,r,0)}}}function runClearTimeout(r){if(cachedClearTimeout===clearTimeout)return clearTimeout(r);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(r);try{return cachedClearTimeout(r)}catch{try{return cachedClearTimeout.call(null,r)}catch{return cachedClearTimeout.call(this,r)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var r=runTimeout(cleanUpNextTick);draining=!0;for(var f=queue.length;f;){for(currentQueue=queue,queue=[];++queueIndex<f;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,f=queue.length}currentQueue=null,draining=!1,runClearTimeout(r)}}process.nextTick=function(r){var f=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)f[d-1]=arguments[d];queue.push(new Item(r,f)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(r,f){this.fun=r,this.array=f}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$1(){}process.on=noop$1,process.addListener=noop$1,process.once=noop$1,process.off=noop$1,process.removeListener=noop$1,process.removeAllListeners=noop$1,process.emit=noop$1,process.prependListener=noop$1,process.prependOnceListener=noop$1,process.listeners=function(r){return[]},process.binding=function(r){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(r){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$c.exports;const process$1=getDefaultExportFromCjs$1(browserExports),global$1=globalThis||void 0||self;function bind(r,f){return function(){return r.apply(f,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(r=>f=>{const d=toString.call(f);return r[d]||(r[d]=d.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=r=>(r=r.toLowerCase(),f=>kindOf(f)===r),typeOfTest=r=>f=>typeof f===r,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(r){return r!==null&&!isUndefined(r)&&r.constructor!==null&&!isUndefined(r.constructor)&&isFunction(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(r){let f;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?f=ArrayBuffer.isView(r):f=r&&r.buffer&&isArrayBuffer(r.buffer),f}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject$1=r=>r!==null&&typeof r=="object",isBoolean=r=>r===!0||r===!1,isPlainObject$1=r=>{if(kindOf(r)!=="object")return!1;const f=getPrototypeOf(r);return(f===null||f===Object.prototype||Object.getPrototypeOf(f)===null)&&!(toStringTag in r)&&!(iterator in r)},isEmptyObject=r=>{if(!isObject$1(r)||isBuffer(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=r=>isObject$1(r)&&isFunction(r.pipe),isFormData=r=>{let f;return r&&(typeof FormData=="function"&&r instanceof FormData||isFunction(r.append)&&((f=kindOf(r))==="formdata"||f==="object"&&isFunction(r.toString)&&r.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach$1(r,f,{allOwnKeys:d=!1}={}){if(r===null||typeof r>"u")return;let m,v;if(typeof r!="object"&&(r=[r]),isArray(r))for(m=0,v=r.length;m<v;m++)f.call(null,r[m],m,r);else{if(isBuffer(r))return;const g=d?Object.getOwnPropertyNames(r):Object.keys(r),w=g.length;let x;for(m=0;m<w;m++)x=g[m],f.call(null,r[x],x,r)}}function findKey(r,f){if(isBuffer(r))return null;f=f.toLowerCase();const d=Object.keys(r);let m=d.length,v;for(;m-- >0;)if(v=d[m],f===v.toLowerCase())return v;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined=r=>!isUndefined(r)&&r!==_global;function merge(){const{caseless:r}=isContextDefined(this)&&this||{},f={},d=(m,v)=>{const g=r&&findKey(f,v)||v;isPlainObject$1(f[g])&&isPlainObject$1(m)?f[g]=merge(f[g],m):isPlainObject$1(m)?f[g]=merge({},m):isArray(m)?f[g]=m.slice():f[g]=m};for(let m=0,v=arguments.length;m<v;m++)arguments[m]&&forEach$1(arguments[m],d);return f}const extend=(r,f,d,{allOwnKeys:m}={})=>(forEach$1(f,(v,g)=>{d&&isFunction(v)?r[g]=bind(v,d):r[g]=v},{allOwnKeys:m}),r),stripBOM=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),inherits=(r,f,d,m)=>{r.prototype=Object.create(f.prototype,m),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:f.prototype}),d&&Object.assign(r.prototype,d)},toFlatObject=(r,f,d,m)=>{let v,g,w;const x={};if(f=f||{},r==null)return f;do{for(v=Object.getOwnPropertyNames(r),g=v.length;g-- >0;)w=v[g],(!m||m(w,r,f))&&!x[w]&&(f[w]=r[w],x[w]=!0);r=d!==!1&&getPrototypeOf(r)}while(r&&(!d||d(r,f))&&r!==Object.prototype);return f},endsWith=(r,f,d)=>{r=String(r),(d===void 0||d>r.length)&&(d=r.length),d-=f.length;const m=r.indexOf(f,d);return m!==-1&&m===d},toArray=r=>{if(!r)return null;if(isArray(r))return r;let f=r.length;if(!isNumber(f))return null;const d=new Array(f);for(;f-- >0;)d[f]=r[f];return d},isTypedArray$1=(r=>f=>r&&f instanceof r)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(r,f)=>{const m=(r&&r[iterator]).call(r);let v;for(;(v=m.next())&&!v.done;){const g=v.value;f.call(r,g[0],g[1])}},matchAll=(r,f)=>{let d;const m=[];for(;(d=r.exec(f))!==null;)m.push(d);return m},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(d,m,v){return m.toUpperCase()+v}),hasOwnProperty=(({hasOwnProperty:r})=>(f,d)=>r.call(f,d))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(r,f)=>{const d=Object.getOwnPropertyDescriptors(r),m={};forEach$1(d,(v,g)=>{let w;(w=f(v,g,r))!==!1&&(m[g]=w||v)}),Object.defineProperties(r,m)},freezeMethods=r=>{reduceDescriptors(r,(f,d)=>{if(isFunction(r)&&["arguments","caller","callee"].indexOf(d)!==-1)return!1;const m=r[d];if(isFunction(m)){if(f.enumerable=!1,"writable"in f){f.writable=!1;return}f.set||(f.set=()=>{throw Error("Can not rewrite read-only method '"+d+"'")})}})},toObjectSet=(r,f)=>{const d={},m=v=>{v.forEach(g=>{d[g]=!0})};return isArray(r)?m(r):m(String(r).split(f)),d},noop=()=>{},toFiniteNumber=(r,f)=>r!=null&&Number.isFinite(r=+r)?r:f;function isSpecCompliantForm(r){return!!(r&&isFunction(r.append)&&r[toStringTag]==="FormData"&&r[iterator])}const toJSONObject=r=>{const f=new Array(10),d=(m,v)=>{if(isObject$1(m)){if(f.indexOf(m)>=0)return;if(isBuffer(m))return m;if(!("toJSON"in m)){f[v]=m;const g=isArray(m)?[]:{};return forEach$1(m,(w,x)=>{const S=d(w,v+1);!isUndefined(S)&&(g[x]=S)}),f[v]=void 0,g}}return m};return d(r,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=r=>r&&(isObject$1(r)||isFunction(r))&&isFunction(r.then)&&isFunction(r.catch),_setImmediate=((r,f)=>r?setImmediate:f?((d,m)=>(_global.addEventListener("message",({source:v,data:g})=>{v===_global&&g===d&&m.length&&m.shift()()},!1),v=>{m.push(v),_global.postMessage(d,"*")}))(`axios@${Math.random()}`,[]):d=>setTimeout(d))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process$1<"u"&&process$1.nextTick||_setImmediate,isIterable=r=>r!=null&&isFunction(r[iterator]),utils$5={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject:isObject$1,isPlainObject:isPlainObject$1,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray:isTypedArray$1,isFileList,forEach:forEach$1,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(r,f,d,m,v){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",f&&(this.code=f),d&&(this.config=d),m&&(this.request=m),v&&(this.response=v,this.status=v.status?v.status:null)}utils$5.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$5.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{descriptors[r]={value:r}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(r,f,d,m,v,g)=>{const w=Object.create(prototype$1);return utils$5.toFlatObject(r,w,function(S){return S!==Error.prototype},x=>x!=="isAxiosError"),AxiosError$1.call(w,r.message,f,d,m,v),w.cause=r,w.name=r.name,g&&Object.assign(w,g),w};const httpAdapter=null;function isVisitable(r){return utils$5.isPlainObject(r)||utils$5.isArray(r)}function removeBrackets(r){return utils$5.endsWith(r,"[]")?r.slice(0,-2):r}function renderKey(r,f,d){return r?r.concat(f).map(function(v,g){return v=removeBrackets(v),!d&&g?"["+v+"]":v}).join(d?".":""):f}function isFlatArray(r){return utils$5.isArray(r)&&!r.some(isVisitable)}const predicates=utils$5.toFlatObject(utils$5,{},null,function(f){return/^is[A-Z]/.test(f)});function toFormData$1(r,f,d){if(!utils$5.isObject(r))throw new TypeError("target must be an object");f=f||new FormData,d=utils$5.toFlatObject(d,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,L){return!utils$5.isUndefined(L[T])});const m=d.metaTokens,v=d.visitor||b,g=d.dots,w=d.indexes,S=(d.Blob||typeof Blob<"u"&&Blob)&&utils$5.isSpecCompliantForm(f);if(!utils$5.isFunction(v))throw new TypeError("visitor must be a function");function _(A){if(A===null)return"";if(utils$5.isDate(A))return A.toISOString();if(utils$5.isBoolean(A))return A.toString();if(!S&&utils$5.isBlob(A))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$5.isArrayBuffer(A)||utils$5.isTypedArray(A)?S&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function b(A,T,L){let O=A;if(A&&!L&&typeof A=="object"){if(utils$5.endsWith(T,"{}"))T=m?T:T.slice(0,-2),A=JSON.stringify(A);else if(utils$5.isArray(A)&&isFlatArray(A)||(utils$5.isFileList(A)||utils$5.endsWith(T,"[]"))&&(O=utils$5.toArray(A)))return T=removeBrackets(T),O.forEach(function(H,V){!(utils$5.isUndefined(H)||H===null)&&f.append(w===!0?renderKey([T],V,g):w===null?T:T+"[]",_(H))}),!1}return isVisitable(A)?!0:(f.append(renderKey(L,T,g),_(A)),!1)}const C=[],E=Object.assign(predicates,{defaultVisitor:b,convertValue:_,isVisitable});function M(A,T){if(!utils$5.isUndefined(A)){if(C.indexOf(A)!==-1)throw Error("Circular reference detected in "+T.join("."));C.push(A),utils$5.forEach(A,function(O,N){(!(utils$5.isUndefined(O)||O===null)&&v.call(f,O,utils$5.isString(N)?N.trim():N,T,E))===!0&&M(O,T?T.concat(N):[N])}),C.pop()}}if(!utils$5.isObject(r))throw new TypeError("data must be an object");return M(r),f}function encode$2(r){const f={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(m){return f[m]})}function AxiosURLSearchParams(r,f){this._pairs=[],r&&toFormData$1(r,this,f)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(f,d){this._pairs.push([f,d])},prototype.toString=function(f){const d=f?function(m){return f.call(this,m,encode$2)}:encode$2;return this._pairs.map(function(v){return d(v[0])+"="+d(v[1])},"").join("&")};function encode$1(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(r,f,d){if(!f)return r;const m=d&&d.encode||encode$1;utils$5.isFunction(d)&&(d={serialize:d});const v=d&&d.serialize;let g;if(v?g=v(f,d):g=utils$5.isURLSearchParams(f)?f.toString():new AxiosURLSearchParams(f,d).toString(m),g){const w=r.indexOf("#");w!==-1&&(r=r.slice(0,w)),r+=(r.indexOf("?")===-1?"?":"&")+g}return r}class InterceptorManager{constructor(){this.handlers=[]}use(f,d,m){return this.handlers.push({fulfilled:f,rejected:d,synchronous:m?m.synchronous:!1,runWhen:m?m.runWhen:null}),this.handlers.length-1}eject(f){this.handlers[f]&&(this.handlers[f]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(f){utils$5.forEach(this.handlers,function(m){m!==null&&f(m)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$2={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform$1={...utils$4,...platform$2};function toURLEncodedForm(r,f){return toFormData$1(r,new platform$1.classes.URLSearchParams,{visitor:function(d,m,v,g){return platform$1.isNode&&utils$5.isBuffer(d)?(this.append(m,d.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...f})}function parsePropPath(r){return utils$5.matchAll(/\w+|\[(\w*)]/g,r).map(f=>f[0]==="[]"?"":f[1]||f[0])}function arrayToObject(r){const f={},d=Object.keys(r);let m;const v=d.length;let g;for(m=0;m<v;m++)g=d[m],f[g]=r[g];return f}function formDataToJSON(r){function f(d,m,v,g){let w=d[g++];if(w==="__proto__")return!0;const x=Number.isFinite(+w),S=g>=d.length;return w=!w&&utils$5.isArray(v)?v.length:w,S?(utils$5.hasOwnProp(v,w)?v[w]=[v[w],m]:v[w]=m,!x):((!v[w]||!utils$5.isObject(v[w]))&&(v[w]=[]),f(d,m,v[w],g)&&utils$5.isArray(v[w])&&(v[w]=arrayToObject(v[w])),!x)}if(utils$5.isFormData(r)&&utils$5.isFunction(r.entries)){const d={};return utils$5.forEachEntry(r,(m,v)=>{f(parsePropPath(m),v,d,0)}),d}return null}function stringifySafely(r,f,d){if(utils$5.isString(r))try{return(f||JSON.parse)(r),utils$5.trim(r)}catch(m){if(m.name!=="SyntaxError")throw m}return(d||JSON.stringify)(r)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(f,d){const m=d.getContentType()||"",v=m.indexOf("application/json")>-1,g=utils$5.isObject(f);if(g&&utils$5.isHTMLForm(f)&&(f=new FormData(f)),utils$5.isFormData(f))return v?JSON.stringify(formDataToJSON(f)):f;if(utils$5.isArrayBuffer(f)||utils$5.isBuffer(f)||utils$5.isStream(f)||utils$5.isFile(f)||utils$5.isBlob(f)||utils$5.isReadableStream(f))return f;if(utils$5.isArrayBufferView(f))return f.buffer;if(utils$5.isURLSearchParams(f))return d.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),f.toString();let x;if(g){if(m.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(f,this.formSerializer).toString();if((x=utils$5.isFileList(f))||m.indexOf("multipart/form-data")>-1){const S=this.env&&this.env.FormData;return toFormData$1(x?{"files[]":f}:f,S&&new S,this.formSerializer)}}return g||v?(d.setContentType("application/json",!1),stringifySafely(f)):f}],transformResponse:[function(f){const d=this.transitional||defaults.transitional,m=d&&d.forcedJSONParsing,v=this.responseType==="json";if(utils$5.isResponse(f)||utils$5.isReadableStream(f))return f;if(f&&utils$5.isString(f)&&(m&&!this.responseType||v)){const w=!(d&&d.silentJSONParsing)&&v;try{return JSON.parse(f)}catch(x){if(w)throw x.name==="SyntaxError"?AxiosError$1.from(x,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):x}}return f}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$1.classes.FormData,Blob:platform$1.classes.Blob},validateStatus:function(f){return f>=200&&f<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$5.forEach(["delete","get","head","post","put","patch"],r=>{defaults.headers[r]={}});const ignoreDuplicateOf=utils$5.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=r=>{const f={};let d,m,v;return r&&r.split(`
6
+ */(function(r){const f=base64Js,d=ieee754,m=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=b,r.SlowBuffer=X,r.INSPECT_MAX_BYTES=50;const v=2147483647;r.kMaxLength=v;const{Uint8Array:g,ArrayBuffer:w,SharedArrayBuffer:x}=globalThis;b.TYPED_ARRAY_SUPPORT=S(),!b.TYPED_ARRAY_SUPPORT&&typeof console<"u";function S(){try{const le=new g(1),Z={foo:function(){return 42}};return Object.setPrototypeOf(Z,g.prototype),Object.setPrototypeOf(le,Z),le.foo()===42}catch{return!1}}Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}}),Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});function _(le){if(le>v)throw new RangeError('The value "'+le+'" is invalid for option "size"');const Z=new g(le);return Object.setPrototypeOf(Z,b.prototype),Z}function b(le,Z,J){if(typeof le=="number"){if(typeof Z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(le)}return C(le,Z,J)}b.poolSize=8192;function C(le,Z,J){if(typeof le=="string")return T(le,Z);if(w.isView(le))return O(le);if(le==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le);if(ut(le,w)||le&&ut(le.buffer,w)||typeof x<"u"&&(ut(le,x)||le&&ut(le.buffer,x)))return N(le,Z,J);if(typeof le=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ge=le.valueOf&&le.valueOf();if(ge!=null&&ge!==le)return b.from(ge,Z,J);const Ee=H(le);if(Ee)return Ee;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof le[Symbol.toPrimitive]=="function")return b.from(le[Symbol.toPrimitive]("string"),Z,J);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof le)}b.from=function(le,Z,J){return C(le,Z,J)},Object.setPrototypeOf(b.prototype,g.prototype),Object.setPrototypeOf(b,g);function E(le){if(typeof le!="number")throw new TypeError('"size" argument must be of type number');if(le<0)throw new RangeError('The value "'+le+'" is invalid for option "size"')}function M(le,Z,J){return E(le),le<=0?_(le):Z!==void 0?typeof J=="string"?_(le).fill(Z,J):_(le).fill(Z):_(le)}b.alloc=function(le,Z,J){return M(le,Z,J)};function A(le){return E(le),_(le<0?0:V(le)|0)}b.allocUnsafe=function(le){return A(le)},b.allocUnsafeSlow=function(le){return A(le)};function T(le,Z){if((typeof Z!="string"||Z==="")&&(Z="utf8"),!b.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);const J=oe(le,Z)|0;let ge=_(J);const Ee=ge.write(le,Z);return Ee!==J&&(ge=ge.slice(0,Ee)),ge}function L(le){const Z=le.length<0?0:V(le.length)|0,J=_(Z);for(let ge=0;ge<Z;ge+=1)J[ge]=le[ge]&255;return J}function O(le){if(ut(le,g)){const Z=new g(le);return N(Z.buffer,Z.byteOffset,Z.byteLength)}return L(le)}function N(le,Z,J){if(Z<0||le.byteLength<Z)throw new RangeError('"offset" is outside of buffer bounds');if(le.byteLength<Z+(J||0))throw new RangeError('"length" is outside of buffer bounds');let ge;return Z===void 0&&J===void 0?ge=new g(le):J===void 0?ge=new g(le,Z):ge=new g(le,Z,J),Object.setPrototypeOf(ge,b.prototype),ge}function H(le){if(b.isBuffer(le)){const Z=V(le.length)|0,J=_(Z);return J.length===0||le.copy(J,0,0,Z),J}if(le.length!==void 0)return typeof le.length!="number"||gt(le.length)?_(0):L(le);if(le.type==="Buffer"&&Array.isArray(le.data))return L(le.data)}function V(le){if(le>=v)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+v.toString(16)+" bytes");return le|0}function X(le){return+le!=le&&(le=0),b.alloc(+le)}b.isBuffer=function(Z){return Z!=null&&Z._isBuffer===!0&&Z!==b.prototype},b.compare=function(Z,J){if(ut(Z,g)&&(Z=b.from(Z,Z.offset,Z.byteLength)),ut(J,g)&&(J=b.from(J,J.offset,J.byteLength)),!b.isBuffer(Z)||!b.isBuffer(J))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Z===J)return 0;let ge=Z.length,Ee=J.length;for(let Re=0,ke=Math.min(ge,Ee);Re<ke;++Re)if(Z[Re]!==J[Re]){ge=Z[Re],Ee=J[Re];break}return ge<Ee?-1:Ee<ge?1:0},b.isEncoding=function(Z){switch(String(Z).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}},b.concat=function(Z,J){if(!Array.isArray(Z))throw new TypeError('"list" argument must be an Array of Buffers');if(Z.length===0)return b.alloc(0);let ge;if(J===void 0)for(J=0,ge=0;ge<Z.length;++ge)J+=Z[ge].length;const Ee=b.allocUnsafe(J);let Re=0;for(ge=0;ge<Z.length;++ge){let ke=Z[ge];if(ut(ke,g))Re+ke.length>Ee.length?(b.isBuffer(ke)||(ke=b.from(ke)),ke.copy(Ee,Re)):g.prototype.set.call(Ee,ke,Re);else if(b.isBuffer(ke))ke.copy(Ee,Re);else throw new TypeError('"list" argument must be an Array of Buffers');Re+=ke.length}return Ee};function oe(le,Z){if(b.isBuffer(le))return le.length;if(w.isView(le)||ut(le,w))return le.byteLength;if(typeof le!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof le);const J=le.length,ge=arguments.length>2&&arguments[2]===!0;if(!ge&&J===0)return 0;let Ee=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return J;case"utf8":case"utf-8":return je(le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J*2;case"hex":return J>>>1;case"base64":return Je(le).length;default:if(Ee)return ge?-1:je(le).length;Z=(""+Z).toLowerCase(),Ee=!0}}b.byteLength=oe;function se(le,Z,J){let ge=!1;if((Z===void 0||Z<0)&&(Z=0),Z>this.length||((J===void 0||J>this.length)&&(J=this.length),J<=0)||(J>>>=0,Z>>>=0,J<=Z))return"";for(le||(le="utf8");;)switch(le){case"hex":return R(this,Z,J);case"utf8":case"utf-8":return I(this,Z,J);case"ascii":return D(this,Z,J);case"latin1":case"binary":return W(this,Z,J);case"base64":return $(this,Z,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,Z,J);default:if(ge)throw new TypeError("Unknown encoding: "+le);le=(le+"").toLowerCase(),ge=!0}}b.prototype._isBuffer=!0;function de(le,Z,J){const ge=le[Z];le[Z]=le[J],le[J]=ge}b.prototype.swap16=function(){const Z=this.length;if(Z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let J=0;J<Z;J+=2)de(this,J,J+1);return this},b.prototype.swap32=function(){const Z=this.length;if(Z%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let J=0;J<Z;J+=4)de(this,J,J+3),de(this,J+1,J+2);return this},b.prototype.swap64=function(){const Z=this.length;if(Z%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let J=0;J<Z;J+=8)de(this,J,J+7),de(this,J+1,J+6),de(this,J+2,J+5),de(this,J+3,J+4);return this},b.prototype.toString=function(){const Z=this.length;return Z===0?"":arguments.length===0?I(this,0,Z):se.apply(this,arguments)},b.prototype.toLocaleString=b.prototype.toString,b.prototype.equals=function(Z){if(!b.isBuffer(Z))throw new TypeError("Argument must be a Buffer");return this===Z?!0:b.compare(this,Z)===0},b.prototype.inspect=function(){let Z="";const J=r.INSPECT_MAX_BYTES;return Z=this.toString("hex",0,J).replace(/(.{2})/g,"$1 ").trim(),this.length>J&&(Z+=" ... "),"<Buffer "+Z+">"},m&&(b.prototype[m]=b.prototype.inspect),b.prototype.compare=function(Z,J,ge,Ee,Re){if(ut(Z,g)&&(Z=b.from(Z,Z.offset,Z.byteLength)),!b.isBuffer(Z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Z);if(J===void 0&&(J=0),ge===void 0&&(ge=Z?Z.length:0),Ee===void 0&&(Ee=0),Re===void 0&&(Re=this.length),J<0||ge>Z.length||Ee<0||Re>this.length)throw new RangeError("out of range index");if(Ee>=Re&&J>=ge)return 0;if(Ee>=Re)return-1;if(J>=ge)return 1;if(J>>>=0,ge>>>=0,Ee>>>=0,Re>>>=0,this===Z)return 0;let ke=Re-Ee,Xe=ge-J;const He=Math.min(ke,Xe),Ze=this.slice(Ee,Re),xt=Z.slice(J,ge);for(let tt=0;tt<He;++tt)if(Ze[tt]!==xt[tt]){ke=Ze[tt],Xe=xt[tt];break}return ke<Xe?-1:Xe<ke?1:0};function he(le,Z,J,ge,Ee){if(le.length===0)return-1;if(typeof J=="string"?(ge=J,J=0):J>2147483647?J=2147483647:J<-2147483648&&(J=-2147483648),J=+J,gt(J)&&(J=Ee?0:le.length-1),J<0&&(J=le.length+J),J>=le.length){if(Ee)return-1;J=le.length-1}else if(J<0)if(Ee)J=0;else return-1;if(typeof Z=="string"&&(Z=b.from(Z,ge)),b.isBuffer(Z))return Z.length===0?-1:we(le,Z,J,ge,Ee);if(typeof Z=="number")return Z=Z&255,typeof g.prototype.indexOf=="function"?Ee?g.prototype.indexOf.call(le,Z,J):g.prototype.lastIndexOf.call(le,Z,J):we(le,[Z],J,ge,Ee);throw new TypeError("val must be string, number or Buffer")}function we(le,Z,J,ge,Ee){let Re=1,ke=le.length,Xe=Z.length;if(ge!==void 0&&(ge=String(ge).toLowerCase(),ge==="ucs2"||ge==="ucs-2"||ge==="utf16le"||ge==="utf-16le")){if(le.length<2||Z.length<2)return-1;Re=2,ke/=2,Xe/=2,J/=2}function He(xt,tt){return Re===1?xt[tt]:xt.readUInt16BE(tt*Re)}let Ze;if(Ee){let xt=-1;for(Ze=J;Ze<ke;Ze++)if(He(le,Ze)===He(Z,xt===-1?0:Ze-xt)){if(xt===-1&&(xt=Ze),Ze-xt+1===Xe)return xt*Re}else xt!==-1&&(Ze-=Ze-xt),xt=-1}else for(J+Xe>ke&&(J=ke-Xe),Ze=J;Ze>=0;Ze--){let xt=!0;for(let tt=0;tt<Xe;tt++)if(He(le,Ze+tt)!==He(Z,tt)){xt=!1;break}if(xt)return Ze}return-1}b.prototype.includes=function(Z,J,ge){return this.indexOf(Z,J,ge)!==-1},b.prototype.indexOf=function(Z,J,ge){return he(this,Z,J,ge,!0)},b.prototype.lastIndexOf=function(Z,J,ge){return he(this,Z,J,ge,!1)};function te(le,Z,J,ge){J=Number(J)||0;const Ee=le.length-J;ge?(ge=Number(ge),ge>Ee&&(ge=Ee)):ge=Ee;const Re=Z.length;ge>Re/2&&(ge=Re/2);let ke;for(ke=0;ke<ge;++ke){const Xe=parseInt(Z.substr(ke*2,2),16);if(gt(Xe))return ke;le[J+ke]=Xe}return ke}function k(le,Z,J,ge){return Ge(je(Z,le.length-J),le,J,ge)}function q(le,Z,J,ge){return Ge(Ye(Z),le,J,ge)}function y(le,Z,J,ge){return Ge(Je(Z),le,J,ge)}function B(le,Z,J,ge){return Ge(st(Z,le.length-J),le,J,ge)}b.prototype.write=function(Z,J,ge,Ee){if(J===void 0)Ee="utf8",ge=this.length,J=0;else if(ge===void 0&&typeof J=="string")Ee=J,ge=this.length,J=0;else if(isFinite(J))J=J>>>0,isFinite(ge)?(ge=ge>>>0,Ee===void 0&&(Ee="utf8")):(Ee=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Re=this.length-J;if((ge===void 0||ge>Re)&&(ge=Re),Z.length>0&&(ge<0||J<0)||J>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ee||(Ee="utf8");let ke=!1;for(;;)switch(Ee){case"hex":return te(this,Z,J,ge);case"utf8":case"utf-8":return k(this,Z,J,ge);case"ascii":case"latin1":case"binary":return q(this,Z,J,ge);case"base64":return y(this,Z,J,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,Z,J,ge);default:if(ke)throw new TypeError("Unknown encoding: "+Ee);Ee=(""+Ee).toLowerCase(),ke=!0}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(le,Z,J){return Z===0&&J===le.length?f.fromByteArray(le):f.fromByteArray(le.slice(Z,J))}function I(le,Z,J){J=Math.min(le.length,J);const ge=[];let Ee=Z;for(;Ee<J;){const Re=le[Ee];let ke=null,Xe=Re>239?4:Re>223?3:Re>191?2:1;if(Ee+Xe<=J){let He,Ze,xt,tt;switch(Xe){case 1:Re<128&&(ke=Re);break;case 2:He=le[Ee+1],(He&192)===128&&(tt=(Re&31)<<6|He&63,tt>127&&(ke=tt));break;case 3:He=le[Ee+1],Ze=le[Ee+2],(He&192)===128&&(Ze&192)===128&&(tt=(Re&15)<<12|(He&63)<<6|Ze&63,tt>2047&&(tt<55296||tt>57343)&&(ke=tt));break;case 4:He=le[Ee+1],Ze=le[Ee+2],xt=le[Ee+3],(He&192)===128&&(Ze&192)===128&&(xt&192)===128&&(tt=(Re&15)<<18|(He&63)<<12|(Ze&63)<<6|xt&63,tt>65535&&tt<1114112&&(ke=tt))}}ke===null?(ke=65533,Xe=1):ke>65535&&(ke-=65536,ge.push(ke>>>10&1023|55296),ke=56320|ke&1023),ge.push(ke),Ee+=Xe}return j(ge)}const U=4096;function j(le){const Z=le.length;if(Z<=U)return String.fromCharCode.apply(String,le);let J="",ge=0;for(;ge<Z;)J+=String.fromCharCode.apply(String,le.slice(ge,ge+=U));return J}function D(le,Z,J){let ge="";J=Math.min(le.length,J);for(let Ee=Z;Ee<J;++Ee)ge+=String.fromCharCode(le[Ee]&127);return ge}function W(le,Z,J){let ge="";J=Math.min(le.length,J);for(let Ee=Z;Ee<J;++Ee)ge+=String.fromCharCode(le[Ee]);return ge}function R(le,Z,J){const ge=le.length;(!Z||Z<0)&&(Z=0),(!J||J<0||J>ge)&&(J=ge);let Ee="";for(let Re=Z;Re<J;++Re)Ee+=rt[le[Re]];return Ee}function z(le,Z,J){const ge=le.slice(Z,J);let Ee="";for(let Re=0;Re<ge.length-1;Re+=2)Ee+=String.fromCharCode(ge[Re]+ge[Re+1]*256);return Ee}b.prototype.slice=function(Z,J){const ge=this.length;Z=~~Z,J=J===void 0?ge:~~J,Z<0?(Z+=ge,Z<0&&(Z=0)):Z>ge&&(Z=ge),J<0?(J+=ge,J<0&&(J=0)):J>ge&&(J=ge),J<Z&&(J=Z);const Ee=this.subarray(Z,J);return Object.setPrototypeOf(Ee,b.prototype),Ee};function ye(le,Z,J){if(le%1!==0||le<0)throw new RangeError("offset is not uint");if(le+Z>J)throw new RangeError("Trying to access beyond buffer length")}b.prototype.readUintLE=b.prototype.readUIntLE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z],Re=1,ke=0;for(;++ke<J&&(Re*=256);)Ee+=this[Z+ke]*Re;return Ee},b.prototype.readUintBE=b.prototype.readUIntBE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z+--J],Re=1;for(;J>0&&(Re*=256);)Ee+=this[Z+--J]*Re;return Ee},b.prototype.readUint8=b.prototype.readUInt8=function(Z,J){return Z=Z>>>0,J||ye(Z,1,this.length),this[Z]},b.prototype.readUint16LE=b.prototype.readUInt16LE=function(Z,J){return Z=Z>>>0,J||ye(Z,2,this.length),this[Z]|this[Z+1]<<8},b.prototype.readUint16BE=b.prototype.readUInt16BE=function(Z,J){return Z=Z>>>0,J||ye(Z,2,this.length),this[Z]<<8|this[Z+1]},b.prototype.readUint32LE=b.prototype.readUInt32LE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),(this[Z]|this[Z+1]<<8|this[Z+2]<<16)+this[Z+3]*16777216},b.prototype.readUint32BE=b.prototype.readUInt32BE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]*16777216+(this[Z+1]<<16|this[Z+2]<<8|this[Z+3])},b.prototype.readBigUInt64LE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Fe(Z,this.length-8);const Ee=J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24,Re=this[++Z]+this[++Z]*2**8+this[++Z]*2**16+ge*2**24;return BigInt(Ee)+(BigInt(Re)<<BigInt(32))}),b.prototype.readBigUInt64BE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Fe(Z,this.length-8);const Ee=J*2**24+this[++Z]*2**16+this[++Z]*2**8+this[++Z],Re=this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ge;return(BigInt(Ee)<<BigInt(32))+BigInt(Re)}),b.prototype.readIntLE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=this[Z],Re=1,ke=0;for(;++ke<J&&(Re*=256);)Ee+=this[Z+ke]*Re;return Re*=128,Ee>=Re&&(Ee-=Math.pow(2,8*J)),Ee},b.prototype.readIntBE=function(Z,J,ge){Z=Z>>>0,J=J>>>0,ge||ye(Z,J,this.length);let Ee=J,Re=1,ke=this[Z+--Ee];for(;Ee>0&&(Re*=256);)ke+=this[Z+--Ee]*Re;return Re*=128,ke>=Re&&(ke-=Math.pow(2,8*J)),ke},b.prototype.readInt8=function(Z,J){return Z=Z>>>0,J||ye(Z,1,this.length),this[Z]&128?(255-this[Z]+1)*-1:this[Z]},b.prototype.readInt16LE=function(Z,J){Z=Z>>>0,J||ye(Z,2,this.length);const ge=this[Z]|this[Z+1]<<8;return ge&32768?ge|4294901760:ge},b.prototype.readInt16BE=function(Z,J){Z=Z>>>0,J||ye(Z,2,this.length);const ge=this[Z+1]|this[Z]<<8;return ge&32768?ge|4294901760:ge},b.prototype.readInt32LE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]|this[Z+1]<<8|this[Z+2]<<16|this[Z+3]<<24},b.prototype.readInt32BE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),this[Z]<<24|this[Z+1]<<16|this[Z+2]<<8|this[Z+3]},b.prototype.readBigInt64LE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Fe(Z,this.length-8);const Ee=this[Z+4]+this[Z+5]*2**8+this[Z+6]*2**16+(ge<<24);return(BigInt(Ee)<<BigInt(32))+BigInt(J+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24)}),b.prototype.readBigInt64BE=wt(function(Z){Z=Z>>>0,Oe(Z,"offset");const J=this[Z],ge=this[Z+7];(J===void 0||ge===void 0)&&Fe(Z,this.length-8);const Ee=(J<<24)+this[++Z]*2**16+this[++Z]*2**8+this[++Z];return(BigInt(Ee)<<BigInt(32))+BigInt(this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ge)}),b.prototype.readFloatLE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),d.read(this,Z,!0,23,4)},b.prototype.readFloatBE=function(Z,J){return Z=Z>>>0,J||ye(Z,4,this.length),d.read(this,Z,!1,23,4)},b.prototype.readDoubleLE=function(Z,J){return Z=Z>>>0,J||ye(Z,8,this.length),d.read(this,Z,!0,52,8)},b.prototype.readDoubleBE=function(Z,J){return Z=Z>>>0,J||ye(Z,8,this.length),d.read(this,Z,!1,52,8)};function Ce(le,Z,J,ge,Ee,Re){if(!b.isBuffer(le))throw new TypeError('"buffer" argument must be a Buffer instance');if(Z>Ee||Z<Re)throw new RangeError('"value" argument is out of bounds');if(J+ge>le.length)throw new RangeError("Index out of range")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,ge=ge>>>0,!Ee){const Xe=Math.pow(2,8*ge)-1;Ce(this,Z,J,ge,Xe,0)}let Re=1,ke=0;for(this[J]=Z&255;++ke<ge&&(Re*=256);)this[J+ke]=Z/Re&255;return J+ge},b.prototype.writeUintBE=b.prototype.writeUIntBE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,ge=ge>>>0,!Ee){const Xe=Math.pow(2,8*ge)-1;Ce(this,Z,J,ge,Xe,0)}let Re=ge-1,ke=1;for(this[J+Re]=Z&255;--Re>=0&&(ke*=256);)this[J+Re]=Z/ke&255;return J+ge},b.prototype.writeUint8=b.prototype.writeUInt8=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,1,255,0),this[J]=Z&255,J+1},b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,65535,0),this[J]=Z&255,this[J+1]=Z>>>8,J+2},b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,65535,0),this[J]=Z>>>8,this[J+1]=Z&255,J+2},b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,4294967295,0),this[J+3]=Z>>>24,this[J+2]=Z>>>16,this[J+1]=Z>>>8,this[J]=Z&255,J+4},b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,4294967295,0),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4};function me(le,Z,J,ge,Ee){Ie(Z,ge,Ee,le,J,7);let Re=Number(Z&BigInt(4294967295));le[J++]=Re,Re=Re>>8,le[J++]=Re,Re=Re>>8,le[J++]=Re,Re=Re>>8,le[J++]=Re;let ke=Number(Z>>BigInt(32)&BigInt(4294967295));return le[J++]=ke,ke=ke>>8,le[J++]=ke,ke=ke>>8,le[J++]=ke,ke=ke>>8,le[J++]=ke,J}function ie(le,Z,J,ge,Ee){Ie(Z,ge,Ee,le,J,7);let Re=Number(Z&BigInt(4294967295));le[J+7]=Re,Re=Re>>8,le[J+6]=Re,Re=Re>>8,le[J+5]=Re,Re=Re>>8,le[J+4]=Re;let ke=Number(Z>>BigInt(32)&BigInt(4294967295));return le[J+3]=ke,ke=ke>>8,le[J+2]=ke,ke=ke>>8,le[J+1]=ke,ke=ke>>8,le[J]=ke,J+8}b.prototype.writeBigUInt64LE=wt(function(Z,J=0){return me(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeBigUInt64BE=wt(function(Z,J=0){return ie(this,Z,J,BigInt(0),BigInt("0xffffffffffffffff"))}),b.prototype.writeIntLE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,!Ee){const He=Math.pow(2,8*ge-1);Ce(this,Z,J,ge,He-1,-He)}let Re=0,ke=1,Xe=0;for(this[J]=Z&255;++Re<ge&&(ke*=256);)Z<0&&Xe===0&&this[J+Re-1]!==0&&(Xe=1),this[J+Re]=(Z/ke>>0)-Xe&255;return J+ge},b.prototype.writeIntBE=function(Z,J,ge,Ee){if(Z=+Z,J=J>>>0,!Ee){const He=Math.pow(2,8*ge-1);Ce(this,Z,J,ge,He-1,-He)}let Re=ge-1,ke=1,Xe=0;for(this[J+Re]=Z&255;--Re>=0&&(ke*=256);)Z<0&&Xe===0&&this[J+Re+1]!==0&&(Xe=1),this[J+Re]=(Z/ke>>0)-Xe&255;return J+ge},b.prototype.writeInt8=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,1,127,-128),Z<0&&(Z=255+Z+1),this[J]=Z&255,J+1},b.prototype.writeInt16LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,32767,-32768),this[J]=Z&255,this[J+1]=Z>>>8,J+2},b.prototype.writeInt16BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,2,32767,-32768),this[J]=Z>>>8,this[J+1]=Z&255,J+2},b.prototype.writeInt32LE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,2147483647,-2147483648),this[J]=Z&255,this[J+1]=Z>>>8,this[J+2]=Z>>>16,this[J+3]=Z>>>24,J+4},b.prototype.writeInt32BE=function(Z,J,ge){return Z=+Z,J=J>>>0,ge||Ce(this,Z,J,4,2147483647,-2147483648),Z<0&&(Z=4294967295+Z+1),this[J]=Z>>>24,this[J+1]=Z>>>16,this[J+2]=Z>>>8,this[J+3]=Z&255,J+4},b.prototype.writeBigInt64LE=wt(function(Z,J=0){return me(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),b.prototype.writeBigInt64BE=wt(function(Z,J=0){return ie(this,Z,J,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(le,Z,J,ge,Ee,Re){if(J+ge>le.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("Index out of range")}function pe(le,Z,J,ge,Ee){return Z=+Z,J=J>>>0,Ee||ee(le,Z,J,4),d.write(le,Z,J,ge,23,4),J+4}b.prototype.writeFloatLE=function(Z,J,ge){return pe(this,Z,J,!0,ge)},b.prototype.writeFloatBE=function(Z,J,ge){return pe(this,Z,J,!1,ge)};function be(le,Z,J,ge,Ee){return Z=+Z,J=J>>>0,Ee||ee(le,Z,J,8),d.write(le,Z,J,ge,52,8),J+8}b.prototype.writeDoubleLE=function(Z,J,ge){return be(this,Z,J,!0,ge)},b.prototype.writeDoubleBE=function(Z,J,ge){return be(this,Z,J,!1,ge)},b.prototype.copy=function(Z,J,ge,Ee){if(!b.isBuffer(Z))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),!Ee&&Ee!==0&&(Ee=this.length),J>=Z.length&&(J=Z.length),J||(J=0),Ee>0&&Ee<ge&&(Ee=ge),Ee===ge||Z.length===0||this.length===0)return 0;if(J<0)throw new RangeError("targetStart out of bounds");if(ge<0||ge>=this.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("sourceEnd out of bounds");Ee>this.length&&(Ee=this.length),Z.length-J<Ee-ge&&(Ee=Z.length-J+ge);const Re=Ee-ge;return this===Z&&typeof g.prototype.copyWithin=="function"?this.copyWithin(J,ge,Ee):g.prototype.set.call(Z,this.subarray(ge,Ee),J),Re},b.prototype.fill=function(Z,J,ge,Ee){if(typeof Z=="string"){if(typeof J=="string"?(Ee=J,J=0,ge=this.length):typeof ge=="string"&&(Ee=ge,ge=this.length),Ee!==void 0&&typeof Ee!="string")throw new TypeError("encoding must be a string");if(typeof Ee=="string"&&!b.isEncoding(Ee))throw new TypeError("Unknown encoding: "+Ee);if(Z.length===1){const ke=Z.charCodeAt(0);(Ee==="utf8"&&ke<128||Ee==="latin1")&&(Z=ke)}}else typeof Z=="number"?Z=Z&255:typeof Z=="boolean"&&(Z=Number(Z));if(J<0||this.length<J||this.length<ge)throw new RangeError("Out of range index");if(ge<=J)return this;J=J>>>0,ge=ge===void 0?this.length:ge>>>0,Z||(Z=0);let Re;if(typeof Z=="number")for(Re=J;Re<ge;++Re)this[Re]=Z;else{const ke=b.isBuffer(Z)?Z:b.from(Z,Ee),Xe=ke.length;if(Xe===0)throw new TypeError('The value "'+Z+'" is invalid for argument "value"');for(Re=0;Re<ge-J;++Re)this[Re+J]=ke[Re%Xe]}return this};const ae={};function ne(le,Z,J){ae[le]=class extends J{constructor(){super(),Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${le}]`,this.stack,delete this.name}get code(){return le}set code(Ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ee,writable:!0})}toString(){return`${this.name} [${le}]: ${this.message}`}}}ne("ERR_BUFFER_OUT_OF_BOUNDS",function(le){return le?`${le} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ne("ERR_INVALID_ARG_TYPE",function(le,Z){return`The "${le}" argument must be of type number. Received type ${typeof Z}`},TypeError),ne("ERR_OUT_OF_RANGE",function(le,Z,J){let ge=`The value of "${le}" is out of range.`,Ee=J;return Number.isInteger(J)&&Math.abs(J)>2**32?Ee=Se(String(J)):typeof J=="bigint"&&(Ee=String(J),(J>BigInt(2)**BigInt(32)||J<-(BigInt(2)**BigInt(32)))&&(Ee=Se(Ee)),Ee+="n"),ge+=` It must be ${Z}. Received ${Ee}`,ge},RangeError);function Se(le){let Z="",J=le.length;const ge=le[0]==="-"?1:0;for(;J>=ge+4;J-=3)Z=`_${le.slice(J-3,J)}${Z}`;return`${le.slice(0,J)}${Z}`}function qe(le,Z,J){Oe(Z,"offset"),(le[Z]===void 0||le[Z+J]===void 0)&&Fe(Z,le.length-(J+1))}function Ie(le,Z,J,ge,Ee,Re){if(le>J||le<Z){const ke=typeof Z=="bigint"?"n":"";let Xe;throw Z===0||Z===BigInt(0)?Xe=`>= 0${ke} and < 2${ke} ** ${(Re+1)*8}${ke}`:Xe=`>= -(2${ke} ** ${(Re+1)*8-1}${ke}) and < 2 ** ${(Re+1)*8-1}${ke}`,new ae.ERR_OUT_OF_RANGE("value",Xe,le)}qe(ge,Ee,Re)}function Oe(le,Z){if(typeof le!="number")throw new ae.ERR_INVALID_ARG_TYPE(Z,"number",le)}function Fe(le,Z,J){throw Math.floor(le)!==le?(Oe(le,J),new ae.ERR_OUT_OF_RANGE("offset","an integer",le)):Z<0?new ae.ERR_BUFFER_OUT_OF_BOUNDS:new ae.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Z}`,le)}const De=/[^+/0-9A-Za-z-_]/g;function $e(le){if(le=le.split("=")[0],le=le.trim().replace(De,""),le.length<2)return"";for(;le.length%4!==0;)le=le+"=";return le}function je(le,Z){Z=Z||1/0;let J;const ge=le.length;let Ee=null;const Re=[];for(let ke=0;ke<ge;++ke){if(J=le.charCodeAt(ke),J>55295&&J<57344){if(!Ee){if(J>56319){(Z-=3)>-1&&Re.push(239,191,189);continue}else if(ke+1===ge){(Z-=3)>-1&&Re.push(239,191,189);continue}Ee=J;continue}if(J<56320){(Z-=3)>-1&&Re.push(239,191,189),Ee=J;continue}J=(Ee-55296<<10|J-56320)+65536}else Ee&&(Z-=3)>-1&&Re.push(239,191,189);if(Ee=null,J<128){if((Z-=1)<0)break;Re.push(J)}else if(J<2048){if((Z-=2)<0)break;Re.push(J>>6|192,J&63|128)}else if(J<65536){if((Z-=3)<0)break;Re.push(J>>12|224,J>>6&63|128,J&63|128)}else if(J<1114112){if((Z-=4)<0)break;Re.push(J>>18|240,J>>12&63|128,J>>6&63|128,J&63|128)}else throw new Error("Invalid code point")}return Re}function Ye(le){const Z=[];for(let J=0;J<le.length;++J)Z.push(le.charCodeAt(J)&255);return Z}function st(le,Z){let J,ge,Ee;const Re=[];for(let ke=0;ke<le.length&&!((Z-=2)<0);++ke)J=le.charCodeAt(ke),ge=J>>8,Ee=J%256,Re.push(Ee),Re.push(ge);return Re}function Je(le){return f.toByteArray($e(le))}function Ge(le,Z,J,ge){let Ee;for(Ee=0;Ee<ge&&!(Ee+J>=Z.length||Ee>=le.length);++Ee)Z[Ee+J]=le[Ee];return Ee}function ut(le,Z){return le instanceof Z||le!=null&&le.constructor!=null&&le.constructor.name!=null&&le.constructor.name===Z.name}function gt(le){return le!==le}const rt=(function(){const le="0123456789abcdef",Z=new Array(256);for(let J=0;J<16;++J){const ge=J*16;for(let Ee=0;Ee<16;++Ee)Z[ge+Ee]=le[J]+le[Ee]}return Z})();function wt(le){return typeof BigInt>"u"?bt:le}function bt(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer=buffer$1.Buffer,Buffer$1=buffer$1.Buffer;function getDefaultExportFromCjs$1(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var browser$c={exports:{}},process=browser$c.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(r){if(cachedSetTimeout===setTimeout)return setTimeout(r,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(r,0);try{return cachedSetTimeout(r,0)}catch{try{return cachedSetTimeout.call(null,r,0)}catch{return cachedSetTimeout.call(this,r,0)}}}function runClearTimeout(r){if(cachedClearTimeout===clearTimeout)return clearTimeout(r);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(r);try{return cachedClearTimeout(r)}catch{try{return cachedClearTimeout.call(null,r)}catch{return cachedClearTimeout.call(this,r)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var r=runTimeout(cleanUpNextTick);draining=!0;for(var f=queue.length;f;){for(currentQueue=queue,queue=[];++queueIndex<f;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,f=queue.length}currentQueue=null,draining=!1,runClearTimeout(r)}}process.nextTick=function(r){var f=new Array(arguments.length-1);if(arguments.length>1)for(var d=1;d<arguments.length;d++)f[d-1]=arguments[d];queue.push(new Item(r,f)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(r,f){this.fun=r,this.array=f}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$1(){}process.on=noop$1,process.addListener=noop$1,process.once=noop$1,process.off=noop$1,process.removeListener=noop$1,process.removeAllListeners=noop$1,process.emit=noop$1,process.prependListener=noop$1,process.prependOnceListener=noop$1,process.listeners=function(r){return[]},process.binding=function(r){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(r){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$c.exports;const process$1=getDefaultExportFromCjs$1(browserExports),global$1=globalThis||void 0||self;function bind(r,f){return function(){return r.apply(f,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(r=>f=>{const d=toString.call(f);return r[d]||(r[d]=d.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=r=>(r=r.toLowerCase(),f=>kindOf(f)===r),typeOfTest=r=>f=>typeof f===r,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(r){return r!==null&&!isUndefined(r)&&r.constructor!==null&&!isUndefined(r.constructor)&&isFunction(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(r){let f;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?f=ArrayBuffer.isView(r):f=r&&r.buffer&&isArrayBuffer(r.buffer),f}const isString=typeOfTest("string"),isFunction=typeOfTest("function"),isNumber=typeOfTest("number"),isObject$1=r=>r!==null&&typeof r=="object",isBoolean=r=>r===!0||r===!1,isPlainObject$1=r=>{if(kindOf(r)!=="object")return!1;const f=getPrototypeOf(r);return(f===null||f===Object.prototype||Object.getPrototypeOf(f)===null)&&!(toStringTag in r)&&!(iterator in r)},isEmptyObject=r=>{if(!isObject$1(r)||isBuffer(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=r=>isObject$1(r)&&isFunction(r.pipe),isFormData=r=>{let f;return r&&(typeof FormData=="function"&&r instanceof FormData||isFunction(r.append)&&((f=kindOf(r))==="formdata"||f==="object"&&isFunction(r.toString)&&r.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach$1(r,f,{allOwnKeys:d=!1}={}){if(r===null||typeof r>"u")return;let m,v;if(typeof r!="object"&&(r=[r]),isArray(r))for(m=0,v=r.length;m<v;m++)f.call(null,r[m],m,r);else{if(isBuffer(r))return;const g=d?Object.getOwnPropertyNames(r):Object.keys(r),w=g.length;let x;for(m=0;m<w;m++)x=g[m],f.call(null,r[x],x,r)}}function findKey(r,f){if(isBuffer(r))return null;f=f.toLowerCase();const d=Object.keys(r);let m=d.length,v;for(;m-- >0;)if(v=d[m],f===v.toLowerCase())return v;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global$1,isContextDefined=r=>!isUndefined(r)&&r!==_global;function merge(){const{caseless:r}=isContextDefined(this)&&this||{},f={},d=(m,v)=>{const g=r&&findKey(f,v)||v;isPlainObject$1(f[g])&&isPlainObject$1(m)?f[g]=merge(f[g],m):isPlainObject$1(m)?f[g]=merge({},m):isArray(m)?f[g]=m.slice():f[g]=m};for(let m=0,v=arguments.length;m<v;m++)arguments[m]&&forEach$1(arguments[m],d);return f}const extend=(r,f,d,{allOwnKeys:m}={})=>(forEach$1(f,(v,g)=>{d&&isFunction(v)?r[g]=bind(v,d):r[g]=v},{allOwnKeys:m}),r),stripBOM=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),inherits=(r,f,d,m)=>{r.prototype=Object.create(f.prototype,m),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:f.prototype}),d&&Object.assign(r.prototype,d)},toFlatObject=(r,f,d,m)=>{let v,g,w;const x={};if(f=f||{},r==null)return f;do{for(v=Object.getOwnPropertyNames(r),g=v.length;g-- >0;)w=v[g],(!m||m(w,r,f))&&!x[w]&&(f[w]=r[w],x[w]=!0);r=d!==!1&&getPrototypeOf(r)}while(r&&(!d||d(r,f))&&r!==Object.prototype);return f},endsWith=(r,f,d)=>{r=String(r),(d===void 0||d>r.length)&&(d=r.length),d-=f.length;const m=r.indexOf(f,d);return m!==-1&&m===d},toArray=r=>{if(!r)return null;if(isArray(r))return r;let f=r.length;if(!isNumber(f))return null;const d=new Array(f);for(;f-- >0;)d[f]=r[f];return d},isTypedArray$1=(r=>f=>r&&f instanceof r)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(r,f)=>{const m=(r&&r[iterator]).call(r);let v;for(;(v=m.next())&&!v.done;){const g=v.value;f.call(r,g[0],g[1])}},matchAll=(r,f)=>{let d;const m=[];for(;(d=r.exec(f))!==null;)m.push(d);return m},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(d,m,v){return m.toUpperCase()+v}),hasOwnProperty=(({hasOwnProperty:r})=>(f,d)=>r.call(f,d))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(r,f)=>{const d=Object.getOwnPropertyDescriptors(r),m={};forEach$1(d,(v,g)=>{let w;(w=f(v,g,r))!==!1&&(m[g]=w||v)}),Object.defineProperties(r,m)},freezeMethods=r=>{reduceDescriptors(r,(f,d)=>{if(isFunction(r)&&["arguments","caller","callee"].indexOf(d)!==-1)return!1;const m=r[d];if(isFunction(m)){if(f.enumerable=!1,"writable"in f){f.writable=!1;return}f.set||(f.set=()=>{throw Error("Can not rewrite read-only method '"+d+"'")})}})},toObjectSet=(r,f)=>{const d={},m=v=>{v.forEach(g=>{d[g]=!0})};return isArray(r)?m(r):m(String(r).split(f)),d},noop=()=>{},toFiniteNumber=(r,f)=>r!=null&&Number.isFinite(r=+r)?r:f;function isSpecCompliantForm(r){return!!(r&&isFunction(r.append)&&r[toStringTag]==="FormData"&&r[iterator])}const toJSONObject=r=>{const f=new Array(10),d=(m,v)=>{if(isObject$1(m)){if(f.indexOf(m)>=0)return;if(isBuffer(m))return m;if(!("toJSON"in m)){f[v]=m;const g=isArray(m)?[]:{};return forEach$1(m,(w,x)=>{const S=d(w,v+1);!isUndefined(S)&&(g[x]=S)}),f[v]=void 0,g}}return m};return d(r,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=r=>r&&(isObject$1(r)||isFunction(r))&&isFunction(r.then)&&isFunction(r.catch),_setImmediate=((r,f)=>r?setImmediate:f?((d,m)=>(_global.addEventListener("message",({source:v,data:g})=>{v===_global&&g===d&&m.length&&m.shift()()},!1),v=>{m.push(v),_global.postMessage(d,"*")}))(`axios@${Math.random()}`,[]):d=>setTimeout(d))(typeof setImmediate=="function",isFunction(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process$1<"u"&&process$1.nextTick||_setImmediate,isIterable=r=>r!=null&&isFunction(r[iterator]),utils$5={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject:isObject$1,isPlainObject:isPlainObject$1,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction,isStream,isURLSearchParams,isTypedArray:isTypedArray$1,isFileList,forEach:forEach$1,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError$1(r,f,d,m,v){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",f&&(this.code=f),d&&(this.config=d),m&&(this.request=m),v&&(this.response=v,this.status=v.status?v.status:null)}utils$5.inherits(AxiosError$1,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$5.toJSONObject(this.config),code:this.code,status:this.status}}});const prototype$1=AxiosError$1.prototype,descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{descriptors[r]={value:r}}),Object.defineProperties(AxiosError$1,descriptors),Object.defineProperty(prototype$1,"isAxiosError",{value:!0}),AxiosError$1.from=(r,f,d,m,v,g)=>{const w=Object.create(prototype$1);return utils$5.toFlatObject(r,w,function(S){return S!==Error.prototype},x=>x!=="isAxiosError"),AxiosError$1.call(w,r.message,f,d,m,v),w.cause=r,w.name=r.name,g&&Object.assign(w,g),w};const httpAdapter=null;function isVisitable(r){return utils$5.isPlainObject(r)||utils$5.isArray(r)}function removeBrackets(r){return utils$5.endsWith(r,"[]")?r.slice(0,-2):r}function renderKey(r,f,d){return r?r.concat(f).map(function(v,g){return v=removeBrackets(v),!d&&g?"["+v+"]":v}).join(d?".":""):f}function isFlatArray(r){return utils$5.isArray(r)&&!r.some(isVisitable)}const predicates=utils$5.toFlatObject(utils$5,{},null,function(f){return/^is[A-Z]/.test(f)});function toFormData$1(r,f,d){if(!utils$5.isObject(r))throw new TypeError("target must be an object");f=f||new FormData,d=utils$5.toFlatObject(d,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,L){return!utils$5.isUndefined(L[T])});const m=d.metaTokens,v=d.visitor||b,g=d.dots,w=d.indexes,S=(d.Blob||typeof Blob<"u"&&Blob)&&utils$5.isSpecCompliantForm(f);if(!utils$5.isFunction(v))throw new TypeError("visitor must be a function");function _(A){if(A===null)return"";if(utils$5.isDate(A))return A.toISOString();if(utils$5.isBoolean(A))return A.toString();if(!S&&utils$5.isBlob(A))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$5.isArrayBuffer(A)||utils$5.isTypedArray(A)?S&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function b(A,T,L){let O=A;if(A&&!L&&typeof A=="object"){if(utils$5.endsWith(T,"{}"))T=m?T:T.slice(0,-2),A=JSON.stringify(A);else if(utils$5.isArray(A)&&isFlatArray(A)||(utils$5.isFileList(A)||utils$5.endsWith(T,"[]"))&&(O=utils$5.toArray(A)))return T=removeBrackets(T),O.forEach(function(H,V){!(utils$5.isUndefined(H)||H===null)&&f.append(w===!0?renderKey([T],V,g):w===null?T:T+"[]",_(H))}),!1}return isVisitable(A)?!0:(f.append(renderKey(L,T,g),_(A)),!1)}const C=[],E=Object.assign(predicates,{defaultVisitor:b,convertValue:_,isVisitable});function M(A,T){if(!utils$5.isUndefined(A)){if(C.indexOf(A)!==-1)throw Error("Circular reference detected in "+T.join("."));C.push(A),utils$5.forEach(A,function(O,N){(!(utils$5.isUndefined(O)||O===null)&&v.call(f,O,utils$5.isString(N)?N.trim():N,T,E))===!0&&M(O,T?T.concat(N):[N])}),C.pop()}}if(!utils$5.isObject(r))throw new TypeError("data must be an object");return M(r),f}function encode$2(r){const f={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(m){return f[m]})}function AxiosURLSearchParams(r,f){this._pairs=[],r&&toFormData$1(r,this,f)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(f,d){this._pairs.push([f,d])},prototype.toString=function(f){const d=f?function(m){return f.call(this,m,encode$2)}:encode$2;return this._pairs.map(function(v){return d(v[0])+"="+d(v[1])},"").join("&")};function encode$1(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(r,f,d){if(!f)return r;const m=d&&d.encode||encode$1;utils$5.isFunction(d)&&(d={serialize:d});const v=d&&d.serialize;let g;if(v?g=v(f,d):g=utils$5.isURLSearchParams(f)?f.toString():new AxiosURLSearchParams(f,d).toString(m),g){const w=r.indexOf("#");w!==-1&&(r=r.slice(0,w)),r+=(r.indexOf("?")===-1?"?":"&")+g}return r}class InterceptorManager{constructor(){this.handlers=[]}use(f,d,m){return this.handlers.push({fulfilled:f,rejected:d,synchronous:m?m.synchronous:!1,runWhen:m?m.runWhen:null}),this.handlers.length-1}eject(f){this.handlers[f]&&(this.handlers[f]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(f){utils$5.forEach(this.handlers,function(m){m!==null&&f(m)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$2={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform$1={...utils$4,...platform$2};function toURLEncodedForm(r,f){return toFormData$1(r,new platform$1.classes.URLSearchParams,{visitor:function(d,m,v,g){return platform$1.isNode&&utils$5.isBuffer(d)?(this.append(m,d.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...f})}function parsePropPath(r){return utils$5.matchAll(/\w+|\[(\w*)]/g,r).map(f=>f[0]==="[]"?"":f[1]||f[0])}function arrayToObject(r){const f={},d=Object.keys(r);let m;const v=d.length;let g;for(m=0;m<v;m++)g=d[m],f[g]=r[g];return f}function formDataToJSON(r){function f(d,m,v,g){let w=d[g++];if(w==="__proto__")return!0;const x=Number.isFinite(+w),S=g>=d.length;return w=!w&&utils$5.isArray(v)?v.length:w,S?(utils$5.hasOwnProp(v,w)?v[w]=[v[w],m]:v[w]=m,!x):((!v[w]||!utils$5.isObject(v[w]))&&(v[w]=[]),f(d,m,v[w],g)&&utils$5.isArray(v[w])&&(v[w]=arrayToObject(v[w])),!x)}if(utils$5.isFormData(r)&&utils$5.isFunction(r.entries)){const d={};return utils$5.forEachEntry(r,(m,v)=>{f(parsePropPath(m),v,d,0)}),d}return null}function stringifySafely(r,f,d){if(utils$5.isString(r))try{return(f||JSON.parse)(r),utils$5.trim(r)}catch(m){if(m.name!=="SyntaxError")throw m}return(d||JSON.stringify)(r)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(f,d){const m=d.getContentType()||"",v=m.indexOf("application/json")>-1,g=utils$5.isObject(f);if(g&&utils$5.isHTMLForm(f)&&(f=new FormData(f)),utils$5.isFormData(f))return v?JSON.stringify(formDataToJSON(f)):f;if(utils$5.isArrayBuffer(f)||utils$5.isBuffer(f)||utils$5.isStream(f)||utils$5.isFile(f)||utils$5.isBlob(f)||utils$5.isReadableStream(f))return f;if(utils$5.isArrayBufferView(f))return f.buffer;if(utils$5.isURLSearchParams(f))return d.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),f.toString();let x;if(g){if(m.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(f,this.formSerializer).toString();if((x=utils$5.isFileList(f))||m.indexOf("multipart/form-data")>-1){const S=this.env&&this.env.FormData;return toFormData$1(x?{"files[]":f}:f,S&&new S,this.formSerializer)}}return g||v?(d.setContentType("application/json",!1),stringifySafely(f)):f}],transformResponse:[function(f){const d=this.transitional||defaults.transitional,m=d&&d.forcedJSONParsing,v=this.responseType==="json";if(utils$5.isResponse(f)||utils$5.isReadableStream(f))return f;if(f&&utils$5.isString(f)&&(m&&!this.responseType||v)){const w=!(d&&d.silentJSONParsing)&&v;try{return JSON.parse(f)}catch(x){if(w)throw x.name==="SyntaxError"?AxiosError$1.from(x,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):x}}return f}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform$1.classes.FormData,Blob:platform$1.classes.Blob},validateStatus:function(f){return f>=200&&f<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$5.forEach(["delete","get","head","post","put","patch"],r=>{defaults.headers[r]={}});const ignoreDuplicateOf=utils$5.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=r=>{const f={};let d,m,v;return r&&r.split(`
7
7
  `).forEach(function(w){v=w.indexOf(":"),d=w.substring(0,v).trim().toLowerCase(),m=w.substring(v+1).trim(),!(!d||f[d]&&ignoreDuplicateOf[d])&&(d==="set-cookie"?f[d]?f[d].push(m):f[d]=[m]:f[d]=f[d]?f[d]+", "+m:m)}),f},$internals=Symbol("internals");function normalizeHeader(r){return r&&String(r).trim().toLowerCase()}function normalizeValue(r){return r===!1||r==null?r:utils$5.isArray(r)?r.map(normalizeValue):String(r)}function parseTokens(r){const f=Object.create(null),d=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let m;for(;m=d.exec(r);)f[m[1]]=m[2];return f}const isValidHeaderName=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function matchHeaderValue(r,f,d,m,v){if(utils$5.isFunction(m))return m.call(this,f,d);if(v&&(f=d),!!utils$5.isString(f)){if(utils$5.isString(m))return f.indexOf(m)!==-1;if(utils$5.isRegExp(m))return m.test(f)}}function formatHeader(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(f,d,m)=>d.toUpperCase()+m)}function buildAccessors(r,f){const d=utils$5.toCamelCase(" "+f);["get","set","has"].forEach(m=>{Object.defineProperty(r,m+d,{value:function(v,g,w){return this[m].call(this,f,v,g,w)},configurable:!0})})}let AxiosHeaders$1=class{constructor(f){f&&this.set(f)}set(f,d,m){const v=this;function g(x,S,_){const b=normalizeHeader(S);if(!b)throw new Error("header name must be a non-empty string");const C=utils$5.findKey(v,b);(!C||v[C]===void 0||_===!0||_===void 0&&v[C]!==!1)&&(v[C||S]=normalizeValue(x))}const w=(x,S)=>utils$5.forEach(x,(_,b)=>g(_,b,S));if(utils$5.isPlainObject(f)||f instanceof this.constructor)w(f,d);else if(utils$5.isString(f)&&(f=f.trim())&&!isValidHeaderName(f))w(parseHeaders(f),d);else if(utils$5.isObject(f)&&utils$5.isIterable(f)){let x={},S,_;for(const b of f){if(!utils$5.isArray(b))throw TypeError("Object iterator must return a key-value pair");x[_=b[0]]=(S=x[_])?utils$5.isArray(S)?[...S,b[1]]:[S,b[1]]:b[1]}w(x,d)}else f!=null&&g(d,f,m);return this}get(f,d){if(f=normalizeHeader(f),f){const m=utils$5.findKey(this,f);if(m){const v=this[m];if(!d)return v;if(d===!0)return parseTokens(v);if(utils$5.isFunction(d))return d.call(this,v,m);if(utils$5.isRegExp(d))return d.exec(v);throw new TypeError("parser must be boolean|regexp|function")}}}has(f,d){if(f=normalizeHeader(f),f){const m=utils$5.findKey(this,f);return!!(m&&this[m]!==void 0&&(!d||matchHeaderValue(this,this[m],m,d)))}return!1}delete(f,d){const m=this;let v=!1;function g(w){if(w=normalizeHeader(w),w){const x=utils$5.findKey(m,w);x&&(!d||matchHeaderValue(m,m[x],x,d))&&(delete m[x],v=!0)}}return utils$5.isArray(f)?f.forEach(g):g(f),v}clear(f){const d=Object.keys(this);let m=d.length,v=!1;for(;m--;){const g=d[m];(!f||matchHeaderValue(this,this[g],g,f,!0))&&(delete this[g],v=!0)}return v}normalize(f){const d=this,m={};return utils$5.forEach(this,(v,g)=>{const w=utils$5.findKey(m,g);if(w){d[w]=normalizeValue(v),delete d[g];return}const x=f?formatHeader(g):String(g).trim();x!==g&&delete d[g],d[x]=normalizeValue(v),m[x]=!0}),this}concat(...f){return this.constructor.concat(this,...f)}toJSON(f){const d=Object.create(null);return utils$5.forEach(this,(m,v)=>{m!=null&&m!==!1&&(d[v]=f&&utils$5.isArray(m)?m.join(", "):m)}),d}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([f,d])=>f+": "+d).join(`
8
8
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(f){return f instanceof this?f:new this(f)}static concat(f,...d){const m=new this(f);return d.forEach(v=>m.set(v)),m}static accessor(f){const m=(this[$internals]=this[$internals]={accessors:{}}).accessors,v=this.prototype;function g(w){const x=normalizeHeader(w);m[x]||(buildAccessors(v,w),m[x]=!0)}return utils$5.isArray(f)?f.forEach(g):g(f),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$5.reduceDescriptors(AxiosHeaders$1.prototype,({value:r},f)=>{let d=f[0].toUpperCase()+f.slice(1);return{get:()=>r,set(m){this[d]=m}}}),utils$5.freezeMethods(AxiosHeaders$1);function transformData(r,f){const d=this||defaults,m=f||d,v=AxiosHeaders$1.from(m.headers);let g=m.data;return utils$5.forEach(r,function(x){g=x.call(d,g,v.normalize(),f?f.status:void 0)}),v.normalize(),g}function isCancel$1(r){return!!(r&&r.__CANCEL__)}function CanceledError$1(r,f,d){AxiosError$1.call(this,r??"canceled",AxiosError$1.ERR_CANCELED,f,d),this.name="CanceledError"}utils$5.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(r,f,d){const m=d.config.validateStatus;!d.status||!m||m(d.status)?r(d):f(new AxiosError$1("Request failed with status code "+d.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(d.status/100)-4],d.config,d.request,d))}function parseProtocol(r){const f=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return f&&f[1]||""}function speedometer(r,f){r=r||10;const d=new Array(r),m=new Array(r);let v=0,g=0,w;return f=f!==void 0?f:1e3,function(S){const _=Date.now(),b=m[g];w||(w=_),d[v]=S,m[v]=_;let C=g,E=0;for(;C!==v;)E+=d[C++],C=C%r;if(v=(v+1)%r,v===g&&(g=(g+1)%r),_-w<f)return;const M=b&&_-b;return M?Math.round(E*1e3/M):void 0}}function throttle(r,f){let d=0,m=1e3/f,v,g;const w=(_,b=Date.now())=>{d=b,v=null,g&&(clearTimeout(g),g=null),r(..._)};return[(..._)=>{const b=Date.now(),C=b-d;C>=m?w(_,b):(v=_,g||(g=setTimeout(()=>{g=null,w(v)},m-C)))},()=>v&&w(v)]}const progressEventReducer=(r,f,d=3)=>{let m=0;const v=speedometer(50,250);return throttle(g=>{const w=g.loaded,x=g.lengthComputable?g.total:void 0,S=w-m,_=v(S),b=w<=x;m=w;const C={loaded:w,total:x,progress:x?w/x:void 0,bytes:S,rate:_||void 0,estimated:_&&x&&b?(x-w)/_:void 0,event:g,lengthComputable:x!=null,[f?"download":"upload"]:!0};r(C)},d)},progressEventDecorator=(r,f)=>{const d=r!=null;return[m=>f[0]({lengthComputable:d,total:r,loaded:m}),f[1]]},asyncDecorator=r=>(...f)=>utils$5.asap(()=>r(...f)),isURLSameOrigin=platform$1.hasStandardBrowserEnv?((r,f)=>d=>(d=new URL(d,platform$1.origin),r.protocol===d.protocol&&r.host===d.host&&(f||r.port===d.port)))(new URL(platform$1.origin),platform$1.navigator&&/(msie|trident)/i.test(platform$1.navigator.userAgent)):()=>!0,cookies=platform$1.hasStandardBrowserEnv?{write(r,f,d,m,v,g){const w=[r+"="+encodeURIComponent(f)];utils$5.isNumber(d)&&w.push("expires="+new Date(d).toGMTString()),utils$5.isString(m)&&w.push("path="+m),utils$5.isString(v)&&w.push("domain="+v),g===!0&&w.push("secure"),document.cookie=w.join("; ")},read(r){const f=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function combineURLs(r,f){return f?r.replace(/\/?\/$/,"")+"/"+f.replace(/^\/+/,""):r}function buildFullPath(r,f,d){let m=!isAbsoluteURL(f);return r&&(m||d==!1)?combineURLs(r,f):f}const headersToObject=r=>r instanceof AxiosHeaders$1?{...r}:r;function mergeConfig$1(r,f){f=f||{};const d={};function m(_,b,C,E){return utils$5.isPlainObject(_)&&utils$5.isPlainObject(b)?utils$5.merge.call({caseless:E},_,b):utils$5.isPlainObject(b)?utils$5.merge({},b):utils$5.isArray(b)?b.slice():b}function v(_,b,C,E){if(utils$5.isUndefined(b)){if(!utils$5.isUndefined(_))return m(void 0,_,C,E)}else return m(_,b,C,E)}function g(_,b){if(!utils$5.isUndefined(b))return m(void 0,b)}function w(_,b){if(utils$5.isUndefined(b)){if(!utils$5.isUndefined(_))return m(void 0,_)}else return m(void 0,b)}function x(_,b,C){if(C in f)return m(_,b);if(C in r)return m(void 0,_)}const S={url:g,method:g,data:g,baseURL:w,transformRequest:w,transformResponse:w,paramsSerializer:w,timeout:w,timeoutMessage:w,withCredentials:w,withXSRFToken:w,adapter:w,responseType:w,xsrfCookieName:w,xsrfHeaderName:w,onUploadProgress:w,onDownloadProgress:w,decompress:w,maxContentLength:w,maxBodyLength:w,beforeRedirect:w,transport:w,httpAgent:w,httpsAgent:w,cancelToken:w,socketPath:w,responseEncoding:w,validateStatus:x,headers:(_,b,C)=>v(headersToObject(_),headersToObject(b),C,!0)};return utils$5.forEach(Object.keys({...r,...f}),function(b){const C=S[b]||v,E=C(r[b],f[b],b);utils$5.isUndefined(E)&&C!==x||(d[b]=E)}),d}const resolveConfig=r=>{const f=mergeConfig$1({},r);let{data:d,withXSRFToken:m,xsrfHeaderName:v,xsrfCookieName:g,headers:w,auth:x}=f;f.headers=w=AxiosHeaders$1.from(w),f.url=buildURL(buildFullPath(f.baseURL,f.url,f.allowAbsoluteUrls),r.params,r.paramsSerializer),x&&w.set("Authorization","Basic "+btoa((x.username||"")+":"+(x.password?unescape(encodeURIComponent(x.password)):"")));let S;if(utils$5.isFormData(d)){if(platform$1.hasStandardBrowserEnv||platform$1.hasStandardBrowserWebWorkerEnv)w.setContentType(void 0);else if((S=w.getContentType())!==!1){const[_,...b]=S?S.split(";").map(C=>C.trim()).filter(Boolean):[];w.setContentType([_||"multipart/form-data",...b].join("; "))}}if(platform$1.hasStandardBrowserEnv&&(m&&utils$5.isFunction(m)&&(m=m(f)),m||m!==!1&&isURLSameOrigin(f.url))){const _=v&&g&&cookies.read(g);_&&w.set(v,_)}return f},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(r){return new Promise(function(d,m){const v=resolveConfig(r);let g=v.data;const w=AxiosHeaders$1.from(v.headers).normalize();let{responseType:x,onUploadProgress:S,onDownloadProgress:_}=v,b,C,E,M,A;function T(){M&&M(),A&&A(),v.cancelToken&&v.cancelToken.unsubscribe(b),v.signal&&v.signal.removeEventListener("abort",b)}let L=new XMLHttpRequest;L.open(v.method.toUpperCase(),v.url,!0),L.timeout=v.timeout;function O(){if(!L)return;const H=AxiosHeaders$1.from("getAllResponseHeaders"in L&&L.getAllResponseHeaders()),X={data:!x||x==="text"||x==="json"?L.responseText:L.response,status:L.status,statusText:L.statusText,headers:H,config:r,request:L};settle(function(se){d(se),T()},function(se){m(se),T()},X),L=null}"onloadend"in L?L.onloadend=O:L.onreadystatechange=function(){!L||L.readyState!==4||L.status===0&&!(L.responseURL&&L.responseURL.indexOf("file:")===0)||setTimeout(O)},L.onabort=function(){L&&(m(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,r,L)),L=null)},L.onerror=function(){m(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,r,L)),L=null},L.ontimeout=function(){let V=v.timeout?"timeout of "+v.timeout+"ms exceeded":"timeout exceeded";const X=v.transitional||transitionalDefaults;v.timeoutErrorMessage&&(V=v.timeoutErrorMessage),m(new AxiosError$1(V,X.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,r,L)),L=null},g===void 0&&w.setContentType(null),"setRequestHeader"in L&&utils$5.forEach(w.toJSON(),function(V,X){L.setRequestHeader(X,V)}),utils$5.isUndefined(v.withCredentials)||(L.withCredentials=!!v.withCredentials),x&&x!=="json"&&(L.responseType=v.responseType),_&&([E,A]=progressEventReducer(_,!0),L.addEventListener("progress",E)),S&&L.upload&&([C,M]=progressEventReducer(S),L.upload.addEventListener("progress",C),L.upload.addEventListener("loadend",M)),(v.cancelToken||v.signal)&&(b=H=>{L&&(m(!H||H.type?new CanceledError$1(null,r,L):H),L.abort(),L=null)},v.cancelToken&&v.cancelToken.subscribe(b),v.signal&&(v.signal.aborted?b():v.signal.addEventListener("abort",b)));const N=parseProtocol(v.url);if(N&&platform$1.protocols.indexOf(N)===-1){m(new AxiosError$1("Unsupported protocol "+N+":",AxiosError$1.ERR_BAD_REQUEST,r));return}L.send(g||null)})},composeSignals=(r,f)=>{const{length:d}=r=r?r.filter(Boolean):[];if(f||d){let m=new AbortController,v;const g=function(_){if(!v){v=!0,x();const b=_ instanceof Error?_:this.reason;m.abort(b instanceof AxiosError$1?b:new CanceledError$1(b instanceof Error?b.message:b))}};let w=f&&setTimeout(()=>{w=null,g(new AxiosError$1(`timeout ${f} of ms exceeded`,AxiosError$1.ETIMEDOUT))},f);const x=()=>{r&&(w&&clearTimeout(w),w=null,r.forEach(_=>{_.unsubscribe?_.unsubscribe(g):_.removeEventListener("abort",g)}),r=null)};r.forEach(_=>_.addEventListener("abort",g));const{signal:S}=m;return S.unsubscribe=()=>utils$5.asap(x),S}},streamChunk=function*(r,f){let d=r.byteLength;if(d<f){yield r;return}let m=0,v;for(;m<d;)v=m+f,yield r.slice(m,v),m=v},readBytes=async function*(r,f){for await(const d of readStream(r))yield*streamChunk(d,f)},readStream=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const f=r.getReader();try{for(;;){const{done:d,value:m}=await f.read();if(d)break;yield m}}finally{await f.cancel()}},trackStream=(r,f,d,m)=>{const v=readBytes(r,f);let g=0,w,x=S=>{w||(w=!0,m&&m(S))};return new ReadableStream({async pull(S){try{const{done:_,value:b}=await v.next();if(_){x(),S.close();return}let C=b.byteLength;if(d){let E=g+=C;d(E)}S.enqueue(new Uint8Array(b))}catch(_){throw x(_),_}},cancel(S){return x(S),v.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(r=>f=>r.encode(f))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),test=(r,...f)=>{try{return!!r(...f)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let r=!1;const f=new Request(platform$1.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!f}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$5.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(r=>r.body)};isFetchSupported&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!resolvers[f]&&(resolvers[f]=utils$5.isFunction(r[f])?d=>d[f]():(d,m)=>{throw new AxiosError$1(`Response type '${f}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,m)})})})(new Response);const getBodyLength=async r=>{if(r==null)return 0;if(utils$5.isBlob(r))return r.size;if(utils$5.isSpecCompliantForm(r))return(await new Request(platform$1.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(utils$5.isArrayBufferView(r)||utils$5.isArrayBuffer(r))return r.byteLength;if(utils$5.isURLSearchParams(r)&&(r=r+""),utils$5.isString(r))return(await encodeText(r)).byteLength},resolveBodyLength=async(r,f)=>{const d=utils$5.toFiniteNumber(r.getContentLength());return d??getBodyLength(f)},fetchAdapter=isFetchSupported&&(async r=>{let{url:f,method:d,data:m,signal:v,cancelToken:g,timeout:w,onDownloadProgress:x,onUploadProgress:S,responseType:_,headers:b,withCredentials:C="same-origin",fetchOptions:E}=resolveConfig(r);_=_?(_+"").toLowerCase():"text";let M=composeSignals([v,g&&g.toAbortSignal()],w),A;const T=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let L;try{if(S&&supportsRequestStream&&d!=="get"&&d!=="head"&&(L=await resolveBodyLength(b,m))!==0){let X=new Request(f,{method:"POST",body:m,duplex:"half"}),oe;if(utils$5.isFormData(m)&&(oe=X.headers.get("content-type"))&&b.setContentType(oe),X.body){const[se,de]=progressEventDecorator(L,progressEventReducer(asyncDecorator(S)));m=trackStream(X.body,DEFAULT_CHUNK_SIZE,se,de)}}utils$5.isString(C)||(C=C?"include":"omit");const O="credentials"in Request.prototype;A=new Request(f,{...E,signal:M,method:d.toUpperCase(),headers:b.normalize().toJSON(),body:m,duplex:"half",credentials:O?C:void 0});let N=await fetch(A,E);const H=supportsResponseStream&&(_==="stream"||_==="response");if(supportsResponseStream&&(x||H&&T)){const X={};["status","statusText","headers"].forEach(he=>{X[he]=N[he]});const oe=utils$5.toFiniteNumber(N.headers.get("content-length")),[se,de]=x&&progressEventDecorator(oe,progressEventReducer(asyncDecorator(x),!0))||[];N=new Response(trackStream(N.body,DEFAULT_CHUNK_SIZE,se,()=>{de&&de(),T&&T()}),X)}_=_||"text";let V=await resolvers[utils$5.findKey(resolvers,_)||"text"](N,r);return!H&&T&&T(),await new Promise((X,oe)=>{settle(X,oe,{data:V,headers:AxiosHeaders$1.from(N.headers),status:N.status,statusText:N.statusText,config:r,request:A})})}catch(O){throw T&&T(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,r,A),{cause:O.cause||O}):AxiosError$1.from(O,O&&O.code,r,A)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$5.forEach(knownAdapters,(r,f)=>{if(r){try{Object.defineProperty(r,"name",{value:f})}catch{}Object.defineProperty(r,"adapterName",{value:f})}});const renderReason=r=>`- ${r}`,isResolvedHandle=r=>utils$5.isFunction(r)||r===null||r===!1,adapters={getAdapter:r=>{r=utils$5.isArray(r)?r:[r];const{length:f}=r;let d,m;const v={};for(let g=0;g<f;g++){d=r[g];let w;if(m=d,!isResolvedHandle(d)&&(m=knownAdapters[(w=String(d)).toLowerCase()],m===void 0))throw new AxiosError$1(`Unknown adapter '${w}'`);if(m)break;v[w||"#"+g]=m}if(!m){const g=Object.entries(v).map(([x,S])=>`adapter ${x} `+(S===!1?"is not supported by the environment":"is not available in the build"));let w=f?g.length>1?`since :
9
9
  `+g.map(renderReason).join(`
10
10
  `):" "+renderReason(g[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+w,"ERR_NOT_SUPPORT")}return m},adapters:knownAdapters};function throwIfCancellationRequested(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new CanceledError$1(null,r)}function dispatchRequest(r){return throwIfCancellationRequested(r),r.headers=AxiosHeaders$1.from(r.headers),r.data=transformData.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(r.adapter||defaults.adapter)(r).then(function(m){return throwIfCancellationRequested(r),m.data=transformData.call(r,r.transformResponse,m),m.headers=AxiosHeaders$1.from(m.headers),m},function(m){return isCancel$1(m)||(throwIfCancellationRequested(r),m&&m.response&&(m.response.data=transformData.call(r,r.transformResponse,m.response),m.response.headers=AxiosHeaders$1.from(m.response.headers))),Promise.reject(m)})}const VERSION$1="1.11.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((r,f)=>{validators$1[r]=function(m){return typeof m===r||"a"+(f<1?"n ":" ")+r}});const deprecatedWarnings={};validators$1.transitional=function(f,d,m){function v(g,w){return"[Axios v"+VERSION$1+"] Transitional option '"+g+"'"+w+(m?". "+m:"")}return(g,w,x)=>{if(f===!1)throw new AxiosError$1(v(w," has been removed"+(d?" in "+d:"")),AxiosError$1.ERR_DEPRECATED);return d&&!deprecatedWarnings[w]&&(deprecatedWarnings[w]=!0),f?f(g,w,x):!0}},validators$1.spelling=function(f){return(d,m)=>!0};function assertOptions(r,f,d){if(typeof r!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const m=Object.keys(r);let v=m.length;for(;v-- >0;){const g=m[v],w=f[g];if(w){const x=r[g],S=x===void 0||w(x,g,r);if(S!==!0)throw new AxiosError$1("option "+g+" must be "+S,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(d!==!0)throw new AxiosError$1("Unknown option "+g,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(f){this.defaults=f||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(f,d){try{return await this._request(f,d)}catch(m){if(m instanceof Error){let v={};Error.captureStackTrace?Error.captureStackTrace(v):v=new Error;const g=v.stack?v.stack.replace(/^.+\n/,""):"";try{m.stack?g&&!String(m.stack).endsWith(g.replace(/^.+\n.+\n/,""))&&(m.stack+=`
11
- `+g):m.stack=g}catch{}}throw m}}_request(f,d){typeof f=="string"?(d=d||{},d.url=f):d=f||{},d=mergeConfig$1(this.defaults,d);const{transitional:m,paramsSerializer:v,headers:g}=d;m!==void 0&&validator.assertOptions(m,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),v!=null&&(utils$5.isFunction(v)?d.paramsSerializer={serialize:v}:validator.assertOptions(v,{encode:validators.function,serialize:validators.function},!0)),d.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?d.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:d.allowAbsoluteUrls=!0),validator.assertOptions(d,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),d.method=(d.method||this.defaults.method||"get").toLowerCase();let w=g&&utils$5.merge(g.common,g[d.method]);g&&utils$5.forEach(["delete","get","head","post","put","patch","common"],A=>{delete g[A]}),d.headers=AxiosHeaders$1.concat(w,g);const x=[];let S=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(d)===!1||(S=S&&T.synchronous,x.unshift(T.fulfilled,T.rejected))});const _=[];this.interceptors.response.forEach(function(T){_.push(T.fulfilled,T.rejected)});let b,C=0,E;if(!S){const A=[dispatchRequest.bind(this),void 0];for(A.unshift(...x),A.push(..._),E=A.length,b=Promise.resolve(d);C<E;)b=b.then(A[C++],A[C++]);return b}E=x.length;let M=d;for(C=0;C<E;){const A=x[C++],T=x[C++];try{M=A(M)}catch(L){T.call(this,L);break}}try{b=dispatchRequest.call(this,M)}catch(A){return Promise.reject(A)}for(C=0,E=_.length;C<E;)b=b.then(_[C++],_[C++]);return b}getUri(f){f=mergeConfig$1(this.defaults,f);const d=buildFullPath(f.baseURL,f.url,f.allowAbsoluteUrls);return buildURL(d,f.params,f.paramsSerializer)}};utils$5.forEach(["delete","get","head","options"],function(f){Axios$1.prototype[f]=function(d,m){return this.request(mergeConfig$1(m||{},{method:f,url:d,data:(m||{}).data}))}}),utils$5.forEach(["post","put","patch"],function(f){function d(m){return function(g,w,x){return this.request(mergeConfig$1(x||{},{method:f,headers:m?{"Content-Type":"multipart/form-data"}:{},url:g,data:w}))}}Axios$1.prototype[f]=d(),Axios$1.prototype[f+"Form"]=d(!0)});let CancelToken$1=class Gt{constructor(f){if(typeof f!="function")throw new TypeError("executor must be a function.");let d;this.promise=new Promise(function(g){d=g});const m=this;this.promise.then(v=>{if(!m._listeners)return;let g=m._listeners.length;for(;g-- >0;)m._listeners[g](v);m._listeners=null}),this.promise.then=v=>{let g;const w=new Promise(x=>{m.subscribe(x),g=x}).then(v);return w.cancel=function(){m.unsubscribe(g)},w},f(function(g,w,x){m.reason||(m.reason=new CanceledError$1(g,w,x),d(m.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(f){if(this.reason){f(this.reason);return}this._listeners?this._listeners.push(f):this._listeners=[f]}unsubscribe(f){if(!this._listeners)return;const d=this._listeners.indexOf(f);d!==-1&&this._listeners.splice(d,1)}toAbortSignal(){const f=new AbortController,d=m=>{f.abort(m)};return this.subscribe(d),f.signal.unsubscribe=()=>this.unsubscribe(d),f.signal}static source(){let f;return{token:new Gt(function(v){f=v}),cancel:f}}};function spread$2(r){return function(d){return r.apply(null,d)}}function isAxiosError$1(r){return utils$5.isObject(r)&&r.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([r,f])=>{HttpStatusCode$1[f]=r});function createInstance(r){const f=new Axios$1(r),d=bind(Axios$1.prototype.request,f);return utils$5.extend(d,Axios$1.prototype,f,{allOwnKeys:!0}),utils$5.extend(d,f,null,{allOwnKeys:!0}),d.create=function(v){return createInstance(mergeConfig$1(r,v))},d}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(f){return Promise.all(f)},axios.spread=spread$2,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=r=>formDataToJSON(utils$5.isHTMLForm(r)?new FormData(r):r),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread:spread$1,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,TEST_BASE_URL="https://miniapptest-spinfi.xy1212.com";class HttpClient{constructor(f){this.options=f;const d=f.baseURL;this.instance=axios.create({baseURL:d,timeout:3e4}),this.instance.interceptors.request.use(m=>{const v=this.options.getToken();if(v){m.headers=m.headers||{};const w=`Bearer ${v}`;m.headers.Authorization=w}const g=this.options.getAppId?this.options.getAppId():null;return g&&(m.headers=m.headers||{},m.headers["hm-app-id"]=String(g)),m}),this.instance.interceptors.response.use(m=>m,m=>(m.response&&m.response.status===401&&this.options.onAuthError&&this.options.onAuthError(),Promise.reject(m)))}request(f){return this.instance.request(f)}get(f,d){return this.instance.get(f,d)}post(f,d,m){return this.instance.post(f,d,m)}}class NamespacedStorage{constructor(f="tg_tracking_sdk"){this.prefix=f}k(f){return`${this.prefix}:${f}`}set(f,d){try{localStorage.setItem(this.k(f),JSON.stringify(d))}catch{}}get(f){try{const d=localStorage.getItem(this.k(f));return d?JSON.parse(d):null}catch{return null}}remove(f){try{localStorage.removeItem(this.k(f))}catch{}}}class APIService{constructor(f){this.http=f}auth(f){return this.http.post("/api/user/auth",f).then(d=>d.data)}getAdPositionConfig(f){return this.http.post("/api/ad/adPositionDisplayAd",{adPositionName:f}).then(d=>d.data)}createAd(f){return this.http.post("/api/v2/ad/create",f).then(d=>d.data)}adMonitor(f){return this.http.get("/api/v2/ad/monitor",{params:f}).then(d=>d.data)}bindWalletReq(f){return this.http.post("/api/user/bindWallet",f).then(d=>d.data)}merchantPayModeList(){return this.http.get("/api/v2/merchant/pay/modeList").then(f=>f.data)}merchantPayCreate(f){return this.http.post("/api/v2/merchant/pay/create",f).then(d=>d.data)}merchantPayFinish(f){return this.http.post("/api/v2/merchant/pay/finish",f).then(d=>d.data)}merchantPayQueryResult(f){return this.http.post("/api/v2/merchant/pay/queryResult",f).then(d=>d.data)}merchantPayNotify(f){return this.http.post("/api/v2/merchant/pay/notify",f).then(d=>d.data)}}class HmAdManager{constructor(f={}){this.options=f,this.initialized=!1}async init(){this.initialized||(this.options.autoInjectScript!==!1&&this.sdkZone&&this.sdkFunc&&await this.ensureScriptInjected(),this.initialized=!0)}async setSpace(f){if(!f)return;const d=String(f),m=`show_${f}`,v=this.sdkZone!==d||this.sdkFunc!==m;this.sdkZone=d,this.sdkFunc=m,this.options.autoInjectScript!==!1&&await this.ensureScriptInjected(v)}findExistingScript(){return typeof document>"u"?null:document.querySelector("script[src*='//libtl.com/sdk.js']")}async ensureScriptInjected(f=!1){var g;if(typeof document>"u")return;const d=this.findExistingScript(),m=this.sdkZone||"",v=this.sdkFunc||"";if(d){const w=d.getAttribute("data-zone")||"",x=d.getAttribute("data-sdk")||"";if(w===m&&x===v&&!f)return;(g=d.parentElement)==null||g.removeChild(d)}!m||!v||await this.injectScript(m,v)}injectScript(f,d){return new Promise((m,v)=>{if(typeof document>"u")return m();const g=document.createElement("script");g.src="//libtl.com/sdk.js",g.setAttribute("data-zone",f),g.setAttribute("data-sdk",d),g.async=!0,g.onload=()=>m(),g.onerror=()=>v(new Error("Hm 脚本加载失败")),document.head.appendChild(g)})}async callSDK(f){if(!this.sdkFunc)throw new Error("Hm 未设置 spaceId");const d=window[this.sdkFunc];if(typeof d!="function")throw new Error("Hm SDK 未正确加载");await d(f)}async show(){try{await this.callSDK()}catch(f){throw f}}async showPopup(){try{await this.callSDK("pop")}catch(f){throw f}}async showInApp(f){try{await this.callSDK({type:"inApp",inAppSettings:f})}catch(d){throw d}}}class AdMonitor{constructor(f){this.getMonitor=f}extractParamsFromUrl(f){if(!f)return null;try{return{param:new URL(f).searchParams.get("param")||""}}catch{return null}}async send(f,d){if(!f)return;const m=Array.isArray(f)?f:[f];if(m.length===0)return;const v=m[0],g=this.extractParamsFromUrl(v);let w;if(g&&this.getMonitor)try{const x=Math.floor(Date.now()/1e3).toString(),S=CryptoJS.MD5(d+x).toString(),_={param:g.param,request_code:S,timestamp:x};w=await this.getMonitor(_)}catch{}return await Promise.allSettled(m.slice(1).map(x=>{try{return fetch(x,{method:"GET"})}catch{return Promise.resolve()}})),w}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var dist$1={},sdk={},telegramWebApps={},hasRequiredTelegramWebApps;function requireTelegramWebApps(){return hasRequiredTelegramWebApps||(hasRequiredTelegramWebApps=1,(function(){var r={},f="";try{f=location.hash.toString()}catch{}var d=S(f),m=O("initParams");if(m)for(var v in m)typeof d[v]>"u"&&(d[v]=m[v]);L("initParams",d);var g=!1,w;try{if(g=window.parent!=null&&window!=window.parent,g){window.addEventListener("message",function(N){if(N.source===window.parent){try{var H=JSON.parse(N.data)}catch{return}if(!(!H||!H.eventType))if(H.eventType=="set_custom_style")N.origin==="https://web.telegram.org"&&(w.innerHTML=H.eventData);else if(H.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else E(H.eventType,H.eventData)}}),w=document.createElement("style"),document.head.appendChild(w);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function x(N){try{return N=N.replace(/\+/g,"%20"),decodeURIComponent(N)}catch{return N}}function S(N){N=N.replace(/^#/,"");var H={};if(!N.length)return H;if(N.indexOf("=")<0&&N.indexOf("?")<0)return H._path=x(N),H;var V=N.indexOf("?");if(V>=0){var X=N.substr(0,V);H._path=x(X),N=N.substr(V+1)}var oe=_(N);for(var se in oe)H[se]=oe[se];return H}function _(N){var H={};if(!N.length)return H;var V=N.split("&"),X,oe,se,de;for(X=0;X<V.length;X++)oe=V[X].split("="),se=x(oe[0]),de=oe[1]==null?null:x(oe[1]),H[se]=de;return H}function b(N,H){var V=N.indexOf("#");if(V<0)return N+"#"+H;var X=N.substr(V+1);return X.indexOf("=")>=0||X.indexOf("?")>=0?N+"&"+H:X.length>0?N+"?"+H:N+H}function C(N,H,V){if(H||(H=function(){}),V===void 0&&(V=""),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(N,JSON.stringify(V)),H();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:N,eventData:V})),H();else if(g)try{var X="https://web.telegram.org";X="*",window.parent.postMessage(JSON.stringify({eventType:N,eventData:V}),X),H()}catch(oe){H(oe)}else H({notAvailable:!0})}function E(N,H){M(N,function(V){V(N,H)})}function M(N,H){var V=r[N];if(!(V===void 0||!V.length))for(var X=0;X<V.length;X++)try{H(V[X])}catch{}}function A(N,H){r[N]===void 0&&(r[N]=[]);var V=r[N].indexOf(H);V===-1&&r[N].push(H)}function T(N,H){if(r[N]!==void 0){var V=r[N].indexOf(H);V!==-1&&r[N].splice(V,1)}}function L(N,H){try{return window.sessionStorage.setItem("__telegram__"+N,JSON.stringify(H)),!0}catch{}return!1}function O(N){try{return JSON.parse(window.sessionStorage.getItem("__telegram__"+N))}catch{}return null}window.Telegram||(window.Telegram={}),window.Telegram.WebView={initParams:d,isIframe:g,onEvent:A,offEvent:T,postEvent:C,receiveEvent:E,callEventCallbacks:M},window.Telegram.Utils={urlSafeDecode:x,urlParseQueryString:_,urlParseHashParams:S,urlAppendHashParams:b,sessionStorageSet:L,sessionStorageGet:O},window.TelegramGameProxy_receiveEvent=E,window.TelegramGameProxy={receiveEvent:E}})(),(function(){var r=window.Telegram.Utils,f=window.Telegram.WebView,d=f.initParams,m=f.isIframe,v={},g="",w={},x={},S="light",_="6.0",b="unknown";if(d.tgWebAppData&&d.tgWebAppData.length){g=d.tgWebAppData,w=r.urlParseQueryString(g);for(var C in w){var E=w[C];try{(E.substr(0,1)=="{"&&E.substr(-1)=="}"||E.substr(0,1)=="["&&E.substr(-1)=="]")&&(w[C]=JSON.parse(E))}catch{}}}if(d.tgWebAppThemeParams&&d.tgWebAppThemeParams.length){var M=d.tgWebAppThemeParams;try{var A=JSON.parse(M);A&&he(A)}catch{}}var A=r.sessionStorageGet("themeParams");A&&he(A),d.tgWebAppVersion&&(_=d.tgWebAppVersion),d.tgWebAppPlatform&&(b=d.tgWebAppPlatform);function T(fe,U){U.theme_params&&(he(U.theme_params),window.Telegram.WebApp.MainButton.setParams({}),window.Telegram.WebApp.SecondaryButton.setParams({}),me(),ae(),Oe(),X("themeChanged"))}var L=window.innerHeight;function O(fe,U){U.height&&(window.removeEventListener("resize",N),B(U))}function N(fe){L!=window.innerHeight&&(L=window.innerHeight,X("viewportChanged",{isStateStable:!0}))}function H(fe){if(!(fe.metaKey||fe.ctrlKey)){for(var U=fe.target;U.tagName!="A"&&U.parentNode;)U=U.parentNode;U.tagName=="A"&&U.target!="_blank"&&(U.protocol=="http:"||U.protocol=="https:")&&U.hostname=="t.me"&&(v.openTgLink(U.href),fe.preventDefault())}}function V(fe){return fe.toString().replace(/^\s+|\s+$/g,"")}function X(fe){var U=Array.prototype.slice.call(arguments);fe=U.shift(),f.callEventCallbacks("webview:"+fe,function(G){G.apply(v,U)})}function oe(fe,U){f.onEvent("webview:"+fe,U)}function se(fe,U){f.offEvent("webview:"+fe,U)}function de(fe,U){var G=document.documentElement;G&&G.style&&G.style.setProperty&&G.style.setProperty("--tg-"+fe,U)}function he(fe){fe.bg_color=="#1c1c1d"&&fe.bg_color==fe.secondary_bg_color&&(fe.secondary_bg_color="#2c2c2e");var U;for(var G in fe)(U=Ue(fe[G]))&&(x[G]=U,G=="bg_color"&&(S=De(U)?"dark":"light",de("color-scheme",S)),G="theme-"+G.split("_").join("-"),de(G,U));r.sessionStorageSet("themeParams",x)}var we={};function te(fe){for(var U=100;--U;){for(var G="",re="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",K=re.length,ue=0;ue<fe;ue++)G+=re[Math.floor(Math.random()*K)];if(!we[G])return we[G]={},G}throw Error("WebAppCallbackIdGenerateFailed")}var k=!1,q=!1,y=!0;function B(fe){typeof fe<"u"&&(y=!!fe.is_expanded,k=fe.height,fe.is_state_stable&&(q=fe.height),X("viewportChanged",{isStateStable:!!fe.is_state_stable}));var U,G;k!==!1?U=k-ut+"px":U=ut?"calc(100vh - "+ut+"px)":"100vh",q!==!1?G=q-ut+"px":G=ut?"calc(100vh - "+ut+"px)":"100vh",de("viewport-height",U),de("viewport-stable-height",G)}var $=!1;function I(fe){je("6.2")&&($=!!fe,f.postEvent("web_app_setup_closing_behavior",!1,{need_confirmation:$}))}var F=!0;function j(fe){je("7.7")&&(F=!!fe,f.postEvent("web_app_setup_swipe_behavior",!1,{allow_vertical_swipe:F}))}var D="bg_color",W=null;function R(){return D=="secondary_bg_color"?x.secondary_bg_color:D=="bg_color"?x.bg_color:W}function z(fe){if(je("6.1")){je("6.9")||(x.bg_color&&x.bg_color==fe?fe="bg_color":x.secondary_bg_color&&x.secondary_bg_color==fe&&(fe="secondary_bg_color"));var U=null,G=null;if(fe=="bg_color"||fe=="secondary_bg_color")G=fe;else if(je("6.9")&&(U=Ue(fe),!U))throw Error("WebAppHeaderColorInvalid");if(!je("6.9")&&G!="bg_color"&&G!="secondary_bg_color")throw Error("WebAppHeaderColorKeyInvalid");D=G,W=U,me()}}var ye=null,Ce=null;function me(){(ye!=D||Ce!=W)&&(ye=D,Ce=W,Ce?f.postEvent("web_app_set_header_color",!1,{color:W}):f.postEvent("web_app_set_header_color",!1,{color_key:D}))}var ie="bg_color";function ee(){return ie=="secondary_bg_color"?x.secondary_bg_color:ie=="bg_color"?x.bg_color:ie}function pe(fe){if(je("6.1")){var U;if(fe=="bg_color"||fe=="secondary_bg_color")U=fe;else if(U=Ue(fe),!U)throw Error("WebAppBackgroundColorInvalid");ie=U,ae()}}var be=null;function ae(){var fe=ee();be!=fe&&(be=fe,f.postEvent("web_app_set_background_color",!1,{color:fe}))}var ne="bottom_bar_bg_color";function Se(){return ne=="bottom_bar_bg_color"?x.bottom_bar_bg_color||x.secondary_bg_color||"#ffffff":ne=="secondary_bg_color"?x.secondary_bg_color:ne=="bg_color"?x.bg_color:ne}function qe(fe){if(je("7.10")){var U;if(fe=="bg_color"||fe=="secondary_bg_color"||fe=="bottom_bar_bg_color")U=fe;else if(U=Ue(fe),!U)throw Error("WebAppBottomBarColorInvalid");ne=U,Oe(),window.Telegram.WebApp.SecondaryButton.setParams({})}}var Ie=null;function Oe(){var fe=Se();Ie!=fe&&(Ie=fe,f.postEvent("web_app_set_bottom_bar_color",!1,{color:fe})),d.tgWebAppDebug&&bt()}function Ue(fe){fe+="";var U;if(U=/^\s*#([0-9a-f]{6})\s*$/i.exec(fe))return"#"+U[1].toLowerCase();if(U=/^\s*#([0-9a-f])([0-9a-f])([0-9a-f])\s*$/i.exec(fe))return("#"+U[1]+U[1]+U[2]+U[2]+U[3]+U[3]).toLowerCase();if(U=/^\s*rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)\s*$/.exec(fe)){var G=parseInt(U[1]),re=parseInt(U[2]),K=parseInt(U[3]);return G=(G<16?"0":"")+G.toString(16),re=(re<16?"0":"")+re.toString(16),K=(K<16?"0":"")+K.toString(16),"#"+G+re+K}return!1}function De(fe){fe=fe.replace(/[\s#]/g,""),fe.length==3&&(fe=fe[0]+fe[0]+fe[1]+fe[1]+fe[2]+fe[2]);var U=parseInt(fe.substr(0,2),16),G=parseInt(fe.substr(2,2),16),re=parseInt(fe.substr(4,2),16),K=Math.sqrt(.299*(U*U)+.587*(G*G)+.114*(re*re));return K<120}function $e(fe,U){typeof fe!="string"&&(fe=""),typeof U!="string"&&(U=""),fe=fe.replace(/^\s+|\s+$/g,"").split("."),U=U.replace(/^\s+|\s+$/g,"").split(".");var G=Math.max(fe.length,U.length),re,K,ue;for(re=0;re<G;re++)if(K=parseInt(fe[re])||0,ue=parseInt(U[re])||0,K!=ue)return K>ue?1:-1;return 0}function je(fe){return $e(_,fe)>=0}function Ye(fe){if(window.Blob)try{return new Blob([fe]).size}catch{}for(var U=fe.length,G=fe.length-1;G>=0;G--){var re=fe.charCodeAt(G);re>127&&re<=2047?U++:re>2047&&re<=65535&&(U+=2),re>=56320&&re<=57343&&G--}return U}var st=(function(){var fe=!1,U={};Object.defineProperty(U,"isVisible",{set:function(Pe){Te({is_visible:Pe})},get:function(){return fe},enumerable:!0});var G=null;f.onEvent("back_button_pressed",re);function re(){X("backButtonClicked")}function K(){return{is_visible:fe}}function ue(Pe){return typeof Pe>"u"&&(Pe=K()),JSON.stringify(Pe)}function Ae(){return!!je("6.1")}function xe(){var Pe=K(),Fe=ue(Pe);G!==Fe&&(G=Fe,f.postEvent("web_app_setup_back_button",!1,Pe))}function Te(Pe){return Ae()&&(typeof Pe.is_visible<"u"&&(fe=!!Pe.is_visible),xe()),U}return U.onClick=function(Pe){return Ae()&&oe("backButtonClicked",Pe),U},U.offClick=function(Pe){return Ae()&&se("backButtonClicked",Pe),U},U.show=function(){return Te({is_visible:!0})},U.hide=function(){return Te({is_visible:!1})},U})(),Je=null,Ge={},ut=0;if(d.tgWebAppDebug){Je=document.createElement("tg-bottom-bar");var gt={display:"flex",gap:"7px",font:"600 14px/18px sans-serif",width:"100%",background:Se(),position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"7px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var rt in gt)Je.style[rt]=gt[rt];document.addEventListener("DOMContentLoaded",function fe(U){document.removeEventListener("DOMContentLoaded",fe),document.body.appendChild(Je)});var wt=document.createElement("style");wt.innerHTML='tg-bottom-button.shine { position: relative; overflow: hidden; } tg-bottom-button.shine:before { content:""; position: absolute; top: 0; width: 100%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .2), transparent); animation: tg-bottom-button-shine 5s ease-in-out infinite; } @-webkit-keyframes tg-bottom-button-shine { 0% {left: -100%;} 12%,100% {left: 100%}} @keyframes tg-bottom-button-shine { 0% {left: -100%;} 12%,100% {left: 100%}}',Je.appendChild(wt)}function bt(){var fe=Ge.main._bottomButton,U=Ge.secondary._bottomButton;fe.isVisible||U.isVisible?(Je.style.display="flex",ut=58,fe.isVisible&&U.isVisible&&(U.position=="top"?(Je.style.flexDirection="column-reverse",ut+=51):U.position=="bottom"?(Je.style.flexDirection="column",ut+=51):U.position=="left"?Je.style.flexDirection="row-reverse":U.position=="right"&&(Je.style.flexDirection="row"))):(Je.style.display="none",ut=0),Je.style.background=Se(),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=ut+"px"),B()}var le=function(fe){var U=fe=="main";if(U)var G="web_app_setup_main_button",re="main_button_pressed",K="mainButtonClicked",ue="Continue",Ae=function(){return x.button_color||"#2481cc"},xe=function(){return x.button_text_color||"#ffffff"};else var G="web_app_setup_secondary_button",re="secondary_button_pressed",K="secondaryButtonClicked",ue="Cancel",Ae=function(){return Se()},xe=function(){return x.button_color||"#2481cc"};var Te=!1,Pe=!0,Fe=!1,Ne=!1,At=fe,ot=ue,yt=!1,vt=!1,_t="left",Ve={};Object.defineProperty(Ve,"type",{get:function(){return At},enumerable:!0}),Object.defineProperty(Ve,"text",{set:function(Be){Ve.setParams({text:Be})},get:function(){return ot},enumerable:!0}),Object.defineProperty(Ve,"color",{set:function(Be){Ve.setParams({color:Be})},get:function(){return yt||Ae()},enumerable:!0}),Object.defineProperty(Ve,"textColor",{set:function(Be){Ve.setParams({text_color:Be})},get:function(){return vt||xe()},enumerable:!0}),Object.defineProperty(Ve,"isVisible",{set:function(Be){Ve.setParams({is_visible:Be})},get:function(){return Te},enumerable:!0}),Object.defineProperty(Ve,"isProgressVisible",{get:function(){return Ne},enumerable:!0}),Object.defineProperty(Ve,"isActive",{set:function(Be){Ve.setParams({is_active:Be})},get:function(){return Pe},enumerable:!0}),Object.defineProperty(Ve,"hasShineEffect",{set:function(Be){Ve.setParams({has_shine_effect:Be})},get:function(){return Fe},enumerable:!0}),U||Object.defineProperty(Ve,"position",{set:function(Be){Ve.setParams({position:Be})},get:function(){return _t},enumerable:!0});var ft=null;f.onEvent(re,pt);var et=null;if(d.tgWebAppDebug){et=document.createElement("tg-bottom-button");var ht={display:"none",width:"100%",height:"44px",borderRadius:"0",background:"no-repeat right center",padding:"13px 15px",textAlign:"center",boxSizing:"border-box"};for(var it in ht)et.style[it]=ht[it];Je.appendChild(et),et.addEventListener("click",pt,!1),et._bottomButton=Ve,Ge[fe]=et}function pt(){Pe&&X(K)}function at(){var Be=Ve.color,Ke=Ve.textColor;if(Te){var We={is_visible:!0,is_active:Pe,is_progress_visible:Ne,text:ot,color:Be,text_color:Ke,has_shine_effect:Fe&&Pe&&!Ne};U||(We.position=_t)}else var We={is_visible:!1};return We}function ct(Be){return typeof Be>"u"&&(Be=at()),JSON.stringify(Be)}function dt(){var Be=at(),Ke=ct(Be);ft!==Ke&&(ft=Ke,f.postEvent(G,!1,Be),d.tgWebAppDebug&&nt(Be))}function nt(Be){Be.is_visible?(et.style.display="block",et.style.opacity=Be.is_active?"1":"0.8",et.style.cursor=Be.is_active?"pointer":"auto",et.disabled=!Be.is_active,et.innerText=Be.text,et.className=Be.has_shine_effect?"shine":"",et.style.backgroundImage=Be.is_progress_visible?"url('data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewport="0 0 48 48" width="48px" height="48px"><circle cx="50%" cy="50%" stroke="'+Be.text_color+'" stroke-width="2.25" stroke-linecap="round" fill="none" stroke-dashoffset="106" r="9" stroke-dasharray="56.52" rotate="-90"><animate attributeName="stroke-dashoffset" attributeType="XML" dur="360s" from="0" to="12500" repeatCount="indefinite"></animate><animateTransform attributeName="transform" attributeType="XML" type="rotate" dur="1s" from="-90 24 24" to="630 24 24" repeatCount="indefinite"></animateTransform></circle></svg>')+"')":"none",et.style.backgroundColor=Be.color,et.style.color=Be.text_color):et.style.display="none",bt()}function Le(Be){if(typeof Be.text<"u"){var Ke=V(Be.text);if(!Ke.length||Ke.length>64)throw Error("WebAppBottomButtonParamInvalid");ot=Ke}if(typeof Be.color<"u")if(Be.color===!1||Be.color===null)yt=!1;else{var We=Ue(Be.color);if(!We)throw Error("WebAppBottomButtonParamInvalid");yt=We}if(typeof Be.text_color<"u")if(Be.text_color===!1||Be.text_color===null)vt=!1;else{var ze=Ue(Be.text_color);if(!ze)throw Error("WebAppBottomButtonParamInvalid");vt=ze}if(typeof Be.is_visible<"u"){if(Be.is_visible&&!Ve.text.length)throw Error("WebAppBottomButtonParamInvalid");Te=!!Be.is_visible}if(typeof Be.has_shine_effect<"u"&&(Fe=!!Be.has_shine_effect),!U&&typeof Be.position<"u"){if(Be.position!="left"&&Be.position!="right"&&Be.position!="top"&&Be.position!="bottom")throw Error("WebAppBottomButtonParamInvalid");_t=Be.position}return typeof Be.is_active<"u"&&(Pe=!!Be.is_active),dt(),Ve}return Ve.setText=function(Be){return Ve.setParams({text:Be})},Ve.onClick=function(Be){return oe(K,Be),Ve},Ve.offClick=function(Be){return se(K,Be),Ve},Ve.show=function(){return Ve.setParams({is_visible:!0})},Ve.hide=function(){return Ve.setParams({is_visible:!1})},Ve.enable=function(){return Ve.setParams({is_active:!0})},Ve.disable=function(){return Ve.setParams({is_active:!1})},Ve.showProgress=function(Be){return Pe=!!Be,Ne=!0,dt(),Ve},Ve.hideProgress=function(){return Ve.isActive||(Pe=!0),Ne=!1,dt(),Ve},Ve.setParams=Le,Ve},Z=le("main"),J=le("secondary"),ge=(function(){var fe=!1,U={};Object.defineProperty(U,"isVisible",{set:function(Pe){Te({is_visible:Pe})},get:function(){return fe},enumerable:!0});var G=null;f.onEvent("settings_button_pressed",re);function re(){X("settingsButtonClicked")}function K(){return{is_visible:fe}}function ue(Pe){return typeof Pe>"u"&&(Pe=K()),JSON.stringify(Pe)}function Ae(){return!!je("6.10")}function xe(){var Pe=K(),Fe=ue(Pe);G!==Fe&&(G=Fe,f.postEvent("web_app_setup_settings_button",!1,Pe))}function Te(Pe){return Ae()&&(typeof Pe.is_visible<"u"&&(fe=!!Pe.is_visible),xe()),U}return U.onClick=function(Pe){return Ae()&&oe("settingsButtonClicked",Pe),U},U.offClick=function(Pe){return Ae()&&se("settingsButtonClicked",Pe),U},U.show=function(){return Te({is_visible:!0})},U.hide=function(){return Te({is_visible:!1})},U})(),Ee=(function(){var fe={};function U(G){if(!je("6.1"))return fe;if(G.type=="impact"){if(G.impact_style!="light"&&G.impact_style!="medium"&&G.impact_style!="heavy"&&G.impact_style!="rigid"&&G.impact_style!="soft")throw Error("WebAppHapticImpactStyleInvalid")}else if(G.type=="notification"){if(G.notification_type!="error"&&G.notification_type!="success"&&G.notification_type!="warning")throw Error("WebAppHapticNotificationTypeInvalid")}else if(G.type!="selection_change")throw Error("WebAppHapticFeedbackTypeInvalid");return f.postEvent("web_app_trigger_haptic_feedback",!1,G),fe}return fe.impactOccurred=function(G){return U({type:"impact",impact_style:G})},fe.notificationOccurred=function(G){return U({type:"notification",notification_type:G})},fe.selectionChanged=function(){return U({type:"selection_change"})},fe})(),Re=(function(){var fe={};function U(G,re,K){if(!je("6.9"))throw Error("WebAppMethodUnsupported");return ve(G,re,K),fe}return fe.setItem=function(G,re,K){return U("saveStorageValue",{key:G,value:re},K)},fe.getItem=function(G,re){return fe.getItems([G],re?function(K,ue){K?re(K):re(null,ue[G])}:null)},fe.getItems=function(G,re){return U("getStorageValues",{keys:G},re)},fe.removeItem=function(G,re){return fe.removeItems([G],re)},fe.removeItems=function(G,re){return U("deleteStorageValues",{keys:G},re)},fe.getKeys=function(G){return U("getStorageKeys",{},G)},fe})(),ke=(function(){var fe=!1,U=!1,G="unknown",re=!1,K=!1,ue=!1,Ae="",xe={};Object.defineProperty(xe,"isInited",{get:function(){return fe},enumerable:!0}),Object.defineProperty(xe,"isBiometricAvailable",{get:function(){return fe&&U},enumerable:!0}),Object.defineProperty(xe,"biometricType",{get:function(){return G||"unknown"},enumerable:!0}),Object.defineProperty(xe,"isAccessRequested",{get:function(){return re},enumerable:!0}),Object.defineProperty(xe,"isAccessGranted",{get:function(){return re&&K},enumerable:!0}),Object.defineProperty(xe,"isBiometricTokenSaved",{get:function(){return ue},enumerable:!0}),Object.defineProperty(xe,"deviceId",{get:function(){return Ae||""},enumerable:!0});var Te={callbacks:[]},Pe=!1,Fe=!1,Ne=!1;f.onEvent("biometry_info_received",At),f.onEvent("biometry_auth_requested",ot),f.onEvent("biometry_token_updated",yt);function At(Ve,ft){if(fe=!0,ft.available?(U=!0,G=ft.type||"unknown",ft.access_requested?(re=!0,K=!!ft.access_granted,ue=!!ft.token_saved):(re=!1,K=!1,ue=!1)):(U=!1,G="unknown",re=!1,K=!1,ue=!1),Ae=ft.device_id||"",Te.callbacks.length>0)for(var et=0;et<Te.callbacks.length;et++){var ht=Te.callbacks[et];ht()}if(Pe){var it=Pe;Pe=!1,it.callback&&it.callback(K)}X("biometricManagerUpdated")}function ot(Ve,ft){var et=ft.status=="authorized",ht=ft.token||"";if(Fe){var it=Fe;Fe=!1,it.callback&&it.callback(et,et?ht:null)}X("biometricAuthRequested",et?{isAuthenticated:!0,biometricToken:ht}:{isAuthenticated:!1})}function yt(Ve,ft){var et=!1;if(U&&re&&(ft.status=="updated"?(ue=!0,et=!0):ft.status=="removed"&&(ue=!1,et=!0)),Ne){var ht=Ne;Ne=!1,ht.callback&&ht.callback(et)}X("biometricTokenUpdated",{isUpdated:et})}function vt(){return!!je("7.2")}function _t(){if(!fe)throw Error("WebAppBiometricManagerNotInited");return!0}return xe.init=function(Ve){return!vt()||fe||(Ve&&Te.callbacks.push(Ve),f.postEvent("web_app_biometry_get_info",!1)),xe},xe.requestAccess=function(Ve,ft){if(!vt())return xe;if(_t(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(Pe)throw Error("WebAppBiometricManagerAccessRequested");var et={};if(typeof Ve.reason<"u"){var ht=V(Ve.reason);if(ht.length>128)throw Error("WebAppBiometricRequestAccessParamInvalid");ht.length>0&&(et.reason=ht)}return Pe={callback:ft},f.postEvent("web_app_biometry_request_access",!1,et),xe},xe.authenticate=function(Ve,ft){if(!vt())return xe;if(_t(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!K)throw Error("WebAppBiometricManagerBiometricAccessNotGranted");if(Fe)throw Error("WebAppBiometricManagerAuthenticationRequested");var et={};if(typeof Ve.reason<"u"){var ht=V(Ve.reason);if(ht.length>128)throw Error("WebAppBiometricRequestAccessParamInvalid");ht.length>0&&(et.reason=ht)}return Fe={callback:ft},f.postEvent("web_app_biometry_request_auth",!1,et),xe},xe.updateBiometricToken=function(Ve,ft){if(!vt())return xe;if(Ve=Ve||"",Ve.length>1024)throw Error("WebAppBiometricManagerTokenInvalid");if(_t(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!K)throw Error("WebAppBiometricManagerBiometricAccessNotGranted");if(Ne)throw Error("WebAppBiometricManagerTokenUpdateRequested");return Ne={callback:ft},f.postEvent("web_app_biometry_update_token",!1,{token:Ve}),xe},xe.openSettings=function(){if(!vt())return xe;if(_t(),!U)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!re)throw Error("WebAppBiometricManagerBiometricsAccessNotRequested");return K||f.postEvent("web_app_biometry_open_settings",!1),xe},xe})(),Xe={};function He(fe,U){if(U.slug&&Xe[U.slug]){var G=Xe[U.slug];delete Xe[U.slug],G.callback&&G.callback(U.status),X("invoiceClosed",{url:G.url,status:U.status})}}var Ze=!1;function xt(fe,U){if(Ze){var G=Ze;Ze=!1;var re=null;typeof U.button_id<"u"&&(re=U.button_id),G.callback&&G.callback(re),X("popupClosed",{button_id:re})}}var tt=!1;function mt(fe,U){if(tt){var G=tt,re=null;typeof U.data<"u"&&(re=U.data),G.callback&&G.callback(re)&&(tt=!1,f.postEvent("web_app_close_scan_qr_popup",!1)),X("qrTextReceived",{data:re})}}function Tt(fe,U){tt=!1,X("scanQrPopupClosed")}function St(fe,U){if(U.req_id&&we[U.req_id]){var G=we[U.req_id];delete we[U.req_id];var re=null;typeof U.data<"u"&&(re=U.data),G.callback&&G.callback(re),X("clipboardTextReceived",{data:re})}}var lt=!1;function Mt(fe,U){if(lt){var G=lt;lt=!1,G.callback&&G.callback(U.status=="allowed"),X("writeAccessRequested",{status:U.status})}}function Ct(fe,U){var G,re,K=0,ue=function(){ve("getRequestedContact",{},function(xe,Te){Te&&Te.length?(clearTimeout(re),fe(Te)):(K+=50,G=setTimeout(ue,K))})},Ae=function(){clearTimeout(G),fe("")};re=setTimeout(Ae,U),ue()}var ce=!1;function Y(fe,U){if(ce){var G=ce;ce=!1;var re=U.status=="sent",K={status:U.status};re?Ct(function(ue){if(ue&&ue.length){K.response=ue,K.responseUnsafe=r.urlParseQueryString(ue);for(var Ae in K.responseUnsafe){var xe=K.responseUnsafe[Ae];try{(xe.substr(0,1)=="{"&&xe.substr(-1)=="}"||xe.substr(0,1)=="["&&xe.substr(-1)=="]")&&(K.responseUnsafe[Ae]=JSON.parse(xe))}catch{}}}G.callback&&G.callback(re,K),X("contactRequested",K)},3e3):(G.callback&&G.callback(re,K),X("contactRequested",K))}}function Q(fe,U){if(U.req_id&&we[U.req_id]){var G=we[U.req_id];delete we[U.req_id];var re=null,K=null;typeof U.result<"u"&&(re=U.result),typeof U.error<"u"&&(K=U.error),G.callback&&G.callback(K,re)}}function ve(fe,U,G){if(!je("6.9"))throw Error("WebAppMethodUnsupported");var re=te(16),K={req_id:re,method:fe,params:U||{}};we[re]={callback:G},f.postEvent("web_app_invoke_custom_method",!1,K)}window.Telegram||(window.Telegram={}),Object.defineProperty(v,"initData",{get:function(){return g},enumerable:!0}),Object.defineProperty(v,"initDataUnsafe",{get:function(){return w},enumerable:!0}),Object.defineProperty(v,"version",{get:function(){return _},enumerable:!0}),Object.defineProperty(v,"platform",{get:function(){return b},enumerable:!0}),Object.defineProperty(v,"colorScheme",{get:function(){return S},enumerable:!0}),Object.defineProperty(v,"themeParams",{get:function(){return x},enumerable:!0}),Object.defineProperty(v,"isExpanded",{get:function(){return y},enumerable:!0}),Object.defineProperty(v,"viewportHeight",{get:function(){return(k===!1?window.innerHeight:k)-ut},enumerable:!0}),Object.defineProperty(v,"viewportStableHeight",{get:function(){return(q===!1?window.innerHeight:q)-ut},enumerable:!0}),Object.defineProperty(v,"isClosingConfirmationEnabled",{set:function(fe){I(fe)},get:function(){return $},enumerable:!0}),Object.defineProperty(v,"isVerticalSwipesEnabled",{set:function(fe){j(fe)},get:function(){return F},enumerable:!0}),Object.defineProperty(v,"headerColor",{set:function(fe){z(fe)},get:function(){return R()},enumerable:!0}),Object.defineProperty(v,"backgroundColor",{set:function(fe){pe(fe)},get:function(){return ee()},enumerable:!0}),Object.defineProperty(v,"bottomBarColor",{set:function(fe){qe(fe)},get:function(){return Se()},enumerable:!0}),Object.defineProperty(v,"BackButton",{value:st,enumerable:!0}),Object.defineProperty(v,"MainButton",{value:Z,enumerable:!0}),Object.defineProperty(v,"SecondaryButton",{value:J,enumerable:!0}),Object.defineProperty(v,"SettingsButton",{value:ge,enumerable:!0}),Object.defineProperty(v,"HapticFeedback",{value:Ee,enumerable:!0}),Object.defineProperty(v,"CloudStorage",{value:Re,enumerable:!0}),Object.defineProperty(v,"BiometricManager",{value:ke,enumerable:!0}),v.setHeaderColor=function(fe){v.headerColor=fe},v.setBackgroundColor=function(fe){v.backgroundColor=fe},v.setBottomBarColor=function(fe){v.bottomBarColor=fe},v.enableClosingConfirmation=function(){v.isClosingConfirmationEnabled=!0},v.disableClosingConfirmation=function(){v.isClosingConfirmationEnabled=!1},v.enableVerticalSwipes=function(){v.isVerticalSwipesEnabled=!0},v.disableVerticalSwipes=function(){v.isVerticalSwipesEnabled=!1},v.isVersionAtLeast=function(fe){return je(fe)},v.onEvent=function(fe,U){oe(fe,U)},v.offEvent=function(fe,U){se(fe,U)},v.sendData=function(fe){if(!fe||!fe.length||Ye(fe)>4096)throw Error("WebAppDataInvalid");f.postEvent("web_app_data_send",!1,{data:fe})},v.switchInlineQuery=function(fe,U){if(!je("6.6"))throw Error("WebAppMethodUnsupported");if(!d.tgWebAppBotInline)throw Error("WebAppInlineModeDisabled");if(fe=fe||"",fe.length>256)throw Error("WebAppInlineQueryInvalid");var G=[];if(U){if(!Array.isArray(U))throw Error("WebAppInlineChooseChatTypesInvalid");for(var re={users:1,bots:1,groups:1,channels:1},K=0;K<U.length;K++){var ue=U[K];if(!re[ue])throw Error("WebAppInlineChooseChatTypeInvalid");re[ue]!=2&&(re[ue]=2,G.push(ue))}}f.postEvent("web_app_switch_inline_query",!1,{query:fe,chat_types:G})},v.openLink=function(re,U){var G=document.createElement("A");if(G.href=re,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppTgUrlInvalid");var re=G.href;if(U=U||{},je("6.1")){var K={url:re};je("6.4")&&U.try_instant_view&&(K.try_instant_view=!0),je("7.6")&&U.try_browser&&(K.try_browser=U.try_browser),f.postEvent("web_app_open_link",!1,K)}else window.open(re,"_blank")},v.openTelegramLink=function(fe){var U=document.createElement("A");if(U.href=fe,U.protocol!="http:"&&U.protocol!="https:"||U.hostname!="t.me")throw Error("WebAppTgUrlInvalid");var G=U.pathname+U.search;m||je("6.1")?f.postEvent("web_app_open_tg_link",!1,{path_full:G}):location.href="https://t.me"+G},v.openInvoice=function(fe,U){var G=document.createElement("A"),re,K;if(G.href=fe,G.protocol!="http:"&&G.protocol!="https:"||G.hostname!="t.me"||!(re=G.pathname.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/))||!(K=re[2]))throw Error("WebAppInvoiceUrlInvalid");if(!je("6.1"))throw Error("WebAppMethodUnsupported");if(Xe[K])throw Error("WebAppInvoiceOpened");Xe[K]={url:fe,callback:U},f.postEvent("web_app_open_invoice",!1,{slug:K})},v.showPopup=function(fe,U){if(!je("6.2"))throw Error("WebAppMethodUnsupported");if(Ze)throw Error("WebAppPopupOpened");var G="",re="",K=[],ue={};if(typeof fe.title<"u"){if(G=V(fe.title),G.length>64)throw Error("WebAppPopupParamInvalid");G.length>0&&(ue.title=G)}if(typeof fe.message<"u"&&(re=V(fe.message)),!re.length||re.length>256)throw Error("WebAppPopupParamInvalid");if(ue.message=re,typeof fe.buttons<"u"){if(!Array.isArray(fe.buttons))throw Error("WebAppPopupParamInvalid");for(var Ae=0;Ae<fe.buttons.length;Ae++){var xe=fe.buttons[Ae],Te={},Pe="";if(typeof xe.id<"u"&&(Pe=xe.id.toString(),Pe.length>64))throw Error("WebAppPopupParamInvalid");Te.id=Pe;var Fe=xe.type;if(typeof Fe>"u"&&(Fe="default"),Te.type=Fe,!(Fe=="ok"||Fe=="close"||Fe=="cancel"))if(Fe=="default"||Fe=="destructive"){var Ne="";if(typeof xe.text<"u"&&(Ne=V(xe.text)),!Ne.length||Ne.length>64)throw Error("WebAppPopupParamInvalid");Te.text=Ne}else throw Error("WebAppPopupParamInvalid");K.push(Te)}}else K.push({id:"",type:"close"});if(K.length<1||K.length>3)throw Error("WebAppPopupParamInvalid");ue.buttons=K,Ze={callback:U},f.postEvent("web_app_open_popup",!1,ue)},v.showAlert=function(fe,U){v.showPopup({message:fe},U?function(){U()}:null)},v.showConfirm=function(fe,U){v.showPopup({message:fe,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},U?function(G){U(G=="ok")}:null)},v.showScanQrPopup=function(fe,U){if(!je("6.4"))throw Error("WebAppMethodUnsupported");if(tt)throw Error("WebAppScanQrPopupOpened");var G="",re={};if(typeof fe.text<"u"){if(G=V(fe.text),G.length>64)throw Error("WebAppScanQrPopupParamInvalid");G.length>0&&(re.text=G)}tt={callback:U},f.postEvent("web_app_open_scan_qr_popup",!1,re)},v.closeScanQrPopup=function(){if(!je("6.4"))throw Error("WebAppMethodUnsupported");tt=!1,f.postEvent("web_app_close_scan_qr_popup",!1)},v.readTextFromClipboard=function(fe){if(!je("6.4"))throw Error("WebAppMethodUnsupported");var U=te(16),G={req_id:U};we[U]={callback:fe},f.postEvent("web_app_read_text_from_clipboard",!1,G)},v.requestWriteAccess=function(fe){if(!je("6.9"))throw Error("WebAppMethodUnsupported");if(lt)throw Error("WebAppWriteAccessRequested");lt={callback:fe},f.postEvent("web_app_request_write_access")},v.requestContact=function(fe){if(!je("6.9"))throw Error("WebAppMethodUnsupported");if(ce)throw Error("WebAppContactRequested");ce={callback:fe},f.postEvent("web_app_request_phone")},v.shareToStory=function(fe,U){if(U=U||{},!je("7.8"))throw Error("WebAppMethodUnsupported");var G=document.createElement("A");if(G.href=fe,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppMediaUrlInvalid");var re={};if(re.media_url=G.href,typeof U.text<"u"){var K=V(U.text);if(K.length>2048)throw Error("WebAppShareToStoryParamInvalid");K.length>0&&(re.text=K)}if(typeof U.widget_link<"u"){if(U.widget_link=U.widget_link||{},G.href=U.widget_link.url,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppShareToStoryParamInvalid");var ue={url:G.href};if(typeof U.widget_link.name<"u"){var Ae=V(U.widget_link.name);if(Ae.length>48)throw Error("WebAppShareToStoryParamInvalid");Ae.length>0&&(ue.name=Ae)}re.widget_link=ue}f.postEvent("web_app_share_to_story",!1,re)},v.invokeCustomMethod=function(fe,U,G){ve(fe,U,G)},v.ready=function(){f.postEvent("web_app_ready")},v.expand=function(){f.postEvent("web_app_expand")},v.close=function(fe){fe=fe||{};var U={};je("7.6")&&fe.return_back&&(U.return_back=!0),f.postEvent("web_app_close",!1,U)},window.Telegram.WebApp=v,me(),ae(),Oe(),B(),d.tgWebAppShowSettings&&ge.show(),window.addEventListener("resize",N),m&&document.addEventListener("click",H),f.onEvent("theme_changed",T),f.onEvent("viewport_changed",O),f.onEvent("invoice_closed",He),f.onEvent("popup_closed",xt),f.onEvent("qr_text_received",mt),f.onEvent("scan_qr_popup_closed",Tt),f.onEvent("clipboard_text_received",St),f.onEvent("write_access_requested",Mt),f.onEvent("phone_requested",Y),f.onEvent("custom_method_invoked",Q),f.postEvent("web_app_request_theme"),f.postEvent("web_app_request_viewport")})()),telegramWebApps}var hasRequiredSdk;function requireSdk(){if(hasRequiredSdk)return sdk;hasRequiredSdk=1,Object.defineProperty(sdk,"__esModule",{value:!0}),sdk.WebApp=void 0,requireTelegramWebApps();var r=window;return sdk.WebApp=r.Telegram.WebApp,sdk}var hasRequiredDist$1;function requireDist$1(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1,Object.defineProperty(dist$1,"__esModule",{value:!0});var r=requireSdk();return dist$1.default=r.WebApp,dist$1}var distExports=requireDist$1();const WebApp=getDefaultExportFromCjs(distExports);function getLaunchParams(){const r=window.Telegram.WebApp;if(!r.initData){const f=sessionStorage.getItem("tg_init_data");return f||""}return r.initData}function isTelegramEnv(){try{if(typeof window>"u"||!window.Telegram||!window.Telegram.WebApp)return!1;const r=window.Telegram.WebApp;if(!r.initDataUnsafe||typeof r.initDataUnsafe!="object")return!1;const f=r.initDataUnsafe.user&&typeof r.initDataUnsafe.user=="object",d="initData"in r;if(f||d){const m=r.platform;return!(m!=null&&typeof m=="string"&&["fake","mock","test"].includes(m.toLowerCase()))}return!1}catch{return!1}}function getTelegramUserUnsafe(){try{if(!WebApp||!WebApp.initDataUnsafe)return null;const r=WebApp.initDataUnsafe;return!r.user||!r.user.id?null:{user:{id:r.user.id,firstName:r.user.first_name||"",lastName:r.user.last_name||"",username:r.user.username,photoUrl:r.user.photo_url||"",languageCode:r.user.language_code,isPremium:r.user.is_premium||!1,allowsWriteToPm:r.user.allows_write_to_pm||!1},authDate:new Date().toISOString(),hash:r.hash||"",startParam:r.start_param,chatType:r.chat_type,chatInstance:r.chat_instance}}catch{return null}}function readCookie(r){if(typeof document>"u")return null;const f=document.cookie.match(new RegExp("(?:^|; )"+r.replace(/([.$?*|{}()\[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return f?decodeURIComponent(f[1]):null}function writeCookie(r,f,d=365*2){if(typeof document>"u")return;const m=new Date;m.setTime(m.getTime()+d*24*60*60*1e3);const v="; expires="+m.toUTCString();document.cookie=`${encodeURIComponent(r)}=${encodeURIComponent(f)}${v}; path=/`}function generateNumericId(){const r=Math.floor(Math.random()*1e9),f=Date.now()%1e9;return Number(String(f).padStart(9,"0")+String(r).padStart(9,"0"))}function getAnonymousBrowserUser(r="tg_tracking_uid"){let f=readCookie(r);if(!f){const v=generateNumericId();f=String(v),writeCookie(r,f)}const d=Number(f.replace(/\D/g,"").slice(0,15))||generateNumericId(),m=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en";return{user:{id:d,firstName:"Guest",lastName:"",username:`guest_${f.slice(-6)}`,languageCode:m.toLowerCase(),isPremium:!1,allowsWriteToPm:!1},authDate:new Date().toISOString(),hash:"anonymous_cookie_user",startParam:"browser_guest",chatType:"sender",chatInstance:""}}function getDefaultMockUser(){return{user:{id:2077220643,firstName:"Mock",lastName:"User",username:"mock_user_demo",languageCode:"zh-hans",isPremium:!0,allowsWriteToPm:!0},authDate:new Date().toISOString(),hash:"mock_hash_for_demo_purpose",startParam:"demo_start_param",chatType:"sender",chatInstance:"-245769840322609948"}}var naclUtil$1={exports:{}},naclUtil=naclUtil$1.exports,hasRequiredNaclUtil;function requireNaclUtil(){return hasRequiredNaclUtil||(hasRequiredNaclUtil=1,(function(r){(function(f,d){r.exports?r.exports=d():(f.nacl||(f.nacl={}),f.nacl.util=d())})(naclUtil,function(){var f={};function d(m){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(m))throw new TypeError("invalid encoding")}return f.decodeUTF8=function(m){if(typeof m!="string")throw new TypeError("expected string");var v,g=unescape(encodeURIComponent(m)),w=new Uint8Array(g.length);for(v=0;v<g.length;v++)w[v]=g.charCodeAt(v);return w},f.encodeUTF8=function(m){var v,g=[];for(v=0;v<m.length;v++)g.push(String.fromCharCode(m[v]));return decodeURIComponent(escape(g.join("")))},typeof atob>"u"?typeof Buffer.from<"u"?(f.encodeBase64=function(m){return Buffer.from(m).toString("base64")},f.decodeBase64=function(m){return d(m),new Uint8Array(Array.prototype.slice.call(Buffer.from(m,"base64"),0))}):(f.encodeBase64=function(m){return new Buffer(m).toString("base64")},f.decodeBase64=function(m){return d(m),new Uint8Array(Array.prototype.slice.call(new Buffer(m,"base64"),0))}):(f.encodeBase64=function(m){var v,g=[],w=m.length;for(v=0;v<w;v++)g.push(String.fromCharCode(m[v]));return btoa(g.join(""))},f.decodeBase64=function(m){d(m);var v,g=atob(m),w=new Uint8Array(g.length);for(v=0;v<g.length;v++)w[v]=g.charCodeAt(v);return w}),f})})(naclUtil$1)),naclUtil$1.exports}var naclUtilExports=requireNaclUtil();const nacl=getDefaultExportFromCjs(naclUtilExports);function commonjsRequire(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var naclFast={exports:{}},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}},dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,(function(r){Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var f={},d={};d.byteLength=b,d.toByteArray=E,d.fromByteArray=T;for(var m=[],v=[],g=typeof Uint8Array<"u"?Uint8Array:Array,w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x=0,S=w.length;x<S;++x)m[x]=w[x],v[w.charCodeAt(x)]=x;v[45]=62,v[95]=63;function _(N){var H=N.length;if(H%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var V=N.indexOf("=");V===-1&&(V=H);var X=V===H?0:4-V%4;return[V,X]}function b(N){var H=_(N),V=H[0],X=H[1];return(V+X)*3/4-X}function C(N,H,V){return(H+V)*3/4-V}function E(N){var H,V=_(N),X=V[0],oe=V[1],se=new g(C(N,X,oe)),de=0,he=oe>0?X-4:X,we;for(we=0;we<he;we+=4)H=v[N.charCodeAt(we)]<<18|v[N.charCodeAt(we+1)]<<12|v[N.charCodeAt(we+2)]<<6|v[N.charCodeAt(we+3)],se[de++]=H>>16&255,se[de++]=H>>8&255,se[de++]=H&255;return oe===2&&(H=v[N.charCodeAt(we)]<<2|v[N.charCodeAt(we+1)]>>4,se[de++]=H&255),oe===1&&(H=v[N.charCodeAt(we)]<<10|v[N.charCodeAt(we+1)]<<4|v[N.charCodeAt(we+2)]>>2,se[de++]=H>>8&255,se[de++]=H&255),se}function M(N){return m[N>>18&63]+m[N>>12&63]+m[N>>6&63]+m[N&63]}function A(N,H,V){for(var X,oe=[],se=H;se<V;se+=3)X=(N[se]<<16&16711680)+(N[se+1]<<8&65280)+(N[se+2]&255),oe.push(M(X));return oe.join("")}function T(N){for(var H,V=N.length,X=V%3,oe=[],se=16383,de=0,he=V-X;de<he;de+=se)oe.push(A(N,de,de+se>he?he:de+se));return X===1?(H=N[V-1],oe.push(m[H>>2]+m[H<<4&63]+"==")):X===2&&(H=(N[V-2]<<8)+N[V-1],oe.push(m[H>>10]+m[H>>4&63]+m[H<<2&63]+"=")),oe.join("")}var L={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */L.read=function(N,H,V,X,oe){var se,de,he=oe*8-X-1,we=(1<<he)-1,te=we>>1,k=-7,q=V?oe-1:0,y=V?-1:1,B=N[H+q];for(q+=y,se=B&(1<<-k)-1,B>>=-k,k+=he;k>0;se=se*256+N[H+q],q+=y,k-=8);for(de=se&(1<<-k)-1,se>>=-k,k+=X;k>0;de=de*256+N[H+q],q+=y,k-=8);if(se===0)se=1-te;else{if(se===we)return de?NaN:(B?-1:1)*(1/0);de=de+Math.pow(2,X),se=se-te}return(B?-1:1)*de*Math.pow(2,se-X)},L.write=function(N,H,V,X,oe,se){var de,he,we,te=se*8-oe-1,k=(1<<te)-1,q=k>>1,y=oe===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=X?0:se-1,$=X?1:-1,I=H<0||H===0&&1/H<0?1:0;for(H=Math.abs(H),isNaN(H)||H===1/0?(he=isNaN(H)?1:0,de=k):(de=Math.floor(Math.log(H)/Math.LN2),H*(we=Math.pow(2,-de))<1&&(de--,we*=2),de+q>=1?H+=y/we:H+=y*Math.pow(2,1-q),H*we>=2&&(de++,we/=2),de+q>=k?(he=0,de=k):de+q>=1?(he=(H*we-1)*Math.pow(2,oe),de=de+q):(he=H*Math.pow(2,q-1)*Math.pow(2,oe),de=0));oe>=8;N[V+B]=he&255,B+=$,he/=256,oe-=8);for(de=de<<oe|he,te+=oe;te>0;N[V+B]=de&255,B+=$,de/=256,te-=8);N[V+B-$]|=I*128};/*!
11
+ `+g):m.stack=g}catch{}}throw m}}_request(f,d){typeof f=="string"?(d=d||{},d.url=f):d=f||{},d=mergeConfig$1(this.defaults,d);const{transitional:m,paramsSerializer:v,headers:g}=d;m!==void 0&&validator.assertOptions(m,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),v!=null&&(utils$5.isFunction(v)?d.paramsSerializer={serialize:v}:validator.assertOptions(v,{encode:validators.function,serialize:validators.function},!0)),d.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?d.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:d.allowAbsoluteUrls=!0),validator.assertOptions(d,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),d.method=(d.method||this.defaults.method||"get").toLowerCase();let w=g&&utils$5.merge(g.common,g[d.method]);g&&utils$5.forEach(["delete","get","head","post","put","patch","common"],A=>{delete g[A]}),d.headers=AxiosHeaders$1.concat(w,g);const x=[];let S=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(d)===!1||(S=S&&T.synchronous,x.unshift(T.fulfilled,T.rejected))});const _=[];this.interceptors.response.forEach(function(T){_.push(T.fulfilled,T.rejected)});let b,C=0,E;if(!S){const A=[dispatchRequest.bind(this),void 0];for(A.unshift(...x),A.push(..._),E=A.length,b=Promise.resolve(d);C<E;)b=b.then(A[C++],A[C++]);return b}E=x.length;let M=d;for(C=0;C<E;){const A=x[C++],T=x[C++];try{M=A(M)}catch(L){T.call(this,L);break}}try{b=dispatchRequest.call(this,M)}catch(A){return Promise.reject(A)}for(C=0,E=_.length;C<E;)b=b.then(_[C++],_[C++]);return b}getUri(f){f=mergeConfig$1(this.defaults,f);const d=buildFullPath(f.baseURL,f.url,f.allowAbsoluteUrls);return buildURL(d,f.params,f.paramsSerializer)}};utils$5.forEach(["delete","get","head","options"],function(f){Axios$1.prototype[f]=function(d,m){return this.request(mergeConfig$1(m||{},{method:f,url:d,data:(m||{}).data}))}}),utils$5.forEach(["post","put","patch"],function(f){function d(m){return function(g,w,x){return this.request(mergeConfig$1(x||{},{method:f,headers:m?{"Content-Type":"multipart/form-data"}:{},url:g,data:w}))}}Axios$1.prototype[f]=d(),Axios$1.prototype[f+"Form"]=d(!0)});let CancelToken$1=class Gt{constructor(f){if(typeof f!="function")throw new TypeError("executor must be a function.");let d;this.promise=new Promise(function(g){d=g});const m=this;this.promise.then(v=>{if(!m._listeners)return;let g=m._listeners.length;for(;g-- >0;)m._listeners[g](v);m._listeners=null}),this.promise.then=v=>{let g;const w=new Promise(x=>{m.subscribe(x),g=x}).then(v);return w.cancel=function(){m.unsubscribe(g)},w},f(function(g,w,x){m.reason||(m.reason=new CanceledError$1(g,w,x),d(m.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(f){if(this.reason){f(this.reason);return}this._listeners?this._listeners.push(f):this._listeners=[f]}unsubscribe(f){if(!this._listeners)return;const d=this._listeners.indexOf(f);d!==-1&&this._listeners.splice(d,1)}toAbortSignal(){const f=new AbortController,d=m=>{f.abort(m)};return this.subscribe(d),f.signal.unsubscribe=()=>this.unsubscribe(d),f.signal}static source(){let f;return{token:new Gt(function(v){f=v}),cancel:f}}};function spread$2(r){return function(d){return r.apply(null,d)}}function isAxiosError$1(r){return utils$5.isObject(r)&&r.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([r,f])=>{HttpStatusCode$1[f]=r});function createInstance(r){const f=new Axios$1(r),d=bind(Axios$1.prototype.request,f);return utils$5.extend(d,Axios$1.prototype,f,{allOwnKeys:!0}),utils$5.extend(d,f,null,{allOwnKeys:!0}),d.create=function(v){return createInstance(mergeConfig$1(r,v))},d}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function(f){return Promise.all(f)},axios.spread=spread$2,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=r=>formDataToJSON(utils$5.isHTMLForm(r)?new FormData(r):r),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread:spread$1,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,TEST_BASE_URL="https://miniapptest-spinfi.xy1212.com";class HttpClient{constructor(f){this.options=f;const d=f.baseURL;this.instance=axios.create({baseURL:d,timeout:3e4}),this.instance.interceptors.request.use(m=>{const v=this.options.getToken();if(v){m.headers=m.headers||{};const w=`Bearer ${v}`;m.headers.Authorization=w}const g=this.options.getAppId?this.options.getAppId():null;return g&&(m.headers=m.headers||{},m.headers["hm-app-id"]=String(g)),m}),this.instance.interceptors.response.use(m=>m,m=>(m.response&&m.response.status===401&&this.options.onAuthError&&this.options.onAuthError(),Promise.reject(m)))}request(f){return this.instance.request(f)}get(f,d){return this.instance.get(f,d)}post(f,d,m){return this.instance.post(f,d,m)}}class NamespacedStorage{constructor(f="tg_tracking_sdk"){this.prefix=f}k(f){return`${this.prefix}:${f}`}set(f,d){try{localStorage.setItem(this.k(f),JSON.stringify(d))}catch{}}get(f){try{const d=localStorage.getItem(this.k(f));return d?JSON.parse(d):null}catch{return null}}remove(f){try{localStorage.removeItem(this.k(f))}catch{}}}class APIService{constructor(f){this.http=f}auth(f){return this.http.post("/api/user/auth",f).then(d=>d.data)}getAdPositionConfig(f){return this.http.post("/api/ad/adPositionDisplayAd",{adPositionName:f}).then(d=>d.data)}createAd(f){return this.http.post("/api/v2/ad/create",f).then(d=>d.data)}adMonitor(f){return this.http.get("/api/v2/ad/monitor",{params:f}).then(d=>d.data)}bindWalletReq(f){return this.http.post("/api/user/bindWallet",f).then(d=>d.data)}merchantPayModeList(){return this.http.get("/api/v2/merchant/pay/modeList").then(f=>f.data)}merchantPayCreate(f){return this.http.post("/api/v2/merchant/pay/create",f).then(d=>d.data)}merchantPayFinish(f){return this.http.post("/api/v2/merchant/pay/finish",f).then(d=>d.data)}merchantPayQueryResult(f){return this.http.post("/api/v2/merchant/pay/queryResult",f).then(d=>d.data)}merchantPayNotify(f){return this.http.post("/api/v2/merchant/pay/notify",f).then(d=>d.data)}}class HmAdManager{constructor(f={}){this.options=f,this.initialized=!1}async init(){this.initialized||(this.options.autoInjectScript!==!1&&this.sdkZone&&this.sdkFunc&&await this.ensureScriptInjected(),this.initialized=!0)}async setSpace(f){if(!f)return;const d=String(f),m=`show_${f}`,v=this.sdkZone!==d||this.sdkFunc!==m;this.sdkZone=d,this.sdkFunc=m,this.options.autoInjectScript!==!1&&await this.ensureScriptInjected(v)}findExistingScript(){return typeof document>"u"?null:document.querySelector("script[src*='//libtl.com/sdk.js']")}async ensureScriptInjected(f=!1){var g;if(typeof document>"u")return;const d=this.findExistingScript(),m=this.sdkZone||"",v=this.sdkFunc||"";if(d){const w=d.getAttribute("data-zone")||"",x=d.getAttribute("data-sdk")||"";if(w===m&&x===v&&!f)return;(g=d.parentElement)==null||g.removeChild(d)}!m||!v||await this.injectScript(m,v)}injectScript(f,d){return new Promise((m,v)=>{if(typeof document>"u")return m();const g=document.createElement("script");g.src="//libtl.com/sdk.js",g.setAttribute("data-zone",f),g.setAttribute("data-sdk",d),g.async=!0,g.onload=()=>m(),g.onerror=()=>v(new Error("Hm 脚本加载失败")),document.head.appendChild(g)})}async callSDK(f){if(!this.sdkFunc)throw new Error("Hm 未设置 spaceId");const d=window[this.sdkFunc];if(typeof d!="function")throw new Error("Hm SDK 未正确加载");await d(f)}async show(){try{await this.callSDK()}catch(f){throw f}}async showPopup(){try{await this.callSDK("pop")}catch(f){throw f}}async showInApp(f){try{await this.callSDK({type:"inApp",inAppSettings:f})}catch(d){throw d}}}class AdMonitor{constructor(f){this.getMonitor=f}extractParamsFromUrl(f){if(!f)return null;try{return{param:new URL(f).searchParams.get("param")||""}}catch{return null}}async send(f,d){if(!f)return;const m=Array.isArray(f)?f:[f];if(m.length===0)return;const v=m[0],g=this.extractParamsFromUrl(v);let w;if(g&&this.getMonitor)try{const x=Math.floor(Date.now()/1e3).toString(),S=CryptoJS.MD5(d+x).toString(),_={param:g.param,request_code:S,timestamp:x};w=await this.getMonitor(_)}catch{}return await Promise.allSettled(m.slice(1).map(x=>{try{return fetch(x,{method:"GET"})}catch{return Promise.resolve()}})),w}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var dist$1={},sdk={},telegramWebApps={},hasRequiredTelegramWebApps;function requireTelegramWebApps(){return hasRequiredTelegramWebApps||(hasRequiredTelegramWebApps=1,(function(){var r={},f="";try{f=location.hash.toString()}catch{}var d=S(f),m=O("initParams");if(m)for(var v in m)typeof d[v]>"u"&&(d[v]=m[v]);L("initParams",d);var g=!1,w;try{if(g=window.parent!=null&&window!=window.parent,g){window.addEventListener("message",function(N){if(N.source===window.parent){try{var H=JSON.parse(N.data)}catch{return}if(!(!H||!H.eventType))if(H.eventType=="set_custom_style")N.origin==="https://web.telegram.org"&&(w.innerHTML=H.eventData);else if(H.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else E(H.eventType,H.eventData)}}),w=document.createElement("style"),document.head.appendChild(w);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function x(N){try{return N=N.replace(/\+/g,"%20"),decodeURIComponent(N)}catch{return N}}function S(N){N=N.replace(/^#/,"");var H={};if(!N.length)return H;if(N.indexOf("=")<0&&N.indexOf("?")<0)return H._path=x(N),H;var V=N.indexOf("?");if(V>=0){var X=N.substr(0,V);H._path=x(X),N=N.substr(V+1)}var oe=_(N);for(var se in oe)H[se]=oe[se];return H}function _(N){var H={};if(!N.length)return H;var V=N.split("&"),X,oe,se,de;for(X=0;X<V.length;X++)oe=V[X].split("="),se=x(oe[0]),de=oe[1]==null?null:x(oe[1]),H[se]=de;return H}function b(N,H){var V=N.indexOf("#");if(V<0)return N+"#"+H;var X=N.substr(V+1);return X.indexOf("=")>=0||X.indexOf("?")>=0?N+"&"+H:X.length>0?N+"?"+H:N+H}function C(N,H,V){if(H||(H=function(){}),V===void 0&&(V=""),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(N,JSON.stringify(V)),H();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:N,eventData:V})),H();else if(g)try{var X="https://web.telegram.org";X="*",window.parent.postMessage(JSON.stringify({eventType:N,eventData:V}),X),H()}catch(oe){H(oe)}else H({notAvailable:!0})}function E(N,H){M(N,function(V){V(N,H)})}function M(N,H){var V=r[N];if(!(V===void 0||!V.length))for(var X=0;X<V.length;X++)try{H(V[X])}catch{}}function A(N,H){r[N]===void 0&&(r[N]=[]);var V=r[N].indexOf(H);V===-1&&r[N].push(H)}function T(N,H){if(r[N]!==void 0){var V=r[N].indexOf(H);V!==-1&&r[N].splice(V,1)}}function L(N,H){try{return window.sessionStorage.setItem("__telegram__"+N,JSON.stringify(H)),!0}catch{}return!1}function O(N){try{return JSON.parse(window.sessionStorage.getItem("__telegram__"+N))}catch{}return null}window.Telegram||(window.Telegram={}),window.Telegram.WebView={initParams:d,isIframe:g,onEvent:A,offEvent:T,postEvent:C,receiveEvent:E,callEventCallbacks:M},window.Telegram.Utils={urlSafeDecode:x,urlParseQueryString:_,urlParseHashParams:S,urlAppendHashParams:b,sessionStorageSet:L,sessionStorageGet:O},window.TelegramGameProxy_receiveEvent=E,window.TelegramGameProxy={receiveEvent:E}})(),(function(){var r=window.Telegram.Utils,f=window.Telegram.WebView,d=f.initParams,m=f.isIframe,v={},g="",w={},x={},S="light",_="6.0",b="unknown";if(d.tgWebAppData&&d.tgWebAppData.length){g=d.tgWebAppData,w=r.urlParseQueryString(g);for(var C in w){var E=w[C];try{(E.substr(0,1)=="{"&&E.substr(-1)=="}"||E.substr(0,1)=="["&&E.substr(-1)=="]")&&(w[C]=JSON.parse(E))}catch{}}}if(d.tgWebAppThemeParams&&d.tgWebAppThemeParams.length){var M=d.tgWebAppThemeParams;try{var A=JSON.parse(M);A&&he(A)}catch{}}var A=r.sessionStorageGet("themeParams");A&&he(A),d.tgWebAppVersion&&(_=d.tgWebAppVersion),d.tgWebAppPlatform&&(b=d.tgWebAppPlatform);function T(fe,F){F.theme_params&&(he(F.theme_params),window.Telegram.WebApp.MainButton.setParams({}),window.Telegram.WebApp.SecondaryButton.setParams({}),me(),ae(),Oe(),X("themeChanged"))}var L=window.innerHeight;function O(fe,F){F.height&&(window.removeEventListener("resize",N),B(F))}function N(fe){L!=window.innerHeight&&(L=window.innerHeight,X("viewportChanged",{isStateStable:!0}))}function H(fe){if(!(fe.metaKey||fe.ctrlKey)){for(var F=fe.target;F.tagName!="A"&&F.parentNode;)F=F.parentNode;F.tagName=="A"&&F.target!="_blank"&&(F.protocol=="http:"||F.protocol=="https:")&&F.hostname=="t.me"&&(v.openTgLink(F.href),fe.preventDefault())}}function V(fe){return fe.toString().replace(/^\s+|\s+$/g,"")}function X(fe){var F=Array.prototype.slice.call(arguments);fe=F.shift(),f.callEventCallbacks("webview:"+fe,function(G){G.apply(v,F)})}function oe(fe,F){f.onEvent("webview:"+fe,F)}function se(fe,F){f.offEvent("webview:"+fe,F)}function de(fe,F){var G=document.documentElement;G&&G.style&&G.style.setProperty&&G.style.setProperty("--tg-"+fe,F)}function he(fe){fe.bg_color=="#1c1c1d"&&fe.bg_color==fe.secondary_bg_color&&(fe.secondary_bg_color="#2c2c2e");var F;for(var G in fe)(F=Fe(fe[G]))&&(x[G]=F,G=="bg_color"&&(S=De(F)?"dark":"light",de("color-scheme",S)),G="theme-"+G.split("_").join("-"),de(G,F));r.sessionStorageSet("themeParams",x)}var we={};function te(fe){for(var F=100;--F;){for(var G="",re="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",K=re.length,ue=0;ue<fe;ue++)G+=re[Math.floor(Math.random()*K)];if(!we[G])return we[G]={},G}throw Error("WebAppCallbackIdGenerateFailed")}var k=!1,q=!1,y=!0;function B(fe){typeof fe<"u"&&(y=!!fe.is_expanded,k=fe.height,fe.is_state_stable&&(q=fe.height),X("viewportChanged",{isStateStable:!!fe.is_state_stable}));var F,G;k!==!1?F=k-ut+"px":F=ut?"calc(100vh - "+ut+"px)":"100vh",q!==!1?G=q-ut+"px":G=ut?"calc(100vh - "+ut+"px)":"100vh",de("viewport-height",F),de("viewport-stable-height",G)}var $=!1;function I(fe){je("6.2")&&($=!!fe,f.postEvent("web_app_setup_closing_behavior",!1,{need_confirmation:$}))}var U=!0;function j(fe){je("7.7")&&(U=!!fe,f.postEvent("web_app_setup_swipe_behavior",!1,{allow_vertical_swipe:U}))}var D="bg_color",W=null;function R(){return D=="secondary_bg_color"?x.secondary_bg_color:D=="bg_color"?x.bg_color:W}function z(fe){if(je("6.1")){je("6.9")||(x.bg_color&&x.bg_color==fe?fe="bg_color":x.secondary_bg_color&&x.secondary_bg_color==fe&&(fe="secondary_bg_color"));var F=null,G=null;if(fe=="bg_color"||fe=="secondary_bg_color")G=fe;else if(je("6.9")&&(F=Fe(fe),!F))throw Error("WebAppHeaderColorInvalid");if(!je("6.9")&&G!="bg_color"&&G!="secondary_bg_color")throw Error("WebAppHeaderColorKeyInvalid");D=G,W=F,me()}}var ye=null,Ce=null;function me(){(ye!=D||Ce!=W)&&(ye=D,Ce=W,Ce?f.postEvent("web_app_set_header_color",!1,{color:W}):f.postEvent("web_app_set_header_color",!1,{color_key:D}))}var ie="bg_color";function ee(){return ie=="secondary_bg_color"?x.secondary_bg_color:ie=="bg_color"?x.bg_color:ie}function pe(fe){if(je("6.1")){var F;if(fe=="bg_color"||fe=="secondary_bg_color")F=fe;else if(F=Fe(fe),!F)throw Error("WebAppBackgroundColorInvalid");ie=F,ae()}}var be=null;function ae(){var fe=ee();be!=fe&&(be=fe,f.postEvent("web_app_set_background_color",!1,{color:fe}))}var ne="bottom_bar_bg_color";function Se(){return ne=="bottom_bar_bg_color"?x.bottom_bar_bg_color||x.secondary_bg_color||"#ffffff":ne=="secondary_bg_color"?x.secondary_bg_color:ne=="bg_color"?x.bg_color:ne}function qe(fe){if(je("7.10")){var F;if(fe=="bg_color"||fe=="secondary_bg_color"||fe=="bottom_bar_bg_color")F=fe;else if(F=Fe(fe),!F)throw Error("WebAppBottomBarColorInvalid");ne=F,Oe(),window.Telegram.WebApp.SecondaryButton.setParams({})}}var Ie=null;function Oe(){var fe=Se();Ie!=fe&&(Ie=fe,f.postEvent("web_app_set_bottom_bar_color",!1,{color:fe})),d.tgWebAppDebug&&bt()}function Fe(fe){fe+="";var F;if(F=/^\s*#([0-9a-f]{6})\s*$/i.exec(fe))return"#"+F[1].toLowerCase();if(F=/^\s*#([0-9a-f])([0-9a-f])([0-9a-f])\s*$/i.exec(fe))return("#"+F[1]+F[1]+F[2]+F[2]+F[3]+F[3]).toLowerCase();if(F=/^\s*rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)\s*$/.exec(fe)){var G=parseInt(F[1]),re=parseInt(F[2]),K=parseInt(F[3]);return G=(G<16?"0":"")+G.toString(16),re=(re<16?"0":"")+re.toString(16),K=(K<16?"0":"")+K.toString(16),"#"+G+re+K}return!1}function De(fe){fe=fe.replace(/[\s#]/g,""),fe.length==3&&(fe=fe[0]+fe[0]+fe[1]+fe[1]+fe[2]+fe[2]);var F=parseInt(fe.substr(0,2),16),G=parseInt(fe.substr(2,2),16),re=parseInt(fe.substr(4,2),16),K=Math.sqrt(.299*(F*F)+.587*(G*G)+.114*(re*re));return K<120}function $e(fe,F){typeof fe!="string"&&(fe=""),typeof F!="string"&&(F=""),fe=fe.replace(/^\s+|\s+$/g,"").split("."),F=F.replace(/^\s+|\s+$/g,"").split(".");var G=Math.max(fe.length,F.length),re,K,ue;for(re=0;re<G;re++)if(K=parseInt(fe[re])||0,ue=parseInt(F[re])||0,K!=ue)return K>ue?1:-1;return 0}function je(fe){return $e(_,fe)>=0}function Ye(fe){if(window.Blob)try{return new Blob([fe]).size}catch{}for(var F=fe.length,G=fe.length-1;G>=0;G--){var re=fe.charCodeAt(G);re>127&&re<=2047?F++:re>2047&&re<=65535&&(F+=2),re>=56320&&re<=57343&&G--}return F}var st=(function(){var fe=!1,F={};Object.defineProperty(F,"isVisible",{set:function(Pe){Te({is_visible:Pe})},get:function(){return fe},enumerable:!0});var G=null;f.onEvent("back_button_pressed",re);function re(){X("backButtonClicked")}function K(){return{is_visible:fe}}function ue(Pe){return typeof Pe>"u"&&(Pe=K()),JSON.stringify(Pe)}function Ae(){return!!je("6.1")}function xe(){var Pe=K(),Ue=ue(Pe);G!==Ue&&(G=Ue,f.postEvent("web_app_setup_back_button",!1,Pe))}function Te(Pe){return Ae()&&(typeof Pe.is_visible<"u"&&(fe=!!Pe.is_visible),xe()),F}return F.onClick=function(Pe){return Ae()&&oe("backButtonClicked",Pe),F},F.offClick=function(Pe){return Ae()&&se("backButtonClicked",Pe),F},F.show=function(){return Te({is_visible:!0})},F.hide=function(){return Te({is_visible:!1})},F})(),Je=null,Ge={},ut=0;if(d.tgWebAppDebug){Je=document.createElement("tg-bottom-bar");var gt={display:"flex",gap:"7px",font:"600 14px/18px sans-serif",width:"100%",background:Se(),position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"7px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var rt in gt)Je.style[rt]=gt[rt];document.addEventListener("DOMContentLoaded",function fe(F){document.removeEventListener("DOMContentLoaded",fe),document.body.appendChild(Je)});var wt=document.createElement("style");wt.innerHTML='tg-bottom-button.shine { position: relative; overflow: hidden; } tg-bottom-button.shine:before { content:""; position: absolute; top: 0; width: 100%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .2), transparent); animation: tg-bottom-button-shine 5s ease-in-out infinite; } @-webkit-keyframes tg-bottom-button-shine { 0% {left: -100%;} 12%,100% {left: 100%}} @keyframes tg-bottom-button-shine { 0% {left: -100%;} 12%,100% {left: 100%}}',Je.appendChild(wt)}function bt(){var fe=Ge.main._bottomButton,F=Ge.secondary._bottomButton;fe.isVisible||F.isVisible?(Je.style.display="flex",ut=58,fe.isVisible&&F.isVisible&&(F.position=="top"?(Je.style.flexDirection="column-reverse",ut+=51):F.position=="bottom"?(Je.style.flexDirection="column",ut+=51):F.position=="left"?Je.style.flexDirection="row-reverse":F.position=="right"&&(Je.style.flexDirection="row"))):(Je.style.display="none",ut=0),Je.style.background=Se(),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=ut+"px"),B()}var le=function(fe){var F=fe=="main";if(F)var G="web_app_setup_main_button",re="main_button_pressed",K="mainButtonClicked",ue="Continue",Ae=function(){return x.button_color||"#2481cc"},xe=function(){return x.button_text_color||"#ffffff"};else var G="web_app_setup_secondary_button",re="secondary_button_pressed",K="secondaryButtonClicked",ue="Cancel",Ae=function(){return Se()},xe=function(){return x.button_color||"#2481cc"};var Te=!1,Pe=!0,Ue=!1,Ne=!1,At=fe,ot=ue,yt=!1,vt=!1,_t="left",Ve={};Object.defineProperty(Ve,"type",{get:function(){return At},enumerable:!0}),Object.defineProperty(Ve,"text",{set:function(Be){Ve.setParams({text:Be})},get:function(){return ot},enumerable:!0}),Object.defineProperty(Ve,"color",{set:function(Be){Ve.setParams({color:Be})},get:function(){return yt||Ae()},enumerable:!0}),Object.defineProperty(Ve,"textColor",{set:function(Be){Ve.setParams({text_color:Be})},get:function(){return vt||xe()},enumerable:!0}),Object.defineProperty(Ve,"isVisible",{set:function(Be){Ve.setParams({is_visible:Be})},get:function(){return Te},enumerable:!0}),Object.defineProperty(Ve,"isProgressVisible",{get:function(){return Ne},enumerable:!0}),Object.defineProperty(Ve,"isActive",{set:function(Be){Ve.setParams({is_active:Be})},get:function(){return Pe},enumerable:!0}),Object.defineProperty(Ve,"hasShineEffect",{set:function(Be){Ve.setParams({has_shine_effect:Be})},get:function(){return Ue},enumerable:!0}),F||Object.defineProperty(Ve,"position",{set:function(Be){Ve.setParams({position:Be})},get:function(){return _t},enumerable:!0});var ft=null;f.onEvent(re,pt);var et=null;if(d.tgWebAppDebug){et=document.createElement("tg-bottom-button");var ht={display:"none",width:"100%",height:"44px",borderRadius:"0",background:"no-repeat right center",padding:"13px 15px",textAlign:"center",boxSizing:"border-box"};for(var it in ht)et.style[it]=ht[it];Je.appendChild(et),et.addEventListener("click",pt,!1),et._bottomButton=Ve,Ge[fe]=et}function pt(){Pe&&X(K)}function at(){var Be=Ve.color,Ke=Ve.textColor;if(Te){var We={is_visible:!0,is_active:Pe,is_progress_visible:Ne,text:ot,color:Be,text_color:Ke,has_shine_effect:Ue&&Pe&&!Ne};F||(We.position=_t)}else var We={is_visible:!1};return We}function ct(Be){return typeof Be>"u"&&(Be=at()),JSON.stringify(Be)}function dt(){var Be=at(),Ke=ct(Be);ft!==Ke&&(ft=Ke,f.postEvent(G,!1,Be),d.tgWebAppDebug&&nt(Be))}function nt(Be){Be.is_visible?(et.style.display="block",et.style.opacity=Be.is_active?"1":"0.8",et.style.cursor=Be.is_active?"pointer":"auto",et.disabled=!Be.is_active,et.innerText=Be.text,et.className=Be.has_shine_effect?"shine":"",et.style.backgroundImage=Be.is_progress_visible?"url('data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewport="0 0 48 48" width="48px" height="48px"><circle cx="50%" cy="50%" stroke="'+Be.text_color+'" stroke-width="2.25" stroke-linecap="round" fill="none" stroke-dashoffset="106" r="9" stroke-dasharray="56.52" rotate="-90"><animate attributeName="stroke-dashoffset" attributeType="XML" dur="360s" from="0" to="12500" repeatCount="indefinite"></animate><animateTransform attributeName="transform" attributeType="XML" type="rotate" dur="1s" from="-90 24 24" to="630 24 24" repeatCount="indefinite"></animateTransform></circle></svg>')+"')":"none",et.style.backgroundColor=Be.color,et.style.color=Be.text_color):et.style.display="none",bt()}function Le(Be){if(typeof Be.text<"u"){var Ke=V(Be.text);if(!Ke.length||Ke.length>64)throw Error("WebAppBottomButtonParamInvalid");ot=Ke}if(typeof Be.color<"u")if(Be.color===!1||Be.color===null)yt=!1;else{var We=Fe(Be.color);if(!We)throw Error("WebAppBottomButtonParamInvalid");yt=We}if(typeof Be.text_color<"u")if(Be.text_color===!1||Be.text_color===null)vt=!1;else{var ze=Fe(Be.text_color);if(!ze)throw Error("WebAppBottomButtonParamInvalid");vt=ze}if(typeof Be.is_visible<"u"){if(Be.is_visible&&!Ve.text.length)throw Error("WebAppBottomButtonParamInvalid");Te=!!Be.is_visible}if(typeof Be.has_shine_effect<"u"&&(Ue=!!Be.has_shine_effect),!F&&typeof Be.position<"u"){if(Be.position!="left"&&Be.position!="right"&&Be.position!="top"&&Be.position!="bottom")throw Error("WebAppBottomButtonParamInvalid");_t=Be.position}return typeof Be.is_active<"u"&&(Pe=!!Be.is_active),dt(),Ve}return Ve.setText=function(Be){return Ve.setParams({text:Be})},Ve.onClick=function(Be){return oe(K,Be),Ve},Ve.offClick=function(Be){return se(K,Be),Ve},Ve.show=function(){return Ve.setParams({is_visible:!0})},Ve.hide=function(){return Ve.setParams({is_visible:!1})},Ve.enable=function(){return Ve.setParams({is_active:!0})},Ve.disable=function(){return Ve.setParams({is_active:!1})},Ve.showProgress=function(Be){return Pe=!!Be,Ne=!0,dt(),Ve},Ve.hideProgress=function(){return Ve.isActive||(Pe=!0),Ne=!1,dt(),Ve},Ve.setParams=Le,Ve},Z=le("main"),J=le("secondary"),ge=(function(){var fe=!1,F={};Object.defineProperty(F,"isVisible",{set:function(Pe){Te({is_visible:Pe})},get:function(){return fe},enumerable:!0});var G=null;f.onEvent("settings_button_pressed",re);function re(){X("settingsButtonClicked")}function K(){return{is_visible:fe}}function ue(Pe){return typeof Pe>"u"&&(Pe=K()),JSON.stringify(Pe)}function Ae(){return!!je("6.10")}function xe(){var Pe=K(),Ue=ue(Pe);G!==Ue&&(G=Ue,f.postEvent("web_app_setup_settings_button",!1,Pe))}function Te(Pe){return Ae()&&(typeof Pe.is_visible<"u"&&(fe=!!Pe.is_visible),xe()),F}return F.onClick=function(Pe){return Ae()&&oe("settingsButtonClicked",Pe),F},F.offClick=function(Pe){return Ae()&&se("settingsButtonClicked",Pe),F},F.show=function(){return Te({is_visible:!0})},F.hide=function(){return Te({is_visible:!1})},F})(),Ee=(function(){var fe={};function F(G){if(!je("6.1"))return fe;if(G.type=="impact"){if(G.impact_style!="light"&&G.impact_style!="medium"&&G.impact_style!="heavy"&&G.impact_style!="rigid"&&G.impact_style!="soft")throw Error("WebAppHapticImpactStyleInvalid")}else if(G.type=="notification"){if(G.notification_type!="error"&&G.notification_type!="success"&&G.notification_type!="warning")throw Error("WebAppHapticNotificationTypeInvalid")}else if(G.type!="selection_change")throw Error("WebAppHapticFeedbackTypeInvalid");return f.postEvent("web_app_trigger_haptic_feedback",!1,G),fe}return fe.impactOccurred=function(G){return F({type:"impact",impact_style:G})},fe.notificationOccurred=function(G){return F({type:"notification",notification_type:G})},fe.selectionChanged=function(){return F({type:"selection_change"})},fe})(),Re=(function(){var fe={};function F(G,re,K){if(!je("6.9"))throw Error("WebAppMethodUnsupported");return ve(G,re,K),fe}return fe.setItem=function(G,re,K){return F("saveStorageValue",{key:G,value:re},K)},fe.getItem=function(G,re){return fe.getItems([G],re?function(K,ue){K?re(K):re(null,ue[G])}:null)},fe.getItems=function(G,re){return F("getStorageValues",{keys:G},re)},fe.removeItem=function(G,re){return fe.removeItems([G],re)},fe.removeItems=function(G,re){return F("deleteStorageValues",{keys:G},re)},fe.getKeys=function(G){return F("getStorageKeys",{},G)},fe})(),ke=(function(){var fe=!1,F=!1,G="unknown",re=!1,K=!1,ue=!1,Ae="",xe={};Object.defineProperty(xe,"isInited",{get:function(){return fe},enumerable:!0}),Object.defineProperty(xe,"isBiometricAvailable",{get:function(){return fe&&F},enumerable:!0}),Object.defineProperty(xe,"biometricType",{get:function(){return G||"unknown"},enumerable:!0}),Object.defineProperty(xe,"isAccessRequested",{get:function(){return re},enumerable:!0}),Object.defineProperty(xe,"isAccessGranted",{get:function(){return re&&K},enumerable:!0}),Object.defineProperty(xe,"isBiometricTokenSaved",{get:function(){return ue},enumerable:!0}),Object.defineProperty(xe,"deviceId",{get:function(){return Ae||""},enumerable:!0});var Te={callbacks:[]},Pe=!1,Ue=!1,Ne=!1;f.onEvent("biometry_info_received",At),f.onEvent("biometry_auth_requested",ot),f.onEvent("biometry_token_updated",yt);function At(Ve,ft){if(fe=!0,ft.available?(F=!0,G=ft.type||"unknown",ft.access_requested?(re=!0,K=!!ft.access_granted,ue=!!ft.token_saved):(re=!1,K=!1,ue=!1)):(F=!1,G="unknown",re=!1,K=!1,ue=!1),Ae=ft.device_id||"",Te.callbacks.length>0)for(var et=0;et<Te.callbacks.length;et++){var ht=Te.callbacks[et];ht()}if(Pe){var it=Pe;Pe=!1,it.callback&&it.callback(K)}X("biometricManagerUpdated")}function ot(Ve,ft){var et=ft.status=="authorized",ht=ft.token||"";if(Ue){var it=Ue;Ue=!1,it.callback&&it.callback(et,et?ht:null)}X("biometricAuthRequested",et?{isAuthenticated:!0,biometricToken:ht}:{isAuthenticated:!1})}function yt(Ve,ft){var et=!1;if(F&&re&&(ft.status=="updated"?(ue=!0,et=!0):ft.status=="removed"&&(ue=!1,et=!0)),Ne){var ht=Ne;Ne=!1,ht.callback&&ht.callback(et)}X("biometricTokenUpdated",{isUpdated:et})}function vt(){return!!je("7.2")}function _t(){if(!fe)throw Error("WebAppBiometricManagerNotInited");return!0}return xe.init=function(Ve){return!vt()||fe||(Ve&&Te.callbacks.push(Ve),f.postEvent("web_app_biometry_get_info",!1)),xe},xe.requestAccess=function(Ve,ft){if(!vt())return xe;if(_t(),!F)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(Pe)throw Error("WebAppBiometricManagerAccessRequested");var et={};if(typeof Ve.reason<"u"){var ht=V(Ve.reason);if(ht.length>128)throw Error("WebAppBiometricRequestAccessParamInvalid");ht.length>0&&(et.reason=ht)}return Pe={callback:ft},f.postEvent("web_app_biometry_request_access",!1,et),xe},xe.authenticate=function(Ve,ft){if(!vt())return xe;if(_t(),!F)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!K)throw Error("WebAppBiometricManagerBiometricAccessNotGranted");if(Ue)throw Error("WebAppBiometricManagerAuthenticationRequested");var et={};if(typeof Ve.reason<"u"){var ht=V(Ve.reason);if(ht.length>128)throw Error("WebAppBiometricRequestAccessParamInvalid");ht.length>0&&(et.reason=ht)}return Ue={callback:ft},f.postEvent("web_app_biometry_request_auth",!1,et),xe},xe.updateBiometricToken=function(Ve,ft){if(!vt())return xe;if(Ve=Ve||"",Ve.length>1024)throw Error("WebAppBiometricManagerTokenInvalid");if(_t(),!F)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!K)throw Error("WebAppBiometricManagerBiometricAccessNotGranted");if(Ne)throw Error("WebAppBiometricManagerTokenUpdateRequested");return Ne={callback:ft},f.postEvent("web_app_biometry_update_token",!1,{token:Ve}),xe},xe.openSettings=function(){if(!vt())return xe;if(_t(),!F)throw Error("WebAppBiometricManagerBiometricsNotAvailable");if(!re)throw Error("WebAppBiometricManagerBiometricsAccessNotRequested");return K||f.postEvent("web_app_biometry_open_settings",!1),xe},xe})(),Xe={};function He(fe,F){if(F.slug&&Xe[F.slug]){var G=Xe[F.slug];delete Xe[F.slug],G.callback&&G.callback(F.status),X("invoiceClosed",{url:G.url,status:F.status})}}var Ze=!1;function xt(fe,F){if(Ze){var G=Ze;Ze=!1;var re=null;typeof F.button_id<"u"&&(re=F.button_id),G.callback&&G.callback(re),X("popupClosed",{button_id:re})}}var tt=!1;function mt(fe,F){if(tt){var G=tt,re=null;typeof F.data<"u"&&(re=F.data),G.callback&&G.callback(re)&&(tt=!1,f.postEvent("web_app_close_scan_qr_popup",!1)),X("qrTextReceived",{data:re})}}function Tt(fe,F){tt=!1,X("scanQrPopupClosed")}function St(fe,F){if(F.req_id&&we[F.req_id]){var G=we[F.req_id];delete we[F.req_id];var re=null;typeof F.data<"u"&&(re=F.data),G.callback&&G.callback(re),X("clipboardTextReceived",{data:re})}}var lt=!1;function Mt(fe,F){if(lt){var G=lt;lt=!1,G.callback&&G.callback(F.status=="allowed"),X("writeAccessRequested",{status:F.status})}}function Ct(fe,F){var G,re,K=0,ue=function(){ve("getRequestedContact",{},function(xe,Te){Te&&Te.length?(clearTimeout(re),fe(Te)):(K+=50,G=setTimeout(ue,K))})},Ae=function(){clearTimeout(G),fe("")};re=setTimeout(Ae,F),ue()}var ce=!1;function Y(fe,F){if(ce){var G=ce;ce=!1;var re=F.status=="sent",K={status:F.status};re?Ct(function(ue){if(ue&&ue.length){K.response=ue,K.responseUnsafe=r.urlParseQueryString(ue);for(var Ae in K.responseUnsafe){var xe=K.responseUnsafe[Ae];try{(xe.substr(0,1)=="{"&&xe.substr(-1)=="}"||xe.substr(0,1)=="["&&xe.substr(-1)=="]")&&(K.responseUnsafe[Ae]=JSON.parse(xe))}catch{}}}G.callback&&G.callback(re,K),X("contactRequested",K)},3e3):(G.callback&&G.callback(re,K),X("contactRequested",K))}}function Q(fe,F){if(F.req_id&&we[F.req_id]){var G=we[F.req_id];delete we[F.req_id];var re=null,K=null;typeof F.result<"u"&&(re=F.result),typeof F.error<"u"&&(K=F.error),G.callback&&G.callback(K,re)}}function ve(fe,F,G){if(!je("6.9"))throw Error("WebAppMethodUnsupported");var re=te(16),K={req_id:re,method:fe,params:F||{}};we[re]={callback:G},f.postEvent("web_app_invoke_custom_method",!1,K)}window.Telegram||(window.Telegram={}),Object.defineProperty(v,"initData",{get:function(){return g},enumerable:!0}),Object.defineProperty(v,"initDataUnsafe",{get:function(){return w},enumerable:!0}),Object.defineProperty(v,"version",{get:function(){return _},enumerable:!0}),Object.defineProperty(v,"platform",{get:function(){return b},enumerable:!0}),Object.defineProperty(v,"colorScheme",{get:function(){return S},enumerable:!0}),Object.defineProperty(v,"themeParams",{get:function(){return x},enumerable:!0}),Object.defineProperty(v,"isExpanded",{get:function(){return y},enumerable:!0}),Object.defineProperty(v,"viewportHeight",{get:function(){return(k===!1?window.innerHeight:k)-ut},enumerable:!0}),Object.defineProperty(v,"viewportStableHeight",{get:function(){return(q===!1?window.innerHeight:q)-ut},enumerable:!0}),Object.defineProperty(v,"isClosingConfirmationEnabled",{set:function(fe){I(fe)},get:function(){return $},enumerable:!0}),Object.defineProperty(v,"isVerticalSwipesEnabled",{set:function(fe){j(fe)},get:function(){return U},enumerable:!0}),Object.defineProperty(v,"headerColor",{set:function(fe){z(fe)},get:function(){return R()},enumerable:!0}),Object.defineProperty(v,"backgroundColor",{set:function(fe){pe(fe)},get:function(){return ee()},enumerable:!0}),Object.defineProperty(v,"bottomBarColor",{set:function(fe){qe(fe)},get:function(){return Se()},enumerable:!0}),Object.defineProperty(v,"BackButton",{value:st,enumerable:!0}),Object.defineProperty(v,"MainButton",{value:Z,enumerable:!0}),Object.defineProperty(v,"SecondaryButton",{value:J,enumerable:!0}),Object.defineProperty(v,"SettingsButton",{value:ge,enumerable:!0}),Object.defineProperty(v,"HapticFeedback",{value:Ee,enumerable:!0}),Object.defineProperty(v,"CloudStorage",{value:Re,enumerable:!0}),Object.defineProperty(v,"BiometricManager",{value:ke,enumerable:!0}),v.setHeaderColor=function(fe){v.headerColor=fe},v.setBackgroundColor=function(fe){v.backgroundColor=fe},v.setBottomBarColor=function(fe){v.bottomBarColor=fe},v.enableClosingConfirmation=function(){v.isClosingConfirmationEnabled=!0},v.disableClosingConfirmation=function(){v.isClosingConfirmationEnabled=!1},v.enableVerticalSwipes=function(){v.isVerticalSwipesEnabled=!0},v.disableVerticalSwipes=function(){v.isVerticalSwipesEnabled=!1},v.isVersionAtLeast=function(fe){return je(fe)},v.onEvent=function(fe,F){oe(fe,F)},v.offEvent=function(fe,F){se(fe,F)},v.sendData=function(fe){if(!fe||!fe.length||Ye(fe)>4096)throw Error("WebAppDataInvalid");f.postEvent("web_app_data_send",!1,{data:fe})},v.switchInlineQuery=function(fe,F){if(!je("6.6"))throw Error("WebAppMethodUnsupported");if(!d.tgWebAppBotInline)throw Error("WebAppInlineModeDisabled");if(fe=fe||"",fe.length>256)throw Error("WebAppInlineQueryInvalid");var G=[];if(F){if(!Array.isArray(F))throw Error("WebAppInlineChooseChatTypesInvalid");for(var re={users:1,bots:1,groups:1,channels:1},K=0;K<F.length;K++){var ue=F[K];if(!re[ue])throw Error("WebAppInlineChooseChatTypeInvalid");re[ue]!=2&&(re[ue]=2,G.push(ue))}}f.postEvent("web_app_switch_inline_query",!1,{query:fe,chat_types:G})},v.openLink=function(re,F){var G=document.createElement("A");if(G.href=re,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppTgUrlInvalid");var re=G.href;if(F=F||{},je("6.1")){var K={url:re};je("6.4")&&F.try_instant_view&&(K.try_instant_view=!0),je("7.6")&&F.try_browser&&(K.try_browser=F.try_browser),f.postEvent("web_app_open_link",!1,K)}else window.open(re,"_blank")},v.openTelegramLink=function(fe){var F=document.createElement("A");if(F.href=fe,F.protocol!="http:"&&F.protocol!="https:"||F.hostname!="t.me")throw Error("WebAppTgUrlInvalid");var G=F.pathname+F.search;m||je("6.1")?f.postEvent("web_app_open_tg_link",!1,{path_full:G}):location.href="https://t.me"+G},v.openInvoice=function(fe,F){var G=document.createElement("A"),re,K;if(G.href=fe,G.protocol!="http:"&&G.protocol!="https:"||G.hostname!="t.me"||!(re=G.pathname.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/))||!(K=re[2]))throw Error("WebAppInvoiceUrlInvalid");if(!je("6.1"))throw Error("WebAppMethodUnsupported");if(Xe[K])throw Error("WebAppInvoiceOpened");Xe[K]={url:fe,callback:F},f.postEvent("web_app_open_invoice",!1,{slug:K})},v.showPopup=function(fe,F){if(!je("6.2"))throw Error("WebAppMethodUnsupported");if(Ze)throw Error("WebAppPopupOpened");var G="",re="",K=[],ue={};if(typeof fe.title<"u"){if(G=V(fe.title),G.length>64)throw Error("WebAppPopupParamInvalid");G.length>0&&(ue.title=G)}if(typeof fe.message<"u"&&(re=V(fe.message)),!re.length||re.length>256)throw Error("WebAppPopupParamInvalid");if(ue.message=re,typeof fe.buttons<"u"){if(!Array.isArray(fe.buttons))throw Error("WebAppPopupParamInvalid");for(var Ae=0;Ae<fe.buttons.length;Ae++){var xe=fe.buttons[Ae],Te={},Pe="";if(typeof xe.id<"u"&&(Pe=xe.id.toString(),Pe.length>64))throw Error("WebAppPopupParamInvalid");Te.id=Pe;var Ue=xe.type;if(typeof Ue>"u"&&(Ue="default"),Te.type=Ue,!(Ue=="ok"||Ue=="close"||Ue=="cancel"))if(Ue=="default"||Ue=="destructive"){var Ne="";if(typeof xe.text<"u"&&(Ne=V(xe.text)),!Ne.length||Ne.length>64)throw Error("WebAppPopupParamInvalid");Te.text=Ne}else throw Error("WebAppPopupParamInvalid");K.push(Te)}}else K.push({id:"",type:"close"});if(K.length<1||K.length>3)throw Error("WebAppPopupParamInvalid");ue.buttons=K,Ze={callback:F},f.postEvent("web_app_open_popup",!1,ue)},v.showAlert=function(fe,F){v.showPopup({message:fe},F?function(){F()}:null)},v.showConfirm=function(fe,F){v.showPopup({message:fe,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},F?function(G){F(G=="ok")}:null)},v.showScanQrPopup=function(fe,F){if(!je("6.4"))throw Error("WebAppMethodUnsupported");if(tt)throw Error("WebAppScanQrPopupOpened");var G="",re={};if(typeof fe.text<"u"){if(G=V(fe.text),G.length>64)throw Error("WebAppScanQrPopupParamInvalid");G.length>0&&(re.text=G)}tt={callback:F},f.postEvent("web_app_open_scan_qr_popup",!1,re)},v.closeScanQrPopup=function(){if(!je("6.4"))throw Error("WebAppMethodUnsupported");tt=!1,f.postEvent("web_app_close_scan_qr_popup",!1)},v.readTextFromClipboard=function(fe){if(!je("6.4"))throw Error("WebAppMethodUnsupported");var F=te(16),G={req_id:F};we[F]={callback:fe},f.postEvent("web_app_read_text_from_clipboard",!1,G)},v.requestWriteAccess=function(fe){if(!je("6.9"))throw Error("WebAppMethodUnsupported");if(lt)throw Error("WebAppWriteAccessRequested");lt={callback:fe},f.postEvent("web_app_request_write_access")},v.requestContact=function(fe){if(!je("6.9"))throw Error("WebAppMethodUnsupported");if(ce)throw Error("WebAppContactRequested");ce={callback:fe},f.postEvent("web_app_request_phone")},v.shareToStory=function(fe,F){if(F=F||{},!je("7.8"))throw Error("WebAppMethodUnsupported");var G=document.createElement("A");if(G.href=fe,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppMediaUrlInvalid");var re={};if(re.media_url=G.href,typeof F.text<"u"){var K=V(F.text);if(K.length>2048)throw Error("WebAppShareToStoryParamInvalid");K.length>0&&(re.text=K)}if(typeof F.widget_link<"u"){if(F.widget_link=F.widget_link||{},G.href=F.widget_link.url,G.protocol!="http:"&&G.protocol!="https:")throw Error("WebAppShareToStoryParamInvalid");var ue={url:G.href};if(typeof F.widget_link.name<"u"){var Ae=V(F.widget_link.name);if(Ae.length>48)throw Error("WebAppShareToStoryParamInvalid");Ae.length>0&&(ue.name=Ae)}re.widget_link=ue}f.postEvent("web_app_share_to_story",!1,re)},v.invokeCustomMethod=function(fe,F,G){ve(fe,F,G)},v.ready=function(){f.postEvent("web_app_ready")},v.expand=function(){f.postEvent("web_app_expand")},v.close=function(fe){fe=fe||{};var F={};je("7.6")&&fe.return_back&&(F.return_back=!0),f.postEvent("web_app_close",!1,F)},window.Telegram.WebApp=v,me(),ae(),Oe(),B(),d.tgWebAppShowSettings&&ge.show(),window.addEventListener("resize",N),m&&document.addEventListener("click",H),f.onEvent("theme_changed",T),f.onEvent("viewport_changed",O),f.onEvent("invoice_closed",He),f.onEvent("popup_closed",xt),f.onEvent("qr_text_received",mt),f.onEvent("scan_qr_popup_closed",Tt),f.onEvent("clipboard_text_received",St),f.onEvent("write_access_requested",Mt),f.onEvent("phone_requested",Y),f.onEvent("custom_method_invoked",Q),f.postEvent("web_app_request_theme"),f.postEvent("web_app_request_viewport")})()),telegramWebApps}var hasRequiredSdk;function requireSdk(){if(hasRequiredSdk)return sdk;hasRequiredSdk=1,Object.defineProperty(sdk,"__esModule",{value:!0}),sdk.WebApp=void 0,requireTelegramWebApps();var r=window;return sdk.WebApp=r.Telegram.WebApp,sdk}var hasRequiredDist$1;function requireDist$1(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1,Object.defineProperty(dist$1,"__esModule",{value:!0});var r=requireSdk();return dist$1.default=r.WebApp,dist$1}var distExports=requireDist$1();const WebApp=getDefaultExportFromCjs(distExports);function getLaunchParams(){const r=window.Telegram.WebApp;if(!r.initData){const f=sessionStorage.getItem("tg_init_data");return f||""}return r.initData}function isTelegramEnv(){try{if(typeof window>"u"||!window.Telegram||!window.Telegram.WebApp)return!1;const r=window.Telegram.WebApp;if(!r.initDataUnsafe||typeof r.initDataUnsafe!="object")return!1;const f=r.initDataUnsafe.user&&typeof r.initDataUnsafe.user=="object"&&typeof r.initDataUnsafe.user.id=="number"&&r.initDataUnsafe.user.id>0,d="initData"in r&&typeof r.initData=="string"&&r.initData.length>0;if(!f&&!d)return!1;const m=r.platform;return!(m!=null&&typeof m=="string"&&["fake","mock","test"].includes(m.toLowerCase())||Object.keys(r.initDataUnsafe||{}).length===0&&!d)}catch{return!1}}function getTelegramUserUnsafe(){try{if(!WebApp||!WebApp.initDataUnsafe)return null;const r=WebApp.initDataUnsafe;return!r.user||!r.user.id?null:{user:{id:r.user.id,firstName:r.user.first_name||"",lastName:r.user.last_name||"",username:r.user.username,photoUrl:r.user.photo_url||"",languageCode:r.user.language_code,isPremium:r.user.is_premium||!1,allowsWriteToPm:r.user.allows_write_to_pm||!1},authDate:new Date().toISOString(),hash:r.hash||"",startParam:r.start_param,chatType:r.chat_type,chatInstance:r.chat_instance}}catch{return null}}function readCookie(r){if(typeof document>"u")return null;const f=document.cookie.match(new RegExp("(?:^|; )"+r.replace(/([.$?*|{}()\[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return f?decodeURIComponent(f[1]):null}function writeCookie(r,f,d=365*2){if(typeof document>"u")return;const m=new Date;m.setTime(m.getTime()+d*24*60*60*1e3);const v="; expires="+m.toUTCString();document.cookie=`${encodeURIComponent(r)}=${encodeURIComponent(f)}${v}; path=/`}function generateNumericId(){const r=Math.floor(Math.random()*1e9),f=Date.now()%1e9;return Number(String(f).padStart(9,"0")+String(r).padStart(9,"0"))}function getAnonymousBrowserUser(r="tg_tracking_uid"){let f=readCookie(r);if(!f){const v=generateNumericId();f=String(v),writeCookie(r,f)}const d=Number(f.replace(/\D/g,"").slice(0,15))||generateNumericId(),m=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en";return{user:{id:d,firstName:"Guest",lastName:"",username:`guest_${f.slice(-6)}`,languageCode:m.toLowerCase(),isPremium:!1,allowsWriteToPm:!1},authDate:new Date().toISOString(),hash:"anonymous_cookie_user",startParam:"browser_guest",chatType:"sender",chatInstance:""}}function getDefaultMockUser(){return{user:{id:2077220643,firstName:"Mock",lastName:"User",username:"mock_user_demo",languageCode:"zh-hans",isPremium:!0,allowsWriteToPm:!0},authDate:new Date().toISOString(),hash:"mock_hash_for_demo_purpose",startParam:"demo_start_param",chatType:"sender",chatInstance:"-245769840322609948"}}var naclUtil$1={exports:{}},naclUtil=naclUtil$1.exports,hasRequiredNaclUtil;function requireNaclUtil(){return hasRequiredNaclUtil||(hasRequiredNaclUtil=1,(function(r){(function(f,d){r.exports?r.exports=d():(f.nacl||(f.nacl={}),f.nacl.util=d())})(naclUtil,function(){var f={};function d(m){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(m))throw new TypeError("invalid encoding")}return f.decodeUTF8=function(m){if(typeof m!="string")throw new TypeError("expected string");var v,g=unescape(encodeURIComponent(m)),w=new Uint8Array(g.length);for(v=0;v<g.length;v++)w[v]=g.charCodeAt(v);return w},f.encodeUTF8=function(m){var v,g=[];for(v=0;v<m.length;v++)g.push(String.fromCharCode(m[v]));return decodeURIComponent(escape(g.join("")))},typeof atob>"u"?typeof Buffer.from<"u"?(f.encodeBase64=function(m){return Buffer.from(m).toString("base64")},f.decodeBase64=function(m){return d(m),new Uint8Array(Array.prototype.slice.call(Buffer.from(m,"base64"),0))}):(f.encodeBase64=function(m){return new Buffer(m).toString("base64")},f.decodeBase64=function(m){return d(m),new Uint8Array(Array.prototype.slice.call(new Buffer(m,"base64"),0))}):(f.encodeBase64=function(m){var v,g=[],w=m.length;for(v=0;v<w;v++)g.push(String.fromCharCode(m[v]));return btoa(g.join(""))},f.decodeBase64=function(m){d(m);var v,g=atob(m),w=new Uint8Array(g.length);for(v=0;v<g.length;v++)w[v]=g.charCodeAt(v);return w}),f})})(naclUtil$1)),naclUtil$1.exports}var naclUtilExports=requireNaclUtil();const nacl=getDefaultExportFromCjs(naclUtilExports);function commonjsRequire(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var naclFast={exports:{}},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}},dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,(function(r){Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var f={},d={};d.byteLength=b,d.toByteArray=E,d.fromByteArray=T;for(var m=[],v=[],g=typeof Uint8Array<"u"?Uint8Array:Array,w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x=0,S=w.length;x<S;++x)m[x]=w[x],v[w.charCodeAt(x)]=x;v[45]=62,v[95]=63;function _(N){var H=N.length;if(H%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var V=N.indexOf("=");V===-1&&(V=H);var X=V===H?0:4-V%4;return[V,X]}function b(N){var H=_(N),V=H[0],X=H[1];return(V+X)*3/4-X}function C(N,H,V){return(H+V)*3/4-V}function E(N){var H,V=_(N),X=V[0],oe=V[1],se=new g(C(N,X,oe)),de=0,he=oe>0?X-4:X,we;for(we=0;we<he;we+=4)H=v[N.charCodeAt(we)]<<18|v[N.charCodeAt(we+1)]<<12|v[N.charCodeAt(we+2)]<<6|v[N.charCodeAt(we+3)],se[de++]=H>>16&255,se[de++]=H>>8&255,se[de++]=H&255;return oe===2&&(H=v[N.charCodeAt(we)]<<2|v[N.charCodeAt(we+1)]>>4,se[de++]=H&255),oe===1&&(H=v[N.charCodeAt(we)]<<10|v[N.charCodeAt(we+1)]<<4|v[N.charCodeAt(we+2)]>>2,se[de++]=H>>8&255,se[de++]=H&255),se}function M(N){return m[N>>18&63]+m[N>>12&63]+m[N>>6&63]+m[N&63]}function A(N,H,V){for(var X,oe=[],se=H;se<V;se+=3)X=(N[se]<<16&16711680)+(N[se+1]<<8&65280)+(N[se+2]&255),oe.push(M(X));return oe.join("")}function T(N){for(var H,V=N.length,X=V%3,oe=[],se=16383,de=0,he=V-X;de<he;de+=se)oe.push(A(N,de,de+se>he?he:de+se));return X===1?(H=N[V-1],oe.push(m[H>>2]+m[H<<4&63]+"==")):X===2&&(H=(N[V-2]<<8)+N[V-1],oe.push(m[H>>10]+m[H>>4&63]+m[H<<2&63]+"=")),oe.join("")}var L={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */L.read=function(N,H,V,X,oe){var se,de,he=oe*8-X-1,we=(1<<he)-1,te=we>>1,k=-7,q=V?oe-1:0,y=V?-1:1,B=N[H+q];for(q+=y,se=B&(1<<-k)-1,B>>=-k,k+=he;k>0;se=se*256+N[H+q],q+=y,k-=8);for(de=se&(1<<-k)-1,se>>=-k,k+=X;k>0;de=de*256+N[H+q],q+=y,k-=8);if(se===0)se=1-te;else{if(se===we)return de?NaN:(B?-1:1)*(1/0);de=de+Math.pow(2,X),se=se-te}return(B?-1:1)*de*Math.pow(2,se-X)},L.write=function(N,H,V,X,oe,se){var de,he,we,te=se*8-oe-1,k=(1<<te)-1,q=k>>1,y=oe===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=X?0:se-1,$=X?1:-1,I=H<0||H===0&&1/H<0?1:0;for(H=Math.abs(H),isNaN(H)||H===1/0?(he=isNaN(H)?1:0,de=k):(de=Math.floor(Math.log(H)/Math.LN2),H*(we=Math.pow(2,-de))<1&&(de--,we*=2),de+q>=1?H+=y/we:H+=y*Math.pow(2,1-q),H*we>=2&&(de++,we/=2),de+q>=k?(he=0,de=k):de+q>=1?(he=(H*we-1)*Math.pow(2,oe),de=de+q):(he=H*Math.pow(2,q-1)*Math.pow(2,oe),de=0));oe>=8;N[V+B]=he&255,B+=$,he/=256,oe-=8);for(de=de<<oe|he,te+=oe;te>0;N[V+B]=de&255,B+=$,de/=256,te-=8);N[V+B-$]|=I*128};/*!
12
12
  * The buffer module from node.js, for the browser.
13
13
  *
14
14
  * @author Feross Aboukhadijeh <https://feross.org>
15
15
  * @license MIT
16
- */(function(N){const H=d,V=L,X=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=k,N.SlowBuffer=z,N.INSPECT_MAX_BYTES=50;const oe=2147483647;N.kMaxLength=oe;const{Uint8Array:se,ArrayBuffer:de,SharedArrayBuffer:he}=globalThis;k.TYPED_ARRAY_SUPPORT=we(),!k.TYPED_ARRAY_SUPPORT&&typeof console<"u";function we(){try{const ce=new se(1),Y={foo:function(){return 42}};return Object.setPrototypeOf(Y,se.prototype),Object.setPrototypeOf(ce,Y),ce.foo()===42}catch{return!1}}Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}});function te(ce){if(ce>oe)throw new RangeError('The value "'+ce+'" is invalid for option "size"');const Y=new se(ce);return Object.setPrototypeOf(Y,k.prototype),Y}function k(ce,Y,Q){if(typeof ce=="number"){if(typeof Y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return $(ce)}return q(ce,Y,Q)}k.poolSize=8192;function q(ce,Y,Q){if(typeof ce=="string")return I(ce,Y);if(de.isView(ce))return j(ce);if(ce==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce);if(Tt(ce,de)||ce&&Tt(ce.buffer,de)||typeof he<"u"&&(Tt(ce,he)||ce&&Tt(ce.buffer,he)))return D(ce,Y,Q);if(typeof ce=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ve=ce.valueOf&&ce.valueOf();if(ve!=null&&ve!==ce)return k.from(ve,Y,Q);const fe=W(ce);if(fe)return fe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ce[Symbol.toPrimitive]=="function")return k.from(ce[Symbol.toPrimitive]("string"),Y,Q);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce)}k.from=function(ce,Y,Q){return q(ce,Y,Q)},Object.setPrototypeOf(k.prototype,se.prototype),Object.setPrototypeOf(k,se);function y(ce){if(typeof ce!="number")throw new TypeError('"size" argument must be of type number');if(ce<0)throw new RangeError('The value "'+ce+'" is invalid for option "size"')}function B(ce,Y,Q){return y(ce),ce<=0?te(ce):Y!==void 0?typeof Q=="string"?te(ce).fill(Y,Q):te(ce).fill(Y):te(ce)}k.alloc=function(ce,Y,Q){return B(ce,Y,Q)};function $(ce){return y(ce),te(ce<0?0:R(ce)|0)}k.allocUnsafe=function(ce){return $(ce)},k.allocUnsafeSlow=function(ce){return $(ce)};function I(ce,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!k.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);const Q=ye(ce,Y)|0;let ve=te(Q);const fe=ve.write(ce,Y);return fe!==Q&&(ve=ve.slice(0,fe)),ve}function F(ce){const Y=ce.length<0?0:R(ce.length)|0,Q=te(Y);for(let ve=0;ve<Y;ve+=1)Q[ve]=ce[ve]&255;return Q}function j(ce){if(Tt(ce,se)){const Y=new se(ce);return D(Y.buffer,Y.byteOffset,Y.byteLength)}return F(ce)}function D(ce,Y,Q){if(Y<0||ce.byteLength<Y)throw new RangeError('"offset" is outside of buffer bounds');if(ce.byteLength<Y+(Q||0))throw new RangeError('"length" is outside of buffer bounds');let ve;return Y===void 0&&Q===void 0?ve=new se(ce):Q===void 0?ve=new se(ce,Y):ve=new se(ce,Y,Q),Object.setPrototypeOf(ve,k.prototype),ve}function W(ce){if(k.isBuffer(ce)){const Y=R(ce.length)|0,Q=te(Y);return Q.length===0||ce.copy(Q,0,0,Y),Q}if(ce.length!==void 0)return typeof ce.length!="number"||St(ce.length)?te(0):F(ce);if(ce.type==="Buffer"&&Array.isArray(ce.data))return F(ce.data)}function R(ce){if(ce>=oe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe.toString(16)+" bytes");return ce|0}function z(ce){return+ce!=ce&&(ce=0),k.alloc(+ce)}k.isBuffer=function(Y){return Y!=null&&Y._isBuffer===!0&&Y!==k.prototype},k.compare=function(Y,Q){if(Tt(Y,se)&&(Y=k.from(Y,Y.offset,Y.byteLength)),Tt(Q,se)&&(Q=k.from(Q,Q.offset,Q.byteLength)),!k.isBuffer(Y)||!k.isBuffer(Q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Y===Q)return 0;let ve=Y.length,fe=Q.length;for(let U=0,G=Math.min(ve,fe);U<G;++U)if(Y[U]!==Q[U]){ve=Y[U],fe=Q[U];break}return ve<fe?-1:fe<ve?1:0},k.isEncoding=function(Y){switch(String(Y).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}},k.concat=function(Y,Q){if(!Array.isArray(Y))throw new TypeError('"list" argument must be an Array of Buffers');if(Y.length===0)return k.alloc(0);let ve;if(Q===void 0)for(Q=0,ve=0;ve<Y.length;++ve)Q+=Y[ve].length;const fe=k.allocUnsafe(Q);let U=0;for(ve=0;ve<Y.length;++ve){let G=Y[ve];if(Tt(G,se))U+G.length>fe.length?(k.isBuffer(G)||(G=k.from(G)),G.copy(fe,U)):se.prototype.set.call(fe,G,U);else if(k.isBuffer(G))G.copy(fe,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=G.length}return fe};function ye(ce,Y){if(k.isBuffer(ce))return ce.length;if(de.isView(ce)||Tt(ce,de))return ce.byteLength;if(typeof ce!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ce);const Q=ce.length,ve=arguments.length>2&&arguments[2]===!0;if(!ve&&Q===0)return 0;let fe=!1;for(;;)switch(Y){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return He(ce).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return tt(ce).length;default:if(fe)return ve?-1:He(ce).length;Y=(""+Y).toLowerCase(),fe=!0}}k.byteLength=ye;function Ce(ce,Y,Q){let ve=!1;if((Y===void 0||Y<0)&&(Y=0),Y>this.length||((Q===void 0||Q>this.length)&&(Q=this.length),Q<=0)||(Q>>>=0,Y>>>=0,Q<=Y))return"";for(ce||(ce="utf8");;)switch(ce){case"hex":return je(this,Y,Q);case"utf8":case"utf-8":return Ie(this,Y,Q);case"ascii":return De(this,Y,Q);case"latin1":case"binary":return $e(this,Y,Q);case"base64":return qe(this,Y,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,Y,Q);default:if(ve)throw new TypeError("Unknown encoding: "+ce);ce=(ce+"").toLowerCase(),ve=!0}}k.prototype._isBuffer=!0;function me(ce,Y,Q){const ve=ce[Y];ce[Y]=ce[Q],ce[Q]=ve}k.prototype.swap16=function(){const Y=this.length;if(Y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Q=0;Q<Y;Q+=2)me(this,Q,Q+1);return this},k.prototype.swap32=function(){const Y=this.length;if(Y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Q=0;Q<Y;Q+=4)me(this,Q,Q+3),me(this,Q+1,Q+2);return this},k.prototype.swap64=function(){const Y=this.length;if(Y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Q=0;Q<Y;Q+=8)me(this,Q,Q+7),me(this,Q+1,Q+6),me(this,Q+2,Q+5),me(this,Q+3,Q+4);return this},k.prototype.toString=function(){const Y=this.length;return Y===0?"":arguments.length===0?Ie(this,0,Y):Ce.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(Y){if(!k.isBuffer(Y))throw new TypeError("Argument must be a Buffer");return this===Y?!0:k.compare(this,Y)===0},k.prototype.inspect=function(){let Y="";const Q=N.INSPECT_MAX_BYTES;return Y=this.toString("hex",0,Q).replace(/(.{2})/g,"$1 ").trim(),this.length>Q&&(Y+=" ... "),"<Buffer "+Y+">"},X&&(k.prototype[X]=k.prototype.inspect),k.prototype.compare=function(Y,Q,ve,fe,U){if(Tt(Y,se)&&(Y=k.from(Y,Y.offset,Y.byteLength)),!k.isBuffer(Y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Y);if(Q===void 0&&(Q=0),ve===void 0&&(ve=Y?Y.length:0),fe===void 0&&(fe=0),U===void 0&&(U=this.length),Q<0||ve>Y.length||fe<0||U>this.length)throw new RangeError("out of range index");if(fe>=U&&Q>=ve)return 0;if(fe>=U)return-1;if(Q>=ve)return 1;if(Q>>>=0,ve>>>=0,fe>>>=0,U>>>=0,this===Y)return 0;let G=U-fe,re=ve-Q;const K=Math.min(G,re),ue=this.slice(fe,U),Ae=Y.slice(Q,ve);for(let xe=0;xe<K;++xe)if(ue[xe]!==Ae[xe]){G=ue[xe],re=Ae[xe];break}return G<re?-1:re<G?1:0};function ie(ce,Y,Q,ve,fe){if(ce.length===0)return-1;if(typeof Q=="string"?(ve=Q,Q=0):Q>2147483647?Q=2147483647:Q<-2147483648&&(Q=-2147483648),Q=+Q,St(Q)&&(Q=fe?0:ce.length-1),Q<0&&(Q=ce.length+Q),Q>=ce.length){if(fe)return-1;Q=ce.length-1}else if(Q<0)if(fe)Q=0;else return-1;if(typeof Y=="string"&&(Y=k.from(Y,ve)),k.isBuffer(Y))return Y.length===0?-1:ee(ce,Y,Q,ve,fe);if(typeof Y=="number")return Y=Y&255,typeof se.prototype.indexOf=="function"?fe?se.prototype.indexOf.call(ce,Y,Q):se.prototype.lastIndexOf.call(ce,Y,Q):ee(ce,[Y],Q,ve,fe);throw new TypeError("val must be string, number or Buffer")}function ee(ce,Y,Q,ve,fe){let U=1,G=ce.length,re=Y.length;if(ve!==void 0&&(ve=String(ve).toLowerCase(),ve==="ucs2"||ve==="ucs-2"||ve==="utf16le"||ve==="utf-16le")){if(ce.length<2||Y.length<2)return-1;U=2,G/=2,re/=2,Q/=2}function K(Ae,xe){return U===1?Ae[xe]:Ae.readUInt16BE(xe*U)}let ue;if(fe){let Ae=-1;for(ue=Q;ue<G;ue++)if(K(ce,ue)===K(Y,Ae===-1?0:ue-Ae)){if(Ae===-1&&(Ae=ue),ue-Ae+1===re)return Ae*U}else Ae!==-1&&(ue-=ue-Ae),Ae=-1}else for(Q+re>G&&(Q=G-re),ue=Q;ue>=0;ue--){let Ae=!0;for(let xe=0;xe<re;xe++)if(K(ce,ue+xe)!==K(Y,xe)){Ae=!1;break}if(Ae)return ue}return-1}k.prototype.includes=function(Y,Q,ve){return this.indexOf(Y,Q,ve)!==-1},k.prototype.indexOf=function(Y,Q,ve){return ie(this,Y,Q,ve,!0)},k.prototype.lastIndexOf=function(Y,Q,ve){return ie(this,Y,Q,ve,!1)};function pe(ce,Y,Q,ve){Q=Number(Q)||0;const fe=ce.length-Q;ve?(ve=Number(ve),ve>fe&&(ve=fe)):ve=fe;const U=Y.length;ve>U/2&&(ve=U/2);let G;for(G=0;G<ve;++G){const re=parseInt(Y.substr(G*2,2),16);if(St(re))return G;ce[Q+G]=re}return G}function be(ce,Y,Q,ve){return mt(He(Y,ce.length-Q),ce,Q,ve)}function ae(ce,Y,Q,ve){return mt(Ze(Y),ce,Q,ve)}function ne(ce,Y,Q,ve){return mt(tt(Y),ce,Q,ve)}function Se(ce,Y,Q,ve){return mt(xt(Y,ce.length-Q),ce,Q,ve)}k.prototype.write=function(Y,Q,ve,fe){if(Q===void 0)fe="utf8",ve=this.length,Q=0;else if(ve===void 0&&typeof Q=="string")fe=Q,ve=this.length,Q=0;else if(isFinite(Q))Q=Q>>>0,isFinite(ve)?(ve=ve>>>0,fe===void 0&&(fe="utf8")):(fe=ve,ve=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const U=this.length-Q;if((ve===void 0||ve>U)&&(ve=U),Y.length>0&&(ve<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");fe||(fe="utf8");let G=!1;for(;;)switch(fe){case"hex":return pe(this,Y,Q,ve);case"utf8":case"utf-8":return be(this,Y,Q,ve);case"ascii":case"latin1":case"binary":return ae(this,Y,Q,ve);case"base64":return ne(this,Y,Q,ve);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,Y,Q,ve);default:if(G)throw new TypeError("Unknown encoding: "+fe);fe=(""+fe).toLowerCase(),G=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qe(ce,Y,Q){return Y===0&&Q===ce.length?H.fromByteArray(ce):H.fromByteArray(ce.slice(Y,Q))}function Ie(ce,Y,Q){Q=Math.min(ce.length,Q);const ve=[];let fe=Y;for(;fe<Q;){const U=ce[fe];let G=null,re=U>239?4:U>223?3:U>191?2:1;if(fe+re<=Q){let K,ue,Ae,xe;switch(re){case 1:U<128&&(G=U);break;case 2:K=ce[fe+1],(K&192)===128&&(xe=(U&31)<<6|K&63,xe>127&&(G=xe));break;case 3:K=ce[fe+1],ue=ce[fe+2],(K&192)===128&&(ue&192)===128&&(xe=(U&15)<<12|(K&63)<<6|ue&63,xe>2047&&(xe<55296||xe>57343)&&(G=xe));break;case 4:K=ce[fe+1],ue=ce[fe+2],Ae=ce[fe+3],(K&192)===128&&(ue&192)===128&&(Ae&192)===128&&(xe=(U&15)<<18|(K&63)<<12|(ue&63)<<6|Ae&63,xe>65535&&xe<1114112&&(G=xe))}}G===null?(G=65533,re=1):G>65535&&(G-=65536,ve.push(G>>>10&1023|55296),G=56320|G&1023),ve.push(G),fe+=re}return Ue(ve)}const Oe=4096;function Ue(ce){const Y=ce.length;if(Y<=Oe)return String.fromCharCode.apply(String,ce);let Q="",ve=0;for(;ve<Y;)Q+=String.fromCharCode.apply(String,ce.slice(ve,ve+=Oe));return Q}function De(ce,Y,Q){let ve="";Q=Math.min(ce.length,Q);for(let fe=Y;fe<Q;++fe)ve+=String.fromCharCode(ce[fe]&127);return ve}function $e(ce,Y,Q){let ve="";Q=Math.min(ce.length,Q);for(let fe=Y;fe<Q;++fe)ve+=String.fromCharCode(ce[fe]);return ve}function je(ce,Y,Q){const ve=ce.length;(!Y||Y<0)&&(Y=0),(!Q||Q<0||Q>ve)&&(Q=ve);let fe="";for(let U=Y;U<Q;++U)fe+=lt[ce[U]];return fe}function Ye(ce,Y,Q){const ve=ce.slice(Y,Q);let fe="";for(let U=0;U<ve.length-1;U+=2)fe+=String.fromCharCode(ve[U]+ve[U+1]*256);return fe}k.prototype.slice=function(Y,Q){const ve=this.length;Y=~~Y,Q=Q===void 0?ve:~~Q,Y<0?(Y+=ve,Y<0&&(Y=0)):Y>ve&&(Y=ve),Q<0?(Q+=ve,Q<0&&(Q=0)):Q>ve&&(Q=ve),Q<Y&&(Q=Y);const fe=this.subarray(Y,Q);return Object.setPrototypeOf(fe,k.prototype),fe};function st(ce,Y,Q){if(ce%1!==0||ce<0)throw new RangeError("offset is not uint");if(ce+Y>Q)throw new RangeError("Trying to access beyond buffer length")}k.prototype.readUintLE=k.prototype.readUIntLE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y],U=1,G=0;for(;++G<Q&&(U*=256);)fe+=this[Y+G]*U;return fe},k.prototype.readUintBE=k.prototype.readUIntBE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y+--Q],U=1;for(;Q>0&&(U*=256);)fe+=this[Y+--Q]*U;return fe},k.prototype.readUint8=k.prototype.readUInt8=function(Y,Q){return Y=Y>>>0,Q||st(Y,1,this.length),this[Y]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,2,this.length),this[Y]|this[Y+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,2,this.length),this[Y]<<8|this[Y+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),(this[Y]|this[Y+1]<<8|this[Y+2]<<16)+this[Y+3]*16777216},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]*16777216+(this[Y+1]<<16|this[Y+2]<<8|this[Y+3])},k.prototype.readBigUInt64LE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=Q+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24,U=this[++Y]+this[++Y]*2**8+this[++Y]*2**16+ve*2**24;return BigInt(fe)+(BigInt(U)<<BigInt(32))}),k.prototype.readBigUInt64BE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=Q*2**24+this[++Y]*2**16+this[++Y]*2**8+this[++Y],U=this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ve;return(BigInt(fe)<<BigInt(32))+BigInt(U)}),k.prototype.readIntLE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y],U=1,G=0;for(;++G<Q&&(U*=256);)fe+=this[Y+G]*U;return U*=128,fe>=U&&(fe-=Math.pow(2,8*Q)),fe},k.prototype.readIntBE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=Q,U=1,G=this[Y+--fe];for(;fe>0&&(U*=256);)G+=this[Y+--fe]*U;return U*=128,G>=U&&(G-=Math.pow(2,8*Q)),G},k.prototype.readInt8=function(Y,Q){return Y=Y>>>0,Q||st(Y,1,this.length),this[Y]&128?(255-this[Y]+1)*-1:this[Y]},k.prototype.readInt16LE=function(Y,Q){Y=Y>>>0,Q||st(Y,2,this.length);const ve=this[Y]|this[Y+1]<<8;return ve&32768?ve|4294901760:ve},k.prototype.readInt16BE=function(Y,Q){Y=Y>>>0,Q||st(Y,2,this.length);const ve=this[Y+1]|this[Y]<<8;return ve&32768?ve|4294901760:ve},k.prototype.readInt32LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]|this[Y+1]<<8|this[Y+2]<<16|this[Y+3]<<24},k.prototype.readInt32BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]<<24|this[Y+1]<<16|this[Y+2]<<8|this[Y+3]},k.prototype.readBigInt64LE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=this[Y+4]+this[Y+5]*2**8+this[Y+6]*2**16+(ve<<24);return(BigInt(fe)<<BigInt(32))+BigInt(Q+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24)}),k.prototype.readBigInt64BE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=(Q<<24)+this[++Y]*2**16+this[++Y]*2**8+this[++Y];return(BigInt(fe)<<BigInt(32))+BigInt(this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ve)}),k.prototype.readFloatLE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),V.read(this,Y,!0,23,4)},k.prototype.readFloatBE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),V.read(this,Y,!1,23,4)},k.prototype.readDoubleLE=function(Y,Q){return Y=Y>>>0,Q||st(Y,8,this.length),V.read(this,Y,!0,52,8)},k.prototype.readDoubleBE=function(Y,Q){return Y=Y>>>0,Q||st(Y,8,this.length),V.read(this,Y,!1,52,8)};function Je(ce,Y,Q,ve,fe,U){if(!k.isBuffer(ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(Y>fe||Y<U)throw new RangeError('"value" argument is out of bounds');if(Q+ve>ce.length)throw new RangeError("Index out of range")}k.prototype.writeUintLE=k.prototype.writeUIntLE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,ve=ve>>>0,!fe){const re=Math.pow(2,8*ve)-1;Je(this,Y,Q,ve,re,0)}let U=1,G=0;for(this[Q]=Y&255;++G<ve&&(U*=256);)this[Q+G]=Y/U&255;return Q+ve},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,ve=ve>>>0,!fe){const re=Math.pow(2,8*ve)-1;Je(this,Y,Q,ve,re,0)}let U=ve-1,G=1;for(this[Q+U]=Y&255;--U>=0&&(G*=256);)this[Q+U]=Y/G&255;return Q+ve},k.prototype.writeUint8=k.prototype.writeUInt8=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,1,255,0),this[Q]=Y&255,Q+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,65535,0),this[Q]=Y&255,this[Q+1]=Y>>>8,Q+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,65535,0),this[Q]=Y>>>8,this[Q+1]=Y&255,Q+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,4294967295,0),this[Q+3]=Y>>>24,this[Q+2]=Y>>>16,this[Q+1]=Y>>>8,this[Q]=Y&255,Q+4},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,4294967295,0),this[Q]=Y>>>24,this[Q+1]=Y>>>16,this[Q+2]=Y>>>8,this[Q+3]=Y&255,Q+4};function Ge(ce,Y,Q,ve,fe){ge(Y,ve,fe,ce,Q,7);let U=Number(Y&BigInt(4294967295));ce[Q++]=U,U=U>>8,ce[Q++]=U,U=U>>8,ce[Q++]=U,U=U>>8,ce[Q++]=U;let G=Number(Y>>BigInt(32)&BigInt(4294967295));return ce[Q++]=G,G=G>>8,ce[Q++]=G,G=G>>8,ce[Q++]=G,G=G>>8,ce[Q++]=G,Q}function ut(ce,Y,Q,ve,fe){ge(Y,ve,fe,ce,Q,7);let U=Number(Y&BigInt(4294967295));ce[Q+7]=U,U=U>>8,ce[Q+6]=U,U=U>>8,ce[Q+5]=U,U=U>>8,ce[Q+4]=U;let G=Number(Y>>BigInt(32)&BigInt(4294967295));return ce[Q+3]=G,G=G>>8,ce[Q+2]=G,G=G>>8,ce[Q+1]=G,G=G>>8,ce[Q]=G,Q+8}k.prototype.writeBigUInt64LE=Mt(function(Y,Q=0){return Ge(this,Y,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=Mt(function(Y,Q=0){return ut(this,Y,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,!fe){const K=Math.pow(2,8*ve-1);Je(this,Y,Q,ve,K-1,-K)}let U=0,G=1,re=0;for(this[Q]=Y&255;++U<ve&&(G*=256);)Y<0&&re===0&&this[Q+U-1]!==0&&(re=1),this[Q+U]=(Y/G>>0)-re&255;return Q+ve},k.prototype.writeIntBE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,!fe){const K=Math.pow(2,8*ve-1);Je(this,Y,Q,ve,K-1,-K)}let U=ve-1,G=1,re=0;for(this[Q+U]=Y&255;--U>=0&&(G*=256);)Y<0&&re===0&&this[Q+U+1]!==0&&(re=1),this[Q+U]=(Y/G>>0)-re&255;return Q+ve},k.prototype.writeInt8=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,1,127,-128),Y<0&&(Y=255+Y+1),this[Q]=Y&255,Q+1},k.prototype.writeInt16LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,32767,-32768),this[Q]=Y&255,this[Q+1]=Y>>>8,Q+2},k.prototype.writeInt16BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,32767,-32768),this[Q]=Y>>>8,this[Q+1]=Y&255,Q+2},k.prototype.writeInt32LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,2147483647,-2147483648),this[Q]=Y&255,this[Q+1]=Y>>>8,this[Q+2]=Y>>>16,this[Q+3]=Y>>>24,Q+4},k.prototype.writeInt32BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,2147483647,-2147483648),Y<0&&(Y=4294967295+Y+1),this[Q]=Y>>>24,this[Q+1]=Y>>>16,this[Q+2]=Y>>>8,this[Q+3]=Y&255,Q+4},k.prototype.writeBigInt64LE=Mt(function(Y,Q=0){return Ge(this,Y,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=Mt(function(Y,Q=0){return ut(this,Y,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function gt(ce,Y,Q,ve,fe,U){if(Q+ve>ce.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("Index out of range")}function rt(ce,Y,Q,ve,fe){return Y=+Y,Q=Q>>>0,fe||gt(ce,Y,Q,4),V.write(ce,Y,Q,ve,23,4),Q+4}k.prototype.writeFloatLE=function(Y,Q,ve){return rt(this,Y,Q,!0,ve)},k.prototype.writeFloatBE=function(Y,Q,ve){return rt(this,Y,Q,!1,ve)};function wt(ce,Y,Q,ve,fe){return Y=+Y,Q=Q>>>0,fe||gt(ce,Y,Q,8),V.write(ce,Y,Q,ve,52,8),Q+8}k.prototype.writeDoubleLE=function(Y,Q,ve){return wt(this,Y,Q,!0,ve)},k.prototype.writeDoubleBE=function(Y,Q,ve){return wt(this,Y,Q,!1,ve)},k.prototype.copy=function(Y,Q,ve,fe){if(!k.isBuffer(Y))throw new TypeError("argument should be a Buffer");if(ve||(ve=0),!fe&&fe!==0&&(fe=this.length),Q>=Y.length&&(Q=Y.length),Q||(Q=0),fe>0&&fe<ve&&(fe=ve),fe===ve||Y.length===0||this.length===0)return 0;if(Q<0)throw new RangeError("targetStart out of bounds");if(ve<0||ve>=this.length)throw new RangeError("Index out of range");if(fe<0)throw new RangeError("sourceEnd out of bounds");fe>this.length&&(fe=this.length),Y.length-Q<fe-ve&&(fe=Y.length-Q+ve);const U=fe-ve;return this===Y&&typeof se.prototype.copyWithin=="function"?this.copyWithin(Q,ve,fe):se.prototype.set.call(Y,this.subarray(ve,fe),Q),U},k.prototype.fill=function(Y,Q,ve,fe){if(typeof Y=="string"){if(typeof Q=="string"?(fe=Q,Q=0,ve=this.length):typeof ve=="string"&&(fe=ve,ve=this.length),fe!==void 0&&typeof fe!="string")throw new TypeError("encoding must be a string");if(typeof fe=="string"&&!k.isEncoding(fe))throw new TypeError("Unknown encoding: "+fe);if(Y.length===1){const G=Y.charCodeAt(0);(fe==="utf8"&&G<128||fe==="latin1")&&(Y=G)}}else typeof Y=="number"?Y=Y&255:typeof Y=="boolean"&&(Y=Number(Y));if(Q<0||this.length<Q||this.length<ve)throw new RangeError("Out of range index");if(ve<=Q)return this;Q=Q>>>0,ve=ve===void 0?this.length:ve>>>0,Y||(Y=0);let U;if(typeof Y=="number")for(U=Q;U<ve;++U)this[U]=Y;else{const G=k.isBuffer(Y)?Y:k.from(Y,fe),re=G.length;if(re===0)throw new TypeError('The value "'+Y+'" is invalid for argument "value"');for(U=0;U<ve-Q;++U)this[U+Q]=G[U%re]}return this};const bt={};function le(ce,Y,Q){bt[ce]=class extends Q{constructor(){super(),Object.defineProperty(this,"message",{value:Y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ce}]`,this.stack,delete this.name}get code(){return ce}set code(fe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:fe,writable:!0})}toString(){return`${this.name} [${ce}]: ${this.message}`}}}le("ERR_BUFFER_OUT_OF_BOUNDS",function(ce){return ce?`${ce} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),le("ERR_INVALID_ARG_TYPE",function(ce,Y){return`The "${ce}" argument must be of type number. Received type ${typeof Y}`},TypeError),le("ERR_OUT_OF_RANGE",function(ce,Y,Q){let ve=`The value of "${ce}" is out of range.`,fe=Q;return Number.isInteger(Q)&&Math.abs(Q)>2**32?fe=Z(String(Q)):typeof Q=="bigint"&&(fe=String(Q),(Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))&&(fe=Z(fe)),fe+="n"),ve+=` It must be ${Y}. Received ${fe}`,ve},RangeError);function Z(ce){let Y="",Q=ce.length;const ve=ce[0]==="-"?1:0;for(;Q>=ve+4;Q-=3)Y=`_${ce.slice(Q-3,Q)}${Y}`;return`${ce.slice(0,Q)}${Y}`}function J(ce,Y,Q){Ee(Y,"offset"),(ce[Y]===void 0||ce[Y+Q]===void 0)&&Re(Y,ce.length-(Q+1))}function ge(ce,Y,Q,ve,fe,U){if(ce>Q||ce<Y){const G=typeof Y=="bigint"?"n":"";let re;throw Y===0||Y===BigInt(0)?re=`>= 0${G} and < 2${G} ** ${(U+1)*8}${G}`:re=`>= -(2${G} ** ${(U+1)*8-1}${G}) and < 2 ** ${(U+1)*8-1}${G}`,new bt.ERR_OUT_OF_RANGE("value",re,ce)}J(ve,fe,U)}function Ee(ce,Y){if(typeof ce!="number")throw new bt.ERR_INVALID_ARG_TYPE(Y,"number",ce)}function Re(ce,Y,Q){throw Math.floor(ce)!==ce?(Ee(ce,Q),new bt.ERR_OUT_OF_RANGE("offset","an integer",ce)):Y<0?new bt.ERR_BUFFER_OUT_OF_BOUNDS:new bt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Y}`,ce)}const ke=/[^+/0-9A-Za-z-_]/g;function Xe(ce){if(ce=ce.split("=")[0],ce=ce.trim().replace(ke,""),ce.length<2)return"";for(;ce.length%4!==0;)ce=ce+"=";return ce}function He(ce,Y){Y=Y||1/0;let Q;const ve=ce.length;let fe=null;const U=[];for(let G=0;G<ve;++G){if(Q=ce.charCodeAt(G),Q>55295&&Q<57344){if(!fe){if(Q>56319){(Y-=3)>-1&&U.push(239,191,189);continue}else if(G+1===ve){(Y-=3)>-1&&U.push(239,191,189);continue}fe=Q;continue}if(Q<56320){(Y-=3)>-1&&U.push(239,191,189),fe=Q;continue}Q=(fe-55296<<10|Q-56320)+65536}else fe&&(Y-=3)>-1&&U.push(239,191,189);if(fe=null,Q<128){if((Y-=1)<0)break;U.push(Q)}else if(Q<2048){if((Y-=2)<0)break;U.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((Y-=3)<0)break;U.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((Y-=4)<0)break;U.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw new Error("Invalid code point")}return U}function Ze(ce){const Y=[];for(let Q=0;Q<ce.length;++Q)Y.push(ce.charCodeAt(Q)&255);return Y}function xt(ce,Y){let Q,ve,fe;const U=[];for(let G=0;G<ce.length&&!((Y-=2)<0);++G)Q=ce.charCodeAt(G),ve=Q>>8,fe=Q%256,U.push(fe),U.push(ve);return U}function tt(ce){return H.toByteArray(Xe(ce))}function mt(ce,Y,Q,ve){let fe;for(fe=0;fe<ve&&!(fe+Q>=Y.length||fe>=ce.length);++fe)Y[fe+Q]=ce[fe];return fe}function Tt(ce,Y){return ce instanceof Y||ce!=null&&ce.constructor!=null&&ce.constructor.name!=null&&ce.constructor.name===Y.name}function St(ce){return ce!==ce}const lt=(function(){const ce="0123456789abcdef",Y=new Array(256);for(let Q=0;Q<16;++Q){const ve=Q*16;for(let fe=0;fe<16;++fe)Y[ve+fe]=ce[Q]+ce[fe]}return Y})();function Mt(ce){return typeof BigInt>"u"?Ct:ce}function Ct(){throw new Error("BigInt not supported")}})(f);const O=f.Buffer;r.Blob=f.Blob,r.BlobOptions=f.BlobOptions,r.Buffer=f.Buffer,r.File=f.File,r.FileOptions=f.FileOptions,r.INSPECT_MAX_BYTES=f.INSPECT_MAX_BYTES,r.SlowBuffer=f.SlowBuffer,r.TranscodeEncoding=f.TranscodeEncoding,r.atob=f.atob,r.btoa=f.btoa,r.constants=f.constants,r.default=O,r.isAscii=f.isAscii,r.isUtf8=f.isUtf8,r.kMaxLength=f.kMaxLength,r.kStringMaxLength=f.kStringMaxLength,r.resolveObjectURL=f.resolveObjectURL,r.transcode=f.transcode})(dist)),dist}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,(function(r,f){var d=requireDist(),m=d.Buffer;function v(w,x){for(var S in w)x[S]=w[S]}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?r.exports=d:(v(d,f),f.Buffer=g);function g(w,x,S){return m(w,x,S)}g.prototype=Object.create(m.prototype),v(m,g),g.from=function(w,x,S){if(typeof w=="number")throw new TypeError("Argument must not be a number");return m(w,x,S)},g.alloc=function(w,x,S){if(typeof w!="number")throw new TypeError("Argument must be a number");var _=m(w);return x!==void 0?typeof S=="string"?_.fill(x,S):_.fill(x):_.fill(0),_},g.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return m(w)},g.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(w)}})(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var r=65536,f=4294967295;function d(){throw new Error(`Secure random number generation is not supported by this browser.
17
- Use Chrome, Firefox or Internet Explorer 11`)}var m=requireSafeBuffer$1().Buffer,v=commonjsGlobal.crypto||commonjsGlobal.msCrypto;v&&v.getRandomValues?browser$b.exports=g:browser$b.exports=d;function g(w,x){if(w>f)throw new RangeError("requested too many random bytes");var S=m.allocUnsafe(w);if(w>0)if(w>r)for(var _=0;_<w;_+=r)v.getRandomValues(S.slice(_,_+r));else v.getRandomValues(S);return typeof x=="function"?process$1.nextTick(function(){x(null,S)}):S}return browser$b.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(f,d){d&&(f.super_=d,f.prototype=Object.create(d.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(f,d){if(d){f.super_=d;var m=function(){};m.prototype=d.prototype,f.prototype=new m,f.prototype.constructor=f}}),inherits_browser.exports}var readableBrowser$1={exports:{}},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var r=typeof Reflect=="object"?Reflect:null,f=r&&typeof r.apply=="function"?r.apply:function(X,oe,se){return Function.prototype.apply.call(X,oe,se)},d;r&&typeof r.ownKeys=="function"?d=r.ownKeys:Object.getOwnPropertySymbols?d=function(X){return Object.getOwnPropertyNames(X).concat(Object.getOwnPropertySymbols(X))}:d=function(X){return Object.getOwnPropertyNames(X)};function m(V){}var v=Number.isNaN||function(X){return X!==X};function g(){g.init.call(this)}events.exports=g,events.exports.once=O,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var w=10;function x(V){if(typeof V!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof V)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return w},set:function(V){if(typeof V!="number"||V<0||v(V))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+V+".");w=V}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(X){if(typeof X!="number"||X<0||v(X))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+X+".");return this._maxListeners=X,this};function S(V){return V._maxListeners===void 0?g.defaultMaxListeners:V._maxListeners}g.prototype.getMaxListeners=function(){return S(this)},g.prototype.emit=function(X){for(var oe=[],se=1;se<arguments.length;se++)oe.push(arguments[se]);var de=X==="error",he=this._events;if(he!==void 0)de=de&&he.error===void 0;else if(!de)return!1;if(de){var we;if(oe.length>0&&(we=oe[0]),we instanceof Error)throw we;var te=new Error("Unhandled error."+(we?" ("+we.message+")":""));throw te.context=we,te}var k=he[X];if(k===void 0)return!1;if(typeof k=="function")f(k,this,oe);else for(var q=k.length,y=A(k,q),se=0;se<q;++se)f(y[se],this,oe);return!0};function _(V,X,oe,se){var de,he,we;if(x(oe),he=V._events,he===void 0?(he=V._events=Object.create(null),V._eventsCount=0):(he.newListener!==void 0&&(V.emit("newListener",X,oe.listener?oe.listener:oe),he=V._events),we=he[X]),we===void 0)we=he[X]=oe,++V._eventsCount;else if(typeof we=="function"?we=he[X]=se?[oe,we]:[we,oe]:se?we.unshift(oe):we.push(oe),de=S(V),de>0&&we.length>de&&!we.warned){we.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(X)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=V,te.type=X,te.count=we.length}return V}g.prototype.addListener=function(X,oe){return _(this,X,oe,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(X,oe){return _(this,X,oe,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(V,X,oe){var se={fired:!1,wrapFn:void 0,target:V,type:X,listener:oe},de=b.bind(se);return de.listener=oe,se.wrapFn=de,de}g.prototype.once=function(X,oe){return x(oe),this.on(X,C(this,X,oe)),this},g.prototype.prependOnceListener=function(X,oe){return x(oe),this.prependListener(X,C(this,X,oe)),this},g.prototype.removeListener=function(X,oe){var se,de,he,we,te;if(x(oe),de=this._events,de===void 0)return this;if(se=de[X],se===void 0)return this;if(se===oe||se.listener===oe)--this._eventsCount===0?this._events=Object.create(null):(delete de[X],de.removeListener&&this.emit("removeListener",X,se.listener||oe));else if(typeof se!="function"){for(he=-1,we=se.length-1;we>=0;we--)if(se[we]===oe||se[we].listener===oe){te=se[we].listener,he=we;break}if(he<0)return this;he===0?se.shift():T(se,he),se.length===1&&(de[X]=se[0]),de.removeListener!==void 0&&this.emit("removeListener",X,te||oe)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(X){var oe,se,de;if(se=this._events,se===void 0)return this;if(se.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):se[X]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete se[X]),this;if(arguments.length===0){var he=Object.keys(se),we;for(de=0;de<he.length;++de)we=he[de],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(oe=se[X],typeof oe=="function")this.removeListener(X,oe);else if(oe!==void 0)for(de=oe.length-1;de>=0;de--)this.removeListener(X,oe[de]);return this};function E(V,X,oe){var se=V._events;if(se===void 0)return[];var de=se[X];return de===void 0?[]:typeof de=="function"?oe?[de.listener||de]:[de]:oe?L(de):A(de,de.length)}g.prototype.listeners=function(X){return E(this,X,!0)},g.prototype.rawListeners=function(X){return E(this,X,!1)},g.listenerCount=function(V,X){return typeof V.listenerCount=="function"?V.listenerCount(X):M.call(V,X)},g.prototype.listenerCount=M;function M(V){var X=this._events;if(X!==void 0){var oe=X[V];if(typeof oe=="function")return 1;if(oe!==void 0)return oe.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function A(V,X){for(var oe=new Array(X),se=0;se<X;++se)oe[se]=V[se];return oe}function T(V,X){for(;X+1<V.length;X++)V[X]=V[X+1];V.pop()}function L(V){for(var X=new Array(V.length),oe=0;oe<X.length;++oe)X[oe]=V[oe].listener||V[oe];return X}function O(V,X){return new Promise(function(oe,se){function de(we){V.removeListener(X,he),se(we)}function he(){typeof V.removeListener=="function"&&V.removeListener("error",de),oe([].slice.call(arguments))}H(V,X,he,{once:!0}),X!=="error"&&N(V,de,{once:!0})})}function N(V,X,oe){typeof V.on=="function"&&H(V,"error",X,oe)}function H(V,X,oe,se){if(typeof V.on=="function")se.once?V.once(X,oe):V.on(X,oe);else if(typeof V.addEventListener=="function")V.addEventListener(X,function de(he){se.once&&V.removeEventListener(X,de),oe(he)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof V)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var util$1={},types={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var f={},d=Symbol("test"),m=Object(d);if(typeof d=="string"||Object.prototype.toString.call(d)!=="[object Symbol]"||Object.prototype.toString.call(m)!=="[object Symbol]")return!1;var v=42;f[d]=v;for(var g in f)return!1;if(typeof Object.keys=="function"&&Object.keys(f).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(f).length!==0)return!1;var w=Object.getOwnPropertySymbols(f);if(w.length!==1||w[0]!==d||!Object.prototype.propertyIsEnumerable.call(f,d))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var x=Object.getOwnPropertyDescriptor(f,d);if(x.value!==v||x.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var r=requireShams$1();return shams=function(){return r()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max$1,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max$1=Math.max),max$1}var min$1,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min$1=Math.min),min$1}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round$1,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round$1=Math.round),round$1}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(f){return f!==f}),_isNaN}var sign$1,hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1;var r=require_isNaN();return sign$1=function(d){return r(d)||d===0?d:d<0?-1:1},sign$1}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var r=requireGOPD();if(r)try{r([],"length")}catch{r=null}return gopd=r,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return esDefineProperty=r,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var r=typeof Symbol<"u"&&Symbol,f=requireShams$1();return hasSymbols=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:f()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var r=requireEsObjectAtoms();return Object_getPrototypeOf=r.getPrototypeOf||null,Object_getPrototypeOf}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var r="Function.prototype.bind called on incompatible ",f=Object.prototype.toString,d=Math.max,m="[object Function]",v=function(S,_){for(var b=[],C=0;C<S.length;C+=1)b[C]=S[C];for(var E=0;E<_.length;E+=1)b[E+S.length]=_[E];return b},g=function(S,_){for(var b=[],C=_,E=0;C<S.length;C+=1,E+=1)b[E]=S[C];return b},w=function(x,S){for(var _="",b=0;b<x.length;b+=1)_+=x[b],b+1<x.length&&(_+=S);return _};return implementation=function(S){var _=this;if(typeof _!="function"||f.apply(_)!==m)throw new TypeError(r+_);for(var b=g(arguments,1),C,E=function(){if(this instanceof C){var O=_.apply(this,v(b,arguments));return Object(O)===O?O:this}return _.apply(S,v(b,arguments))},M=d(0,_.length-b.length),A=[],T=0;T<M;T++)A[T]="$"+T;if(C=Function("binder","return function ("+w(A,",")+"){ return binder.apply(this,arguments); }")(E),_.prototype){var L=function(){};L.prototype=_.prototype,C.prototype=new L,L.prototype=null}return C},implementation}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var r=requireImplementation();return functionBind=Function.prototype.bind||r,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var r=requireFunctionBind(),f=requireFunctionApply(),d=requireFunctionCall(),m=requireReflectApply();return actualApply=m||r.call(d,f),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var r=requireFunctionBind(),f=requireType(),d=requireFunctionCall(),m=requireActualApply();return callBindApplyHelpers=function(g){if(g.length<1||typeof g[0]!="function")throw new f("a function is required");return m(r,d,g)},callBindApplyHelpers}var get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var r=requireCallBindApplyHelpers(),f=requireGopd(),d;try{d=[].__proto__===Array.prototype}catch(w){if(!w||typeof w!="object"||!("code"in w)||w.code!=="ERR_PROTO_ACCESS")throw w}var m=!!d&&f&&f(Object.prototype,"__proto__"),v=Object,g=v.getPrototypeOf;return get=m&&typeof m.get=="function"?r([m.get]):typeof g=="function"?function(x){return g(x==null?x:v(x))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var r=requireReflect_getPrototypeOf(),f=requireObject_getPrototypeOf(),d=requireGet();return getProto=r?function(v){return r(v)}:f?function(v){if(!v||typeof v!="object"&&typeof v!="function")throw new TypeError("getProto: not an object");return f(v)}:d?function(v){return d(v)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var r=Function.prototype.call,f=Object.prototype.hasOwnProperty,d=requireFunctionBind();return hasown=d.call(r,f),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var r,f=requireEsObjectAtoms(),d=requireEsErrors(),m=require_eval(),v=requireRange(),g=requireRef(),w=requireSyntax(),x=requireType(),S=requireUri(),_=requireAbs(),b=requireFloor(),C=requireMax(),E=requireMin(),M=requirePow(),A=requireRound(),T=requireSign$1(),L=Function,O=function(pe){try{return L('"use strict"; return ('+pe+").constructor;")()}catch{}},N=requireGopd(),H=requireEsDefineProperty(),V=function(){throw new x},X=N?(function(){try{return arguments.callee,V}catch{try{return N(arguments,"callee").get}catch{return V}}})():V,oe=requireHasSymbols()(),se=requireGetProto(),de=requireObject_getPrototypeOf(),he=requireReflect_getPrototypeOf(),we=requireFunctionApply(),te=requireFunctionCall(),k={},q=typeof Uint8Array>"u"||!se?r:se(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":oe&&se?se([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d,"%eval%":eval,"%EvalError%":m,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":L,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":oe&&se?se(se([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!oe||!se?r:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":f,"%Object.getOwnPropertyDescriptor%":N,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":v,"%ReferenceError%":g,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!oe||!se?r:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":oe&&se?se(""[Symbol.iterator]()):r,"%Symbol%":oe?Symbol:r,"%SyntaxError%":w,"%ThrowTypeError%":X,"%TypedArray%":q,"%TypeError%":x,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":S,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":te,"%Function.prototype.apply%":we,"%Object.defineProperty%":H,"%Object.getPrototypeOf%":de,"%Math.abs%":_,"%Math.floor%":b,"%Math.max%":C,"%Math.min%":E,"%Math.pow%":M,"%Math.round%":A,"%Math.sign%":T,"%Reflect.getPrototypeOf%":he};if(se)try{null.error}catch(pe){var B=se(se(pe));y["%Error.prototype%"]=B}var $=function pe(be){var ae;if(be==="%AsyncFunction%")ae=O("async function () {}");else if(be==="%GeneratorFunction%")ae=O("function* () {}");else if(be==="%AsyncGeneratorFunction%")ae=O("async function* () {}");else if(be==="%AsyncGenerator%"){var ne=pe("%AsyncGeneratorFunction%");ne&&(ae=ne.prototype)}else if(be==="%AsyncIteratorPrototype%"){var Se=pe("%AsyncGenerator%");Se&&se&&(ae=se(Se.prototype))}return y[be]=ae,ae},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=requireFunctionBind(),j=requireHasown(),D=F.call(te,Array.prototype.concat),W=F.call(we,Array.prototype.splice),R=F.call(te,String.prototype.replace),z=F.call(te,String.prototype.slice),ye=F.call(te,RegExp.prototype.exec),Ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,me=/\\(\\)?/g,ie=function(be){var ae=z(be,0,1),ne=z(be,-1);if(ae==="%"&&ne!=="%")throw new w("invalid intrinsic syntax, expected closing `%`");if(ne==="%"&&ae!=="%")throw new w("invalid intrinsic syntax, expected opening `%`");var Se=[];return R(be,Ce,function(qe,Ie,Oe,Ue){Se[Se.length]=Oe?R(Ue,me,"$1"):Ie||qe}),Se},ee=function(be,ae){var ne=be,Se;if(j(I,ne)&&(Se=I[ne],ne="%"+Se[0]+"%"),j(y,ne)){var qe=y[ne];if(qe===k&&(qe=$(ne)),typeof qe>"u"&&!ae)throw new x("intrinsic "+be+" exists, but is not available. Please file an issue!");return{alias:Se,name:ne,value:qe}}throw new w("intrinsic "+be+" does not exist!")};return getIntrinsic=function(be,ae){if(typeof be!="string"||be.length===0)throw new x("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ae!="boolean")throw new x('"allowMissing" argument must be a boolean');if(ye(/^%?[^%]*%?$/,be)===null)throw new w("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ne=ie(be),Se=ne.length>0?ne[0]:"",qe=ee("%"+Se+"%",ae),Ie=qe.name,Oe=qe.value,Ue=!1,De=qe.alias;De&&(Se=De[0],W(ne,D([0,1],De)));for(var $e=1,je=!0;$e<ne.length;$e+=1){var Ye=ne[$e],st=z(Ye,0,1),Je=z(Ye,-1);if((st==='"'||st==="'"||st==="`"||Je==='"'||Je==="'"||Je==="`")&&st!==Je)throw new w("property names with quotes must have matching quotes");if((Ye==="constructor"||!je)&&(Ue=!0),Se+="."+Ye,Ie="%"+Se+"%",j(y,Ie))Oe=y[Ie];else if(Oe!=null){if(!(Ye in Oe)){if(!ae)throw new x("base intrinsic for "+be+" exists, but the property is not available.");return}if(N&&$e+1>=ne.length){var Ge=N(Oe,Ye);je=!!Ge,je&&"get"in Ge&&!("originalValue"in Ge.get)?Oe=Ge.get:Oe=Oe[Ye]}else je=j(Oe,Ye),Oe=Oe[Ye];je&&!Ue&&(y[Ie]=Oe)}}return Oe},getIntrinsic}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var r=requireGetIntrinsic(),f=requireCallBindApplyHelpers(),d=f([r("%String.prototype.indexOf%")]);return callBound=function(v,g){var w=r(v,!!g);return typeof w=="function"&&d(v,".prototype.")>-1?f([w]):w},callBound}var isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var r=requireShams()(),f=requireCallBound(),d=f("Object.prototype.toString"),m=function(x){return r&&x&&typeof x=="object"&&Symbol.toStringTag in x?!1:d(x)==="[object Arguments]"},v=function(x){return m(x)?!0:x!==null&&typeof x=="object"&&"length"in x&&typeof x.length=="number"&&x.length>=0&&d(x)!=="[object Array]"&&"callee"in x&&d(x.callee)==="[object Function]"},g=(function(){return m(arguments)})();return m.isLegacyArguments=v,isArguments=g?m:v,isArguments}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var r=requireCallBound(),f=requireShams()(),d=requireHasown(),m=requireGopd(),v;if(f){var g=r("RegExp.prototype.exec"),w={},x=function(){throw w},S={toString:x,valueOf:x};typeof Symbol.toPrimitive=="symbol"&&(S[Symbol.toPrimitive]=x),v=function(E){if(!E||typeof E!="object")return!1;var M=m(E,"lastIndex"),A=M&&d(M,"value");if(!A)return!1;try{g(E,S)}catch(T){return T===w}}}else{var _=r("Object.prototype.toString"),b="[object RegExp]";v=function(E){return!E||typeof E!="object"&&typeof E!="function"?!1:_(E)===b}}return isRegex=v,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var r=requireCallBound(),f=requireIsRegex(),d=r("RegExp.prototype.exec"),m=requireType();return safeRegexTest=function(g){if(!f(g))throw new m("`regex` must be a RegExp");return function(x){return d(g,x)!==null}},safeRegexTest}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var r=requireCallBound(),f=requireSafeRegexTest(),d=f(/^\s*(?:function)?\*/),m=requireShams()(),v=requireGetProto(),g=r("Object.prototype.toString"),w=r("Function.prototype.toString"),x=function(){if(!m)return!1;try{return Function("return function*() {}")()}catch{}},S;return isGeneratorFunction=function(b){if(typeof b!="function")return!1;if(d(w(b)))return!0;if(!m){var C=g(b);return C==="[object GeneratorFunction]"}if(!v)return!1;if(typeof S>"u"){var E=x();S=E?v(E):!1}return v(b)===S},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var r=Function.prototype.toString,f=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,d,m;if(typeof f=="function"&&typeof Object.defineProperty=="function")try{d=Object.defineProperty({},"length",{get:function(){throw m}}),m={},f(function(){throw 42},null,d)}catch(N){N!==m&&(f=null)}else f=null;var v=/^\s*class\b/,g=function(H){try{var V=r.call(H);return v.test(V)}catch{return!1}},w=function(H){try{return g(H)?!1:(r.call(H),!0)}catch{return!1}},x=Object.prototype.toString,S="[object Object]",_="[object Function]",b="[object GeneratorFunction]",C="[object HTMLAllCollection]",E="[object HTML document.all class]",M="[object HTMLCollection]",A=typeof Symbol=="function"&&!!Symbol.toStringTag,T=!(0 in[,]),L=function(){return!1};if(typeof document=="object"){var O=document.all;x.call(O)===x.call(document.all)&&(L=function(H){if((T||!H)&&(typeof H>"u"||typeof H=="object"))try{var V=x.call(H);return(V===C||V===E||V===M||V===S)&&H("")==null}catch{}return!1})}return isCallable=f?function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;try{f(H,null,d)}catch(V){if(V!==m)return!1}return!g(H)&&w(H)}:function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;if(A)return w(H);if(g(H))return!1;var V=x.call(H);return V!==_&&V!==b&&!/^\[object HTML/.test(V)?!1:w(H)},isCallable}var forEach,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var r=requireIsCallable(),f=Object.prototype.toString,d=Object.prototype.hasOwnProperty,m=function(S,_,b){for(var C=0,E=S.length;C<E;C++)d.call(S,C)&&(b==null?_(S[C],C,S):_.call(b,S[C],C,S))},v=function(S,_,b){for(var C=0,E=S.length;C<E;C++)b==null?_(S.charAt(C),C,S):_.call(b,S.charAt(C),C,S)},g=function(S,_,b){for(var C in S)d.call(S,C)&&(b==null?_(S[C],C,S):_.call(b,S[C],C,S))};function w(x){return f.call(x)==="[object Array]"}return forEach=function(S,_,b){if(!r(_))throw new TypeError("iterator must be a function");var C;arguments.length>=3&&(C=b),w(S)?m(S,_,C):typeof S=="string"?v(S,_,C):g(S,_,C)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var r=requirePossibleTypedArrayNames(),f=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var m=[],v=0;v<r.length;v++)typeof f[r[v]]=="function"&&(m[m.length]=r[v]);return m},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var r=requireEsDefineProperty(),f=requireSyntax(),d=requireType(),m=requireGopd();return defineDataProperty=function(g,w,x){if(!g||typeof g!="object"&&typeof g!="function")throw new d("`obj` must be an object or a function`");if(typeof w!="string"&&typeof w!="symbol")throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new d("`loose`, if provided, must be a boolean");var S=arguments.length>3?arguments[3]:null,_=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,C=arguments.length>6?arguments[6]:!1,E=!!m&&m(g,w);if(r)r(g,w,{configurable:b===null&&E?E.configurable:!b,enumerable:S===null&&E?E.enumerable:!S,value:x,writable:_===null&&E?E.writable:!_});else if(C||!S&&!_&&!b)g[w]=x;else throw new f("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var r=requireEsDefineProperty(),f=function(){return!!r};return f.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=f,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var r=requireGetIntrinsic(),f=requireDefineDataProperty(),d=requireHasPropertyDescriptors()(),m=requireGopd(),v=requireType(),g=r("%Math.floor%");return setFunctionLength=function(x,S){if(typeof x!="function")throw new v("`fn` is not a function");if(typeof S!="number"||S<0||S>4294967295||g(S)!==S)throw new v("`length` must be a positive 32-bit integer");var _=arguments.length>2&&!!arguments[2],b=!0,C=!0;if("length"in x&&m){var E=m(x,"length");E&&!E.configurable&&(b=!1),E&&!E.writable&&(C=!1)}return(b||C||!_)&&(d?f(x,"length",S,!0,!0):f(x,"length",S)),x},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var r=requireFunctionBind(),f=requireFunctionApply(),d=requireActualApply();return applyBind=function(){return d(r,f,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,(function(r){var f=requireSetFunctionLength(),d=requireEsDefineProperty(),m=requireCallBindApplyHelpers(),v=requireApplyBind();r.exports=function(w){var x=m(arguments),S=w.length-(arguments.length-1);return f(x,1+(S>0?S:0),!0)},d?d(r.exports,"apply",{value:v}):r.exports.apply=v})(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var r=requireForEach(),f=requireAvailableTypedArrays(),d=requireCallBind(),m=requireCallBound(),v=requireGopd(),g=requireGetProto(),w=m("Object.prototype.toString"),x=requireShams()(),S=typeof globalThis>"u"?commonjsGlobal:globalThis,_=f(),b=m("String.prototype.slice"),C=m("Array.prototype.indexOf",!0)||function(L,O){for(var N=0;N<L.length;N+=1)if(L[N]===O)return N;return-1},E={__proto__:null};x&&v&&g?r(_,function(T){var L=new S[T];if(Symbol.toStringTag in L&&g){var O=g(L),N=v(O,Symbol.toStringTag);if(!N&&O){var H=g(O);N=v(H,Symbol.toStringTag)}E["$"+T]=d(N.get)}}):r(_,function(T){var L=new S[T],O=L.slice||L.set;O&&(E["$"+T]=d(O))});var M=function(L){var O=!1;return r(E,function(N,H){if(!O)try{"$"+N(L)===H&&(O=b(H,1))}catch{}}),O},A=function(L){var O=!1;return r(E,function(N,H){if(!O)try{N(L),O=b(H,1)}catch{}}),O};return whichTypedArray=function(L){if(!L||typeof L!="object")return!1;if(!x){var O=b(w(L),8,-1);return C(_,O)>-1?O:O!=="Object"?!1:A(L)}return v?M(L):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var r=requireWhichTypedArray();return isTypedArray=function(d){return!!r(d)},isTypedArray}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,(function(r){var f=requireIsArguments(),d=requireIsGeneratorFunction(),m=requireWhichTypedArray(),v=requireIsTypedArray();function g($e){return $e.call.bind($e)}var w=typeof BigInt<"u",x=typeof Symbol<"u",S=g(Object.prototype.toString),_=g(Number.prototype.valueOf),b=g(String.prototype.valueOf),C=g(Boolean.prototype.valueOf);if(w)var E=g(BigInt.prototype.valueOf);if(x)var M=g(Symbol.prototype.valueOf);function A($e,je){if(typeof $e!="object")return!1;try{return je($e),!0}catch{return!1}}r.isArgumentsObject=f,r.isGeneratorFunction=d,r.isTypedArray=v;function T($e){return typeof Promise<"u"&&$e instanceof Promise||$e!==null&&typeof $e=="object"&&typeof $e.then=="function"&&typeof $e.catch=="function"}r.isPromise=T;function L($e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView($e):v($e)||z($e)}r.isArrayBufferView=L;function O($e){return m($e)==="Uint8Array"}r.isUint8Array=O;function N($e){return m($e)==="Uint8ClampedArray"}r.isUint8ClampedArray=N;function H($e){return m($e)==="Uint16Array"}r.isUint16Array=H;function V($e){return m($e)==="Uint32Array"}r.isUint32Array=V;function X($e){return m($e)==="Int8Array"}r.isInt8Array=X;function oe($e){return m($e)==="Int16Array"}r.isInt16Array=oe;function se($e){return m($e)==="Int32Array"}r.isInt32Array=se;function de($e){return m($e)==="Float32Array"}r.isFloat32Array=de;function he($e){return m($e)==="Float64Array"}r.isFloat64Array=he;function we($e){return m($e)==="BigInt64Array"}r.isBigInt64Array=we;function te($e){return m($e)==="BigUint64Array"}r.isBigUint64Array=te;function k($e){return S($e)==="[object Map]"}k.working=typeof Map<"u"&&k(new Map);function q($e){return typeof Map>"u"?!1:k.working?k($e):$e instanceof Map}r.isMap=q;function y($e){return S($e)==="[object Set]"}y.working=typeof Set<"u"&&y(new Set);function B($e){return typeof Set>"u"?!1:y.working?y($e):$e instanceof Set}r.isSet=B;function $($e){return S($e)==="[object WeakMap]"}$.working=typeof WeakMap<"u"&&$(new WeakMap);function I($e){return typeof WeakMap>"u"?!1:$.working?$($e):$e instanceof WeakMap}r.isWeakMap=I;function F($e){return S($e)==="[object WeakSet]"}F.working=typeof WeakSet<"u"&&F(new WeakSet);function j($e){return F($e)}r.isWeakSet=j;function D($e){return S($e)==="[object ArrayBuffer]"}D.working=typeof ArrayBuffer<"u"&&D(new ArrayBuffer);function W($e){return typeof ArrayBuffer>"u"?!1:D.working?D($e):$e instanceof ArrayBuffer}r.isArrayBuffer=W;function R($e){return S($e)==="[object DataView]"}R.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&R(new DataView(new ArrayBuffer(1),0,1));function z($e){return typeof DataView>"u"?!1:R.working?R($e):$e instanceof DataView}r.isDataView=z;var ye=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ce($e){return S($e)==="[object SharedArrayBuffer]"}function me($e){return typeof ye>"u"?!1:(typeof Ce.working>"u"&&(Ce.working=Ce(new ye)),Ce.working?Ce($e):$e instanceof ye)}r.isSharedArrayBuffer=me;function ie($e){return S($e)==="[object AsyncFunction]"}r.isAsyncFunction=ie;function ee($e){return S($e)==="[object Map Iterator]"}r.isMapIterator=ee;function pe($e){return S($e)==="[object Set Iterator]"}r.isSetIterator=pe;function be($e){return S($e)==="[object Generator]"}r.isGeneratorObject=be;function ae($e){return S($e)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=ae;function ne($e){return A($e,_)}r.isNumberObject=ne;function Se($e){return A($e,b)}r.isStringObject=Se;function qe($e){return A($e,C)}r.isBooleanObject=qe;function Ie($e){return w&&A($e,E)}r.isBigIntObject=Ie;function Oe($e){return x&&A($e,M)}r.isSymbolObject=Oe;function Ue($e){return ne($e)||Se($e)||qe($e)||Ie($e)||Oe($e)}r.isBoxedPrimitive=Ue;function De($e){return typeof Uint8Array<"u"&&(W($e)||me($e))}r.isAnyArrayBuffer=De,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function($e){Object.defineProperty(r,$e,{enumerable:!1,value:function(){throw new Error($e+" is not supported in userland")}})})})(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(f){return f&&typeof f=="object"&&typeof f.copy=="function"&&typeof f.fill=="function"&&typeof f.readUInt8=="function"}),isBufferBrowser}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,(function(r){var f=Object.getOwnPropertyDescriptors||function(z){for(var ye=Object.keys(z),Ce={},me=0;me<ye.length;me++)Ce[ye[me]]=Object.getOwnPropertyDescriptor(z,ye[me]);return Ce},d=/%[sdj%]/g;r.format=function(R){if(!X(R)){for(var z=[],ye=0;ye<arguments.length;ye++)z.push(w(arguments[ye]));return z.join(" ")}for(var ye=1,Ce=arguments,me=Ce.length,ie=String(R).replace(d,function(pe){if(pe==="%%")return"%";if(ye>=me)return pe;switch(pe){case"%s":return String(Ce[ye++]);case"%d":return Number(Ce[ye++]);case"%j":try{return JSON.stringify(Ce[ye++])}catch{return"[Circular]"}default:return pe}}),ee=Ce[ye];ye<me;ee=Ce[++ye])N(ee)||!he(ee)?ie+=" "+ee:ie+=" "+w(ee);return ie},r.deprecate=function(R,z){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return R;if(typeof process$1>"u")return function(){return r.deprecate(R,z).apply(this,arguments)};var ye=!1;function Ce(){if(!ye){if(process$1.throwDeprecation)throw new Error(z);process$1.traceDeprecation,ye=!0}return R.apply(this,arguments)}return Ce};var m={},v=/^$/;if(process$1.env.NODE_DEBUG){var g=process$1.env.NODE_DEBUG;g=g.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),v=new RegExp("^"+g+"$","i")}r.debuglog=function(R){if(R=R.toUpperCase(),!m[R])if(v.test(R)){var z=process$1.pid;m[R]=function(){var ye=r.format.apply(r,arguments)}}else m[R]=function(){};return m[R]};function w(R,z){var ye={seen:[],stylize:S};return arguments.length>=3&&(ye.depth=arguments[2]),arguments.length>=4&&(ye.colors=arguments[3]),O(z)?ye.showHidden=z:z&&r._extend(ye,z),se(ye.showHidden)&&(ye.showHidden=!1),se(ye.depth)&&(ye.depth=2),se(ye.colors)&&(ye.colors=!1),se(ye.customInspect)&&(ye.customInspect=!0),ye.colors&&(ye.stylize=x),b(ye,R,ye.depth)}r.inspect=w,w.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},w.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function x(R,z){var ye=w.styles[z];return ye?"\x1B["+w.colors[ye][0]+"m"+R+"\x1B["+w.colors[ye][1]+"m":R}function S(R,z){return R}function _(R){var z={};return R.forEach(function(ye,Ce){z[ye]=!0}),z}function b(R,z,ye){if(R.customInspect&&z&&k(z.inspect)&&z.inspect!==r.inspect&&!(z.constructor&&z.constructor.prototype===z)){var Ce=z.inspect(ye,R);return X(Ce)||(Ce=b(R,Ce,ye)),Ce}var me=C(R,z);if(me)return me;var ie=Object.keys(z),ee=_(ie);if(R.showHidden&&(ie=Object.getOwnPropertyNames(z)),te(z)&&(ie.indexOf("message")>=0||ie.indexOf("description")>=0))return E(z);if(ie.length===0){if(k(z)){var pe=z.name?": "+z.name:"";return R.stylize("[Function"+pe+"]","special")}if(de(z))return R.stylize(RegExp.prototype.toString.call(z),"regexp");if(we(z))return R.stylize(Date.prototype.toString.call(z),"date");if(te(z))return E(z)}var be="",ae=!1,ne=["{","}"];if(L(z)&&(ae=!0,ne=["[","]"]),k(z)){var Se=z.name?": "+z.name:"";be=" [Function"+Se+"]"}if(de(z)&&(be=" "+RegExp.prototype.toString.call(z)),we(z)&&(be=" "+Date.prototype.toUTCString.call(z)),te(z)&&(be=" "+E(z)),ie.length===0&&(!ae||z.length==0))return ne[0]+be+ne[1];if(ye<0)return de(z)?R.stylize(RegExp.prototype.toString.call(z),"regexp"):R.stylize("[Object]","special");R.seen.push(z);var qe;return ae?qe=M(R,z,ye,ee,ie):qe=ie.map(function(Ie){return A(R,z,ye,ee,Ie,ae)}),R.seen.pop(),T(qe,be,ne)}function C(R,z){if(se(z))return R.stylize("undefined","undefined");if(X(z)){var ye="'"+JSON.stringify(z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return R.stylize(ye,"string")}if(V(z))return R.stylize(""+z,"number");if(O(z))return R.stylize(""+z,"boolean");if(N(z))return R.stylize("null","null")}function E(R){return"["+Error.prototype.toString.call(R)+"]"}function M(R,z,ye,Ce,me){for(var ie=[],ee=0,pe=z.length;ee<pe;++ee)F(z,String(ee))?ie.push(A(R,z,ye,Ce,String(ee),!0)):ie.push("");return me.forEach(function(be){be.match(/^\d+$/)||ie.push(A(R,z,ye,Ce,be,!0))}),ie}function A(R,z,ye,Ce,me,ie){var ee,pe,be;if(be=Object.getOwnPropertyDescriptor(z,me)||{value:z[me]},be.get?be.set?pe=R.stylize("[Getter/Setter]","special"):pe=R.stylize("[Getter]","special"):be.set&&(pe=R.stylize("[Setter]","special")),F(Ce,me)||(ee="["+me+"]"),pe||(R.seen.indexOf(be.value)<0?(N(ye)?pe=b(R,be.value,null):pe=b(R,be.value,ye-1),pe.indexOf(`
16
+ */(function(N){const H=d,V=L,X=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=k,N.SlowBuffer=z,N.INSPECT_MAX_BYTES=50;const oe=2147483647;N.kMaxLength=oe;const{Uint8Array:se,ArrayBuffer:de,SharedArrayBuffer:he}=globalThis;k.TYPED_ARRAY_SUPPORT=we(),!k.TYPED_ARRAY_SUPPORT&&typeof console<"u";function we(){try{const ce=new se(1),Y={foo:function(){return 42}};return Object.setPrototypeOf(Y,se.prototype),Object.setPrototypeOf(ce,Y),ce.foo()===42}catch{return!1}}Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}});function te(ce){if(ce>oe)throw new RangeError('The value "'+ce+'" is invalid for option "size"');const Y=new se(ce);return Object.setPrototypeOf(Y,k.prototype),Y}function k(ce,Y,Q){if(typeof ce=="number"){if(typeof Y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return $(ce)}return q(ce,Y,Q)}k.poolSize=8192;function q(ce,Y,Q){if(typeof ce=="string")return I(ce,Y);if(de.isView(ce))return j(ce);if(ce==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce);if(Tt(ce,de)||ce&&Tt(ce.buffer,de)||typeof he<"u"&&(Tt(ce,he)||ce&&Tt(ce.buffer,he)))return D(ce,Y,Q);if(typeof ce=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ve=ce.valueOf&&ce.valueOf();if(ve!=null&&ve!==ce)return k.from(ve,Y,Q);const fe=W(ce);if(fe)return fe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ce[Symbol.toPrimitive]=="function")return k.from(ce[Symbol.toPrimitive]("string"),Y,Q);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ce)}k.from=function(ce,Y,Q){return q(ce,Y,Q)},Object.setPrototypeOf(k.prototype,se.prototype),Object.setPrototypeOf(k,se);function y(ce){if(typeof ce!="number")throw new TypeError('"size" argument must be of type number');if(ce<0)throw new RangeError('The value "'+ce+'" is invalid for option "size"')}function B(ce,Y,Q){return y(ce),ce<=0?te(ce):Y!==void 0?typeof Q=="string"?te(ce).fill(Y,Q):te(ce).fill(Y):te(ce)}k.alloc=function(ce,Y,Q){return B(ce,Y,Q)};function $(ce){return y(ce),te(ce<0?0:R(ce)|0)}k.allocUnsafe=function(ce){return $(ce)},k.allocUnsafeSlow=function(ce){return $(ce)};function I(ce,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!k.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);const Q=ye(ce,Y)|0;let ve=te(Q);const fe=ve.write(ce,Y);return fe!==Q&&(ve=ve.slice(0,fe)),ve}function U(ce){const Y=ce.length<0?0:R(ce.length)|0,Q=te(Y);for(let ve=0;ve<Y;ve+=1)Q[ve]=ce[ve]&255;return Q}function j(ce){if(Tt(ce,se)){const Y=new se(ce);return D(Y.buffer,Y.byteOffset,Y.byteLength)}return U(ce)}function D(ce,Y,Q){if(Y<0||ce.byteLength<Y)throw new RangeError('"offset" is outside of buffer bounds');if(ce.byteLength<Y+(Q||0))throw new RangeError('"length" is outside of buffer bounds');let ve;return Y===void 0&&Q===void 0?ve=new se(ce):Q===void 0?ve=new se(ce,Y):ve=new se(ce,Y,Q),Object.setPrototypeOf(ve,k.prototype),ve}function W(ce){if(k.isBuffer(ce)){const Y=R(ce.length)|0,Q=te(Y);return Q.length===0||ce.copy(Q,0,0,Y),Q}if(ce.length!==void 0)return typeof ce.length!="number"||St(ce.length)?te(0):U(ce);if(ce.type==="Buffer"&&Array.isArray(ce.data))return U(ce.data)}function R(ce){if(ce>=oe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe.toString(16)+" bytes");return ce|0}function z(ce){return+ce!=ce&&(ce=0),k.alloc(+ce)}k.isBuffer=function(Y){return Y!=null&&Y._isBuffer===!0&&Y!==k.prototype},k.compare=function(Y,Q){if(Tt(Y,se)&&(Y=k.from(Y,Y.offset,Y.byteLength)),Tt(Q,se)&&(Q=k.from(Q,Q.offset,Q.byteLength)),!k.isBuffer(Y)||!k.isBuffer(Q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Y===Q)return 0;let ve=Y.length,fe=Q.length;for(let F=0,G=Math.min(ve,fe);F<G;++F)if(Y[F]!==Q[F]){ve=Y[F],fe=Q[F];break}return ve<fe?-1:fe<ve?1:0},k.isEncoding=function(Y){switch(String(Y).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}},k.concat=function(Y,Q){if(!Array.isArray(Y))throw new TypeError('"list" argument must be an Array of Buffers');if(Y.length===0)return k.alloc(0);let ve;if(Q===void 0)for(Q=0,ve=0;ve<Y.length;++ve)Q+=Y[ve].length;const fe=k.allocUnsafe(Q);let F=0;for(ve=0;ve<Y.length;++ve){let G=Y[ve];if(Tt(G,se))F+G.length>fe.length?(k.isBuffer(G)||(G=k.from(G)),G.copy(fe,F)):se.prototype.set.call(fe,G,F);else if(k.isBuffer(G))G.copy(fe,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=G.length}return fe};function ye(ce,Y){if(k.isBuffer(ce))return ce.length;if(de.isView(ce)||Tt(ce,de))return ce.byteLength;if(typeof ce!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ce);const Q=ce.length,ve=arguments.length>2&&arguments[2]===!0;if(!ve&&Q===0)return 0;let fe=!1;for(;;)switch(Y){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return He(ce).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return tt(ce).length;default:if(fe)return ve?-1:He(ce).length;Y=(""+Y).toLowerCase(),fe=!0}}k.byteLength=ye;function Ce(ce,Y,Q){let ve=!1;if((Y===void 0||Y<0)&&(Y=0),Y>this.length||((Q===void 0||Q>this.length)&&(Q=this.length),Q<=0)||(Q>>>=0,Y>>>=0,Q<=Y))return"";for(ce||(ce="utf8");;)switch(ce){case"hex":return je(this,Y,Q);case"utf8":case"utf-8":return Ie(this,Y,Q);case"ascii":return De(this,Y,Q);case"latin1":case"binary":return $e(this,Y,Q);case"base64":return qe(this,Y,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ye(this,Y,Q);default:if(ve)throw new TypeError("Unknown encoding: "+ce);ce=(ce+"").toLowerCase(),ve=!0}}k.prototype._isBuffer=!0;function me(ce,Y,Q){const ve=ce[Y];ce[Y]=ce[Q],ce[Q]=ve}k.prototype.swap16=function(){const Y=this.length;if(Y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Q=0;Q<Y;Q+=2)me(this,Q,Q+1);return this},k.prototype.swap32=function(){const Y=this.length;if(Y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Q=0;Q<Y;Q+=4)me(this,Q,Q+3),me(this,Q+1,Q+2);return this},k.prototype.swap64=function(){const Y=this.length;if(Y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Q=0;Q<Y;Q+=8)me(this,Q,Q+7),me(this,Q+1,Q+6),me(this,Q+2,Q+5),me(this,Q+3,Q+4);return this},k.prototype.toString=function(){const Y=this.length;return Y===0?"":arguments.length===0?Ie(this,0,Y):Ce.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(Y){if(!k.isBuffer(Y))throw new TypeError("Argument must be a Buffer");return this===Y?!0:k.compare(this,Y)===0},k.prototype.inspect=function(){let Y="";const Q=N.INSPECT_MAX_BYTES;return Y=this.toString("hex",0,Q).replace(/(.{2})/g,"$1 ").trim(),this.length>Q&&(Y+=" ... "),"<Buffer "+Y+">"},X&&(k.prototype[X]=k.prototype.inspect),k.prototype.compare=function(Y,Q,ve,fe,F){if(Tt(Y,se)&&(Y=k.from(Y,Y.offset,Y.byteLength)),!k.isBuffer(Y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Y);if(Q===void 0&&(Q=0),ve===void 0&&(ve=Y?Y.length:0),fe===void 0&&(fe=0),F===void 0&&(F=this.length),Q<0||ve>Y.length||fe<0||F>this.length)throw new RangeError("out of range index");if(fe>=F&&Q>=ve)return 0;if(fe>=F)return-1;if(Q>=ve)return 1;if(Q>>>=0,ve>>>=0,fe>>>=0,F>>>=0,this===Y)return 0;let G=F-fe,re=ve-Q;const K=Math.min(G,re),ue=this.slice(fe,F),Ae=Y.slice(Q,ve);for(let xe=0;xe<K;++xe)if(ue[xe]!==Ae[xe]){G=ue[xe],re=Ae[xe];break}return G<re?-1:re<G?1:0};function ie(ce,Y,Q,ve,fe){if(ce.length===0)return-1;if(typeof Q=="string"?(ve=Q,Q=0):Q>2147483647?Q=2147483647:Q<-2147483648&&(Q=-2147483648),Q=+Q,St(Q)&&(Q=fe?0:ce.length-1),Q<0&&(Q=ce.length+Q),Q>=ce.length){if(fe)return-1;Q=ce.length-1}else if(Q<0)if(fe)Q=0;else return-1;if(typeof Y=="string"&&(Y=k.from(Y,ve)),k.isBuffer(Y))return Y.length===0?-1:ee(ce,Y,Q,ve,fe);if(typeof Y=="number")return Y=Y&255,typeof se.prototype.indexOf=="function"?fe?se.prototype.indexOf.call(ce,Y,Q):se.prototype.lastIndexOf.call(ce,Y,Q):ee(ce,[Y],Q,ve,fe);throw new TypeError("val must be string, number or Buffer")}function ee(ce,Y,Q,ve,fe){let F=1,G=ce.length,re=Y.length;if(ve!==void 0&&(ve=String(ve).toLowerCase(),ve==="ucs2"||ve==="ucs-2"||ve==="utf16le"||ve==="utf-16le")){if(ce.length<2||Y.length<2)return-1;F=2,G/=2,re/=2,Q/=2}function K(Ae,xe){return F===1?Ae[xe]:Ae.readUInt16BE(xe*F)}let ue;if(fe){let Ae=-1;for(ue=Q;ue<G;ue++)if(K(ce,ue)===K(Y,Ae===-1?0:ue-Ae)){if(Ae===-1&&(Ae=ue),ue-Ae+1===re)return Ae*F}else Ae!==-1&&(ue-=ue-Ae),Ae=-1}else for(Q+re>G&&(Q=G-re),ue=Q;ue>=0;ue--){let Ae=!0;for(let xe=0;xe<re;xe++)if(K(ce,ue+xe)!==K(Y,xe)){Ae=!1;break}if(Ae)return ue}return-1}k.prototype.includes=function(Y,Q,ve){return this.indexOf(Y,Q,ve)!==-1},k.prototype.indexOf=function(Y,Q,ve){return ie(this,Y,Q,ve,!0)},k.prototype.lastIndexOf=function(Y,Q,ve){return ie(this,Y,Q,ve,!1)};function pe(ce,Y,Q,ve){Q=Number(Q)||0;const fe=ce.length-Q;ve?(ve=Number(ve),ve>fe&&(ve=fe)):ve=fe;const F=Y.length;ve>F/2&&(ve=F/2);let G;for(G=0;G<ve;++G){const re=parseInt(Y.substr(G*2,2),16);if(St(re))return G;ce[Q+G]=re}return G}function be(ce,Y,Q,ve){return mt(He(Y,ce.length-Q),ce,Q,ve)}function ae(ce,Y,Q,ve){return mt(Ze(Y),ce,Q,ve)}function ne(ce,Y,Q,ve){return mt(tt(Y),ce,Q,ve)}function Se(ce,Y,Q,ve){return mt(xt(Y,ce.length-Q),ce,Q,ve)}k.prototype.write=function(Y,Q,ve,fe){if(Q===void 0)fe="utf8",ve=this.length,Q=0;else if(ve===void 0&&typeof Q=="string")fe=Q,ve=this.length,Q=0;else if(isFinite(Q))Q=Q>>>0,isFinite(ve)?(ve=ve>>>0,fe===void 0&&(fe="utf8")):(fe=ve,ve=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const F=this.length-Q;if((ve===void 0||ve>F)&&(ve=F),Y.length>0&&(ve<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");fe||(fe="utf8");let G=!1;for(;;)switch(fe){case"hex":return pe(this,Y,Q,ve);case"utf8":case"utf-8":return be(this,Y,Q,ve);case"ascii":case"latin1":case"binary":return ae(this,Y,Q,ve);case"base64":return ne(this,Y,Q,ve);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,Y,Q,ve);default:if(G)throw new TypeError("Unknown encoding: "+fe);fe=(""+fe).toLowerCase(),G=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qe(ce,Y,Q){return Y===0&&Q===ce.length?H.fromByteArray(ce):H.fromByteArray(ce.slice(Y,Q))}function Ie(ce,Y,Q){Q=Math.min(ce.length,Q);const ve=[];let fe=Y;for(;fe<Q;){const F=ce[fe];let G=null,re=F>239?4:F>223?3:F>191?2:1;if(fe+re<=Q){let K,ue,Ae,xe;switch(re){case 1:F<128&&(G=F);break;case 2:K=ce[fe+1],(K&192)===128&&(xe=(F&31)<<6|K&63,xe>127&&(G=xe));break;case 3:K=ce[fe+1],ue=ce[fe+2],(K&192)===128&&(ue&192)===128&&(xe=(F&15)<<12|(K&63)<<6|ue&63,xe>2047&&(xe<55296||xe>57343)&&(G=xe));break;case 4:K=ce[fe+1],ue=ce[fe+2],Ae=ce[fe+3],(K&192)===128&&(ue&192)===128&&(Ae&192)===128&&(xe=(F&15)<<18|(K&63)<<12|(ue&63)<<6|Ae&63,xe>65535&&xe<1114112&&(G=xe))}}G===null?(G=65533,re=1):G>65535&&(G-=65536,ve.push(G>>>10&1023|55296),G=56320|G&1023),ve.push(G),fe+=re}return Fe(ve)}const Oe=4096;function Fe(ce){const Y=ce.length;if(Y<=Oe)return String.fromCharCode.apply(String,ce);let Q="",ve=0;for(;ve<Y;)Q+=String.fromCharCode.apply(String,ce.slice(ve,ve+=Oe));return Q}function De(ce,Y,Q){let ve="";Q=Math.min(ce.length,Q);for(let fe=Y;fe<Q;++fe)ve+=String.fromCharCode(ce[fe]&127);return ve}function $e(ce,Y,Q){let ve="";Q=Math.min(ce.length,Q);for(let fe=Y;fe<Q;++fe)ve+=String.fromCharCode(ce[fe]);return ve}function je(ce,Y,Q){const ve=ce.length;(!Y||Y<0)&&(Y=0),(!Q||Q<0||Q>ve)&&(Q=ve);let fe="";for(let F=Y;F<Q;++F)fe+=lt[ce[F]];return fe}function Ye(ce,Y,Q){const ve=ce.slice(Y,Q);let fe="";for(let F=0;F<ve.length-1;F+=2)fe+=String.fromCharCode(ve[F]+ve[F+1]*256);return fe}k.prototype.slice=function(Y,Q){const ve=this.length;Y=~~Y,Q=Q===void 0?ve:~~Q,Y<0?(Y+=ve,Y<0&&(Y=0)):Y>ve&&(Y=ve),Q<0?(Q+=ve,Q<0&&(Q=0)):Q>ve&&(Q=ve),Q<Y&&(Q=Y);const fe=this.subarray(Y,Q);return Object.setPrototypeOf(fe,k.prototype),fe};function st(ce,Y,Q){if(ce%1!==0||ce<0)throw new RangeError("offset is not uint");if(ce+Y>Q)throw new RangeError("Trying to access beyond buffer length")}k.prototype.readUintLE=k.prototype.readUIntLE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y],F=1,G=0;for(;++G<Q&&(F*=256);)fe+=this[Y+G]*F;return fe},k.prototype.readUintBE=k.prototype.readUIntBE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y+--Q],F=1;for(;Q>0&&(F*=256);)fe+=this[Y+--Q]*F;return fe},k.prototype.readUint8=k.prototype.readUInt8=function(Y,Q){return Y=Y>>>0,Q||st(Y,1,this.length),this[Y]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,2,this.length),this[Y]|this[Y+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,2,this.length),this[Y]<<8|this[Y+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),(this[Y]|this[Y+1]<<8|this[Y+2]<<16)+this[Y+3]*16777216},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]*16777216+(this[Y+1]<<16|this[Y+2]<<8|this[Y+3])},k.prototype.readBigUInt64LE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=Q+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24,F=this[++Y]+this[++Y]*2**8+this[++Y]*2**16+ve*2**24;return BigInt(fe)+(BigInt(F)<<BigInt(32))}),k.prototype.readBigUInt64BE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=Q*2**24+this[++Y]*2**16+this[++Y]*2**8+this[++Y],F=this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ve;return(BigInt(fe)<<BigInt(32))+BigInt(F)}),k.prototype.readIntLE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=this[Y],F=1,G=0;for(;++G<Q&&(F*=256);)fe+=this[Y+G]*F;return F*=128,fe>=F&&(fe-=Math.pow(2,8*Q)),fe},k.prototype.readIntBE=function(Y,Q,ve){Y=Y>>>0,Q=Q>>>0,ve||st(Y,Q,this.length);let fe=Q,F=1,G=this[Y+--fe];for(;fe>0&&(F*=256);)G+=this[Y+--fe]*F;return F*=128,G>=F&&(G-=Math.pow(2,8*Q)),G},k.prototype.readInt8=function(Y,Q){return Y=Y>>>0,Q||st(Y,1,this.length),this[Y]&128?(255-this[Y]+1)*-1:this[Y]},k.prototype.readInt16LE=function(Y,Q){Y=Y>>>0,Q||st(Y,2,this.length);const ve=this[Y]|this[Y+1]<<8;return ve&32768?ve|4294901760:ve},k.prototype.readInt16BE=function(Y,Q){Y=Y>>>0,Q||st(Y,2,this.length);const ve=this[Y+1]|this[Y]<<8;return ve&32768?ve|4294901760:ve},k.prototype.readInt32LE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]|this[Y+1]<<8|this[Y+2]<<16|this[Y+3]<<24},k.prototype.readInt32BE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),this[Y]<<24|this[Y+1]<<16|this[Y+2]<<8|this[Y+3]},k.prototype.readBigInt64LE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=this[Y+4]+this[Y+5]*2**8+this[Y+6]*2**16+(ve<<24);return(BigInt(fe)<<BigInt(32))+BigInt(Q+this[++Y]*2**8+this[++Y]*2**16+this[++Y]*2**24)}),k.prototype.readBigInt64BE=Mt(function(Y){Y=Y>>>0,Ee(Y,"offset");const Q=this[Y],ve=this[Y+7];(Q===void 0||ve===void 0)&&Re(Y,this.length-8);const fe=(Q<<24)+this[++Y]*2**16+this[++Y]*2**8+this[++Y];return(BigInt(fe)<<BigInt(32))+BigInt(this[++Y]*2**24+this[++Y]*2**16+this[++Y]*2**8+ve)}),k.prototype.readFloatLE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),V.read(this,Y,!0,23,4)},k.prototype.readFloatBE=function(Y,Q){return Y=Y>>>0,Q||st(Y,4,this.length),V.read(this,Y,!1,23,4)},k.prototype.readDoubleLE=function(Y,Q){return Y=Y>>>0,Q||st(Y,8,this.length),V.read(this,Y,!0,52,8)},k.prototype.readDoubleBE=function(Y,Q){return Y=Y>>>0,Q||st(Y,8,this.length),V.read(this,Y,!1,52,8)};function Je(ce,Y,Q,ve,fe,F){if(!k.isBuffer(ce))throw new TypeError('"buffer" argument must be a Buffer instance');if(Y>fe||Y<F)throw new RangeError('"value" argument is out of bounds');if(Q+ve>ce.length)throw new RangeError("Index out of range")}k.prototype.writeUintLE=k.prototype.writeUIntLE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,ve=ve>>>0,!fe){const re=Math.pow(2,8*ve)-1;Je(this,Y,Q,ve,re,0)}let F=1,G=0;for(this[Q]=Y&255;++G<ve&&(F*=256);)this[Q+G]=Y/F&255;return Q+ve},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,ve=ve>>>0,!fe){const re=Math.pow(2,8*ve)-1;Je(this,Y,Q,ve,re,0)}let F=ve-1,G=1;for(this[Q+F]=Y&255;--F>=0&&(G*=256);)this[Q+F]=Y/G&255;return Q+ve},k.prototype.writeUint8=k.prototype.writeUInt8=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,1,255,0),this[Q]=Y&255,Q+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,65535,0),this[Q]=Y&255,this[Q+1]=Y>>>8,Q+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,65535,0),this[Q]=Y>>>8,this[Q+1]=Y&255,Q+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,4294967295,0),this[Q+3]=Y>>>24,this[Q+2]=Y>>>16,this[Q+1]=Y>>>8,this[Q]=Y&255,Q+4},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,4294967295,0),this[Q]=Y>>>24,this[Q+1]=Y>>>16,this[Q+2]=Y>>>8,this[Q+3]=Y&255,Q+4};function Ge(ce,Y,Q,ve,fe){ge(Y,ve,fe,ce,Q,7);let F=Number(Y&BigInt(4294967295));ce[Q++]=F,F=F>>8,ce[Q++]=F,F=F>>8,ce[Q++]=F,F=F>>8,ce[Q++]=F;let G=Number(Y>>BigInt(32)&BigInt(4294967295));return ce[Q++]=G,G=G>>8,ce[Q++]=G,G=G>>8,ce[Q++]=G,G=G>>8,ce[Q++]=G,Q}function ut(ce,Y,Q,ve,fe){ge(Y,ve,fe,ce,Q,7);let F=Number(Y&BigInt(4294967295));ce[Q+7]=F,F=F>>8,ce[Q+6]=F,F=F>>8,ce[Q+5]=F,F=F>>8,ce[Q+4]=F;let G=Number(Y>>BigInt(32)&BigInt(4294967295));return ce[Q+3]=G,G=G>>8,ce[Q+2]=G,G=G>>8,ce[Q+1]=G,G=G>>8,ce[Q]=G,Q+8}k.prototype.writeBigUInt64LE=Mt(function(Y,Q=0){return Ge(this,Y,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=Mt(function(Y,Q=0){return ut(this,Y,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,!fe){const K=Math.pow(2,8*ve-1);Je(this,Y,Q,ve,K-1,-K)}let F=0,G=1,re=0;for(this[Q]=Y&255;++F<ve&&(G*=256);)Y<0&&re===0&&this[Q+F-1]!==0&&(re=1),this[Q+F]=(Y/G>>0)-re&255;return Q+ve},k.prototype.writeIntBE=function(Y,Q,ve,fe){if(Y=+Y,Q=Q>>>0,!fe){const K=Math.pow(2,8*ve-1);Je(this,Y,Q,ve,K-1,-K)}let F=ve-1,G=1,re=0;for(this[Q+F]=Y&255;--F>=0&&(G*=256);)Y<0&&re===0&&this[Q+F+1]!==0&&(re=1),this[Q+F]=(Y/G>>0)-re&255;return Q+ve},k.prototype.writeInt8=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,1,127,-128),Y<0&&(Y=255+Y+1),this[Q]=Y&255,Q+1},k.prototype.writeInt16LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,32767,-32768),this[Q]=Y&255,this[Q+1]=Y>>>8,Q+2},k.prototype.writeInt16BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,2,32767,-32768),this[Q]=Y>>>8,this[Q+1]=Y&255,Q+2},k.prototype.writeInt32LE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,2147483647,-2147483648),this[Q]=Y&255,this[Q+1]=Y>>>8,this[Q+2]=Y>>>16,this[Q+3]=Y>>>24,Q+4},k.prototype.writeInt32BE=function(Y,Q,ve){return Y=+Y,Q=Q>>>0,ve||Je(this,Y,Q,4,2147483647,-2147483648),Y<0&&(Y=4294967295+Y+1),this[Q]=Y>>>24,this[Q+1]=Y>>>16,this[Q+2]=Y>>>8,this[Q+3]=Y&255,Q+4},k.prototype.writeBigInt64LE=Mt(function(Y,Q=0){return Ge(this,Y,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=Mt(function(Y,Q=0){return ut(this,Y,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function gt(ce,Y,Q,ve,fe,F){if(Q+ve>ce.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("Index out of range")}function rt(ce,Y,Q,ve,fe){return Y=+Y,Q=Q>>>0,fe||gt(ce,Y,Q,4),V.write(ce,Y,Q,ve,23,4),Q+4}k.prototype.writeFloatLE=function(Y,Q,ve){return rt(this,Y,Q,!0,ve)},k.prototype.writeFloatBE=function(Y,Q,ve){return rt(this,Y,Q,!1,ve)};function wt(ce,Y,Q,ve,fe){return Y=+Y,Q=Q>>>0,fe||gt(ce,Y,Q,8),V.write(ce,Y,Q,ve,52,8),Q+8}k.prototype.writeDoubleLE=function(Y,Q,ve){return wt(this,Y,Q,!0,ve)},k.prototype.writeDoubleBE=function(Y,Q,ve){return wt(this,Y,Q,!1,ve)},k.prototype.copy=function(Y,Q,ve,fe){if(!k.isBuffer(Y))throw new TypeError("argument should be a Buffer");if(ve||(ve=0),!fe&&fe!==0&&(fe=this.length),Q>=Y.length&&(Q=Y.length),Q||(Q=0),fe>0&&fe<ve&&(fe=ve),fe===ve||Y.length===0||this.length===0)return 0;if(Q<0)throw new RangeError("targetStart out of bounds");if(ve<0||ve>=this.length)throw new RangeError("Index out of range");if(fe<0)throw new RangeError("sourceEnd out of bounds");fe>this.length&&(fe=this.length),Y.length-Q<fe-ve&&(fe=Y.length-Q+ve);const F=fe-ve;return this===Y&&typeof se.prototype.copyWithin=="function"?this.copyWithin(Q,ve,fe):se.prototype.set.call(Y,this.subarray(ve,fe),Q),F},k.prototype.fill=function(Y,Q,ve,fe){if(typeof Y=="string"){if(typeof Q=="string"?(fe=Q,Q=0,ve=this.length):typeof ve=="string"&&(fe=ve,ve=this.length),fe!==void 0&&typeof fe!="string")throw new TypeError("encoding must be a string");if(typeof fe=="string"&&!k.isEncoding(fe))throw new TypeError("Unknown encoding: "+fe);if(Y.length===1){const G=Y.charCodeAt(0);(fe==="utf8"&&G<128||fe==="latin1")&&(Y=G)}}else typeof Y=="number"?Y=Y&255:typeof Y=="boolean"&&(Y=Number(Y));if(Q<0||this.length<Q||this.length<ve)throw new RangeError("Out of range index");if(ve<=Q)return this;Q=Q>>>0,ve=ve===void 0?this.length:ve>>>0,Y||(Y=0);let F;if(typeof Y=="number")for(F=Q;F<ve;++F)this[F]=Y;else{const G=k.isBuffer(Y)?Y:k.from(Y,fe),re=G.length;if(re===0)throw new TypeError('The value "'+Y+'" is invalid for argument "value"');for(F=0;F<ve-Q;++F)this[F+Q]=G[F%re]}return this};const bt={};function le(ce,Y,Q){bt[ce]=class extends Q{constructor(){super(),Object.defineProperty(this,"message",{value:Y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ce}]`,this.stack,delete this.name}get code(){return ce}set code(fe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:fe,writable:!0})}toString(){return`${this.name} [${ce}]: ${this.message}`}}}le("ERR_BUFFER_OUT_OF_BOUNDS",function(ce){return ce?`${ce} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),le("ERR_INVALID_ARG_TYPE",function(ce,Y){return`The "${ce}" argument must be of type number. Received type ${typeof Y}`},TypeError),le("ERR_OUT_OF_RANGE",function(ce,Y,Q){let ve=`The value of "${ce}" is out of range.`,fe=Q;return Number.isInteger(Q)&&Math.abs(Q)>2**32?fe=Z(String(Q)):typeof Q=="bigint"&&(fe=String(Q),(Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))&&(fe=Z(fe)),fe+="n"),ve+=` It must be ${Y}. Received ${fe}`,ve},RangeError);function Z(ce){let Y="",Q=ce.length;const ve=ce[0]==="-"?1:0;for(;Q>=ve+4;Q-=3)Y=`_${ce.slice(Q-3,Q)}${Y}`;return`${ce.slice(0,Q)}${Y}`}function J(ce,Y,Q){Ee(Y,"offset"),(ce[Y]===void 0||ce[Y+Q]===void 0)&&Re(Y,ce.length-(Q+1))}function ge(ce,Y,Q,ve,fe,F){if(ce>Q||ce<Y){const G=typeof Y=="bigint"?"n":"";let re;throw Y===0||Y===BigInt(0)?re=`>= 0${G} and < 2${G} ** ${(F+1)*8}${G}`:re=`>= -(2${G} ** ${(F+1)*8-1}${G}) and < 2 ** ${(F+1)*8-1}${G}`,new bt.ERR_OUT_OF_RANGE("value",re,ce)}J(ve,fe,F)}function Ee(ce,Y){if(typeof ce!="number")throw new bt.ERR_INVALID_ARG_TYPE(Y,"number",ce)}function Re(ce,Y,Q){throw Math.floor(ce)!==ce?(Ee(ce,Q),new bt.ERR_OUT_OF_RANGE("offset","an integer",ce)):Y<0?new bt.ERR_BUFFER_OUT_OF_BOUNDS:new bt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Y}`,ce)}const ke=/[^+/0-9A-Za-z-_]/g;function Xe(ce){if(ce=ce.split("=")[0],ce=ce.trim().replace(ke,""),ce.length<2)return"";for(;ce.length%4!==0;)ce=ce+"=";return ce}function He(ce,Y){Y=Y||1/0;let Q;const ve=ce.length;let fe=null;const F=[];for(let G=0;G<ve;++G){if(Q=ce.charCodeAt(G),Q>55295&&Q<57344){if(!fe){if(Q>56319){(Y-=3)>-1&&F.push(239,191,189);continue}else if(G+1===ve){(Y-=3)>-1&&F.push(239,191,189);continue}fe=Q;continue}if(Q<56320){(Y-=3)>-1&&F.push(239,191,189),fe=Q;continue}Q=(fe-55296<<10|Q-56320)+65536}else fe&&(Y-=3)>-1&&F.push(239,191,189);if(fe=null,Q<128){if((Y-=1)<0)break;F.push(Q)}else if(Q<2048){if((Y-=2)<0)break;F.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((Y-=3)<0)break;F.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((Y-=4)<0)break;F.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw new Error("Invalid code point")}return F}function Ze(ce){const Y=[];for(let Q=0;Q<ce.length;++Q)Y.push(ce.charCodeAt(Q)&255);return Y}function xt(ce,Y){let Q,ve,fe;const F=[];for(let G=0;G<ce.length&&!((Y-=2)<0);++G)Q=ce.charCodeAt(G),ve=Q>>8,fe=Q%256,F.push(fe),F.push(ve);return F}function tt(ce){return H.toByteArray(Xe(ce))}function mt(ce,Y,Q,ve){let fe;for(fe=0;fe<ve&&!(fe+Q>=Y.length||fe>=ce.length);++fe)Y[fe+Q]=ce[fe];return fe}function Tt(ce,Y){return ce instanceof Y||ce!=null&&ce.constructor!=null&&ce.constructor.name!=null&&ce.constructor.name===Y.name}function St(ce){return ce!==ce}const lt=(function(){const ce="0123456789abcdef",Y=new Array(256);for(let Q=0;Q<16;++Q){const ve=Q*16;for(let fe=0;fe<16;++fe)Y[ve+fe]=ce[Q]+ce[fe]}return Y})();function Mt(ce){return typeof BigInt>"u"?Ct:ce}function Ct(){throw new Error("BigInt not supported")}})(f);const O=f.Buffer;r.Blob=f.Blob,r.BlobOptions=f.BlobOptions,r.Buffer=f.Buffer,r.File=f.File,r.FileOptions=f.FileOptions,r.INSPECT_MAX_BYTES=f.INSPECT_MAX_BYTES,r.SlowBuffer=f.SlowBuffer,r.TranscodeEncoding=f.TranscodeEncoding,r.atob=f.atob,r.btoa=f.btoa,r.constants=f.constants,r.default=O,r.isAscii=f.isAscii,r.isUtf8=f.isUtf8,r.kMaxLength=f.kMaxLength,r.kStringMaxLength=f.kStringMaxLength,r.resolveObjectURL=f.resolveObjectURL,r.transcode=f.transcode})(dist)),dist}/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,(function(r,f){var d=requireDist(),m=d.Buffer;function v(w,x){for(var S in w)x[S]=w[S]}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?r.exports=d:(v(d,f),f.Buffer=g);function g(w,x,S){return m(w,x,S)}g.prototype=Object.create(m.prototype),v(m,g),g.from=function(w,x,S){if(typeof w=="number")throw new TypeError("Argument must not be a number");return m(w,x,S)},g.alloc=function(w,x,S){if(typeof w!="number")throw new TypeError("Argument must be a number");var _=m(w);return x!==void 0?typeof S=="string"?_.fill(x,S):_.fill(x):_.fill(0),_},g.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return m(w)},g.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(w)}})(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var r=65536,f=4294967295;function d(){throw new Error(`Secure random number generation is not supported by this browser.
17
+ Use Chrome, Firefox or Internet Explorer 11`)}var m=requireSafeBuffer$1().Buffer,v=commonjsGlobal.crypto||commonjsGlobal.msCrypto;v&&v.getRandomValues?browser$b.exports=g:browser$b.exports=d;function g(w,x){if(w>f)throw new RangeError("requested too many random bytes");var S=m.allocUnsafe(w);if(w>0)if(w>r)for(var _=0;_<w;_+=r)v.getRandomValues(S.slice(_,_+r));else v.getRandomValues(S);return typeof x=="function"?process$1.nextTick(function(){x(null,S)}):S}return browser$b.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(f,d){d&&(f.super_=d,f.prototype=Object.create(d.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(f,d){if(d){f.super_=d;var m=function(){};m.prototype=d.prototype,f.prototype=new m,f.prototype.constructor=f}}),inherits_browser.exports}var readableBrowser$1={exports:{}},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var r=typeof Reflect=="object"?Reflect:null,f=r&&typeof r.apply=="function"?r.apply:function(X,oe,se){return Function.prototype.apply.call(X,oe,se)},d;r&&typeof r.ownKeys=="function"?d=r.ownKeys:Object.getOwnPropertySymbols?d=function(X){return Object.getOwnPropertyNames(X).concat(Object.getOwnPropertySymbols(X))}:d=function(X){return Object.getOwnPropertyNames(X)};function m(V){}var v=Number.isNaN||function(X){return X!==X};function g(){g.init.call(this)}events.exports=g,events.exports.once=O,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var w=10;function x(V){if(typeof V!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof V)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return w},set:function(V){if(typeof V!="number"||V<0||v(V))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+V+".");w=V}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(X){if(typeof X!="number"||X<0||v(X))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+X+".");return this._maxListeners=X,this};function S(V){return V._maxListeners===void 0?g.defaultMaxListeners:V._maxListeners}g.prototype.getMaxListeners=function(){return S(this)},g.prototype.emit=function(X){for(var oe=[],se=1;se<arguments.length;se++)oe.push(arguments[se]);var de=X==="error",he=this._events;if(he!==void 0)de=de&&he.error===void 0;else if(!de)return!1;if(de){var we;if(oe.length>0&&(we=oe[0]),we instanceof Error)throw we;var te=new Error("Unhandled error."+(we?" ("+we.message+")":""));throw te.context=we,te}var k=he[X];if(k===void 0)return!1;if(typeof k=="function")f(k,this,oe);else for(var q=k.length,y=A(k,q),se=0;se<q;++se)f(y[se],this,oe);return!0};function _(V,X,oe,se){var de,he,we;if(x(oe),he=V._events,he===void 0?(he=V._events=Object.create(null),V._eventsCount=0):(he.newListener!==void 0&&(V.emit("newListener",X,oe.listener?oe.listener:oe),he=V._events),we=he[X]),we===void 0)we=he[X]=oe,++V._eventsCount;else if(typeof we=="function"?we=he[X]=se?[oe,we]:[we,oe]:se?we.unshift(oe):we.push(oe),de=S(V),de>0&&we.length>de&&!we.warned){we.warned=!0;var te=new Error("Possible EventEmitter memory leak detected. "+we.length+" "+String(X)+" listeners added. Use emitter.setMaxListeners() to increase limit");te.name="MaxListenersExceededWarning",te.emitter=V,te.type=X,te.count=we.length}return V}g.prototype.addListener=function(X,oe){return _(this,X,oe,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(X,oe){return _(this,X,oe,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(V,X,oe){var se={fired:!1,wrapFn:void 0,target:V,type:X,listener:oe},de=b.bind(se);return de.listener=oe,se.wrapFn=de,de}g.prototype.once=function(X,oe){return x(oe),this.on(X,C(this,X,oe)),this},g.prototype.prependOnceListener=function(X,oe){return x(oe),this.prependListener(X,C(this,X,oe)),this},g.prototype.removeListener=function(X,oe){var se,de,he,we,te;if(x(oe),de=this._events,de===void 0)return this;if(se=de[X],se===void 0)return this;if(se===oe||se.listener===oe)--this._eventsCount===0?this._events=Object.create(null):(delete de[X],de.removeListener&&this.emit("removeListener",X,se.listener||oe));else if(typeof se!="function"){for(he=-1,we=se.length-1;we>=0;we--)if(se[we]===oe||se[we].listener===oe){te=se[we].listener,he=we;break}if(he<0)return this;he===0?se.shift():T(se,he),se.length===1&&(de[X]=se[0]),de.removeListener!==void 0&&this.emit("removeListener",X,te||oe)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(X){var oe,se,de;if(se=this._events,se===void 0)return this;if(se.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):se[X]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete se[X]),this;if(arguments.length===0){var he=Object.keys(se),we;for(de=0;de<he.length;++de)we=he[de],we!=="removeListener"&&this.removeAllListeners(we);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(oe=se[X],typeof oe=="function")this.removeListener(X,oe);else if(oe!==void 0)for(de=oe.length-1;de>=0;de--)this.removeListener(X,oe[de]);return this};function E(V,X,oe){var se=V._events;if(se===void 0)return[];var de=se[X];return de===void 0?[]:typeof de=="function"?oe?[de.listener||de]:[de]:oe?L(de):A(de,de.length)}g.prototype.listeners=function(X){return E(this,X,!0)},g.prototype.rawListeners=function(X){return E(this,X,!1)},g.listenerCount=function(V,X){return typeof V.listenerCount=="function"?V.listenerCount(X):M.call(V,X)},g.prototype.listenerCount=M;function M(V){var X=this._events;if(X!==void 0){var oe=X[V];if(typeof oe=="function")return 1;if(oe!==void 0)return oe.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function A(V,X){for(var oe=new Array(X),se=0;se<X;++se)oe[se]=V[se];return oe}function T(V,X){for(;X+1<V.length;X++)V[X]=V[X+1];V.pop()}function L(V){for(var X=new Array(V.length),oe=0;oe<X.length;++oe)X[oe]=V[oe].listener||V[oe];return X}function O(V,X){return new Promise(function(oe,se){function de(we){V.removeListener(X,he),se(we)}function he(){typeof V.removeListener=="function"&&V.removeListener("error",de),oe([].slice.call(arguments))}H(V,X,he,{once:!0}),X!=="error"&&N(V,de,{once:!0})})}function N(V,X,oe){typeof V.on=="function"&&H(V,"error",X,oe)}function H(V,X,oe,se){if(typeof V.on=="function")se.once?V.once(X,oe):V.on(X,oe);else if(typeof V.addEventListener=="function")V.addEventListener(X,function de(he){se.once&&V.removeEventListener(X,de),oe(he)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof V)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var util$1={},types={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var f={},d=Symbol("test"),m=Object(d);if(typeof d=="string"||Object.prototype.toString.call(d)!=="[object Symbol]"||Object.prototype.toString.call(m)!=="[object Symbol]")return!1;var v=42;f[d]=v;for(var g in f)return!1;if(typeof Object.keys=="function"&&Object.keys(f).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(f).length!==0)return!1;var w=Object.getOwnPropertySymbols(f);if(w.length!==1||w[0]!==d||!Object.prototype.propertyIsEnumerable.call(f,d))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var x=Object.getOwnPropertyDescriptor(f,d);if(x.value!==v||x.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var r=requireShams$1();return shams=function(){return r()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max$1,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max$1=Math.max),max$1}var min$1,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min$1=Math.min),min$1}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round$1,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round$1=Math.round),round$1}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(f){return f!==f}),_isNaN}var sign$1,hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1;var r=require_isNaN();return sign$1=function(d){return r(d)||d===0?d:d<0?-1:1},sign$1}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var r=requireGOPD();if(r)try{r([],"length")}catch{r=null}return gopd=r,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return esDefineProperty=r,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var r=typeof Symbol<"u"&&Symbol,f=requireShams$1();return hasSymbols=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:f()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var r=requireEsObjectAtoms();return Object_getPrototypeOf=r.getPrototypeOf||null,Object_getPrototypeOf}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var r="Function.prototype.bind called on incompatible ",f=Object.prototype.toString,d=Math.max,m="[object Function]",v=function(S,_){for(var b=[],C=0;C<S.length;C+=1)b[C]=S[C];for(var E=0;E<_.length;E+=1)b[E+S.length]=_[E];return b},g=function(S,_){for(var b=[],C=_,E=0;C<S.length;C+=1,E+=1)b[E]=S[C];return b},w=function(x,S){for(var _="",b=0;b<x.length;b+=1)_+=x[b],b+1<x.length&&(_+=S);return _};return implementation=function(S){var _=this;if(typeof _!="function"||f.apply(_)!==m)throw new TypeError(r+_);for(var b=g(arguments,1),C,E=function(){if(this instanceof C){var O=_.apply(this,v(b,arguments));return Object(O)===O?O:this}return _.apply(S,v(b,arguments))},M=d(0,_.length-b.length),A=[],T=0;T<M;T++)A[T]="$"+T;if(C=Function("binder","return function ("+w(A,",")+"){ return binder.apply(this,arguments); }")(E),_.prototype){var L=function(){};L.prototype=_.prototype,C.prototype=new L,L.prototype=null}return C},implementation}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var r=requireImplementation();return functionBind=Function.prototype.bind||r,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var r=requireFunctionBind(),f=requireFunctionApply(),d=requireFunctionCall(),m=requireReflectApply();return actualApply=m||r.call(d,f),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var r=requireFunctionBind(),f=requireType(),d=requireFunctionCall(),m=requireActualApply();return callBindApplyHelpers=function(g){if(g.length<1||typeof g[0]!="function")throw new f("a function is required");return m(r,d,g)},callBindApplyHelpers}var get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var r=requireCallBindApplyHelpers(),f=requireGopd(),d;try{d=[].__proto__===Array.prototype}catch(w){if(!w||typeof w!="object"||!("code"in w)||w.code!=="ERR_PROTO_ACCESS")throw w}var m=!!d&&f&&f(Object.prototype,"__proto__"),v=Object,g=v.getPrototypeOf;return get=m&&typeof m.get=="function"?r([m.get]):typeof g=="function"?function(x){return g(x==null?x:v(x))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var r=requireReflect_getPrototypeOf(),f=requireObject_getPrototypeOf(),d=requireGet();return getProto=r?function(v){return r(v)}:f?function(v){if(!v||typeof v!="object"&&typeof v!="function")throw new TypeError("getProto: not an object");return f(v)}:d?function(v){return d(v)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var r=Function.prototype.call,f=Object.prototype.hasOwnProperty,d=requireFunctionBind();return hasown=d.call(r,f),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var r,f=requireEsObjectAtoms(),d=requireEsErrors(),m=require_eval(),v=requireRange(),g=requireRef(),w=requireSyntax(),x=requireType(),S=requireUri(),_=requireAbs(),b=requireFloor(),C=requireMax(),E=requireMin(),M=requirePow(),A=requireRound(),T=requireSign$1(),L=Function,O=function(pe){try{return L('"use strict"; return ('+pe+").constructor;")()}catch{}},N=requireGopd(),H=requireEsDefineProperty(),V=function(){throw new x},X=N?(function(){try{return arguments.callee,V}catch{try{return N(arguments,"callee").get}catch{return V}}})():V,oe=requireHasSymbols()(),se=requireGetProto(),de=requireObject_getPrototypeOf(),he=requireReflect_getPrototypeOf(),we=requireFunctionApply(),te=requireFunctionCall(),k={},q=typeof Uint8Array>"u"||!se?r:se(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":oe&&se?se([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d,"%eval%":eval,"%EvalError%":m,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":L,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":oe&&se?se(se([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!oe||!se?r:se(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":f,"%Object.getOwnPropertyDescriptor%":N,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":v,"%ReferenceError%":g,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!oe||!se?r:se(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":oe&&se?se(""[Symbol.iterator]()):r,"%Symbol%":oe?Symbol:r,"%SyntaxError%":w,"%ThrowTypeError%":X,"%TypedArray%":q,"%TypeError%":x,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":S,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":te,"%Function.prototype.apply%":we,"%Object.defineProperty%":H,"%Object.getPrototypeOf%":de,"%Math.abs%":_,"%Math.floor%":b,"%Math.max%":C,"%Math.min%":E,"%Math.pow%":M,"%Math.round%":A,"%Math.sign%":T,"%Reflect.getPrototypeOf%":he};if(se)try{null.error}catch(pe){var B=se(se(pe));y["%Error.prototype%"]=B}var $=function pe(be){var ae;if(be==="%AsyncFunction%")ae=O("async function () {}");else if(be==="%GeneratorFunction%")ae=O("function* () {}");else if(be==="%AsyncGeneratorFunction%")ae=O("async function* () {}");else if(be==="%AsyncGenerator%"){var ne=pe("%AsyncGeneratorFunction%");ne&&(ae=ne.prototype)}else if(be==="%AsyncIteratorPrototype%"){var Se=pe("%AsyncGenerator%");Se&&se&&(ae=se(Se.prototype))}return y[be]=ae,ae},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=requireFunctionBind(),j=requireHasown(),D=U.call(te,Array.prototype.concat),W=U.call(we,Array.prototype.splice),R=U.call(te,String.prototype.replace),z=U.call(te,String.prototype.slice),ye=U.call(te,RegExp.prototype.exec),Ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,me=/\\(\\)?/g,ie=function(be){var ae=z(be,0,1),ne=z(be,-1);if(ae==="%"&&ne!=="%")throw new w("invalid intrinsic syntax, expected closing `%`");if(ne==="%"&&ae!=="%")throw new w("invalid intrinsic syntax, expected opening `%`");var Se=[];return R(be,Ce,function(qe,Ie,Oe,Fe){Se[Se.length]=Oe?R(Fe,me,"$1"):Ie||qe}),Se},ee=function(be,ae){var ne=be,Se;if(j(I,ne)&&(Se=I[ne],ne="%"+Se[0]+"%"),j(y,ne)){var qe=y[ne];if(qe===k&&(qe=$(ne)),typeof qe>"u"&&!ae)throw new x("intrinsic "+be+" exists, but is not available. Please file an issue!");return{alias:Se,name:ne,value:qe}}throw new w("intrinsic "+be+" does not exist!")};return getIntrinsic=function(be,ae){if(typeof be!="string"||be.length===0)throw new x("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ae!="boolean")throw new x('"allowMissing" argument must be a boolean');if(ye(/^%?[^%]*%?$/,be)===null)throw new w("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ne=ie(be),Se=ne.length>0?ne[0]:"",qe=ee("%"+Se+"%",ae),Ie=qe.name,Oe=qe.value,Fe=!1,De=qe.alias;De&&(Se=De[0],W(ne,D([0,1],De)));for(var $e=1,je=!0;$e<ne.length;$e+=1){var Ye=ne[$e],st=z(Ye,0,1),Je=z(Ye,-1);if((st==='"'||st==="'"||st==="`"||Je==='"'||Je==="'"||Je==="`")&&st!==Je)throw new w("property names with quotes must have matching quotes");if((Ye==="constructor"||!je)&&(Fe=!0),Se+="."+Ye,Ie="%"+Se+"%",j(y,Ie))Oe=y[Ie];else if(Oe!=null){if(!(Ye in Oe)){if(!ae)throw new x("base intrinsic for "+be+" exists, but the property is not available.");return}if(N&&$e+1>=ne.length){var Ge=N(Oe,Ye);je=!!Ge,je&&"get"in Ge&&!("originalValue"in Ge.get)?Oe=Ge.get:Oe=Oe[Ye]}else je=j(Oe,Ye),Oe=Oe[Ye];je&&!Fe&&(y[Ie]=Oe)}}return Oe},getIntrinsic}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var r=requireGetIntrinsic(),f=requireCallBindApplyHelpers(),d=f([r("%String.prototype.indexOf%")]);return callBound=function(v,g){var w=r(v,!!g);return typeof w=="function"&&d(v,".prototype.")>-1?f([w]):w},callBound}var isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var r=requireShams()(),f=requireCallBound(),d=f("Object.prototype.toString"),m=function(x){return r&&x&&typeof x=="object"&&Symbol.toStringTag in x?!1:d(x)==="[object Arguments]"},v=function(x){return m(x)?!0:x!==null&&typeof x=="object"&&"length"in x&&typeof x.length=="number"&&x.length>=0&&d(x)!=="[object Array]"&&"callee"in x&&d(x.callee)==="[object Function]"},g=(function(){return m(arguments)})();return m.isLegacyArguments=v,isArguments=g?m:v,isArguments}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var r=requireCallBound(),f=requireShams()(),d=requireHasown(),m=requireGopd(),v;if(f){var g=r("RegExp.prototype.exec"),w={},x=function(){throw w},S={toString:x,valueOf:x};typeof Symbol.toPrimitive=="symbol"&&(S[Symbol.toPrimitive]=x),v=function(E){if(!E||typeof E!="object")return!1;var M=m(E,"lastIndex"),A=M&&d(M,"value");if(!A)return!1;try{g(E,S)}catch(T){return T===w}}}else{var _=r("Object.prototype.toString"),b="[object RegExp]";v=function(E){return!E||typeof E!="object"&&typeof E!="function"?!1:_(E)===b}}return isRegex=v,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var r=requireCallBound(),f=requireIsRegex(),d=r("RegExp.prototype.exec"),m=requireType();return safeRegexTest=function(g){if(!f(g))throw new m("`regex` must be a RegExp");return function(x){return d(g,x)!==null}},safeRegexTest}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var r=requireCallBound(),f=requireSafeRegexTest(),d=f(/^\s*(?:function)?\*/),m=requireShams()(),v=requireGetProto(),g=r("Object.prototype.toString"),w=r("Function.prototype.toString"),x=function(){if(!m)return!1;try{return Function("return function*() {}")()}catch{}},S;return isGeneratorFunction=function(b){if(typeof b!="function")return!1;if(d(w(b)))return!0;if(!m){var C=g(b);return C==="[object GeneratorFunction]"}if(!v)return!1;if(typeof S>"u"){var E=x();S=E?v(E):!1}return v(b)===S},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var r=Function.prototype.toString,f=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,d,m;if(typeof f=="function"&&typeof Object.defineProperty=="function")try{d=Object.defineProperty({},"length",{get:function(){throw m}}),m={},f(function(){throw 42},null,d)}catch(N){N!==m&&(f=null)}else f=null;var v=/^\s*class\b/,g=function(H){try{var V=r.call(H);return v.test(V)}catch{return!1}},w=function(H){try{return g(H)?!1:(r.call(H),!0)}catch{return!1}},x=Object.prototype.toString,S="[object Object]",_="[object Function]",b="[object GeneratorFunction]",C="[object HTMLAllCollection]",E="[object HTML document.all class]",M="[object HTMLCollection]",A=typeof Symbol=="function"&&!!Symbol.toStringTag,T=!(0 in[,]),L=function(){return!1};if(typeof document=="object"){var O=document.all;x.call(O)===x.call(document.all)&&(L=function(H){if((T||!H)&&(typeof H>"u"||typeof H=="object"))try{var V=x.call(H);return(V===C||V===E||V===M||V===S)&&H("")==null}catch{}return!1})}return isCallable=f?function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;try{f(H,null,d)}catch(V){if(V!==m)return!1}return!g(H)&&w(H)}:function(H){if(L(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;if(A)return w(H);if(g(H))return!1;var V=x.call(H);return V!==_&&V!==b&&!/^\[object HTML/.test(V)?!1:w(H)},isCallable}var forEach,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var r=requireIsCallable(),f=Object.prototype.toString,d=Object.prototype.hasOwnProperty,m=function(S,_,b){for(var C=0,E=S.length;C<E;C++)d.call(S,C)&&(b==null?_(S[C],C,S):_.call(b,S[C],C,S))},v=function(S,_,b){for(var C=0,E=S.length;C<E;C++)b==null?_(S.charAt(C),C,S):_.call(b,S.charAt(C),C,S)},g=function(S,_,b){for(var C in S)d.call(S,C)&&(b==null?_(S[C],C,S):_.call(b,S[C],C,S))};function w(x){return f.call(x)==="[object Array]"}return forEach=function(S,_,b){if(!r(_))throw new TypeError("iterator must be a function");var C;arguments.length>=3&&(C=b),w(S)?m(S,_,C):typeof S=="string"?v(S,_,C):g(S,_,C)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var r=requirePossibleTypedArrayNames(),f=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var m=[],v=0;v<r.length;v++)typeof f[r[v]]=="function"&&(m[m.length]=r[v]);return m},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var r=requireEsDefineProperty(),f=requireSyntax(),d=requireType(),m=requireGopd();return defineDataProperty=function(g,w,x){if(!g||typeof g!="object"&&typeof g!="function")throw new d("`obj` must be an object or a function`");if(typeof w!="string"&&typeof w!="symbol")throw new d("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new d("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new d("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new d("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new d("`loose`, if provided, must be a boolean");var S=arguments.length>3?arguments[3]:null,_=arguments.length>4?arguments[4]:null,b=arguments.length>5?arguments[5]:null,C=arguments.length>6?arguments[6]:!1,E=!!m&&m(g,w);if(r)r(g,w,{configurable:b===null&&E?E.configurable:!b,enumerable:S===null&&E?E.enumerable:!S,value:x,writable:_===null&&E?E.writable:!_});else if(C||!S&&!_&&!b)g[w]=x;else throw new f("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var r=requireEsDefineProperty(),f=function(){return!!r};return f.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=f,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var r=requireGetIntrinsic(),f=requireDefineDataProperty(),d=requireHasPropertyDescriptors()(),m=requireGopd(),v=requireType(),g=r("%Math.floor%");return setFunctionLength=function(x,S){if(typeof x!="function")throw new v("`fn` is not a function");if(typeof S!="number"||S<0||S>4294967295||g(S)!==S)throw new v("`length` must be a positive 32-bit integer");var _=arguments.length>2&&!!arguments[2],b=!0,C=!0;if("length"in x&&m){var E=m(x,"length");E&&!E.configurable&&(b=!1),E&&!E.writable&&(C=!1)}return(b||C||!_)&&(d?f(x,"length",S,!0,!0):f(x,"length",S)),x},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var r=requireFunctionBind(),f=requireFunctionApply(),d=requireActualApply();return applyBind=function(){return d(r,f,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,(function(r){var f=requireSetFunctionLength(),d=requireEsDefineProperty(),m=requireCallBindApplyHelpers(),v=requireApplyBind();r.exports=function(w){var x=m(arguments),S=w.length-(arguments.length-1);return f(x,1+(S>0?S:0),!0)},d?d(r.exports,"apply",{value:v}):r.exports.apply=v})(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var r=requireForEach(),f=requireAvailableTypedArrays(),d=requireCallBind(),m=requireCallBound(),v=requireGopd(),g=requireGetProto(),w=m("Object.prototype.toString"),x=requireShams()(),S=typeof globalThis>"u"?commonjsGlobal:globalThis,_=f(),b=m("String.prototype.slice"),C=m("Array.prototype.indexOf",!0)||function(L,O){for(var N=0;N<L.length;N+=1)if(L[N]===O)return N;return-1},E={__proto__:null};x&&v&&g?r(_,function(T){var L=new S[T];if(Symbol.toStringTag in L&&g){var O=g(L),N=v(O,Symbol.toStringTag);if(!N&&O){var H=g(O);N=v(H,Symbol.toStringTag)}E["$"+T]=d(N.get)}}):r(_,function(T){var L=new S[T],O=L.slice||L.set;O&&(E["$"+T]=d(O))});var M=function(L){var O=!1;return r(E,function(N,H){if(!O)try{"$"+N(L)===H&&(O=b(H,1))}catch{}}),O},A=function(L){var O=!1;return r(E,function(N,H){if(!O)try{N(L),O=b(H,1)}catch{}}),O};return whichTypedArray=function(L){if(!L||typeof L!="object")return!1;if(!x){var O=b(w(L),8,-1);return C(_,O)>-1?O:O!=="Object"?!1:A(L)}return v?M(L):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var r=requireWhichTypedArray();return isTypedArray=function(d){return!!r(d)},isTypedArray}var hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,(function(r){var f=requireIsArguments(),d=requireIsGeneratorFunction(),m=requireWhichTypedArray(),v=requireIsTypedArray();function g($e){return $e.call.bind($e)}var w=typeof BigInt<"u",x=typeof Symbol<"u",S=g(Object.prototype.toString),_=g(Number.prototype.valueOf),b=g(String.prototype.valueOf),C=g(Boolean.prototype.valueOf);if(w)var E=g(BigInt.prototype.valueOf);if(x)var M=g(Symbol.prototype.valueOf);function A($e,je){if(typeof $e!="object")return!1;try{return je($e),!0}catch{return!1}}r.isArgumentsObject=f,r.isGeneratorFunction=d,r.isTypedArray=v;function T($e){return typeof Promise<"u"&&$e instanceof Promise||$e!==null&&typeof $e=="object"&&typeof $e.then=="function"&&typeof $e.catch=="function"}r.isPromise=T;function L($e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView($e):v($e)||z($e)}r.isArrayBufferView=L;function O($e){return m($e)==="Uint8Array"}r.isUint8Array=O;function N($e){return m($e)==="Uint8ClampedArray"}r.isUint8ClampedArray=N;function H($e){return m($e)==="Uint16Array"}r.isUint16Array=H;function V($e){return m($e)==="Uint32Array"}r.isUint32Array=V;function X($e){return m($e)==="Int8Array"}r.isInt8Array=X;function oe($e){return m($e)==="Int16Array"}r.isInt16Array=oe;function se($e){return m($e)==="Int32Array"}r.isInt32Array=se;function de($e){return m($e)==="Float32Array"}r.isFloat32Array=de;function he($e){return m($e)==="Float64Array"}r.isFloat64Array=he;function we($e){return m($e)==="BigInt64Array"}r.isBigInt64Array=we;function te($e){return m($e)==="BigUint64Array"}r.isBigUint64Array=te;function k($e){return S($e)==="[object Map]"}k.working=typeof Map<"u"&&k(new Map);function q($e){return typeof Map>"u"?!1:k.working?k($e):$e instanceof Map}r.isMap=q;function y($e){return S($e)==="[object Set]"}y.working=typeof Set<"u"&&y(new Set);function B($e){return typeof Set>"u"?!1:y.working?y($e):$e instanceof Set}r.isSet=B;function $($e){return S($e)==="[object WeakMap]"}$.working=typeof WeakMap<"u"&&$(new WeakMap);function I($e){return typeof WeakMap>"u"?!1:$.working?$($e):$e instanceof WeakMap}r.isWeakMap=I;function U($e){return S($e)==="[object WeakSet]"}U.working=typeof WeakSet<"u"&&U(new WeakSet);function j($e){return U($e)}r.isWeakSet=j;function D($e){return S($e)==="[object ArrayBuffer]"}D.working=typeof ArrayBuffer<"u"&&D(new ArrayBuffer);function W($e){return typeof ArrayBuffer>"u"?!1:D.working?D($e):$e instanceof ArrayBuffer}r.isArrayBuffer=W;function R($e){return S($e)==="[object DataView]"}R.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&R(new DataView(new ArrayBuffer(1),0,1));function z($e){return typeof DataView>"u"?!1:R.working?R($e):$e instanceof DataView}r.isDataView=z;var ye=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Ce($e){return S($e)==="[object SharedArrayBuffer]"}function me($e){return typeof ye>"u"?!1:(typeof Ce.working>"u"&&(Ce.working=Ce(new ye)),Ce.working?Ce($e):$e instanceof ye)}r.isSharedArrayBuffer=me;function ie($e){return S($e)==="[object AsyncFunction]"}r.isAsyncFunction=ie;function ee($e){return S($e)==="[object Map Iterator]"}r.isMapIterator=ee;function pe($e){return S($e)==="[object Set Iterator]"}r.isSetIterator=pe;function be($e){return S($e)==="[object Generator]"}r.isGeneratorObject=be;function ae($e){return S($e)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=ae;function ne($e){return A($e,_)}r.isNumberObject=ne;function Se($e){return A($e,b)}r.isStringObject=Se;function qe($e){return A($e,C)}r.isBooleanObject=qe;function Ie($e){return w&&A($e,E)}r.isBigIntObject=Ie;function Oe($e){return x&&A($e,M)}r.isSymbolObject=Oe;function Fe($e){return ne($e)||Se($e)||qe($e)||Ie($e)||Oe($e)}r.isBoxedPrimitive=Fe;function De($e){return typeof Uint8Array<"u"&&(W($e)||me($e))}r.isAnyArrayBuffer=De,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function($e){Object.defineProperty(r,$e,{enumerable:!1,value:function(){throw new Error($e+" is not supported in userland")}})})})(types)),types}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(f){return f&&typeof f=="object"&&typeof f.copy=="function"&&typeof f.fill=="function"&&typeof f.readUInt8=="function"}),isBufferBrowser}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,(function(r){var f=Object.getOwnPropertyDescriptors||function(z){for(var ye=Object.keys(z),Ce={},me=0;me<ye.length;me++)Ce[ye[me]]=Object.getOwnPropertyDescriptor(z,ye[me]);return Ce},d=/%[sdj%]/g;r.format=function(R){if(!X(R)){for(var z=[],ye=0;ye<arguments.length;ye++)z.push(w(arguments[ye]));return z.join(" ")}for(var ye=1,Ce=arguments,me=Ce.length,ie=String(R).replace(d,function(pe){if(pe==="%%")return"%";if(ye>=me)return pe;switch(pe){case"%s":return String(Ce[ye++]);case"%d":return Number(Ce[ye++]);case"%j":try{return JSON.stringify(Ce[ye++])}catch{return"[Circular]"}default:return pe}}),ee=Ce[ye];ye<me;ee=Ce[++ye])N(ee)||!he(ee)?ie+=" "+ee:ie+=" "+w(ee);return ie},r.deprecate=function(R,z){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return R;if(typeof process$1>"u")return function(){return r.deprecate(R,z).apply(this,arguments)};var ye=!1;function Ce(){if(!ye){if(process$1.throwDeprecation)throw new Error(z);process$1.traceDeprecation,ye=!0}return R.apply(this,arguments)}return Ce};var m={},v=/^$/;if(process$1.env.NODE_DEBUG){var g=process$1.env.NODE_DEBUG;g=g.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),v=new RegExp("^"+g+"$","i")}r.debuglog=function(R){if(R=R.toUpperCase(),!m[R])if(v.test(R)){var z=process$1.pid;m[R]=function(){var ye=r.format.apply(r,arguments)}}else m[R]=function(){};return m[R]};function w(R,z){var ye={seen:[],stylize:S};return arguments.length>=3&&(ye.depth=arguments[2]),arguments.length>=4&&(ye.colors=arguments[3]),O(z)?ye.showHidden=z:z&&r._extend(ye,z),se(ye.showHidden)&&(ye.showHidden=!1),se(ye.depth)&&(ye.depth=2),se(ye.colors)&&(ye.colors=!1),se(ye.customInspect)&&(ye.customInspect=!0),ye.colors&&(ye.stylize=x),b(ye,R,ye.depth)}r.inspect=w,w.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},w.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function x(R,z){var ye=w.styles[z];return ye?"\x1B["+w.colors[ye][0]+"m"+R+"\x1B["+w.colors[ye][1]+"m":R}function S(R,z){return R}function _(R){var z={};return R.forEach(function(ye,Ce){z[ye]=!0}),z}function b(R,z,ye){if(R.customInspect&&z&&k(z.inspect)&&z.inspect!==r.inspect&&!(z.constructor&&z.constructor.prototype===z)){var Ce=z.inspect(ye,R);return X(Ce)||(Ce=b(R,Ce,ye)),Ce}var me=C(R,z);if(me)return me;var ie=Object.keys(z),ee=_(ie);if(R.showHidden&&(ie=Object.getOwnPropertyNames(z)),te(z)&&(ie.indexOf("message")>=0||ie.indexOf("description")>=0))return E(z);if(ie.length===0){if(k(z)){var pe=z.name?": "+z.name:"";return R.stylize("[Function"+pe+"]","special")}if(de(z))return R.stylize(RegExp.prototype.toString.call(z),"regexp");if(we(z))return R.stylize(Date.prototype.toString.call(z),"date");if(te(z))return E(z)}var be="",ae=!1,ne=["{","}"];if(L(z)&&(ae=!0,ne=["[","]"]),k(z)){var Se=z.name?": "+z.name:"";be=" [Function"+Se+"]"}if(de(z)&&(be=" "+RegExp.prototype.toString.call(z)),we(z)&&(be=" "+Date.prototype.toUTCString.call(z)),te(z)&&(be=" "+E(z)),ie.length===0&&(!ae||z.length==0))return ne[0]+be+ne[1];if(ye<0)return de(z)?R.stylize(RegExp.prototype.toString.call(z),"regexp"):R.stylize("[Object]","special");R.seen.push(z);var qe;return ae?qe=M(R,z,ye,ee,ie):qe=ie.map(function(Ie){return A(R,z,ye,ee,Ie,ae)}),R.seen.pop(),T(qe,be,ne)}function C(R,z){if(se(z))return R.stylize("undefined","undefined");if(X(z)){var ye="'"+JSON.stringify(z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return R.stylize(ye,"string")}if(V(z))return R.stylize(""+z,"number");if(O(z))return R.stylize(""+z,"boolean");if(N(z))return R.stylize("null","null")}function E(R){return"["+Error.prototype.toString.call(R)+"]"}function M(R,z,ye,Ce,me){for(var ie=[],ee=0,pe=z.length;ee<pe;++ee)U(z,String(ee))?ie.push(A(R,z,ye,Ce,String(ee),!0)):ie.push("");return me.forEach(function(be){be.match(/^\d+$/)||ie.push(A(R,z,ye,Ce,be,!0))}),ie}function A(R,z,ye,Ce,me,ie){var ee,pe,be;if(be=Object.getOwnPropertyDescriptor(z,me)||{value:z[me]},be.get?be.set?pe=R.stylize("[Getter/Setter]","special"):pe=R.stylize("[Getter]","special"):be.set&&(pe=R.stylize("[Setter]","special")),U(Ce,me)||(ee="["+me+"]"),pe||(R.seen.indexOf(be.value)<0?(N(ye)?pe=b(R,be.value,null):pe=b(R,be.value,ye-1),pe.indexOf(`
18
18
  `)>-1&&(ie?pe=pe.split(`
19
19
  `).map(function(ae){return" "+ae}).join(`
20
20
  `).slice(2):pe=`
@@ -23,13 +23,13 @@ Use Chrome, Firefox or Internet Explorer 11`)}var m=requireSafeBuffer$1().Buffer
23
23
  `))):pe=R.stylize("[Circular]","special")),se(ee)){if(ie&&me.match(/^\d+$/))return pe;ee=JSON.stringify(""+me),ee.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ee=ee.slice(1,-1),ee=R.stylize(ee,"name")):(ee=ee.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ee=R.stylize(ee,"string"))}return ee+": "+pe}function T(R,z,ye){var Ce=R.reduce(function(me,ie){return ie.indexOf(`
24
24
  `)>=0,me+ie.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ce>60?ye[0]+(z===""?"":z+`
25
25
  `)+" "+R.join(`,
26
- `)+" "+ye[1]:ye[0]+z+" "+R.join(", ")+" "+ye[1]}r.types=requireTypes();function L(R){return Array.isArray(R)}r.isArray=L;function O(R){return typeof R=="boolean"}r.isBoolean=O;function N(R){return R===null}r.isNull=N;function H(R){return R==null}r.isNullOrUndefined=H;function V(R){return typeof R=="number"}r.isNumber=V;function X(R){return typeof R=="string"}r.isString=X;function oe(R){return typeof R=="symbol"}r.isSymbol=oe;function se(R){return R===void 0}r.isUndefined=se;function de(R){return he(R)&&y(R)==="[object RegExp]"}r.isRegExp=de,r.types.isRegExp=de;function he(R){return typeof R=="object"&&R!==null}r.isObject=he;function we(R){return he(R)&&y(R)==="[object Date]"}r.isDate=we,r.types.isDate=we;function te(R){return he(R)&&(y(R)==="[object Error]"||R instanceof Error)}r.isError=te,r.types.isNativeError=te;function k(R){return typeof R=="function"}r.isFunction=k;function q(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}r.isPrimitive=q,r.isBuffer=requireIsBufferBrowser();function y(R){return Object.prototype.toString.call(R)}function B(R){return R<10?"0"+R.toString(10):R.toString(10)}var $=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var R=new Date,z=[B(R.getHours()),B(R.getMinutes()),B(R.getSeconds())].join(":");return[R.getDate(),$[R.getMonth()],z].join(" ")}r.log=function(){},r.inherits=requireInherits_browser(),r._extend=function(R,z){if(!z||!he(z))return R;for(var ye=Object.keys(z),Ce=ye.length;Ce--;)R[ye[Ce]]=z[ye[Ce]];return R};function F(R,z){return Object.prototype.hasOwnProperty.call(R,z)}var j=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;r.promisify=function(z){if(typeof z!="function")throw new TypeError('The "original" argument must be of type Function');if(j&&z[j]){var ye=z[j];if(typeof ye!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ye,j,{value:ye,enumerable:!1,writable:!1,configurable:!0}),ye}function ye(){for(var Ce,me,ie=new Promise(function(be,ae){Ce=be,me=ae}),ee=[],pe=0;pe<arguments.length;pe++)ee.push(arguments[pe]);ee.push(function(be,ae){be?me(be):Ce(ae)});try{z.apply(this,ee)}catch(be){me(be)}return ie}return Object.setPrototypeOf(ye,Object.getPrototypeOf(z)),j&&Object.defineProperty(ye,j,{value:ye,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ye,f(z))},r.promisify.custom=j;function D(R,z){if(!R){var ye=new Error("Promise was rejected with a falsy value");ye.reason=R,R=ye}return z(R)}function W(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');function z(){for(var ye=[],Ce=0;Ce<arguments.length;Ce++)ye.push(arguments[Ce]);var me=ye.pop();if(typeof me!="function")throw new TypeError("The last argument must be of type Function");var ie=this,ee=function(){return me.apply(ie,arguments)};R.apply(this,ye).then(function(pe){process$1.nextTick(ee.bind(null,null,pe))},function(pe){process$1.nextTick(D.bind(null,pe,ee))})}return Object.setPrototypeOf(z,Object.getPrototypeOf(R)),Object.defineProperties(z,f(R)),z}r.callbackify=W})(util$1)),util$1}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function r(A,T){var L=Object.keys(A);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(A);T&&(O=O.filter(function(N){return Object.getOwnPropertyDescriptor(A,N).enumerable})),L.push.apply(L,O)}return L}function f(A){for(var T=1;T<arguments.length;T++){var L=arguments[T]!=null?arguments[T]:{};T%2?r(Object(L),!0).forEach(function(O){d(A,O,L[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(L)):r(Object(L)).forEach(function(O){Object.defineProperty(A,O,Object.getOwnPropertyDescriptor(L,O))})}return A}function d(A,T,L){return T=w(T),T in A?Object.defineProperty(A,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):A[T]=L,A}function m(A,T){if(!(A instanceof T))throw new TypeError("Cannot call a class as a function")}function v(A,T){for(var L=0;L<T.length;L++){var O=T[L];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(A,w(O.key),O)}}function g(A,T,L){return T&&v(A.prototype,T),Object.defineProperty(A,"prototype",{writable:!1}),A}function w(A){var T=x(A,"string");return typeof T=="symbol"?T:String(T)}function x(A,T){if(typeof A!="object"||A===null)return A;var L=A[Symbol.toPrimitive];if(L!==void 0){var O=L.call(A,T);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}var S=requireDist(),_=S.Buffer,b=requireUtil$1(),C=b.inspect,E=C&&C.custom||"inspect";function M(A,T,L){_.prototype.copy.call(A,T,L)}return buffer_list=(function(){function A(){m(this,A),this.head=null,this.tail=null,this.length=0}return g(A,[{key:"push",value:function(L){var O={data:L,next:null};this.length>0?this.tail.next=O:this.head=O,this.tail=O,++this.length}},{key:"unshift",value:function(L){var O={data:L,next:this.head};this.length===0&&(this.tail=O),this.head=O,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var O=this.head,N=""+O.data;O=O.next;)N+=L+O.data;return N}},{key:"concat",value:function(L){if(this.length===0)return _.alloc(0);for(var O=_.allocUnsafe(L>>>0),N=this.head,H=0;N;)M(N.data,O,H),H+=N.data.length,N=N.next;return O}},{key:"consume",value:function(L,O){var N;return L<this.head.data.length?(N=this.head.data.slice(0,L),this.head.data=this.head.data.slice(L)):L===this.head.data.length?N=this.shift():N=O?this._getString(L):this._getBuffer(L),N}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(L){var O=this.head,N=1,H=O.data;for(L-=H.length;O=O.next;){var V=O.data,X=L>V.length?V.length:L;if(X===V.length?H+=V:H+=V.slice(0,L),L-=X,L===0){X===V.length?(++N,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=V.slice(X));break}++N}return this.length-=N,H}},{key:"_getBuffer",value:function(L){var O=_.allocUnsafe(L),N=this.head,H=1;for(N.data.copy(O),L-=N.data.length;N=N.next;){var V=N.data,X=L>V.length?V.length:L;if(V.copy(O,O.length-L,0,X),L-=X,L===0){X===V.length?(++H,N.next?this.head=N.next:this.head=this.tail=null):(this.head=N,N.data=V.slice(X));break}++H}return this.length-=H,O}},{key:E,value:function(L,O){return C(this,f(f({},O),{},{depth:0,customInspect:!1}))}}]),A})(),buffer_list}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;function r(w,x){var S=this,_=this._readableState&&this._readableState.destroyed,b=this._writableState&&this._writableState.destroyed;return _||b?(x?x(w):w&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(v,this,w)):process$1.nextTick(v,this,w)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(w||null,function(C){!x&&C?S._writableState?S._writableState.errorEmitted?process$1.nextTick(d,S):(S._writableState.errorEmitted=!0,process$1.nextTick(f,S,C)):process$1.nextTick(f,S,C):x?(process$1.nextTick(d,S),x(C)):process$1.nextTick(d,S)}),this)}function f(w,x){v(w,x),d(w)}function d(w){w._writableState&&!w._writableState.emitClose||w._readableState&&!w._readableState.emitClose||w.emit("close")}function m(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function v(w,x){w.emit("error",x)}function g(w,x){var S=w._readableState,_=w._writableState;S&&S.autoDestroy||_&&_.autoDestroy?w.destroy(x):w.emit("error",x)}return destroy_1$1={destroy:r,undestroy:m,errorOrDestroy:g},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function r(x,S){x.prototype=Object.create(S.prototype),x.prototype.constructor=x,x.__proto__=S}var f={};function d(x,S,_){_||(_=Error);function b(E,M,A){return typeof S=="string"?S:S(E,M,A)}var C=(function(E){r(M,E);function M(A,T,L){return E.call(this,b(A,T,L))||this}return M})(_);C.prototype.name=_.name,C.prototype.code=x,f[x]=C}function m(x,S){if(Array.isArray(x)){var _=x.length;return x=x.map(function(b){return String(b)}),_>2?"one of ".concat(S," ").concat(x.slice(0,_-1).join(", "),", or ")+x[_-1]:_===2?"one of ".concat(S," ").concat(x[0]," or ").concat(x[1]):"of ".concat(S," ").concat(x[0])}else return"of ".concat(S," ").concat(String(x))}function v(x,S,_){return x.substr(0,S.length)===S}function g(x,S,_){return(_===void 0||_>x.length)&&(_=x.length),x.substring(_-S.length,_)===S}function w(x,S,_){return typeof _!="number"&&(_=0),_+S.length>x.length?!1:x.indexOf(S,_)!==-1}return d("ERR_INVALID_OPT_VALUE",function(x,S){return'The value "'+S+'" is invalid for option "'+x+'"'},TypeError),d("ERR_INVALID_ARG_TYPE",function(x,S,_){var b;typeof S=="string"&&v(S,"not ")?(b="must not be",S=S.replace(/^not /,"")):b="must be";var C;if(g(x," argument"))C="The ".concat(x," ").concat(b," ").concat(m(S,"type"));else{var E=w(x,".")?"property":"argument";C='The "'.concat(x,'" ').concat(E," ").concat(b," ").concat(m(S,"type"))}return C+=". Received type ".concat(typeof _),C},TypeError),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),d("ERR_METHOD_NOT_IMPLEMENTED",function(x){return"The "+x+" method is not implemented"}),d("ERR_STREAM_PREMATURE_CLOSE","Premature close"),d("ERR_STREAM_DESTROYED",function(x){return"Cannot call "+x+" after a stream was destroyed"}),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),d("ERR_STREAM_WRITE_AFTER_END","write after end"),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_UNKNOWN_ENCODING",function(x){return"Unknown encoding: "+x},TypeError),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=f,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var r=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function f(m,v,g){return m.highWaterMark!=null?m.highWaterMark:v?m[g]:null}function d(m,v,g,w){var x=f(v,w,g);if(x!=null){if(!(isFinite(x)&&Math.floor(x)===x)||x<0){var S=w?g:"highWaterMark";throw new r(S,x)}return Math.floor(x)}return m.objectMode?16:16*1024}return state={getHighWaterMark:d},state}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=r;function r(d,m){if(f("noDeprecation"))return d;var v=!1;function g(){if(!v){if(f("throwDeprecation"))throw new Error(m);f("traceDeprecation"),v=!0}return d.apply(this,arguments)}return g}function f(d){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var m=commonjsGlobal.localStorage[d];return m==null?!1:String(m).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=de;function r(me){var ie=this;this.next=null,this.entry=null,this.finish=function(){Ce(ie,me)}}var f;de.WritableState=oe;var d={deprecate:requireBrowser$a()},m=requireStreamBrowser$1(),v=requireDist().Buffer,g=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function w(me){return v.from(me)}function x(me){return v.isBuffer(me)||me instanceof g}var S=requireDestroy$1(),_=requireState(),b=_.getHighWaterMark,C=requireErrorsBrowser().codes,E=C.ERR_INVALID_ARG_TYPE,M=C.ERR_METHOD_NOT_IMPLEMENTED,A=C.ERR_MULTIPLE_CALLBACK,T=C.ERR_STREAM_CANNOT_PIPE,L=C.ERR_STREAM_DESTROYED,O=C.ERR_STREAM_NULL_VALUES,N=C.ERR_STREAM_WRITE_AFTER_END,H=C.ERR_UNKNOWN_ENCODING,V=S.errorOrDestroy;requireInherits_browser()(de,m);function X(){}function oe(me,ie,ee){f=f||require_stream_duplex$1(),me=me||{},typeof ee!="boolean"&&(ee=ie instanceof f),this.objectMode=!!me.objectMode,ee&&(this.objectMode=this.objectMode||!!me.writableObjectMode),this.highWaterMark=b(this,me,"writableHighWaterMark",ee),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var pe=me.decodeStrings===!1;this.decodeStrings=!pe,this.defaultEncoding=me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(be){$(ie,be)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=me.emitClose!==!1,this.autoDestroy=!!me.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}oe.prototype.getBuffer=function(){for(var ie=this.bufferedRequest,ee=[];ie;)ee.push(ie),ie=ie.next;return ee},(function(){try{Object.defineProperty(oe.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var se;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(se=Function.prototype[Symbol.hasInstance],Object.defineProperty(de,Symbol.hasInstance,{value:function(ie){return se.call(this,ie)?!0:this!==de?!1:ie&&ie._writableState instanceof oe}})):se=function(ie){return ie instanceof this};function de(me){f=f||require_stream_duplex$1();var ie=this instanceof f;if(!ie&&!se.call(de,this))return new de(me);this._writableState=new oe(me,this,ie),this.writable=!0,me&&(typeof me.write=="function"&&(this._write=me.write),typeof me.writev=="function"&&(this._writev=me.writev),typeof me.destroy=="function"&&(this._destroy=me.destroy),typeof me.final=="function"&&(this._final=me.final)),m.call(this)}de.prototype.pipe=function(){V(this,new T)};function he(me,ie){var ee=new N;V(me,ee),process$1.nextTick(ie,ee)}function we(me,ie,ee,pe){var be;return ee===null?be=new O:typeof ee!="string"&&!ie.objectMode&&(be=new E("chunk",["string","Buffer"],ee)),be?(V(me,be),process$1.nextTick(pe,be),!1):!0}de.prototype.write=function(me,ie,ee){var pe=this._writableState,be=!1,ae=!pe.objectMode&&x(me);return ae&&!v.isBuffer(me)&&(me=w(me)),typeof ie=="function"&&(ee=ie,ie=null),ae?ie="buffer":ie||(ie=pe.defaultEncoding),typeof ee!="function"&&(ee=X),pe.ending?he(this,ee):(ae||we(this,pe,me,ee))&&(pe.pendingcb++,be=k(this,pe,ae,me,ie,ee)),be},de.prototype.cork=function(){this._writableState.corked++},de.prototype.uncork=function(){var me=this._writableState;me.corked&&(me.corked--,!me.writing&&!me.corked&&!me.bufferProcessing&&me.bufferedRequest&&j(this,me))},de.prototype.setDefaultEncoding=function(ie){if(typeof ie=="string"&&(ie=ie.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ie+"").toLowerCase())>-1))throw new H(ie);return this._writableState.defaultEncoding=ie,this},Object.defineProperty(de.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function te(me,ie,ee){return!me.objectMode&&me.decodeStrings!==!1&&typeof ie=="string"&&(ie=v.from(ie,ee)),ie}Object.defineProperty(de.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function k(me,ie,ee,pe,be,ae){if(!ee){var ne=te(ie,pe,be);pe!==ne&&(ee=!0,be="buffer",pe=ne)}var Se=ie.objectMode?1:pe.length;ie.length+=Se;var qe=ie.length<ie.highWaterMark;if(qe||(ie.needDrain=!0),ie.writing||ie.corked){var Ie=ie.lastBufferedRequest;ie.lastBufferedRequest={chunk:pe,encoding:be,isBuf:ee,callback:ae,next:null},Ie?Ie.next=ie.lastBufferedRequest:ie.bufferedRequest=ie.lastBufferedRequest,ie.bufferedRequestCount+=1}else q(me,ie,!1,Se,pe,be,ae);return qe}function q(me,ie,ee,pe,be,ae,ne){ie.writelen=pe,ie.writecb=ne,ie.writing=!0,ie.sync=!0,ie.destroyed?ie.onwrite(new L("write")):ee?me._writev(be,ie.onwrite):me._write(be,ae,ie.onwrite),ie.sync=!1}function y(me,ie,ee,pe,be){--ie.pendingcb,ee?(process$1.nextTick(be,pe),process$1.nextTick(z,me,ie),me._writableState.errorEmitted=!0,V(me,pe)):(be(pe),me._writableState.errorEmitted=!0,V(me,pe),z(me,ie))}function B(me){me.writing=!1,me.writecb=null,me.length-=me.writelen,me.writelen=0}function $(me,ie){var ee=me._writableState,pe=ee.sync,be=ee.writecb;if(typeof be!="function")throw new A;if(B(ee),ie)y(me,ee,pe,ie,be);else{var ae=D(ee)||me.destroyed;!ae&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&j(me,ee),pe?process$1.nextTick(I,me,ee,ae,be):I(me,ee,ae,be)}}function I(me,ie,ee,pe){ee||F(me,ie),ie.pendingcb--,pe(),z(me,ie)}function F(me,ie){ie.length===0&&ie.needDrain&&(ie.needDrain=!1,me.emit("drain"))}function j(me,ie){ie.bufferProcessing=!0;var ee=ie.bufferedRequest;if(me._writev&&ee&&ee.next){var pe=ie.bufferedRequestCount,be=new Array(pe),ae=ie.corkedRequestsFree;ae.entry=ee;for(var ne=0,Se=!0;ee;)be[ne]=ee,ee.isBuf||(Se=!1),ee=ee.next,ne+=1;be.allBuffers=Se,q(me,ie,!0,ie.length,be,"",ae.finish),ie.pendingcb++,ie.lastBufferedRequest=null,ae.next?(ie.corkedRequestsFree=ae.next,ae.next=null):ie.corkedRequestsFree=new r(ie),ie.bufferedRequestCount=0}else{for(;ee;){var qe=ee.chunk,Ie=ee.encoding,Oe=ee.callback,Ue=ie.objectMode?1:qe.length;if(q(me,ie,!1,Ue,qe,Ie,Oe),ee=ee.next,ie.bufferedRequestCount--,ie.writing)break}ee===null&&(ie.lastBufferedRequest=null)}ie.bufferedRequest=ee,ie.bufferProcessing=!1}de.prototype._write=function(me,ie,ee){ee(new M("_write()"))},de.prototype._writev=null,de.prototype.end=function(me,ie,ee){var pe=this._writableState;return typeof me=="function"?(ee=me,me=null,ie=null):typeof ie=="function"&&(ee=ie,ie=null),me!=null&&this.write(me,ie),pe.corked&&(pe.corked=1,this.uncork()),pe.ending||ye(this,pe,ee),this},Object.defineProperty(de.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function D(me){return me.ending&&me.length===0&&me.bufferedRequest===null&&!me.finished&&!me.writing}function W(me,ie){me._final(function(ee){ie.pendingcb--,ee&&V(me,ee),ie.prefinished=!0,me.emit("prefinish"),z(me,ie)})}function R(me,ie){!ie.prefinished&&!ie.finalCalled&&(typeof me._final=="function"&&!ie.destroyed?(ie.pendingcb++,ie.finalCalled=!0,process$1.nextTick(W,me,ie)):(ie.prefinished=!0,me.emit("prefinish")))}function z(me,ie){var ee=D(ie);if(ee&&(R(me,ie),ie.pendingcb===0&&(ie.finished=!0,me.emit("finish"),ie.autoDestroy))){var pe=me._readableState;(!pe||pe.autoDestroy&&pe.endEmitted)&&me.destroy()}return ee}function ye(me,ie,ee){ie.ending=!0,z(me,ie),ee&&(ie.finished?process$1.nextTick(ee):me.once("finish",ee)),ie.ended=!0,me.writable=!1}function Ce(me,ie,ee){var pe=me.entry;for(me.entry=null;pe;){var be=pe.callback;ie.pendingcb--,be(ee),pe=pe.next}ie.corkedRequestsFree.next=me}return Object.defineProperty(de.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ie){this._writableState&&(this._writableState.destroyed=ie)}}),de.prototype.destroy=S.destroy,de.prototype._undestroy=S.undestroy,de.prototype._destroy=function(me,ie){ie(me)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var r=Object.keys||function(_){var b=[];for(var C in _)b.push(C);return b};_stream_duplex$1=w;var f=require_stream_readable$1(),d=require_stream_writable$1();requireInherits_browser()(w,f);for(var m=r(d.prototype),v=0;v<m.length;v++){var g=m[v];w.prototype[g]||(w.prototype[g]=d.prototype[g])}function w(_){if(!(this instanceof w))return new w(_);f.call(this,_),d.call(this,_),this.allowHalfOpen=!0,_&&(_.readable===!1&&(this.readable=!1),_.writable===!1&&(this.writable=!1),_.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",x)))}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function x(){this._writableState.ended||process$1.nextTick(S,this)}function S(_){_.end()}return Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),_stream_duplex$1}var string_decoder={},hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var r=requireSafeBuffer$1().Buffer,f=r.isEncoding||function(O){switch(O=""+O,O&&O.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 d(O){if(!O)return"utf8";for(var N;;)switch(O){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 O;default:if(N)return;O=(""+O).toLowerCase(),N=!0}}function m(O){var N=d(O);if(typeof N!="string"&&(r.isEncoding===f||!f(O)))throw new Error("Unknown encoding: "+O);return N||O}string_decoder.StringDecoder=v;function v(O){this.encoding=m(O);var N;switch(this.encoding){case"utf16le":this.text=C,this.end=E,N=4;break;case"utf8":this.fillLast=S,N=4;break;case"base64":this.text=M,this.end=A,N=3;break;default:this.write=T,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(N)}v.prototype.write=function(O){if(O.length===0)return"";var N,H;if(this.lastNeed){if(N=this.fillLast(O),N===void 0)return"";H=this.lastNeed,this.lastNeed=0}else H=0;return H<O.length?N?N+this.text(O,H):this.text(O,H):N||""},v.prototype.end=b,v.prototype.text=_,v.prototype.fillLast=function(O){if(this.lastNeed<=O.length)return O.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);O.copy(this.lastChar,this.lastTotal-this.lastNeed,0,O.length),this.lastNeed-=O.length};function g(O){return O<=127?0:O>>5===6?2:O>>4===14?3:O>>3===30?4:O>>6===2?-1:-2}function w(O,N,H){var V=N.length-1;if(V<H)return 0;var X=g(N[V]);return X>=0?(X>0&&(O.lastNeed=X-1),X):--V<H||X===-2?0:(X=g(N[V]),X>=0?(X>0&&(O.lastNeed=X-2),X):--V<H||X===-2?0:(X=g(N[V]),X>=0?(X>0&&(X===2?X=0:O.lastNeed=X-3),X):0))}function x(O,N,H){if((N[0]&192)!==128)return O.lastNeed=0,"�";if(O.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return O.lastNeed=1,"�";if(O.lastNeed>2&&N.length>2&&(N[2]&192)!==128)return O.lastNeed=2,"�"}}function S(O){var N=this.lastTotal-this.lastNeed,H=x(this,O);if(H!==void 0)return H;if(this.lastNeed<=O.length)return O.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);O.copy(this.lastChar,N,0,O.length),this.lastNeed-=O.length}function _(O,N){var H=w(this,O,N);if(!this.lastNeed)return O.toString("utf8",N);this.lastTotal=H;var V=O.length-(H-this.lastNeed);return O.copy(this.lastChar,0,V),O.toString("utf8",N,V)}function b(O){var N=O&&O.length?this.write(O):"";return this.lastNeed?N+"�":N}function C(O,N){if((O.length-N)%2===0){var H=O.toString("utf16le",N);if(H){var V=H.charCodeAt(H.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=O[O.length-2],this.lastChar[1]=O[O.length-1],H.slice(0,-1)}return H}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=O[O.length-1],O.toString("utf16le",N,O.length-1)}function E(O){var N=O&&O.length?this.write(O):"";if(this.lastNeed){var H=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,H)}return N}function M(O,N){var H=(O.length-N)%3;return H===0?O.toString("base64",N):(this.lastNeed=3-H,this.lastTotal=3,H===1?this.lastChar[0]=O[O.length-1]:(this.lastChar[0]=O[O.length-2],this.lastChar[1]=O[O.length-1]),O.toString("base64",N,O.length-H))}function A(O){var N=O&&O.length?this.write(O):"";return this.lastNeed?N+this.lastChar.toString("base64",0,3-this.lastNeed):N}function T(O){return O.toString(this.encoding)}function L(O){return O&&O.length?this.write(O):""}return string_decoder}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var r=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function f(g){var w=!1;return function(){if(!w){w=!0;for(var x=arguments.length,S=new Array(x),_=0;_<x;_++)S[_]=arguments[_];g.apply(this,S)}}}function d(){}function m(g){return g.setHeader&&typeof g.abort=="function"}function v(g,w,x){if(typeof w=="function")return v(g,null,w);w||(w={}),x=f(x||d);var S=w.readable||w.readable!==!1&&g.readable,_=w.writable||w.writable!==!1&&g.writable,b=function(){g.writable||E()},C=g._writableState&&g._writableState.finished,E=function(){_=!1,C=!0,S||x.call(g)},M=g._readableState&&g._readableState.endEmitted,A=function(){S=!1,M=!0,_||x.call(g)},T=function(H){x.call(g,H)},L=function(){var H;if(S&&!M)return(!g._readableState||!g._readableState.ended)&&(H=new r),x.call(g,H);if(_&&!C)return(!g._writableState||!g._writableState.ended)&&(H=new r),x.call(g,H)},O=function(){g.req.on("finish",E)};return m(g)?(g.on("complete",E),g.on("abort",L),g.req?O():g.on("request",O)):_&&!g._writableState&&(g.on("end",b),g.on("close",b)),g.on("end",A),g.on("finish",E),w.error!==!1&&g.on("error",T),g.on("close",L),function(){g.removeListener("complete",E),g.removeListener("abort",L),g.removeListener("request",O),g.req&&g.req.removeListener("finish",E),g.removeListener("end",b),g.removeListener("close",b),g.removeListener("finish",E),g.removeListener("end",A),g.removeListener("error",T),g.removeListener("close",L)}}return endOfStream=v,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var r;function f(H,V,X){return V=d(V),V in H?Object.defineProperty(H,V,{value:X,enumerable:!0,configurable:!0,writable:!0}):H[V]=X,H}function d(H){var V=m(H,"string");return typeof V=="symbol"?V:String(V)}function m(H,V){if(typeof H!="object"||H===null)return H;var X=H[Symbol.toPrimitive];if(X!==void 0){var oe=X.call(H,V);if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)(H)}var v=requireEndOfStream(),g=Symbol("lastResolve"),w=Symbol("lastReject"),x=Symbol("error"),S=Symbol("ended"),_=Symbol("lastPromise"),b=Symbol("handlePromise"),C=Symbol("stream");function E(H,V){return{value:H,done:V}}function M(H){var V=H[g];if(V!==null){var X=H[C].read();X!==null&&(H[_]=null,H[g]=null,H[w]=null,V(E(X,!1)))}}function A(H){process$1.nextTick(M,H)}function T(H,V){return function(X,oe){H.then(function(){if(V[S]){X(E(void 0,!0));return}V[b](X,oe)},oe)}}var L=Object.getPrototypeOf(function(){}),O=Object.setPrototypeOf((r={get stream(){return this[C]},next:function(){var V=this,X=this[x];if(X!==null)return Promise.reject(X);if(this[S])return Promise.resolve(E(void 0,!0));if(this[C].destroyed)return new Promise(function(he,we){process$1.nextTick(function(){V[x]?we(V[x]):he(E(void 0,!0))})});var oe=this[_],se;if(oe)se=new Promise(T(oe,this));else{var de=this[C].read();if(de!==null)return Promise.resolve(E(de,!1));se=new Promise(this[b])}return this[_]=se,se}},f(r,Symbol.asyncIterator,function(){return this}),f(r,"return",function(){var V=this;return new Promise(function(X,oe){V[C].destroy(null,function(se){if(se){oe(se);return}X(E(void 0,!0))})})}),r),L),N=function(V){var X,oe=Object.create(O,(X={},f(X,C,{value:V,writable:!0}),f(X,g,{value:null,writable:!0}),f(X,w,{value:null,writable:!0}),f(X,x,{value:null,writable:!0}),f(X,S,{value:V._readableState.endEmitted,writable:!0}),f(X,b,{value:function(de,he){var we=oe[C].read();we?(oe[_]=null,oe[g]=null,oe[w]=null,de(E(we,!1))):(oe[g]=de,oe[w]=he)},writable:!0}),X));return oe[_]=null,v(V,function(se){if(se&&se.code!=="ERR_STREAM_PREMATURE_CLOSE"){var de=oe[w];de!==null&&(oe[_]=null,oe[g]=null,oe[w]=null,de(se)),oe[x]=se;return}var he=oe[g];he!==null&&(oe[_]=null,oe[g]=null,oe[w]=null,he(E(void 0,!0))),oe[S]=!0}),V.on("readable",A.bind(null,oe)),oe};return async_iterator=N,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=he;var r;he.ReadableState=de,requireEvents().EventEmitter;var f=function(ne,Se){return ne.listeners(Se).length},d=requireStreamBrowser$1(),m=requireDist().Buffer,v=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function g(ae){return m.from(ae)}function w(ae){return m.isBuffer(ae)||ae instanceof v}var x=requireUtil$1(),S;x&&x.debuglog?S=x.debuglog("stream"):S=function(){};var _=requireBuffer_list(),b=requireDestroy$1(),C=requireState(),E=C.getHighWaterMark,M=requireErrorsBrowser().codes,A=M.ERR_INVALID_ARG_TYPE,T=M.ERR_STREAM_PUSH_AFTER_EOF,L=M.ERR_METHOD_NOT_IMPLEMENTED,O=M.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,N,H,V;requireInherits_browser()(he,d);var X=b.errorOrDestroy,oe=["error","close","destroy","pause","resume"];function se(ae,ne,Se){if(typeof ae.prependListener=="function")return ae.prependListener(ne,Se);!ae._events||!ae._events[ne]?ae.on(ne,Se):Array.isArray(ae._events[ne])?ae._events[ne].unshift(Se):ae._events[ne]=[Se,ae._events[ne]]}function de(ae,ne,Se){r=r||require_stream_duplex$1(),ae=ae||{},typeof Se!="boolean"&&(Se=ne instanceof r),this.objectMode=!!ae.objectMode,Se&&(this.objectMode=this.objectMode||!!ae.readableObjectMode),this.highWaterMark=E(this,ae,"readableHighWaterMark",Se),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ae.emitClose!==!1,this.autoDestroy=!!ae.autoDestroy,this.destroyed=!1,this.defaultEncoding=ae.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ae.encoding&&(N||(N=requireString_decoder().StringDecoder),this.decoder=new N(ae.encoding),this.encoding=ae.encoding)}function he(ae){if(r=r||require_stream_duplex$1(),!(this instanceof he))return new he(ae);var ne=this instanceof r;this._readableState=new de(ae,this,ne),this.readable=!0,ae&&(typeof ae.read=="function"&&(this._read=ae.read),typeof ae.destroy=="function"&&(this._destroy=ae.destroy)),d.call(this)}Object.defineProperty(he.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ne){this._readableState&&(this._readableState.destroyed=ne)}}),he.prototype.destroy=b.destroy,he.prototype._undestroy=b.undestroy,he.prototype._destroy=function(ae,ne){ne(ae)},he.prototype.push=function(ae,ne){var Se=this._readableState,qe;return Se.objectMode?qe=!0:typeof ae=="string"&&(ne=ne||Se.defaultEncoding,ne!==Se.encoding&&(ae=m.from(ae,ne),ne=""),qe=!0),we(this,ae,ne,!1,qe)},he.prototype.unshift=function(ae){return we(this,ae,null,!0,!1)};function we(ae,ne,Se,qe,Ie){S("readableAddChunk",ne);var Oe=ae._readableState;if(ne===null)Oe.reading=!1,$(ae,Oe);else{var Ue;if(Ie||(Ue=k(Oe,ne)),Ue)X(ae,Ue);else if(Oe.objectMode||ne&&ne.length>0)if(typeof ne!="string"&&!Oe.objectMode&&Object.getPrototypeOf(ne)!==m.prototype&&(ne=g(ne)),qe)Oe.endEmitted?X(ae,new O):te(ae,Oe,ne,!0);else if(Oe.ended)X(ae,new T);else{if(Oe.destroyed)return!1;Oe.reading=!1,Oe.decoder&&!Se?(ne=Oe.decoder.write(ne),Oe.objectMode||ne.length!==0?te(ae,Oe,ne,!1):j(ae,Oe)):te(ae,Oe,ne,!1)}else qe||(Oe.reading=!1,j(ae,Oe))}return!Oe.ended&&(Oe.length<Oe.highWaterMark||Oe.length===0)}function te(ae,ne,Se,qe){ne.flowing&&ne.length===0&&!ne.sync?(ne.awaitDrain=0,ae.emit("data",Se)):(ne.length+=ne.objectMode?1:Se.length,qe?ne.buffer.unshift(Se):ne.buffer.push(Se),ne.needReadable&&I(ae)),j(ae,ne)}function k(ae,ne){var Se;return!w(ne)&&typeof ne!="string"&&ne!==void 0&&!ae.objectMode&&(Se=new A("chunk",["string","Buffer","Uint8Array"],ne)),Se}he.prototype.isPaused=function(){return this._readableState.flowing===!1},he.prototype.setEncoding=function(ae){N||(N=requireString_decoder().StringDecoder);var ne=new N(ae);this._readableState.decoder=ne,this._readableState.encoding=this._readableState.decoder.encoding;for(var Se=this._readableState.buffer.head,qe="";Se!==null;)qe+=ne.write(Se.data),Se=Se.next;return this._readableState.buffer.clear(),qe!==""&&this._readableState.buffer.push(qe),this._readableState.length=qe.length,this};var q=1073741824;function y(ae){return ae>=q?ae=q:(ae--,ae|=ae>>>1,ae|=ae>>>2,ae|=ae>>>4,ae|=ae>>>8,ae|=ae>>>16,ae++),ae}function B(ae,ne){return ae<=0||ne.length===0&&ne.ended?0:ne.objectMode?1:ae!==ae?ne.flowing&&ne.length?ne.buffer.head.data.length:ne.length:(ae>ne.highWaterMark&&(ne.highWaterMark=y(ae)),ae<=ne.length?ae:ne.ended?ne.length:(ne.needReadable=!0,0))}he.prototype.read=function(ae){S("read",ae),ae=parseInt(ae,10);var ne=this._readableState,Se=ae;if(ae!==0&&(ne.emittedReadable=!1),ae===0&&ne.needReadable&&((ne.highWaterMark!==0?ne.length>=ne.highWaterMark:ne.length>0)||ne.ended))return S("read: emitReadable",ne.length,ne.ended),ne.length===0&&ne.ended?ee(this):I(this),null;if(ae=B(ae,ne),ae===0&&ne.ended)return ne.length===0&&ee(this),null;var qe=ne.needReadable;S("need readable",qe),(ne.length===0||ne.length-ae<ne.highWaterMark)&&(qe=!0,S("length less than watermark",qe)),ne.ended||ne.reading?(qe=!1,S("reading or ended",qe)):qe&&(S("do read"),ne.reading=!0,ne.sync=!0,ne.length===0&&(ne.needReadable=!0),this._read(ne.highWaterMark),ne.sync=!1,ne.reading||(ae=B(Se,ne)));var Ie;return ae>0?Ie=ie(ae,ne):Ie=null,Ie===null?(ne.needReadable=ne.length<=ne.highWaterMark,ae=0):(ne.length-=ae,ne.awaitDrain=0),ne.length===0&&(ne.ended||(ne.needReadable=!0),Se!==ae&&ne.ended&&ee(this)),Ie!==null&&this.emit("data",Ie),Ie};function $(ae,ne){if(S("onEofChunk"),!ne.ended){if(ne.decoder){var Se=ne.decoder.end();Se&&Se.length&&(ne.buffer.push(Se),ne.length+=ne.objectMode?1:Se.length)}ne.ended=!0,ne.sync?I(ae):(ne.needReadable=!1,ne.emittedReadable||(ne.emittedReadable=!0,F(ae)))}}function I(ae){var ne=ae._readableState;S("emitReadable",ne.needReadable,ne.emittedReadable),ne.needReadable=!1,ne.emittedReadable||(S("emitReadable",ne.flowing),ne.emittedReadable=!0,process$1.nextTick(F,ae))}function F(ae){var ne=ae._readableState;S("emitReadable_",ne.destroyed,ne.length,ne.ended),!ne.destroyed&&(ne.length||ne.ended)&&(ae.emit("readable"),ne.emittedReadable=!1),ne.needReadable=!ne.flowing&&!ne.ended&&ne.length<=ne.highWaterMark,me(ae)}function j(ae,ne){ne.readingMore||(ne.readingMore=!0,process$1.nextTick(D,ae,ne))}function D(ae,ne){for(;!ne.reading&&!ne.ended&&(ne.length<ne.highWaterMark||ne.flowing&&ne.length===0);){var Se=ne.length;if(S("maybeReadMore read 0"),ae.read(0),Se===ne.length)break}ne.readingMore=!1}he.prototype._read=function(ae){X(this,new L("_read()"))},he.prototype.pipe=function(ae,ne){var Se=this,qe=this._readableState;switch(qe.pipesCount){case 0:qe.pipes=ae;break;case 1:qe.pipes=[qe.pipes,ae];break;default:qe.pipes.push(ae);break}qe.pipesCount+=1,S("pipe count=%d opts=%j",qe.pipesCount,ne);var Ie=(!ne||ne.end!==!1)&&ae!==process$1.stdout&&ae!==process$1.stderr,Oe=Ie?De:gt;qe.endEmitted?process$1.nextTick(Oe):Se.once("end",Oe),ae.on("unpipe",Ue);function Ue(rt,wt){S("onunpipe"),rt===Se&&wt&&wt.hasUnpiped===!1&&(wt.hasUnpiped=!0,Ye())}function De(){S("onend"),ae.end()}var $e=W(Se);ae.on("drain",$e);var je=!1;function Ye(){S("cleanup"),ae.removeListener("close",Ge),ae.removeListener("finish",ut),ae.removeListener("drain",$e),ae.removeListener("error",Je),ae.removeListener("unpipe",Ue),Se.removeListener("end",De),Se.removeListener("end",gt),Se.removeListener("data",st),je=!0,qe.awaitDrain&&(!ae._writableState||ae._writableState.needDrain)&&$e()}Se.on("data",st);function st(rt){S("ondata");var wt=ae.write(rt);S("dest.write",wt),wt===!1&&((qe.pipesCount===1&&qe.pipes===ae||qe.pipesCount>1&&be(qe.pipes,ae)!==-1)&&!je&&(S("false write response, pause",qe.awaitDrain),qe.awaitDrain++),Se.pause())}function Je(rt){S("onerror",rt),gt(),ae.removeListener("error",Je),f(ae,"error")===0&&X(ae,rt)}se(ae,"error",Je);function Ge(){ae.removeListener("finish",ut),gt()}ae.once("close",Ge);function ut(){S("onfinish"),ae.removeListener("close",Ge),gt()}ae.once("finish",ut);function gt(){S("unpipe"),Se.unpipe(ae)}return ae.emit("pipe",Se),qe.flowing||(S("pipe resume"),Se.resume()),ae};function W(ae){return function(){var Se=ae._readableState;S("pipeOnDrain",Se.awaitDrain),Se.awaitDrain&&Se.awaitDrain--,Se.awaitDrain===0&&f(ae,"data")&&(Se.flowing=!0,me(ae))}}he.prototype.unpipe=function(ae){var ne=this._readableState,Se={hasUnpiped:!1};if(ne.pipesCount===0)return this;if(ne.pipesCount===1)return ae&&ae!==ne.pipes?this:(ae||(ae=ne.pipes),ne.pipes=null,ne.pipesCount=0,ne.flowing=!1,ae&&ae.emit("unpipe",this,Se),this);if(!ae){var qe=ne.pipes,Ie=ne.pipesCount;ne.pipes=null,ne.pipesCount=0,ne.flowing=!1;for(var Oe=0;Oe<Ie;Oe++)qe[Oe].emit("unpipe",this,{hasUnpiped:!1});return this}var Ue=be(ne.pipes,ae);return Ue===-1?this:(ne.pipes.splice(Ue,1),ne.pipesCount-=1,ne.pipesCount===1&&(ne.pipes=ne.pipes[0]),ae.emit("unpipe",this,Se),this)},he.prototype.on=function(ae,ne){var Se=d.prototype.on.call(this,ae,ne),qe=this._readableState;return ae==="data"?(qe.readableListening=this.listenerCount("readable")>0,qe.flowing!==!1&&this.resume()):ae==="readable"&&!qe.endEmitted&&!qe.readableListening&&(qe.readableListening=qe.needReadable=!0,qe.flowing=!1,qe.emittedReadable=!1,S("on readable",qe.length,qe.reading),qe.length?I(this):qe.reading||process$1.nextTick(z,this)),Se},he.prototype.addListener=he.prototype.on,he.prototype.removeListener=function(ae,ne){var Se=d.prototype.removeListener.call(this,ae,ne);return ae==="readable"&&process$1.nextTick(R,this),Se},he.prototype.removeAllListeners=function(ae){var ne=d.prototype.removeAllListeners.apply(this,arguments);return(ae==="readable"||ae===void 0)&&process$1.nextTick(R,this),ne};function R(ae){var ne=ae._readableState;ne.readableListening=ae.listenerCount("readable")>0,ne.resumeScheduled&&!ne.paused?ne.flowing=!0:ae.listenerCount("data")>0&&ae.resume()}function z(ae){S("readable nexttick read 0"),ae.read(0)}he.prototype.resume=function(){var ae=this._readableState;return ae.flowing||(S("resume"),ae.flowing=!ae.readableListening,ye(this,ae)),ae.paused=!1,this};function ye(ae,ne){ne.resumeScheduled||(ne.resumeScheduled=!0,process$1.nextTick(Ce,ae,ne))}function Ce(ae,ne){S("resume",ne.reading),ne.reading||ae.read(0),ne.resumeScheduled=!1,ae.emit("resume"),me(ae),ne.flowing&&!ne.reading&&ae.read(0)}he.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function me(ae){var ne=ae._readableState;for(S("flow",ne.flowing);ne.flowing&&ae.read()!==null;);}he.prototype.wrap=function(ae){var ne=this,Se=this._readableState,qe=!1;ae.on("end",function(){if(S("wrapped end"),Se.decoder&&!Se.ended){var Ue=Se.decoder.end();Ue&&Ue.length&&ne.push(Ue)}ne.push(null)}),ae.on("data",function(Ue){if(S("wrapped data"),Se.decoder&&(Ue=Se.decoder.write(Ue)),!(Se.objectMode&&Ue==null)&&!(!Se.objectMode&&(!Ue||!Ue.length))){var De=ne.push(Ue);De||(qe=!0,ae.pause())}});for(var Ie in ae)this[Ie]===void 0&&typeof ae[Ie]=="function"&&(this[Ie]=(function(De){return function(){return ae[De].apply(ae,arguments)}})(Ie));for(var Oe=0;Oe<oe.length;Oe++)ae.on(oe[Oe],this.emit.bind(this,oe[Oe]));return this._read=function(Ue){S("wrapped _read",Ue),qe&&(qe=!1,ae.resume())},this},typeof Symbol=="function"&&(he.prototype[Symbol.asyncIterator]=function(){return H===void 0&&(H=requireAsync_iterator()),H(this)}),Object.defineProperty(he.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(he.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(he.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ne){this._readableState&&(this._readableState.flowing=ne)}}),he._fromList=ie,Object.defineProperty(he.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ie(ae,ne){if(ne.length===0)return null;var Se;return ne.objectMode?Se=ne.buffer.shift():!ae||ae>=ne.length?(ne.decoder?Se=ne.buffer.join(""):ne.buffer.length===1?Se=ne.buffer.first():Se=ne.buffer.concat(ne.length),ne.buffer.clear()):Se=ne.buffer.consume(ae,ne.decoder),Se}function ee(ae){var ne=ae._readableState;S("endReadable",ne.endEmitted),ne.endEmitted||(ne.ended=!0,process$1.nextTick(pe,ne,ae))}function pe(ae,ne){if(S("endReadableNT",ae.endEmitted,ae.length),!ae.endEmitted&&ae.length===0&&(ae.endEmitted=!0,ne.readable=!1,ne.emit("end"),ae.autoDestroy)){var Se=ne._writableState;(!Se||Se.autoDestroy&&Se.finished)&&ne.destroy()}}typeof Symbol=="function"&&(he.from=function(ae,ne){return V===void 0&&(V=requireFromBrowser()),V(he,ae,ne)});function be(ae,ne){for(var Se=0,qe=ae.length;Se<qe;Se++)if(ae[Se]===ne)return Se;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=x;var r=requireErrorsBrowser().codes,f=r.ERR_METHOD_NOT_IMPLEMENTED,d=r.ERR_MULTIPLE_CALLBACK,m=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,v=r.ERR_TRANSFORM_WITH_LENGTH_0,g=require_stream_duplex$1();requireInherits_browser()(x,g);function w(b,C){var E=this._transformState;E.transforming=!1;var M=E.writecb;if(M===null)return this.emit("error",new d);E.writechunk=null,E.writecb=null,C!=null&&this.push(C),M(b);var A=this._readableState;A.reading=!1,(A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}function x(b){if(!(this instanceof x))return new x(b);g.call(this,b),this._transformState={afterTransform:w.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",S)}function S(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(C,E){_(b,C,E)}):_(this,null,null)}x.prototype.push=function(b,C){return this._transformState.needTransform=!1,g.prototype.push.call(this,b,C)},x.prototype._transform=function(b,C,E){E(new f("_transform()"))},x.prototype._write=function(b,C,E){var M=this._transformState;if(M.writecb=E,M.writechunk=b,M.writeencoding=C,!M.transforming){var A=this._readableState;(M.needTransform||A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}},x.prototype._read=function(b){var C=this._transformState;C.writechunk!==null&&!C.transforming?(C.transforming=!0,this._transform(C.writechunk,C.writeencoding,C.afterTransform)):C.needTransform=!0},x.prototype._destroy=function(b,C){g.prototype._destroy.call(this,b,function(E){C(E)})};function _(b,C,E){if(C)return b.emit("error",C);if(E!=null&&b.push(E),b._writableState.length)throw new v;if(b._transformState.transforming)throw new m;return b.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=f;var r=require_stream_transform$1();requireInherits_browser()(f,r);function f(d){if(!(this instanceof f))return new f(d);r.call(this,d)}return f.prototype._transform=function(d,m,v){v(null,d)},_stream_passthrough$1}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var r;function f(E){var M=!1;return function(){M||(M=!0,E.apply(void 0,arguments))}}var d=requireErrorsBrowser().codes,m=d.ERR_MISSING_ARGS,v=d.ERR_STREAM_DESTROYED;function g(E){if(E)throw E}function w(E){return E.setHeader&&typeof E.abort=="function"}function x(E,M,A,T){T=f(T);var L=!1;E.on("close",function(){L=!0}),r===void 0&&(r=requireEndOfStream()),r(E,{readable:M,writable:A},function(N){if(N)return T(N);L=!0,T()});var O=!1;return function(N){if(!L&&!O){if(O=!0,w(E))return E.abort();if(typeof E.destroy=="function")return E.destroy();T(N||new v("pipe"))}}}function S(E){E()}function _(E,M){return E.pipe(M)}function b(E){return!E.length||typeof E[E.length-1]!="function"?g:E.pop()}function C(){for(var E=arguments.length,M=new Array(E),A=0;A<E;A++)M[A]=arguments[A];var T=b(M);if(Array.isArray(M[0])&&(M=M[0]),M.length<2)throw new m("streams");var L,O=M.map(function(N,H){var V=H<M.length-1,X=H>0;return x(N,V,X,function(oe){L||(L=oe),oe&&O.forEach(S),!V&&(O.forEach(S),T(L))})});return M.reduce(_)}return pipeline_1=C,pipeline_1}var hasRequiredReadableBrowser$1;function requireReadableBrowser$1(){return hasRequiredReadableBrowser$1||(hasRequiredReadableBrowser$1=1,(function(r,f){f=r.exports=require_stream_readable$1(),f.Stream=f,f.Readable=f,f.Writable=require_stream_writable$1(),f.Duplex=require_stream_duplex$1(),f.Transform=require_stream_transform$1(),f.PassThrough=require_stream_passthrough$1(),f.finished=requireEndOfStream(),f.pipeline=requirePipeline()})(readableBrowser$1,readableBrowser$1.exports)),readableBrowser$1.exports}var hashBase$2,hasRequiredHashBase$2;function requireHashBase$2(){if(hasRequiredHashBase$2)return hashBase$2;hasRequiredHashBase$2=1;var r=requireSafeBuffer$1().Buffer,f=requireReadableBrowser$1().Transform,d=requireInherits_browser();function m(g,w){if(!r.isBuffer(g)&&typeof g!="string")throw new TypeError(w+" must be a string or a buffer")}function v(g){f.call(this),this._block=r.allocUnsafe(g),this._blockSize=g,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return d(v,f),v.prototype._transform=function(g,w,x){var S=null;try{this.update(g,w)}catch(_){S=_}x(S)},v.prototype._flush=function(g){var w=null;try{this.push(this.digest())}catch(x){w=x}g(w)},v.prototype.update=function(g,w){if(m(g,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(g)||(g=r.from(g,w));for(var x=this._block,S=0;this._blockOffset+g.length-S>=this._blockSize;){for(var _=this._blockOffset;_<this._blockSize;)x[_++]=g[S++];this._update(),this._blockOffset=0}for(;S<g.length;)x[this._blockOffset++]=g[S++];for(var b=0,C=g.length*8;C>0;++b)this._length[b]+=C,C=this._length[b]/4294967296|0,C>0&&(this._length[b]-=4294967296*C);return this},v.prototype._update=function(){throw new Error("_update is not implemented")},v.prototype.digest=function(g){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var w=this._digest();g!==void 0&&(w=w.toString(g)),this._block.fill(0),this._blockOffset=0;for(var x=0;x<4;++x)this._length[x]=0;return w},v.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$2=v,hashBase$2}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var r=requireInherits_browser(),f=requireHashBase$2(),d=requireSafeBuffer$1().Buffer,m=new Array(16);function v(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}r(v,f),v.prototype._update=function(){for(var b=m,C=0;C<16;++C)b[C]=this._block.readInt32LE(C*4);var E=this._a,M=this._b,A=this._c,T=this._d;E=w(E,M,A,T,b[0],3614090360,7),T=w(T,E,M,A,b[1],3905402710,12),A=w(A,T,E,M,b[2],606105819,17),M=w(M,A,T,E,b[3],3250441966,22),E=w(E,M,A,T,b[4],4118548399,7),T=w(T,E,M,A,b[5],1200080426,12),A=w(A,T,E,M,b[6],2821735955,17),M=w(M,A,T,E,b[7],4249261313,22),E=w(E,M,A,T,b[8],1770035416,7),T=w(T,E,M,A,b[9],2336552879,12),A=w(A,T,E,M,b[10],4294925233,17),M=w(M,A,T,E,b[11],2304563134,22),E=w(E,M,A,T,b[12],1804603682,7),T=w(T,E,M,A,b[13],4254626195,12),A=w(A,T,E,M,b[14],2792965006,17),M=w(M,A,T,E,b[15],1236535329,22),E=x(E,M,A,T,b[1],4129170786,5),T=x(T,E,M,A,b[6],3225465664,9),A=x(A,T,E,M,b[11],643717713,14),M=x(M,A,T,E,b[0],3921069994,20),E=x(E,M,A,T,b[5],3593408605,5),T=x(T,E,M,A,b[10],38016083,9),A=x(A,T,E,M,b[15],3634488961,14),M=x(M,A,T,E,b[4],3889429448,20),E=x(E,M,A,T,b[9],568446438,5),T=x(T,E,M,A,b[14],3275163606,9),A=x(A,T,E,M,b[3],4107603335,14),M=x(M,A,T,E,b[8],1163531501,20),E=x(E,M,A,T,b[13],2850285829,5),T=x(T,E,M,A,b[2],4243563512,9),A=x(A,T,E,M,b[7],1735328473,14),M=x(M,A,T,E,b[12],2368359562,20),E=S(E,M,A,T,b[5],4294588738,4),T=S(T,E,M,A,b[8],2272392833,11),A=S(A,T,E,M,b[11],1839030562,16),M=S(M,A,T,E,b[14],4259657740,23),E=S(E,M,A,T,b[1],2763975236,4),T=S(T,E,M,A,b[4],1272893353,11),A=S(A,T,E,M,b[7],4139469664,16),M=S(M,A,T,E,b[10],3200236656,23),E=S(E,M,A,T,b[13],681279174,4),T=S(T,E,M,A,b[0],3936430074,11),A=S(A,T,E,M,b[3],3572445317,16),M=S(M,A,T,E,b[6],76029189,23),E=S(E,M,A,T,b[9],3654602809,4),T=S(T,E,M,A,b[12],3873151461,11),A=S(A,T,E,M,b[15],530742520,16),M=S(M,A,T,E,b[2],3299628645,23),E=_(E,M,A,T,b[0],4096336452,6),T=_(T,E,M,A,b[7],1126891415,10),A=_(A,T,E,M,b[14],2878612391,15),M=_(M,A,T,E,b[5],4237533241,21),E=_(E,M,A,T,b[12],1700485571,6),T=_(T,E,M,A,b[3],2399980690,10),A=_(A,T,E,M,b[10],4293915773,15),M=_(M,A,T,E,b[1],2240044497,21),E=_(E,M,A,T,b[8],1873313359,6),T=_(T,E,M,A,b[15],4264355552,10),A=_(A,T,E,M,b[6],2734768916,15),M=_(M,A,T,E,b[13],1309151649,21),E=_(E,M,A,T,b[4],4149444226,6),T=_(T,E,M,A,b[11],3174756917,10),A=_(A,T,E,M,b[2],718787259,15),M=_(M,A,T,E,b[9],3951481745,21),this._a=this._a+E|0,this._b=this._b+M|0,this._c=this._c+A|0,this._d=this._d+T|0},v.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 b=d.allocUnsafe(16);return b.writeInt32LE(this._a,0),b.writeInt32LE(this._b,4),b.writeInt32LE(this._c,8),b.writeInt32LE(this._d,12),b};function g(b,C){return b<<C|b>>>32-C}function w(b,C,E,M,A,T,L){return g(b+(C&E|~C&M)+A+T|0,L)+C|0}function x(b,C,E,M,A,T,L){return g(b+(C&M|E&~M)+A+T|0,L)+C|0}function S(b,C,E,M,A,T,L){return g(b+(C^E^M)+A+T|0,L)+C|0}function _(b,C,E,M,A,T,L){return g(b+(E^(C|~M))+A+T|0,L)+C|0}return md5_js=v,md5_js}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var r=requireSafeBuffer$1().Buffer,f=requireReadableBrowser$1().Transform,d=requireInherits_browser();function m(g,w){if(!r.isBuffer(g)&&typeof g!="string")throw new TypeError(w+" must be a string or a buffer")}function v(g){f.call(this),this._block=r.allocUnsafe(g),this._blockSize=g,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return d(v,f),v.prototype._transform=function(g,w,x){var S=null;try{this.update(g,w)}catch(_){S=_}x(S)},v.prototype._flush=function(g){var w=null;try{this.push(this.digest())}catch(x){w=x}g(w)},v.prototype.update=function(g,w){if(m(g,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(g)||(g=r.from(g,w));for(var x=this._block,S=0;this._blockOffset+g.length-S>=this._blockSize;){for(var _=this._blockOffset;_<this._blockSize;)x[_++]=g[S++];this._update(),this._blockOffset=0}for(;S<g.length;)x[this._blockOffset++]=g[S++];for(var b=0,C=g.length*8;C>0;++b)this._length[b]+=C,C=this._length[b]/4294967296|0,C>0&&(this._length[b]-=4294967296*C);return this},v.prototype._update=function(){throw new Error("_update is not implemented")},v.prototype.digest=function(g){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var w=this._digest();g!==void 0&&(w=w.toString(g)),this._block.fill(0),this._blockOffset=0;for(var x=0;x<4;++x)this._length[x]=0;return w},v.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=v,hashBase$1}var ripemd160$1,hasRequiredRipemd160$1;function requireRipemd160$1(){if(hasRequiredRipemd160$1)return ripemd160$1;hasRequiredRipemd160$1=1;var r=requireDist().Buffer,f=requireInherits_browser(),d=requireHashBase$1(),m=new Array(16),v=[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],g=[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],w=[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],x=[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],S=[0,1518500249,1859775393,2400959708,2840853838],_=[1352829926,1548603684,1836072691,2053994217,0];function b(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}f(b,d),b.prototype._update=function(){for(var O=m,N=0;N<16;++N)O[N]=this._block.readInt32LE(N*4);for(var H=this._a|0,V=this._b|0,X=this._c|0,oe=this._d|0,se=this._e|0,de=this._a|0,he=this._b|0,we=this._c|0,te=this._d|0,k=this._e|0,q=0;q<80;q+=1){var y,B;q<16?(y=E(H,V,X,oe,se,O[v[q]],S[0],w[q]),B=L(de,he,we,te,k,O[g[q]],_[0],x[q])):q<32?(y=M(H,V,X,oe,se,O[v[q]],S[1],w[q]),B=T(de,he,we,te,k,O[g[q]],_[1],x[q])):q<48?(y=A(H,V,X,oe,se,O[v[q]],S[2],w[q]),B=A(de,he,we,te,k,O[g[q]],_[2],x[q])):q<64?(y=T(H,V,X,oe,se,O[v[q]],S[3],w[q]),B=M(de,he,we,te,k,O[g[q]],_[3],x[q])):(y=L(H,V,X,oe,se,O[v[q]],S[4],w[q]),B=E(de,he,we,te,k,O[g[q]],_[4],x[q])),H=se,se=oe,oe=C(X,10),X=V,V=y,de=k,k=te,te=C(we,10),we=he,he=B}var $=this._b+X+te|0;this._b=this._c+oe+k|0,this._c=this._d+se+de|0,this._d=this._e+H+he|0,this._e=this._a+V+we|0,this._a=$},b.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 O=r.alloc?r.alloc(20):new r(20);return O.writeInt32LE(this._a,0),O.writeInt32LE(this._b,4),O.writeInt32LE(this._c,8),O.writeInt32LE(this._d,12),O.writeInt32LE(this._e,16),O};function C(O,N){return O<<N|O>>>32-N}function E(O,N,H,V,X,oe,se,de){return C(O+(N^H^V)+oe+se|0,de)+X|0}function M(O,N,H,V,X,oe,se,de){return C(O+(N&H|~N&V)+oe+se|0,de)+X|0}function A(O,N,H,V,X,oe,se,de){return C(O+((N|~H)^V)+oe+se|0,de)+X|0}function T(O,N,H,V,X,oe,se,de){return C(O+(N&V|H&~V)+oe+se|0,de)+X|0}function L(O,N,H,V,X,oe,se,de){return C(O+(N^(H|~V))+oe+se|0,de)+X|0}return ripemd160$1=b,ripemd160$1}var sha_js={exports:{}},isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var r={}.toString;return isarray$1=Array.isArray||function(f){return r.call(f)=="[object Array]"},isarray$1}var typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var r=requireType(),f=requireCallBound(),d=f("TypedArray.prototype.buffer",!0),m=requireIsTypedArray();return typedArrayBuffer=d||function(g){if(!m(g))throw new r("Not a Typed Array");return g.buffer},typedArrayBuffer}var toBuffer,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer;hasRequiredToBuffer$1=1;var r=requireSafeBuffer$1().Buffer,f=requireIsarray$1(),d=requireTypedArrayBuffer(),m=ArrayBuffer.isView||function(S){try{return d(S),!0}catch{return!1}},v=typeof Uint8Array<"u",g=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",w=g&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);return toBuffer=function(S,_){if(S instanceof r)return S;if(typeof S=="string")return r.from(S,_);if(g&&m(S)){if(S.byteLength===0)return r.alloc(0);if(w){var b=r.from(S.buffer,S.byteOffset,S.byteLength);if(b.byteLength===S.byteLength)return b}var C=S instanceof Uint8Array?S:new Uint8Array(S.buffer,S.byteOffset,S.byteLength),E=r.from(C);if(E.length===S.byteLength)return E}if(v&&S instanceof Uint8Array)return r.from(S);var M=f(S);if(M)for(var A=0;A<S.length;A+=1){var T=S[A];if(typeof T!="number"||T<0||T>255||~~T!==T)throw new RangeError("Array items must be numbers in the range 0-255.")}if(M||r.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S))return r.from(S);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer}var hash$1,hasRequiredHash$1;function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var r=requireSafeBuffer$1().Buffer,f=requireToBuffer$1();function d(m,v){this._block=r.alloc(m),this._finalSize=v,this._blockSize=m,this._len=0}return d.prototype.update=function(m,v){m=f(m,v||"utf8");for(var g=this._block,w=this._blockSize,x=m.length,S=this._len,_=0;_<x;){for(var b=S%w,C=Math.min(x-_,w-b),E=0;E<C;E++)g[b+E]=m[_+E];S+=C,_+=C,S%w===0&&this._update(g)}return this._len+=x,this},d.prototype.digest=function(m){var v=this._len%this._blockSize;this._block[v]=128,this._block.fill(0,v+1),v>=this._finalSize&&(this._update(this._block),this._block.fill(0));var g=this._len*8;if(g<=4294967295)this._block.writeUInt32BE(g,this._blockSize-4);else{var w=(g&4294967295)>>>0,x=(g-w)/4294967296;this._block.writeUInt32BE(x,this._blockSize-8),this._block.writeUInt32BE(w,this._blockSize-4)}this._update(this._block);var S=this._hash();return m?S.toString(m):S},d.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=d,hash$1}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[1518500249,1859775393,-1894007588,-899497514],v=new Array(80);function g(){this.init(),this._w=v,f.call(this,64,56)}r(g,f),g.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function w(_){return _<<5|_>>>27}function x(_){return _<<30|_>>>2}function S(_,b,C,E){return _===0?b&C|~b&E:_===2?b&C|b&E|C&E:b^C^E}return g.prototype._update=function(_){for(var b=this._w,C=this._a|0,E=this._b|0,M=this._c|0,A=this._d|0,T=this._e|0,L=0;L<16;++L)b[L]=_.readInt32BE(L*4);for(;L<80;++L)b[L]=b[L-3]^b[L-8]^b[L-14]^b[L-16];for(var O=0;O<80;++O){var N=~~(O/20),H=w(C)+S(N,E,M,A)+T+b[O]+m[N]|0;T=A,A=M,M=x(E),E=C,C=H}this._a=C+this._a|0,this._b=E+this._b|0,this._c=M+this._c|0,this._d=A+this._d|0,this._e=T+this._e|0},g.prototype._hash=function(){var _=d.allocUnsafe(20);return _.writeInt32BE(this._a|0,0),_.writeInt32BE(this._b|0,4),_.writeInt32BE(this._c|0,8),_.writeInt32BE(this._d|0,12),_.writeInt32BE(this._e|0,16),_},sha$1=g,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[1518500249,1859775393,-1894007588,-899497514],v=new Array(80);function g(){this.init(),this._w=v,f.call(this,64,56)}r(g,f),g.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function w(b){return b<<1|b>>>31}function x(b){return b<<5|b>>>27}function S(b){return b<<30|b>>>2}function _(b,C,E,M){return b===0?C&E|~C&M:b===2?C&E|C&M|E&M:C^E^M}return g.prototype._update=function(b){for(var C=this._w,E=this._a|0,M=this._b|0,A=this._c|0,T=this._d|0,L=this._e|0,O=0;O<16;++O)C[O]=b.readInt32BE(O*4);for(;O<80;++O)C[O]=w(C[O-3]^C[O-8]^C[O-14]^C[O-16]);for(var N=0;N<80;++N){var H=~~(N/20),V=x(E)+_(H,M,A,T)+L+C[N]+m[H]|0;L=T,T=A,A=S(M),M=E,E=V}this._a=E+this._a|0,this._b=M+this._b|0,this._c=A+this._c|0,this._d=T+this._d|0,this._e=L+this._e|0},g.prototype._hash=function(){var b=d.allocUnsafe(20);return b.writeInt32BE(this._a|0,0),b.writeInt32BE(this._b|0,4),b.writeInt32BE(this._c|0,8),b.writeInt32BE(this._d|0,12),b.writeInt32BE(this._e|0,16),b},sha1=g,sha1}var sha256$1,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[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],v=new Array(64);function g(){this.init(),this._w=v,f.call(this,64,56)}r(g,f),g.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 w(E,M,A){return A^E&(M^A)}function x(E,M,A){return E&M|A&(E|M)}function S(E){return(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10)}function _(E){return(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7)}function b(E){return(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3}function C(E){return(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10}return g.prototype._update=function(E){for(var M=this._w,A=this._a|0,T=this._b|0,L=this._c|0,O=this._d|0,N=this._e|0,H=this._f|0,V=this._g|0,X=this._h|0,oe=0;oe<16;++oe)M[oe]=E.readInt32BE(oe*4);for(;oe<64;++oe)M[oe]=C(M[oe-2])+M[oe-7]+b(M[oe-15])+M[oe-16]|0;for(var se=0;se<64;++se){var de=X+_(N)+w(N,H,V)+m[se]+M[se]|0,he=S(A)+x(A,T,L)|0;X=V,V=H,H=N,N=O+de|0,O=L,L=T,T=A,A=de+he|0}this._a=A+this._a|0,this._b=T+this._b|0,this._c=L+this._c|0,this._d=O+this._d|0,this._e=N+this._e|0,this._f=H+this._f|0,this._g=V+this._g|0,this._h=X+this._h|0},g.prototype._hash=function(){var E=d.allocUnsafe(32);return E.writeInt32BE(this._a,0),E.writeInt32BE(this._b,4),E.writeInt32BE(this._c,8),E.writeInt32BE(this._d,12),E.writeInt32BE(this._e,16),E.writeInt32BE(this._f,20),E.writeInt32BE(this._g,24),E.writeInt32BE(this._h,28),E},sha256$1=g,sha256$1}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var r=requireInherits_browser(),f=requireSha256(),d=requireHash$1(),m=requireSafeBuffer$1().Buffer,v=new Array(64);function g(){this.init(),this._w=v,d.call(this,64,56)}return r(g,f),g.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},g.prototype._hash=function(){var w=m.allocUnsafe(28);return w.writeInt32BE(this._a,0),w.writeInt32BE(this._b,4),w.writeInt32BE(this._c,8),w.writeInt32BE(this._d,12),w.writeInt32BE(this._e,16),w.writeInt32BE(this._f,20),w.writeInt32BE(this._g,24),w},sha224$1=g,sha224$1}var sha512$1,hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[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],v=new Array(160);function g(){this.init(),this._w=v,f.call(this,128,112)}r(g,f),g.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 w(T,L,O){return O^T&(L^O)}function x(T,L,O){return T&L|O&(T|L)}function S(T,L){return(T>>>28|L<<4)^(L>>>2|T<<30)^(L>>>7|T<<25)}function _(T,L){return(T>>>14|L<<18)^(T>>>18|L<<14)^(L>>>9|T<<23)}function b(T,L){return(T>>>1|L<<31)^(T>>>8|L<<24)^T>>>7}function C(T,L){return(T>>>1|L<<31)^(T>>>8|L<<24)^(T>>>7|L<<25)}function E(T,L){return(T>>>19|L<<13)^(L>>>29|T<<3)^T>>>6}function M(T,L){return(T>>>19|L<<13)^(L>>>29|T<<3)^(T>>>6|L<<26)}function A(T,L){return T>>>0<L>>>0?1:0}return g.prototype._update=function(T){for(var L=this._w,O=this._ah|0,N=this._bh|0,H=this._ch|0,V=this._dh|0,X=this._eh|0,oe=this._fh|0,se=this._gh|0,de=this._hh|0,he=this._al|0,we=this._bl|0,te=this._cl|0,k=this._dl|0,q=this._el|0,y=this._fl|0,B=this._gl|0,$=this._hl|0,I=0;I<32;I+=2)L[I]=T.readInt32BE(I*4),L[I+1]=T.readInt32BE(I*4+4);for(;I<160;I+=2){var F=L[I-30],j=L[I-30+1],D=b(F,j),W=C(j,F);F=L[I-4],j=L[I-4+1];var R=E(F,j),z=M(j,F),ye=L[I-14],Ce=L[I-14+1],me=L[I-32],ie=L[I-32+1],ee=W+Ce|0,pe=D+ye+A(ee,W)|0;ee=ee+z|0,pe=pe+R+A(ee,z)|0,ee=ee+ie|0,pe=pe+me+A(ee,ie)|0,L[I]=pe,L[I+1]=ee}for(var be=0;be<160;be+=2){pe=L[be],ee=L[be+1];var ae=x(O,N,H),ne=x(he,we,te),Se=S(O,he),qe=S(he,O),Ie=_(X,q),Oe=_(q,X),Ue=m[be],De=m[be+1],$e=w(X,oe,se),je=w(q,y,B),Ye=$+Oe|0,st=de+Ie+A(Ye,$)|0;Ye=Ye+je|0,st=st+$e+A(Ye,je)|0,Ye=Ye+De|0,st=st+Ue+A(Ye,De)|0,Ye=Ye+ee|0,st=st+pe+A(Ye,ee)|0;var Je=qe+ne|0,Ge=Se+ae+A(Je,qe)|0;de=se,$=B,se=oe,B=y,oe=X,y=q,q=k+Ye|0,X=V+st+A(q,k)|0,V=H,k=te,H=N,te=we,N=O,we=he,he=Ye+Je|0,O=st+Ge+A(he,Ye)|0}this._al=this._al+he|0,this._bl=this._bl+we|0,this._cl=this._cl+te|0,this._dl=this._dl+k|0,this._el=this._el+q|0,this._fl=this._fl+y|0,this._gl=this._gl+B|0,this._hl=this._hl+$|0,this._ah=this._ah+O+A(this._al,he)|0,this._bh=this._bh+N+A(this._bl,we)|0,this._ch=this._ch+H+A(this._cl,te)|0,this._dh=this._dh+V+A(this._dl,k)|0,this._eh=this._eh+X+A(this._el,q)|0,this._fh=this._fh+oe+A(this._fl,y)|0,this._gh=this._gh+se+A(this._gl,B)|0,this._hh=this._hh+de+A(this._hl,$)|0},g.prototype._hash=function(){var T=d.allocUnsafe(64);function L(O,N,H){T.writeInt32BE(O,H),T.writeInt32BE(N,H+4)}return L(this._ah,this._al,0),L(this._bh,this._bl,8),L(this._ch,this._cl,16),L(this._dh,this._dl,24),L(this._eh,this._el,32),L(this._fh,this._fl,40),L(this._gh,this._gl,48),L(this._hh,this._hl,56),T},sha512$1=g,sha512$1}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var r=requireInherits_browser(),f=requireSha512(),d=requireHash$1(),m=requireSafeBuffer$1().Buffer,v=new Array(160);function g(){this.init(),this._w=v,d.call(this,128,112)}return r(g,f),g.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},g.prototype._hash=function(){var w=m.allocUnsafe(48);function x(S,_,b){w.writeInt32BE(S,b),w.writeInt32BE(_,b+4)}return x(this._ah,this._al,0),x(this._bh,this._bl,8),x(this._ch,this._cl,16),x(this._dh,this._dl,24),x(this._eh,this._el,32),x(this._fh,this._fl,40),w},sha384$1=g,sha384$1}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(function(r){r.exports=function(d){var m=d.toLowerCase(),v=r.exports[m];if(!v)throw new Error(m+" is not supported (we accept pull requests)");return new v},r.exports.sha=requireSha$1(),r.exports.sha1=requireSha1(),r.exports.sha224=requireSha224(),r.exports.sha256=requireSha256(),r.exports.sha384=requireSha384(),r.exports.sha512=requireSha512()})(sha_js)),sha_js.exports}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=d;var r=requireEvents().EventEmitter,f=requireInherits_browser();f(d,r),d.Readable=require_stream_readable$1(),d.Writable=require_stream_writable$1(),d.Duplex=require_stream_duplex$1(),d.Transform=require_stream_transform$1(),d.PassThrough=require_stream_passthrough$1(),d.finished=requireEndOfStream(),d.pipeline=requirePipeline(),d.Stream=d;function d(){r.call(this)}return d.prototype.pipe=function(m,v){var g=this;function w(M){m.writable&&m.write(M)===!1&&g.pause&&g.pause()}g.on("data",w);function x(){g.readable&&g.resume&&g.resume()}m.on("drain",x),!m._isStdio&&(!v||v.end!==!1)&&(g.on("end",_),g.on("close",b));var S=!1;function _(){S||(S=!0,m.end())}function b(){S||(S=!0,typeof m.destroy=="function"&&m.destroy())}function C(M){if(E(),r.listenerCount(this,"error")===0)throw M}g.on("error",C),m.on("error",C);function E(){g.removeListener("data",w),m.removeListener("drain",x),g.removeListener("end",_),g.removeListener("close",b),g.removeListener("error",C),m.removeListener("error",C),g.removeListener("end",E),g.removeListener("close",E),m.removeListener("close",E)}return g.on("end",E),g.on("close",E),m.on("close",E),m.emit("pipe",g),m},streamBrowserify}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var r=requireSafeBuffer$1().Buffer,f=requireStreamBrowserify().Transform,d=requireString_decoder().StringDecoder,m=requireInherits_browser();function v(S){f.call(this),this.hashMode=typeof S=="string",this.hashMode?this[S]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}m(v,f);var g=typeof Uint8Array<"u",w=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);function x(S,_){if(S instanceof r)return S;if(typeof S=="string")return r.from(S,_);if(w&&ArrayBuffer.isView(S)){if(S.byteLength===0)return r.alloc(0);var b=r.from(S.buffer,S.byteOffset,S.byteLength);if(b.byteLength===S.byteLength)return b}if(g&&S instanceof Uint8Array||r.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S))return r.from(S);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return v.prototype.update=function(S,_,b){var C=x(S,_),E=this._update(C);return this.hashMode?this:(b&&(E=this._toString(E,b)),E)},v.prototype.setAutoPadding=function(){},v.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},v.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},v.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},v.prototype._transform=function(S,_,b){var C;try{this.hashMode?this._update(S):this.push(this._update(S))}catch(E){C=E}finally{b(C)}},v.prototype._flush=function(S){var _;try{this.push(this.__final())}catch(b){_=b}S(_)},v.prototype._finalOrDigest=function(S){var _=this.__final()||r.alloc(0);return S&&(_=this._toString(_,S,!0)),_},v.prototype._toString=function(S,_,b){if(this._decoder||(this._decoder=new d(_),this._encoding=_),this._encoding!==_)throw new Error("can’t switch encodings");var C=this._decoder.write(S);return b&&(C+=this._decoder.end()),C},cipherBase=v,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var r=requireInherits_browser(),f=requireMd5_js(),d=requireRipemd160$1(),m=requireSha_js(),v=requireCipherBase();function g(w){v.call(this,"digest"),this._hash=w}return r(g,v),g.prototype._update=function(w){this._hash.update(w)},g.prototype._final=function(){return this._hash.digest()},browser$9=function(x){return x=x.toLowerCase(),x==="md5"?new f:x==="rmd160"||x==="ripemd160"?new d:new g(m(x))},browser$9}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var r=requireInherits_browser(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),m=f.alloc(128),v=64;function g(w,x){d.call(this,"digest"),typeof x=="string"&&(x=f.from(x)),this._alg=w,this._key=x,x.length>v?x=w(x):x.length<v&&(x=f.concat([x,m],v));for(var S=this._ipad=f.allocUnsafe(v),_=this._opad=f.allocUnsafe(v),b=0;b<v;b++)S[b]=x[b]^54,_[b]=x[b]^92;this._hash=[S]}return r(g,d),g.prototype._update=function(w){this._hash.push(w)},g.prototype._final=function(){var w=this._alg(f.concat(this._hash));return this._alg(f.concat([this._opad,w]))},legacy=g,legacy}var md5$1,hasRequiredMd5$1;function requireMd5$1(){if(hasRequiredMd5$1)return md5$1;hasRequiredMd5$1=1;var r=requireMd5_js();return md5$1=function(f){return new r().update(f).digest()},md5$1}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var r=requireInherits_browser(),f=requireLegacy(),d=requireCipherBase(),m=requireSafeBuffer$1().Buffer,v=requireMd5$1(),g=requireRipemd160$1(),w=requireSha_js(),x=m.alloc(128);function S(_,b){d.call(this,"digest"),typeof b=="string"&&(b=m.from(b));var C=_==="sha512"||_==="sha384"?128:64;if(this._alg=_,this._key=b,b.length>C){var E=_==="rmd160"?new g:w(_);b=E.update(b).digest()}else b.length<C&&(b=m.concat([b,x],C));for(var M=this._ipad=m.allocUnsafe(C),A=this._opad=m.allocUnsafe(C),T=0;T<C;T++)M[T]=b[T]^54,A[T]=b[T]^92;this._hash=_==="rmd160"?new g:w(_),this._hash.update(M)}return r(S,d),S.prototype._update=function(_){this._hash.update(_)},S.prototype._final=function(){var _=this._hash.digest(),b=this._alg==="rmd160"?new g:w(this._alg);return b.update(this._opad).update(_).digest()},browser$8=function(b,C){return b=b.toLowerCase(),b==="rmd160"||b==="ripemd160"?new S("rmd160",C):b==="md5"?new f(v,C):new S(b,C)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},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={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"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,sha224,sha384,sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"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,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var r=Math.pow(2,30)-1;return precondition=function(f,d){if(typeof f!="number")throw new TypeError("Iterations not a number");if(f<0)throw new TypeError("Bad iterations");if(typeof d!="number")throw new TypeError("Key length not a number");if(d<0||d>r||d!==d)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var r;if(commonjsGlobal.process&&commonjsGlobal.process.browser)r="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var f=parseInt(process$1.version.split(".")[0].slice(1),10);r=f>=6?"utf-8":"binary"}else r="utf-8";return defaultEncoding_1=r,defaultEncoding_1}var makeHash,hasRequiredMakeHash;function requireMakeHash(){if(hasRequiredMakeHash)return makeHash;hasRequiredMakeHash=1;var r=4,f=new Buffer(r);f.fill(0);var d=8,m=16;function v(g){if(g.length%r!==0){var w=g.length+(r-g.length%r);g=Buffer.concat([g,f],w)}for(var x=new Array(g.length>>>2),S=0,_=0;S<g.length;S+=r,_++)x[_]=g.readInt32LE(S);return x}return makeHash=function(w,x){var S=x(v(w),w.length*d);w=new Buffer(m);for(var _=0;_<S.length;_++)w.writeInt32LE(S[_],_<<2,!0);return w},makeHash}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var r=requireMakeHash();function f(_,b){_[b>>5]|=128<<b%32,_[(b+64>>>9<<4)+14]=b;for(var C=1732584193,E=-271733879,M=-1732584194,A=271733878,T=0;T<_.length;T+=16){var L=C,O=E,N=M,H=A;C=m(C,E,M,A,_[T+0],7,-680876936),A=m(A,C,E,M,_[T+1],12,-389564586),M=m(M,A,C,E,_[T+2],17,606105819),E=m(E,M,A,C,_[T+3],22,-1044525330),C=m(C,E,M,A,_[T+4],7,-176418897),A=m(A,C,E,M,_[T+5],12,1200080426),M=m(M,A,C,E,_[T+6],17,-1473231341),E=m(E,M,A,C,_[T+7],22,-45705983),C=m(C,E,M,A,_[T+8],7,1770035416),A=m(A,C,E,M,_[T+9],12,-1958414417),M=m(M,A,C,E,_[T+10],17,-42063),E=m(E,M,A,C,_[T+11],22,-1990404162),C=m(C,E,M,A,_[T+12],7,1804603682),A=m(A,C,E,M,_[T+13],12,-40341101),M=m(M,A,C,E,_[T+14],17,-1502002290),E=m(E,M,A,C,_[T+15],22,1236535329),C=v(C,E,M,A,_[T+1],5,-165796510),A=v(A,C,E,M,_[T+6],9,-1069501632),M=v(M,A,C,E,_[T+11],14,643717713),E=v(E,M,A,C,_[T+0],20,-373897302),C=v(C,E,M,A,_[T+5],5,-701558691),A=v(A,C,E,M,_[T+10],9,38016083),M=v(M,A,C,E,_[T+15],14,-660478335),E=v(E,M,A,C,_[T+4],20,-405537848),C=v(C,E,M,A,_[T+9],5,568446438),A=v(A,C,E,M,_[T+14],9,-1019803690),M=v(M,A,C,E,_[T+3],14,-187363961),E=v(E,M,A,C,_[T+8],20,1163531501),C=v(C,E,M,A,_[T+13],5,-1444681467),A=v(A,C,E,M,_[T+2],9,-51403784),M=v(M,A,C,E,_[T+7],14,1735328473),E=v(E,M,A,C,_[T+12],20,-1926607734),C=g(C,E,M,A,_[T+5],4,-378558),A=g(A,C,E,M,_[T+8],11,-2022574463),M=g(M,A,C,E,_[T+11],16,1839030562),E=g(E,M,A,C,_[T+14],23,-35309556),C=g(C,E,M,A,_[T+1],4,-1530992060),A=g(A,C,E,M,_[T+4],11,1272893353),M=g(M,A,C,E,_[T+7],16,-155497632),E=g(E,M,A,C,_[T+10],23,-1094730640),C=g(C,E,M,A,_[T+13],4,681279174),A=g(A,C,E,M,_[T+0],11,-358537222),M=g(M,A,C,E,_[T+3],16,-722521979),E=g(E,M,A,C,_[T+6],23,76029189),C=g(C,E,M,A,_[T+9],4,-640364487),A=g(A,C,E,M,_[T+12],11,-421815835),M=g(M,A,C,E,_[T+15],16,530742520),E=g(E,M,A,C,_[T+2],23,-995338651),C=w(C,E,M,A,_[T+0],6,-198630844),A=w(A,C,E,M,_[T+7],10,1126891415),M=w(M,A,C,E,_[T+14],15,-1416354905),E=w(E,M,A,C,_[T+5],21,-57434055),C=w(C,E,M,A,_[T+12],6,1700485571),A=w(A,C,E,M,_[T+3],10,-1894986606),M=w(M,A,C,E,_[T+10],15,-1051523),E=w(E,M,A,C,_[T+1],21,-2054922799),C=w(C,E,M,A,_[T+8],6,1873313359),A=w(A,C,E,M,_[T+15],10,-30611744),M=w(M,A,C,E,_[T+6],15,-1560198380),E=w(E,M,A,C,_[T+13],21,1309151649),C=w(C,E,M,A,_[T+4],6,-145523070),A=w(A,C,E,M,_[T+11],10,-1120210379),M=w(M,A,C,E,_[T+2],15,718787259),E=w(E,M,A,C,_[T+9],21,-343485551),C=x(C,L),E=x(E,O),M=x(M,N),A=x(A,H)}return[C,E,M,A]}function d(_,b,C,E,M,A){return x(S(x(x(b,_),x(E,A)),M),C)}function m(_,b,C,E,M,A,T){return d(b&C|~b&E,_,b,M,A,T)}function v(_,b,C,E,M,A,T){return d(b&E|C&~E,_,b,M,A,T)}function g(_,b,C,E,M,A,T){return d(b^C^E,_,b,M,A,T)}function w(_,b,C,E,M,A,T){return d(C^(b|~E),_,b,M,A,T)}function x(_,b){var C=(_&65535)+(b&65535),E=(_>>16)+(b>>16)+(C>>16);return E<<16|C&65535}function S(_,b){return _<<b|_>>>32-b}return md5=function(b){return r(b,f)},md5}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var r=requireStreamBrowserify().Transform,f=requireInherits_browser();function d(m){r.call(this),this._block=new Buffer(m),this._blockSize=m,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return f(d,r),d.prototype._transform=function(m,v,g){var w=null;try{v!=="buffer"&&(m=new Buffer(m,v)),this.update(m)}catch(x){w=x}g(w)},d.prototype._flush=function(m){var v=null;try{this.push(this._digest())}catch(g){v=g}m(v)},d.prototype.update=function(m,v){if(!Buffer.isBuffer(m)&&typeof m!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(m)||(m=new Buffer(m,v||"binary"));for(var g=this._block,w=0;this._blockOffset+m.length-w>=this._blockSize;){for(var x=this._blockOffset;x<this._blockSize;)g[x++]=m[w++];this._update(),this._blockOffset=0}for(;w<m.length;)g[this._blockOffset++]=m[w++];for(var S=0,_=m.length*8;_>0;++S)this._length[S]+=_,_=this._length[S]/4294967296|0,_>0&&(this._length[S]-=4294967296*_);return this},d.prototype._update=function(m){throw new Error("_update is not implemented")},d.prototype.digest=function(m){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var v=this._digest();return m!==void 0&&(v=v.toString(m)),v},d.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=d,hashBase}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var r=requireInherits_browser(),f=requireHashBase();function d(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}r(d,f),d.prototype._update=function(){for(var _=new Array(16),b=0;b<16;++b)_[b]=this._block.readInt32LE(b*4);var C=this._a,E=this._b,M=this._c,A=this._d,T=this._e;C=v(C,E,M,A,T,_[0],0,11),M=m(M,10),T=v(T,C,E,M,A,_[1],0,14),E=m(E,10),A=v(A,T,C,E,M,_[2],0,15),C=m(C,10),M=v(M,A,T,C,E,_[3],0,12),T=m(T,10),E=v(E,M,A,T,C,_[4],0,5),A=m(A,10),C=v(C,E,M,A,T,_[5],0,8),M=m(M,10),T=v(T,C,E,M,A,_[6],0,7),E=m(E,10),A=v(A,T,C,E,M,_[7],0,9),C=m(C,10),M=v(M,A,T,C,E,_[8],0,11),T=m(T,10),E=v(E,M,A,T,C,_[9],0,13),A=m(A,10),C=v(C,E,M,A,T,_[10],0,14),M=m(M,10),T=v(T,C,E,M,A,_[11],0,15),E=m(E,10),A=v(A,T,C,E,M,_[12],0,6),C=m(C,10),M=v(M,A,T,C,E,_[13],0,7),T=m(T,10),E=v(E,M,A,T,C,_[14],0,9),A=m(A,10),C=v(C,E,M,A,T,_[15],0,8),M=m(M,10),T=g(T,C,E,M,A,_[7],1518500249,7),E=m(E,10),A=g(A,T,C,E,M,_[4],1518500249,6),C=m(C,10),M=g(M,A,T,C,E,_[13],1518500249,8),T=m(T,10),E=g(E,M,A,T,C,_[1],1518500249,13),A=m(A,10),C=g(C,E,M,A,T,_[10],1518500249,11),M=m(M,10),T=g(T,C,E,M,A,_[6],1518500249,9),E=m(E,10),A=g(A,T,C,E,M,_[15],1518500249,7),C=m(C,10),M=g(M,A,T,C,E,_[3],1518500249,15),T=m(T,10),E=g(E,M,A,T,C,_[12],1518500249,7),A=m(A,10),C=g(C,E,M,A,T,_[0],1518500249,12),M=m(M,10),T=g(T,C,E,M,A,_[9],1518500249,15),E=m(E,10),A=g(A,T,C,E,M,_[5],1518500249,9),C=m(C,10),M=g(M,A,T,C,E,_[2],1518500249,11),T=m(T,10),E=g(E,M,A,T,C,_[14],1518500249,7),A=m(A,10),C=g(C,E,M,A,T,_[11],1518500249,13),M=m(M,10),T=g(T,C,E,M,A,_[8],1518500249,12),E=m(E,10),A=w(A,T,C,E,M,_[3],1859775393,11),C=m(C,10),M=w(M,A,T,C,E,_[10],1859775393,13),T=m(T,10),E=w(E,M,A,T,C,_[14],1859775393,6),A=m(A,10),C=w(C,E,M,A,T,_[4],1859775393,7),M=m(M,10),T=w(T,C,E,M,A,_[9],1859775393,14),E=m(E,10),A=w(A,T,C,E,M,_[15],1859775393,9),C=m(C,10),M=w(M,A,T,C,E,_[8],1859775393,13),T=m(T,10),E=w(E,M,A,T,C,_[1],1859775393,15),A=m(A,10),C=w(C,E,M,A,T,_[2],1859775393,14),M=m(M,10),T=w(T,C,E,M,A,_[7],1859775393,8),E=m(E,10),A=w(A,T,C,E,M,_[0],1859775393,13),C=m(C,10),M=w(M,A,T,C,E,_[6],1859775393,6),T=m(T,10),E=w(E,M,A,T,C,_[13],1859775393,5),A=m(A,10),C=w(C,E,M,A,T,_[11],1859775393,12),M=m(M,10),T=w(T,C,E,M,A,_[5],1859775393,7),E=m(E,10),A=w(A,T,C,E,M,_[12],1859775393,5),C=m(C,10),M=x(M,A,T,C,E,_[1],2400959708,11),T=m(T,10),E=x(E,M,A,T,C,_[9],2400959708,12),A=m(A,10),C=x(C,E,M,A,T,_[11],2400959708,14),M=m(M,10),T=x(T,C,E,M,A,_[10],2400959708,15),E=m(E,10),A=x(A,T,C,E,M,_[0],2400959708,14),C=m(C,10),M=x(M,A,T,C,E,_[8],2400959708,15),T=m(T,10),E=x(E,M,A,T,C,_[12],2400959708,9),A=m(A,10),C=x(C,E,M,A,T,_[4],2400959708,8),M=m(M,10),T=x(T,C,E,M,A,_[13],2400959708,9),E=m(E,10),A=x(A,T,C,E,M,_[3],2400959708,14),C=m(C,10),M=x(M,A,T,C,E,_[7],2400959708,5),T=m(T,10),E=x(E,M,A,T,C,_[15],2400959708,6),A=m(A,10),C=x(C,E,M,A,T,_[14],2400959708,8),M=m(M,10),T=x(T,C,E,M,A,_[5],2400959708,6),E=m(E,10),A=x(A,T,C,E,M,_[6],2400959708,5),C=m(C,10),M=x(M,A,T,C,E,_[2],2400959708,12),T=m(T,10),E=S(E,M,A,T,C,_[4],2840853838,9),A=m(A,10),C=S(C,E,M,A,T,_[0],2840853838,15),M=m(M,10),T=S(T,C,E,M,A,_[5],2840853838,5),E=m(E,10),A=S(A,T,C,E,M,_[9],2840853838,11),C=m(C,10),M=S(M,A,T,C,E,_[7],2840853838,6),T=m(T,10),E=S(E,M,A,T,C,_[12],2840853838,8),A=m(A,10),C=S(C,E,M,A,T,_[2],2840853838,13),M=m(M,10),T=S(T,C,E,M,A,_[10],2840853838,12),E=m(E,10),A=S(A,T,C,E,M,_[14],2840853838,5),C=m(C,10),M=S(M,A,T,C,E,_[1],2840853838,12),T=m(T,10),E=S(E,M,A,T,C,_[3],2840853838,13),A=m(A,10),C=S(C,E,M,A,T,_[8],2840853838,14),M=m(M,10),T=S(T,C,E,M,A,_[11],2840853838,11),E=m(E,10),A=S(A,T,C,E,M,_[6],2840853838,8),C=m(C,10),M=S(M,A,T,C,E,_[15],2840853838,5),T=m(T,10),E=S(E,M,A,T,C,_[13],2840853838,6),A=m(A,10);var L=this._a,O=this._b,N=this._c,H=this._d,V=this._e;L=S(L,O,N,H,V,_[5],1352829926,8),N=m(N,10),V=S(V,L,O,N,H,_[14],1352829926,9),O=m(O,10),H=S(H,V,L,O,N,_[7],1352829926,9),L=m(L,10),N=S(N,H,V,L,O,_[0],1352829926,11),V=m(V,10),O=S(O,N,H,V,L,_[9],1352829926,13),H=m(H,10),L=S(L,O,N,H,V,_[2],1352829926,15),N=m(N,10),V=S(V,L,O,N,H,_[11],1352829926,15),O=m(O,10),H=S(H,V,L,O,N,_[4],1352829926,5),L=m(L,10),N=S(N,H,V,L,O,_[13],1352829926,7),V=m(V,10),O=S(O,N,H,V,L,_[6],1352829926,7),H=m(H,10),L=S(L,O,N,H,V,_[15],1352829926,8),N=m(N,10),V=S(V,L,O,N,H,_[8],1352829926,11),O=m(O,10),H=S(H,V,L,O,N,_[1],1352829926,14),L=m(L,10),N=S(N,H,V,L,O,_[10],1352829926,14),V=m(V,10),O=S(O,N,H,V,L,_[3],1352829926,12),H=m(H,10),L=S(L,O,N,H,V,_[12],1352829926,6),N=m(N,10),V=x(V,L,O,N,H,_[6],1548603684,9),O=m(O,10),H=x(H,V,L,O,N,_[11],1548603684,13),L=m(L,10),N=x(N,H,V,L,O,_[3],1548603684,15),V=m(V,10),O=x(O,N,H,V,L,_[7],1548603684,7),H=m(H,10),L=x(L,O,N,H,V,_[0],1548603684,12),N=m(N,10),V=x(V,L,O,N,H,_[13],1548603684,8),O=m(O,10),H=x(H,V,L,O,N,_[5],1548603684,9),L=m(L,10),N=x(N,H,V,L,O,_[10],1548603684,11),V=m(V,10),O=x(O,N,H,V,L,_[14],1548603684,7),H=m(H,10),L=x(L,O,N,H,V,_[15],1548603684,7),N=m(N,10),V=x(V,L,O,N,H,_[8],1548603684,12),O=m(O,10),H=x(H,V,L,O,N,_[12],1548603684,7),L=m(L,10),N=x(N,H,V,L,O,_[4],1548603684,6),V=m(V,10),O=x(O,N,H,V,L,_[9],1548603684,15),H=m(H,10),L=x(L,O,N,H,V,_[1],1548603684,13),N=m(N,10),V=x(V,L,O,N,H,_[2],1548603684,11),O=m(O,10),H=w(H,V,L,O,N,_[15],1836072691,9),L=m(L,10),N=w(N,H,V,L,O,_[5],1836072691,7),V=m(V,10),O=w(O,N,H,V,L,_[1],1836072691,15),H=m(H,10),L=w(L,O,N,H,V,_[3],1836072691,11),N=m(N,10),V=w(V,L,O,N,H,_[7],1836072691,8),O=m(O,10),H=w(H,V,L,O,N,_[14],1836072691,6),L=m(L,10),N=w(N,H,V,L,O,_[6],1836072691,6),V=m(V,10),O=w(O,N,H,V,L,_[9],1836072691,14),H=m(H,10),L=w(L,O,N,H,V,_[11],1836072691,12),N=m(N,10),V=w(V,L,O,N,H,_[8],1836072691,13),O=m(O,10),H=w(H,V,L,O,N,_[12],1836072691,5),L=m(L,10),N=w(N,H,V,L,O,_[2],1836072691,14),V=m(V,10),O=w(O,N,H,V,L,_[10],1836072691,13),H=m(H,10),L=w(L,O,N,H,V,_[0],1836072691,13),N=m(N,10),V=w(V,L,O,N,H,_[4],1836072691,7),O=m(O,10),H=w(H,V,L,O,N,_[13],1836072691,5),L=m(L,10),N=g(N,H,V,L,O,_[8],2053994217,15),V=m(V,10),O=g(O,N,H,V,L,_[6],2053994217,5),H=m(H,10),L=g(L,O,N,H,V,_[4],2053994217,8),N=m(N,10),V=g(V,L,O,N,H,_[1],2053994217,11),O=m(O,10),H=g(H,V,L,O,N,_[3],2053994217,14),L=m(L,10),N=g(N,H,V,L,O,_[11],2053994217,14),V=m(V,10),O=g(O,N,H,V,L,_[15],2053994217,6),H=m(H,10),L=g(L,O,N,H,V,_[0],2053994217,14),N=m(N,10),V=g(V,L,O,N,H,_[5],2053994217,6),O=m(O,10),H=g(H,V,L,O,N,_[12],2053994217,9),L=m(L,10),N=g(N,H,V,L,O,_[2],2053994217,12),V=m(V,10),O=g(O,N,H,V,L,_[13],2053994217,9),H=m(H,10),L=g(L,O,N,H,V,_[9],2053994217,12),N=m(N,10),V=g(V,L,O,N,H,_[7],2053994217,5),O=m(O,10),H=g(H,V,L,O,N,_[10],2053994217,15),L=m(L,10),N=g(N,H,V,L,O,_[14],2053994217,8),V=m(V,10),O=v(O,N,H,V,L,_[12],0,8),H=m(H,10),L=v(L,O,N,H,V,_[15],0,5),N=m(N,10),V=v(V,L,O,N,H,_[10],0,12),O=m(O,10),H=v(H,V,L,O,N,_[4],0,9),L=m(L,10),N=v(N,H,V,L,O,_[1],0,12),V=m(V,10),O=v(O,N,H,V,L,_[5],0,5),H=m(H,10),L=v(L,O,N,H,V,_[8],0,14),N=m(N,10),V=v(V,L,O,N,H,_[7],0,6),O=m(O,10),H=v(H,V,L,O,N,_[6],0,8),L=m(L,10),N=v(N,H,V,L,O,_[2],0,13),V=m(V,10),O=v(O,N,H,V,L,_[13],0,6),H=m(H,10),L=v(L,O,N,H,V,_[14],0,5),N=m(N,10),V=v(V,L,O,N,H,_[0],0,15),O=m(O,10),H=v(H,V,L,O,N,_[3],0,13),L=m(L,10),N=v(N,H,V,L,O,_[9],0,11),V=m(V,10),O=v(O,N,H,V,L,_[11],0,11),H=m(H,10);var X=this._b+M+H|0;this._b=this._c+A+V|0,this._c=this._d+T+L|0,this._d=this._e+C+O|0,this._e=this._a+E+N|0,this._a=X},d.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 _=new Buffer(20);return _.writeInt32LE(this._a,0),_.writeInt32LE(this._b,4),_.writeInt32LE(this._c,8),_.writeInt32LE(this._d,12),_.writeInt32LE(this._e,16),_};function m(_,b){return _<<b|_>>>32-b}function v(_,b,C,E,M,A,T,L){return m(_+(b^C^E)+A+T|0,L)+M|0}function g(_,b,C,E,M,A,T,L){return m(_+(b&C|~b&E)+A+T|0,L)+M|0}function w(_,b,C,E,M,A,T,L){return m(_+((b|~C)^E)+A+T|0,L)+M|0}function x(_,b,C,E,M,A,T,L){return m(_+(b&E|C&~E)+A+T|0,L)+M|0}function S(_,b,C,E,M,A,T,L){return m(_+(b^(C|~E))+A+T|0,L)+M|0}return ripemd160=d,ripemd160}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var r=requireSafeBuffer$1().Buffer,f=requireToBuffer$1(),d=typeof Uint8Array<"u",m=d&&typeof ArrayBuffer<"u",v=m&&ArrayBuffer.isView;return toBuffer_1=function(g,w,x){if(typeof g=="string"||r.isBuffer(g)||d&&g instanceof Uint8Array||v&&v(g))return f(g,w);throw new TypeError(x+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var r=requireMd5(),f=requireRipemd160(),d=requireSha_js(),m=requireSafeBuffer$1().Buffer,v=requirePrecondition(),g=requireDefaultEncoding(),w=requireToBuffer(),x=m.alloc(128),S={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},_={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function b(A){return new f().update(A).digest()}function C(A){function T(L){return d(A).update(L).digest()}return A==="rmd160"||A==="ripemd160"?b:A==="md5"?r:T}function E(A,T,L){var O=C(A),N=A==="sha512"||A==="sha384"?128:64;T.length>N?T=O(T):T.length<N&&(T=m.concat([T,x],N));for(var H=m.allocUnsafe(N+S[A]),V=m.allocUnsafe(N+S[A]),X=0;X<N;X++)H[X]=T[X]^54,V[X]=T[X]^92;var oe=m.allocUnsafe(N+L+4);H.copy(oe,0,0,N),this.ipad1=oe,this.ipad2=H,this.opad=V,this.alg=A,this.blocksize=N,this.hash=O,this.size=S[A]}E.prototype.run=function(A,T){A.copy(T,this.blocksize);var L=this.hash(T);return L.copy(this.opad,this.blocksize),this.hash(this.opad)};function M(A,T,L,O,N){v(L,O),A=w(A,g,"Password"),T=w(T,g,"Salt");var H=(N||"sha1").toLowerCase(),V=_[H]||H,X=S[V];if(typeof X!="number"||!X)throw new TypeError("Digest algorithm not supported: "+N);var oe=new E(V,A,T.length),se=m.allocUnsafe(O),de=m.allocUnsafe(T.length+4);T.copy(de,0,0,T.length);for(var he=0,we=X,te=Math.ceil(O/we),k=1;k<=te;k++){de.writeUInt32BE(k,T.length);for(var q=oe.run(de,oe.ipad1),y=q,B=1;B<L;B++){y=oe.run(y,oe.ipad2);for(var $=0;$<we;$++)q[$]^=y[$]}q.copy(se,he),he+=we}return se}return syncBrowser=M,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var r=requireSafeBuffer$1().Buffer,f=requirePrecondition(),d=requireDefaultEncoding(),m=requireSyncBrowser(),v=requireToBuffer(),g,w=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,x={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"},S=[],_;function b(){return _||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?_=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?_=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?_=commonjsGlobal.setImmediate:_=commonjsGlobal.setTimeout,_)}function C(A,T,L,O,N){return w.importKey("raw",A,{name:"PBKDF2"},!1,["deriveBits"]).then(function(H){return w.deriveBits({name:"PBKDF2",salt:T,iterations:L,hash:{name:N}},H,O<<3)}).then(function(H){return r.from(H)})}function E(A){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!w||!w.importKey||!w.deriveBits)return Promise.resolve(!1);if(S[A]!==void 0)return S[A];g=g||r.alloc(8);var T=C(g,g,10,128,A).then(function(){return!0},function(){return!1});return S[A]=T,T}function M(A,T){A.then(function(L){b()(function(){T(null,L)})},function(L){b()(function(){T(L)})})}return async=function(A,T,L,O,N,H){typeof N=="function"&&(H=N,N=void 0),N=N||"sha1";var V=x[N.toLowerCase()];if(!V||typeof commonjsGlobal.Promise!="function"){b()(function(){var X;try{X=m(A,T,L,O,N)}catch(oe){H(oe);return}H(null,X)});return}if(f(L,O),A=v(A,d,"Password"),T=v(T,d,"Salt"),typeof H!="function")throw new Error("No callback provided to pbkdf2");M(E(V).then(function(X){return X?C(A,T,L,O,V):m(A,T,L,O,N)}),H)},async}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$3={},hasRequiredUtils$3;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,utils$3.readUInt32BE=function(v,g){var w=v[0+g]<<24|v[1+g]<<16|v[2+g]<<8|v[3+g];return w>>>0},utils$3.writeUInt32BE=function(v,g,w){v[0+w]=g>>>24,v[1+w]=g>>>16&255,v[2+w]=g>>>8&255,v[3+w]=g&255},utils$3.ip=function(v,g,w,x){for(var S=0,_=0,b=6;b>=0;b-=2){for(var C=0;C<=24;C+=8)S<<=1,S|=g>>>C+b&1;for(var C=0;C<=24;C+=8)S<<=1,S|=v>>>C+b&1}for(var b=6;b>=0;b-=2){for(var C=1;C<=25;C+=8)_<<=1,_|=g>>>C+b&1;for(var C=1;C<=25;C+=8)_<<=1,_|=v>>>C+b&1}w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.rip=function(v,g,w,x){for(var S=0,_=0,b=0;b<4;b++)for(var C=24;C>=0;C-=8)S<<=1,S|=g>>>C+b&1,S<<=1,S|=v>>>C+b&1;for(var b=4;b<8;b++)for(var C=24;C>=0;C-=8)_<<=1,_|=g>>>C+b&1,_<<=1,_|=v>>>C+b&1;w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.pc1=function(v,g,w,x){for(var S=0,_=0,b=7;b>=5;b--){for(var C=0;C<=24;C+=8)S<<=1,S|=g>>C+b&1;for(var C=0;C<=24;C+=8)S<<=1,S|=v>>C+b&1}for(var C=0;C<=24;C+=8)S<<=1,S|=g>>C+b&1;for(var b=1;b<=3;b++){for(var C=0;C<=24;C+=8)_<<=1,_|=g>>C+b&1;for(var C=0;C<=24;C+=8)_<<=1,_|=v>>C+b&1}for(var C=0;C<=24;C+=8)_<<=1,_|=v>>C+b&1;w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.r28shl=function(v,g){return v<<g&268435455|v>>>28-g};var r=[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];utils$3.pc2=function(v,g,w,x){for(var S=0,_=0,b=r.length>>>1,C=0;C<b;C++)S<<=1,S|=v>>>r[C]&1;for(var C=b;C<r.length;C++)_<<=1,_|=g>>>r[C]&1;w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.expand=function(v,g,w){var x=0,S=0;x=(v&1)<<5|v>>>27;for(var _=23;_>=15;_-=4)x<<=6,x|=v>>>_&63;for(var _=11;_>=3;_-=4)S|=v>>>_&63,S<<=6;S|=(v&31)<<1|v>>>31,g[w+0]=x>>>0,g[w+1]=S>>>0};var f=[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];utils$3.substitute=function(v,g){for(var w=0,x=0;x<4;x++){var S=v>>>18-x*6&63,_=f[x*64+S];w<<=4,w|=_}for(var x=0;x<4;x++){var S=g>>>18-x*6&63,_=f[256+x*64+S];w<<=4,w|=_}return w>>>0};var d=[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];return utils$3.permute=function(v){for(var g=0,w=0;w<d.length;w++)g<<=1,g|=v>>>d[w]&1;return g>>>0},utils$3.padSplit=function(v,g,w){for(var x=v.toString(2);x.length<g;)x="0"+x;for(var S=[],_=0;_<g;_+=w)S.push(x.slice(_,_+w));return S.join(" ")},utils$3}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=r;function r(f,d){if(!f)throw new Error(d||"Assertion failed")}return r.equal=function(d,m,v){if(d!=m)throw new Error(v||"Assertion failed: "+d+" != "+m)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var r=requireMinimalisticAssert();function f(d){this.options=d,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=d.padding!==!1}return cipher=f,f.prototype._init=function(){},f.prototype.update=function(m){return m.length===0?[]:this.type==="decrypt"?this._updateDecrypt(m):this._updateEncrypt(m)},f.prototype._buffer=function(m,v){for(var g=Math.min(this.buffer.length-this.bufferOff,m.length-v),w=0;w<g;w++)this.buffer[this.bufferOff+w]=m[v+w];return this.bufferOff+=g,g},f.prototype._flushBuffer=function(m,v){return this._update(this.buffer,0,m,v),this.bufferOff=0,this.blockSize},f.prototype._updateEncrypt=function(m){var v=0,g=0,w=(this.bufferOff+m.length)/this.blockSize|0,x=new Array(w*this.blockSize);this.bufferOff!==0&&(v+=this._buffer(m,v),this.bufferOff===this.buffer.length&&(g+=this._flushBuffer(x,g)));for(var S=m.length-(m.length-v)%this.blockSize;v<S;v+=this.blockSize)this._update(m,v,x,g),g+=this.blockSize;for(;v<m.length;v++,this.bufferOff++)this.buffer[this.bufferOff]=m[v];return x},f.prototype._updateDecrypt=function(m){for(var v=0,g=0,w=Math.ceil((this.bufferOff+m.length)/this.blockSize)-1,x=new Array(w*this.blockSize);w>0;w--)v+=this._buffer(m,v),g+=this._flushBuffer(x,g);return v+=this._buffer(m,v),x},f.prototype.final=function(m){var v;m&&(v=this.update(m));var g;return this.type==="encrypt"?g=this._finalEncrypt():g=this._finalDecrypt(),v?v.concat(g):g},f.prototype._pad=function(m,v){if(v===0)return!1;for(;v<m.length;)m[v++]=0;return!0},f.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var m=new Array(this.blockSize);return this._update(this.buffer,0,m,0),m},f.prototype._unpad=function(m){return m},f.prototype._finalDecrypt=function(){r.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var m=new Array(this.blockSize);return this._flushBuffer(m,0),this._unpad(m)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d=requireUtils$3(),m=requireCipher();function v(){this.tmp=new Array(2),this.keys=null}function g(x){m.call(this,x);var S=new v;this._desState=S,this.deriveKeys(S,x.key)}f(g,m),des=g,g.create=function(S){return new g(S)};var w=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return g.prototype.deriveKeys=function(S,_){S.keys=new Array(32),r.equal(_.length,this.blockSize,"Invalid key length");var b=d.readUInt32BE(_,0),C=d.readUInt32BE(_,4);d.pc1(b,C,S.tmp,0),b=S.tmp[0],C=S.tmp[1];for(var E=0;E<S.keys.length;E+=2){var M=w[E>>>1];b=d.r28shl(b,M),C=d.r28shl(C,M),d.pc2(b,C,S.keys,E)}},g.prototype._update=function(S,_,b,C){var E=this._desState,M=d.readUInt32BE(S,_),A=d.readUInt32BE(S,_+4);d.ip(M,A,E.tmp,0),M=E.tmp[0],A=E.tmp[1],this.type==="encrypt"?this._encrypt(E,M,A,E.tmp,0):this._decrypt(E,M,A,E.tmp,0),M=E.tmp[0],A=E.tmp[1],d.writeUInt32BE(b,M,C),d.writeUInt32BE(b,A,C+4)},g.prototype._pad=function(S,_){if(this.padding===!1)return!1;for(var b=S.length-_,C=_;C<S.length;C++)S[C]=b;return!0},g.prototype._unpad=function(S){if(this.padding===!1)return S;for(var _=S[S.length-1],b=S.length-_;b<S.length;b++)r.equal(S[b],_);return S.slice(0,S.length-_)},g.prototype._encrypt=function(S,_,b,C,E){for(var M=_,A=b,T=0;T<S.keys.length;T+=2){var L=S.keys[T],O=S.keys[T+1];d.expand(A,S.tmp,0),L^=S.tmp[0],O^=S.tmp[1];var N=d.substitute(L,O),H=d.permute(N),V=A;A=(M^H)>>>0,M=V}d.rip(A,M,C,E)},g.prototype._decrypt=function(S,_,b,C,E){for(var M=b,A=_,T=S.keys.length-2;T>=0;T-=2){var L=S.keys[T],O=S.keys[T+1];d.expand(M,S.tmp,0),L^=S.tmp[0],O^=S.tmp[1];var N=d.substitute(L,O),H=d.permute(N),V=M;M=(A^H)>>>0,A=V}d.rip(M,A,C,E)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d={};function m(g){r.equal(g.length,8,"Invalid IV length"),this.iv=new Array(8);for(var w=0;w<this.iv.length;w++)this.iv[w]=g[w]}function v(g){function w(b){g.call(this,b),this._cbcInit()}f(w,g);for(var x=Object.keys(d),S=0;S<x.length;S++){var _=x[S];w.prototype[_]=d[_]}return w.create=function(C){return new w(C)},w}return cbc$1.instantiate=v,d._cbcInit=function(){var w=new m(this.options.iv);this._cbcState=w},d._update=function(w,x,S,_){var b=this._cbcState,C=this.constructor.super_.prototype,E=b.iv;if(this.type==="encrypt"){for(var M=0;M<this.blockSize;M++)E[M]^=w[x+M];C._update.call(this,E,0,S,_);for(var M=0;M<this.blockSize;M++)E[M]=S[_+M]}else{C._update.call(this,w,x,S,_);for(var M=0;M<this.blockSize;M++)S[_+M]^=E[M];for(var M=0;M<this.blockSize;M++)E[M]=w[x+M]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d=requireCipher(),m=requireDes$1();function v(w,x){r.equal(x.length,24,"Invalid key length");var S=x.slice(0,8),_=x.slice(8,16),b=x.slice(16,24);w==="encrypt"?this.ciphers=[m.create({type:"encrypt",key:S}),m.create({type:"decrypt",key:_}),m.create({type:"encrypt",key:b})]:this.ciphers=[m.create({type:"decrypt",key:b}),m.create({type:"encrypt",key:_}),m.create({type:"decrypt",key:S})]}function g(w){d.call(this,w);var x=new v(this.type,this.options.key);this._edeState=x}return f(g,d),ede=g,g.create=function(x){return new g(x)},g.prototype._update=function(x,S,_,b){var C=this._edeState;C.ciphers[0]._update(x,S,_,b),C.ciphers[1]._update(_,b,_,b),C.ciphers[2]._update(_,b,_,b)},g.prototype._pad=m.prototype._pad,g.prototype._unpad=m.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$3(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var r=requireCipherBase(),f=requireDes(),d=requireInherits_browser(),m=requireSafeBuffer$1().Buffer,v={"des-ede3-cbc":f.CBC.instantiate(f.EDE),"des-ede3":f.EDE,"des-ede-cbc":f.CBC.instantiate(f.EDE),"des-ede":f.EDE,"des-cbc":f.CBC.instantiate(f.DES),"des-ecb":f.DES};v.des=v["des-cbc"],v.des3=v["des-ede3-cbc"],browserifyDes=g,d(g,r);function g(w){r.call(this);var x=w.mode.toLowerCase(),S=v[x],_;w.decrypt?_="decrypt":_="encrypt";var b=w.key;m.isBuffer(b)||(b=m.from(b)),(x==="des-ede"||x==="des-ede-cbc")&&(b=m.concat([b,b.slice(0,8)]));var C=w.iv;m.isBuffer(C)||(C=m.from(C)),this._des=S.create({key:b,iv:C,type:_})}return g.prototype._update=function(w){return m.from(this._des.update(w))},g.prototype._final=function(){return m.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(r,f){return r._cipher.encryptBlock(f)},ecb.decrypt=function(r,f){return r._cipher.decryptBlock(f)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(f,d){for(var m=Math.min(f.length,d.length),v=new Buffer(m),g=0;g<m;++g)v[g]=f[g]^d[g];return v}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var r=requireBufferXor();return cbc.encrypt=function(f,d){var m=r(d,f._prev);return f._prev=f._cipher.encryptBlock(m),f._prev},cbc.decrypt=function(f,d){var m=f._prev;f._prev=d;var v=f._cipher.decryptBlock(d);return r(v,m)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var r=requireSafeBuffer$1().Buffer,f=requireBufferXor();function d(m,v,g){var w=v.length,x=f(v,m._cache);return m._cache=m._cache.slice(w),m._prev=r.concat([m._prev,g?v:x]),x}return cfb.encrypt=function(m,v,g){for(var w=r.allocUnsafe(0),x;v.length;)if(m._cache.length===0&&(m._cache=m._cipher.encryptBlock(m._prev),m._prev=r.allocUnsafe(0)),m._cache.length<=v.length)x=m._cache.length,w=r.concat([w,d(m,v.slice(0,x),g)]),v=v.slice(x);else{w=r.concat([w,d(m,v,g)]);break}return w},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var r=requireSafeBuffer$1().Buffer;function f(d,m,v){var g=d._cipher.encryptBlock(d._prev),w=g[0]^m;return d._prev=r.concat([d._prev.slice(1),r.from([v?m:w])]),w}return cfb8.encrypt=function(d,m,v){for(var g=m.length,w=r.allocUnsafe(g),x=-1;++x<g;)w[x]=f(d,m[x],v);return w},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var r=requireSafeBuffer$1().Buffer;function f(m,v,g){for(var w,x=-1,S=8,_=0,b,C;++x<S;)w=m._cipher.encryptBlock(m._prev),b=v&1<<7-x?128:0,C=w[0]^b,_+=(C&128)>>x%8,m._prev=d(m._prev,g?b:C);return _}function d(m,v){var g=m.length,w=-1,x=r.allocUnsafe(m.length);for(m=r.concat([m,r.from([v])]);++w<g;)x[w]=m[w]<<1|m[w+1]>>7;return x}return cfb1.encrypt=function(m,v,g){for(var w=v.length,x=r.allocUnsafe(w),S=-1;++S<w;)x[S]=f(m,v[S],g);return x},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var r=requireBufferXor();function f(d){return d._prev=d._cipher.encryptBlock(d._prev),d._prev}return ofb.encrypt=function(d,m){for(;d._cache.length<m.length;)d._cache=Buffer.concat([d._cache,f(d)]);var v=d._cache.slice(0,m.length);return d._cache=d._cache.slice(m.length),r(m,v)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function r(f){for(var d=f.length,m;d--;)if(m=f.readUInt8(d),m===255)f.writeUInt8(0,d);else{m++,f.writeUInt8(m,d);break}}return incr32_1=r,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var r=requireBufferXor(),f=requireSafeBuffer$1().Buffer,d=requireIncr32();function m(g){var w=g._cipher.encryptBlockRaw(g._prev);return d(g._prev),w}var v=16;return ctr.encrypt=function(g,w){var x=Math.ceil(w.length/v),S=g._cache.length;g._cache=f.concat([g._cache,f.allocUnsafe(x*v)]);for(var _=0;_<x;_++){var b=m(g),C=S+_*v;g._cache.writeUInt32BE(b[0],C+0),g._cache.writeUInt32BE(b[1],C+4),g._cache.writeUInt32BE(b[2],C+8),g._cache.writeUInt32BE(b[3],C+12)}var E=g._cache.slice(0,w.length);return g._cache=g._cache.slice(w.length),r(w,E)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var r={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},f=require$$2;for(var d in f)f[d].module=r[f[d].mode];return modes_1=f,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var r=requireSafeBuffer$1().Buffer;function f(x){r.isBuffer(x)||(x=r.from(x));for(var S=x.length/4|0,_=new Array(S),b=0;b<S;b++)_[b]=x.readUInt32BE(b*4);return _}function d(x){for(var S=0;S<x.length;x++)x[S]=0}function m(x,S,_,b,C){for(var E=_[0],M=_[1],A=_[2],T=_[3],L=x[0]^S[0],O=x[1]^S[1],N=x[2]^S[2],H=x[3]^S[3],V,X,oe,se,de=4,he=1;he<C;he++)V=E[L>>>24]^M[O>>>16&255]^A[N>>>8&255]^T[H&255]^S[de++],X=E[O>>>24]^M[N>>>16&255]^A[H>>>8&255]^T[L&255]^S[de++],oe=E[N>>>24]^M[H>>>16&255]^A[L>>>8&255]^T[O&255]^S[de++],se=E[H>>>24]^M[L>>>16&255]^A[O>>>8&255]^T[N&255]^S[de++],L=V,O=X,N=oe,H=se;return V=(b[L>>>24]<<24|b[O>>>16&255]<<16|b[N>>>8&255]<<8|b[H&255])^S[de++],X=(b[O>>>24]<<24|b[N>>>16&255]<<16|b[H>>>8&255]<<8|b[L&255])^S[de++],oe=(b[N>>>24]<<24|b[H>>>16&255]<<16|b[L>>>8&255]<<8|b[O&255])^S[de++],se=(b[H>>>24]<<24|b[L>>>16&255]<<16|b[O>>>8&255]<<8|b[N&255])^S[de++],V=V>>>0,X=X>>>0,oe=oe>>>0,se=se>>>0,[V,X,oe,se]}var v=[0,1,2,4,8,16,32,64,128,27,54],g=(function(){for(var x=new Array(256),S=0;S<256;S++)S<128?x[S]=S<<1:x[S]=S<<1^283;for(var _=[],b=[],C=[[],[],[],[]],E=[[],[],[],[]],M=0,A=0,T=0;T<256;++T){var L=A^A<<1^A<<2^A<<3^A<<4;L=L>>>8^L&255^99,_[M]=L,b[L]=M;var O=x[M],N=x[O],H=x[N],V=x[L]*257^L*16843008;C[0][M]=V<<24|V>>>8,C[1][M]=V<<16|V>>>16,C[2][M]=V<<8|V>>>24,C[3][M]=V,V=H*16843009^N*65537^O*257^M*16843008,E[0][L]=V<<24|V>>>8,E[1][L]=V<<16|V>>>16,E[2][L]=V<<8|V>>>24,E[3][L]=V,M===0?M=A=1:(M=O^x[x[x[H^O]]],A^=x[x[A]])}return{SBOX:_,INV_SBOX:b,SUB_MIX:C,INV_SUB_MIX:E}})();function w(x){this._key=f(x),this._reset()}return w.blockSize=16,w.keySize=256/8,w.prototype.blockSize=w.blockSize,w.prototype.keySize=w.keySize,w.prototype._reset=function(){for(var x=this._key,S=x.length,_=S+6,b=(_+1)*4,C=[],E=0;E<S;E++)C[E]=x[E];for(E=S;E<b;E++){var M=C[E-1];E%S===0?(M=M<<8|M>>>24,M=g.SBOX[M>>>24]<<24|g.SBOX[M>>>16&255]<<16|g.SBOX[M>>>8&255]<<8|g.SBOX[M&255],M^=v[E/S|0]<<24):S>6&&E%S===4&&(M=g.SBOX[M>>>24]<<24|g.SBOX[M>>>16&255]<<16|g.SBOX[M>>>8&255]<<8|g.SBOX[M&255]),C[E]=C[E-S]^M}for(var A=[],T=0;T<b;T++){var L=b-T,O=C[L-(T%4?0:4)];T<4||L<=4?A[T]=O:A[T]=g.INV_SUB_MIX[0][g.SBOX[O>>>24]]^g.INV_SUB_MIX[1][g.SBOX[O>>>16&255]]^g.INV_SUB_MIX[2][g.SBOX[O>>>8&255]]^g.INV_SUB_MIX[3][g.SBOX[O&255]]}this._nRounds=_,this._keySchedule=C,this._invKeySchedule=A},w.prototype.encryptBlockRaw=function(x){return x=f(x),m(x,this._keySchedule,g.SUB_MIX,g.SBOX,this._nRounds)},w.prototype.encryptBlock=function(x){var S=this.encryptBlockRaw(x),_=r.allocUnsafe(16);return _.writeUInt32BE(S[0],0),_.writeUInt32BE(S[1],4),_.writeUInt32BE(S[2],8),_.writeUInt32BE(S[3],12),_},w.prototype.decryptBlock=function(x){x=f(x);var S=x[1];x[1]=x[3],x[3]=S;var _=m(x,this._invKeySchedule,g.INV_SUB_MIX,g.INV_SBOX,this._nRounds),b=r.allocUnsafe(16);return b.writeUInt32BE(_[0],0),b.writeUInt32BE(_[3],4),b.writeUInt32BE(_[2],8),b.writeUInt32BE(_[1],12),b},w.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},aes.AES=w,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var r=requireSafeBuffer$1().Buffer,f=r.alloc(16,0);function d(g){return[g.readUInt32BE(0),g.readUInt32BE(4),g.readUInt32BE(8),g.readUInt32BE(12)]}function m(g){var w=r.allocUnsafe(16);return w.writeUInt32BE(g[0]>>>0,0),w.writeUInt32BE(g[1]>>>0,4),w.writeUInt32BE(g[2]>>>0,8),w.writeUInt32BE(g[3]>>>0,12),w}function v(g){this.h=g,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}return v.prototype.ghash=function(g){for(var w=-1;++w<g.length;)this.state[w]^=g[w];this._multiply()},v.prototype._multiply=function(){for(var g=d(this.h),w=[0,0,0,0],x,S,_,b=-1;++b<128;){for(S=(this.state[~~(b/8)]&1<<7-b%8)!==0,S&&(w[0]^=g[0],w[1]^=g[1],w[2]^=g[2],w[3]^=g[3]),_=(g[3]&1)!==0,x=3;x>0;x--)g[x]=g[x]>>>1|(g[x-1]&1)<<31;g[0]=g[0]>>>1,_&&(g[0]=g[0]^225<<24)}this.state=m(w)},v.prototype.update=function(g){this.cache=r.concat([this.cache,g]);for(var w;this.cache.length>=16;)w=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(w)},v.prototype.final=function(g,w){return this.cache.length&&this.ghash(r.concat([this.cache,f],16)),this.ghash(m([0,g,0,w])),this.state},ghash=v,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var r=requireAes(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),m=requireInherits_browser(),v=requireGhash(),g=requireBufferXor(),w=requireIncr32();function x(b,C){var E=0;b.length!==C.length&&E++;for(var M=Math.min(b.length,C.length),A=0;A<M;++A)E+=b[A]^C[A];return E}function S(b,C,E){if(C.length===12)return b._finID=f.concat([C,f.from([0,0,0,1])]),f.concat([C,f.from([0,0,0,2])]);var M=new v(E),A=C.length,T=A%16;M.update(C),T&&(T=16-T,M.update(f.alloc(T,0))),M.update(f.alloc(8,0));var L=A*8,O=f.alloc(8);O.writeUIntBE(L,0,8),M.update(O),b._finID=M.state;var N=f.from(b._finID);return w(N),N}function _(b,C,E,M){d.call(this);var A=f.alloc(4,0);this._cipher=new r.AES(C);var T=this._cipher.encryptBlock(A);this._ghash=new v(T),E=S(this,E,T),this._prev=f.from(E),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=M,this._alen=0,this._len=0,this._mode=b,this._authTag=null,this._called=!1}return m(_,d),_.prototype._update=function(b){if(!this._called&&this._alen){var C=16-this._alen%16;C<16&&(C=f.alloc(C,0),this._ghash.update(C))}this._called=!0;var E=this._mode.encrypt(this,b);return this._decrypt?this._ghash.update(b):this._ghash.update(E),this._len+=b.length,E},_.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var b=g(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&x(b,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=b,this._cipher.scrub()},_.prototype.getAuthTag=function(){if(this._decrypt||!f.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},_.prototype.setAuthTag=function(C){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=C},_.prototype.setAAD=function(C){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(C),this._alen+=C.length},authCipher=_,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var r=requireAes(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),m=requireInherits_browser();function v(g,w,x,S){d.call(this),this._cipher=new r.AES(w),this._prev=f.from(x),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=S,this._mode=g}return m(v,d),v.prototype._update=function(g){return this._mode.encrypt(this,g,this._decrypt)},v.prototype._final=function(){this._cipher.scrub()},streamCipher=v,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var r=requireSafeBuffer$1().Buffer,f=requireMd5_js();function d(m,v,g,w){if(r.isBuffer(m)||(m=r.from(m,"binary")),v&&(r.isBuffer(v)||(v=r.from(v,"binary")),v.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var x=g/8,S=r.alloc(x),_=r.alloc(w||0),b=r.alloc(0);x>0||w>0;){var C=new f;C.update(b),C.update(m),v&&C.update(v),b=C.digest();var E=0;if(x>0){var M=S.length-x;E=Math.min(x,b.length),b.copy(S,M,0,E),x-=E}if(E<b.length&&w>0){var A=_.length-w,T=Math.min(w,b.length-E);b.copy(_,A,E,E+T),w-=T}}return b.fill(0),{key:S,iv:_}}return evp_bytestokey=d,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var r=requireModes$1(),f=requireAuthCipher(),d=requireSafeBuffer$1().Buffer,m=requireStreamCipher(),v=requireCipherBase(),g=requireAes(),w=requireEvp_bytestokey(),x=requireInherits_browser();function S(M,A,T){v.call(this),this._cache=new b,this._cipher=new g.AES(A),this._prev=d.from(T),this._mode=M,this._autopadding=!0}x(S,v),S.prototype._update=function(M){this._cache.add(M);for(var A,T,L=[];A=this._cache.get();)T=this._mode.encrypt(this,A),L.push(T);return d.concat(L)};var _=d.alloc(16,16);S.prototype._final=function(){var M=this._cache.flush();if(this._autopadding)return M=this._mode.encrypt(this,M),this._cipher.scrub(),M;if(!M.equals(_))throw this._cipher.scrub(),new Error("data not multiple of block length")},S.prototype.setAutoPadding=function(M){return this._autopadding=!!M,this};function b(){this.cache=d.allocUnsafe(0)}b.prototype.add=function(M){this.cache=d.concat([this.cache,M])},b.prototype.get=function(){if(this.cache.length>15){var M=this.cache.slice(0,16);return this.cache=this.cache.slice(16),M}return null},b.prototype.flush=function(){for(var M=16-this.cache.length,A=d.allocUnsafe(M),T=-1;++T<M;)A.writeUInt8(M,T);return d.concat([this.cache,A])};function C(M,A,T){var L=r[M.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if(typeof A=="string"&&(A=d.from(A)),A.length!==L.key/8)throw new TypeError("invalid key length "+A.length);if(typeof T=="string"&&(T=d.from(T)),L.mode!=="GCM"&&T.length!==L.iv)throw new TypeError("invalid iv length "+T.length);return L.type==="stream"?new m(L.module,A,T):L.type==="auth"?new f(L.module,A,T):new S(L.module,A,T)}function E(M,A){var T=r[M.toLowerCase()];if(!T)throw new TypeError("invalid suite type");var L=w(A,!1,T.key,T.iv);return C(M,L.key,L.iv)}return encrypter.createCipheriv=C,encrypter.createCipher=E,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var r=requireAuthCipher(),f=requireSafeBuffer$1().Buffer,d=requireModes$1(),m=requireStreamCipher(),v=requireCipherBase(),g=requireAes(),w=requireEvp_bytestokey(),x=requireInherits_browser();function S(M,A,T){v.call(this),this._cache=new _,this._last=void 0,this._cipher=new g.AES(A),this._prev=f.from(T),this._mode=M,this._autopadding=!0}x(S,v),S.prototype._update=function(M){this._cache.add(M);for(var A,T,L=[];A=this._cache.get(this._autopadding);)T=this._mode.decrypt(this,A),L.push(T);return f.concat(L)},S.prototype._final=function(){var M=this._cache.flush();if(this._autopadding)return b(this._mode.decrypt(this,M));if(M)throw new Error("data not multiple of block length")},S.prototype.setAutoPadding=function(M){return this._autopadding=!!M,this};function _(){this.cache=f.allocUnsafe(0)}_.prototype.add=function(M){this.cache=f.concat([this.cache,M])},_.prototype.get=function(M){var A;if(M){if(this.cache.length>16)return A=this.cache.slice(0,16),this.cache=this.cache.slice(16),A}else if(this.cache.length>=16)return A=this.cache.slice(0,16),this.cache=this.cache.slice(16),A;return null},_.prototype.flush=function(){if(this.cache.length)return this.cache};function b(M){var A=M[15];if(A<1||A>16)throw new Error("unable to decrypt data");for(var T=-1;++T<A;)if(M[T+(16-A)]!==A)throw new Error("unable to decrypt data");if(A!==16)return M.slice(0,16-A)}function C(M,A,T){var L=d[M.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if(typeof T=="string"&&(T=f.from(T)),L.mode!=="GCM"&&T.length!==L.iv)throw new TypeError("invalid iv length "+T.length);if(typeof A=="string"&&(A=f.from(A)),A.length!==L.key/8)throw new TypeError("invalid key length "+A.length);return L.type==="stream"?new m(L.module,A,T,!0):L.type==="auth"?new r(L.module,A,T,!0):new S(L.module,A,T)}function E(M,A){var T=d[M.toLowerCase()];if(!T)throw new TypeError("invalid suite type");var L=w(A,!1,T.key,T.iv);return C(M,L.key,L.iv)}return decrypter.createDecipher=E,decrypter.createDecipheriv=C,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var r=requireEncrypter(),f=requireDecrypter(),d=require$$2;function m(){return Object.keys(d)}return browser$5.createCipher=browser$5.Cipher=r.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=r.createCipheriv,browser$5.createDecipher=browser$5.Decipher=f.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=f.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=m,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(function(r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}})(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var r=requireBrowserifyDes(),f=requireBrowser$6(),d=requireModes$1(),m=requireModes(),v=requireEvp_bytestokey();function g(b,C){b=b.toLowerCase();var E,M;if(d[b])E=d[b].key,M=d[b].iv;else if(m[b])E=m[b].key*8,M=m[b].iv;else throw new TypeError("invalid suite type");var A=v(C,!1,E,M);return x(b,A.key,A.iv)}function w(b,C){b=b.toLowerCase();var E,M;if(d[b])E=d[b].key,M=d[b].iv;else if(m[b])E=m[b].key*8,M=m[b].iv;else throw new TypeError("invalid suite type");var A=v(C,!1,E,M);return S(b,A.key,A.iv)}function x(b,C,E){if(b=b.toLowerCase(),d[b])return f.createCipheriv(b,C,E);if(m[b])return new r({key:C,iv:E,mode:b});throw new TypeError("invalid suite type")}function S(b,C,E){if(b=b.toLowerCase(),d[b])return f.createDecipheriv(b,C,E);if(m[b])return new r({key:C,iv:E,mode:b,decrypt:!0});throw new TypeError("invalid suite type")}function _(){return Object.keys(m).concat(f.getCiphers())}return browser$6.createCipher=browser$6.Cipher=g,browser$6.createCipheriv=browser$6.Cipheriv=x,browser$6.createDecipher=browser$6.Decipher=w,browser$6.createDecipheriv=browser$6.Decipheriv=S,browser$6.listCiphers=browser$6.getCiphers=_,browser$6}var browser$4={},bn$5={exports:{}},bn$4=bn$5.exports,hasRequiredBn$2;function requireBn$2(){return hasRequiredBn$2||(hasRequiredBn$2=1,(function(r){(function(f,d){function m(te,k){if(!te)throw new Error(k||"Assertion failed")}function v(te,k){te.super_=k;var q=function(){};q.prototype=k.prototype,te.prototype=new q,te.prototype.constructor=te}function g(te,k,q){if(g.isBN(te))return te;this.negative=0,this.words=null,this.length=0,this.red=null,te!==null&&((k==="le"||k==="be")&&(q=k,k=10),this._init(te||0,k||10,q||"be"))}typeof f=="object"?f.exports=g:d.BN=g,g.BN=g,g.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}g.isBN=function(k){return k instanceof g?!0:k!==null&&typeof k=="object"&&k.constructor.wordSize===g.wordSize&&Array.isArray(k.words)},g.max=function(k,q){return k.cmp(q)>0?k:q},g.min=function(k,q){return k.cmp(q)<0?k:q},g.prototype._init=function(k,q,y){if(typeof k=="number")return this._initNumber(k,q,y);if(typeof k=="object")return this._initArray(k,q,y);q==="hex"&&(q=16),m(q===(q|0)&&q>=2&&q<=36),k=k.toString().replace(/\s+/g,"");var B=0;k[0]==="-"&&(B++,this.negative=1),B<k.length&&(q===16?this._parseHex(k,B,y):(this._parseBase(k,q,B),y==="le"&&this._initArray(this.toArray(),q,y)))},g.prototype._initNumber=function(k,q,y){k<0&&(this.negative=1,k=-k),k<67108864?(this.words=[k&67108863],this.length=1):k<4503599627370496?(this.words=[k&67108863,k/67108864&67108863],this.length=2):(m(k<9007199254740992),this.words=[k&67108863,k/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),q,y)},g.prototype._initArray=function(k,q,y){if(m(typeof k.length=="number"),k.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(k.length/3),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var $,I,F=0;if(y==="be")for(B=k.length-1,$=0;B>=0;B-=3)I=k[B]|k[B-1]<<8|k[B-2]<<16,this.words[$]|=I<<F&67108863,this.words[$+1]=I>>>26-F&67108863,F+=24,F>=26&&(F-=26,$++);else if(y==="le")for(B=0,$=0;B<k.length;B+=3)I=k[B]|k[B+1]<<8|k[B+2]<<16,this.words[$]|=I<<F&67108863,this.words[$+1]=I>>>26-F&67108863,F+=24,F>=26&&(F-=26,$++);return this.strip()};function x(te,k){var q=te.charCodeAt(k);return q>=65&&q<=70?q-55:q>=97&&q<=102?q-87:q-48&15}function S(te,k,q){var y=x(te,q);return q-1>=k&&(y|=x(te,q-1)<<4),y}g.prototype._parseHex=function(k,q,y){this.length=Math.ceil((k.length-q)/6),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var $=0,I=0,F;if(y==="be")for(B=k.length-1;B>=q;B-=2)F=S(k,q,B)<<$,this.words[I]|=F&67108863,$>=18?($-=18,I+=1,this.words[I]|=F>>>26):$+=8;else{var j=k.length-q;for(B=j%2===0?q+1:q;B<k.length;B+=2)F=S(k,q,B)<<$,this.words[I]|=F&67108863,$>=18?($-=18,I+=1,this.words[I]|=F>>>26):$+=8}this.strip()};function _(te,k,q,y){for(var B=0,$=Math.min(te.length,q),I=k;I<$;I++){var F=te.charCodeAt(I)-48;B*=y,F>=49?B+=F-49+10:F>=17?B+=F-17+10:B+=F}return B}g.prototype._parseBase=function(k,q,y){this.words=[0],this.length=1;for(var B=0,$=1;$<=67108863;$*=q)B++;B--,$=$/q|0;for(var I=k.length-y,F=I%B,j=Math.min(I,I-F)+y,D=0,W=y;W<j;W+=B)D=_(k,W,W+B,q),this.imuln($),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D);if(F!==0){var R=1;for(D=_(k,W,k.length,q),W=0;W<F;W++)R*=q;this.imuln(R),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D)}this.strip()},g.prototype.copy=function(k){k.words=new Array(this.length);for(var q=0;q<this.length;q++)k.words[q]=this.words[q];k.length=this.length,k.negative=this.negative,k.red=this.red},g.prototype.clone=function(){var k=new g(null);return this.copy(k),k},g.prototype._expand=function(k){for(;this.length<k;)this.words[this.length++]=0;return this},g.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},g.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},g.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];g.prototype.toString=function(k,q){k=k||10,q=q|0||1;var y;if(k===16||k==="hex"){y="";for(var B=0,$=0,I=0;I<this.length;I++){var F=this.words[I],j=((F<<B|$)&16777215).toString(16);$=F>>>24-B&16777215,B+=2,B>=26&&(B-=26,I--),$!==0||I!==this.length-1?y=b[6-j.length]+j+y:y=j+y}for($!==0&&(y=$.toString(16)+y);y.length%q!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(k===(k|0)&&k>=2&&k<=36){var D=C[k],W=E[k];y="";var R=this.clone();for(R.negative=0;!R.isZero();){var z=R.modn(W).toString(k);R=R.idivn(W),R.isZero()?y=z+y:y=b[D-z.length]+z+y}for(this.isZero()&&(y="0"+y);y.length%q!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}m(!1,"Base should be between 2 and 36")},g.prototype.toNumber=function(){var k=this.words[0];return this.length===2?k+=this.words[1]*67108864:this.length===3&&this.words[2]===1?k+=4503599627370496+this.words[1]*67108864:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},g.prototype.toJSON=function(){return this.toString(16)},g.prototype.toBuffer=function(k,q){return m(typeof w<"u"),this.toArrayLike(w,k,q)},g.prototype.toArray=function(k,q){return this.toArrayLike(Array,k,q)},g.prototype.toArrayLike=function(k,q,y){var B=this.byteLength(),$=y||Math.max(1,B);m(B<=$,"byte array longer than desired length"),m($>0,"Requested array length <= 0"),this.strip();var I=q==="le",F=new k($),j,D,W=this.clone();if(I){for(D=0;!W.isZero();D++)j=W.andln(255),W.iushrn(8),F[D]=j;for(;D<$;D++)F[D]=0}else{for(D=0;D<$-B;D++)F[D]=0;for(D=0;!W.isZero();D++)j=W.andln(255),W.iushrn(8),F[$-D-1]=j}return F},Math.clz32?g.prototype._countBits=function(k){return 32-Math.clz32(k)}:g.prototype._countBits=function(k){var q=k,y=0;return q>=4096&&(y+=13,q>>>=13),q>=64&&(y+=7,q>>>=7),q>=8&&(y+=4,q>>>=4),q>=2&&(y+=2,q>>>=2),y+q},g.prototype._zeroBits=function(k){if(k===0)return 26;var q=k,y=0;return(q&8191)===0&&(y+=13,q>>>=13),(q&127)===0&&(y+=7,q>>>=7),(q&15)===0&&(y+=4,q>>>=4),(q&3)===0&&(y+=2,q>>>=2),(q&1)===0&&y++,y},g.prototype.bitLength=function(){var k=this.words[this.length-1],q=this._countBits(k);return(this.length-1)*26+q};function M(te){for(var k=new Array(te.bitLength()),q=0;q<k.length;q++){var y=q/26|0,B=q%26;k[q]=(te.words[y]&1<<B)>>>B}return k}g.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,q=0;q<this.length;q++){var y=this._zeroBits(this.words[q]);if(k+=y,y!==26)break}return k},g.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},g.prototype.toTwos=function(k){return this.negative!==0?this.abs().inotn(k).iaddn(1):this.clone()},g.prototype.fromTwos=function(k){return this.testn(k-1)?this.notn(k).iaddn(1).ineg():this.clone()},g.prototype.isNeg=function(){return this.negative!==0},g.prototype.neg=function(){return this.clone().ineg()},g.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},g.prototype.iuor=function(k){for(;this.length<k.length;)this.words[this.length++]=0;for(var q=0;q<k.length;q++)this.words[q]=this.words[q]|k.words[q];return this.strip()},g.prototype.ior=function(k){return m((this.negative|k.negative)===0),this.iuor(k)},g.prototype.or=function(k){return this.length>k.length?this.clone().ior(k):k.clone().ior(this)},g.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},g.prototype.iuand=function(k){var q;this.length>k.length?q=k:q=this;for(var y=0;y<q.length;y++)this.words[y]=this.words[y]&k.words[y];return this.length=q.length,this.strip()},g.prototype.iand=function(k){return m((this.negative|k.negative)===0),this.iuand(k)},g.prototype.and=function(k){return this.length>k.length?this.clone().iand(k):k.clone().iand(this)},g.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},g.prototype.iuxor=function(k){var q,y;this.length>k.length?(q=this,y=k):(q=k,y=this);for(var B=0;B<y.length;B++)this.words[B]=q.words[B]^y.words[B];if(this!==q)for(;B<q.length;B++)this.words[B]=q.words[B];return this.length=q.length,this.strip()},g.prototype.ixor=function(k){return m((this.negative|k.negative)===0),this.iuxor(k)},g.prototype.xor=function(k){return this.length>k.length?this.clone().ixor(k):k.clone().ixor(this)},g.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},g.prototype.inotn=function(k){m(typeof k=="number"&&k>=0);var q=Math.ceil(k/26)|0,y=k%26;this._expand(q),y>0&&q--;for(var B=0;B<q;B++)this.words[B]=~this.words[B]&67108863;return y>0&&(this.words[B]=~this.words[B]&67108863>>26-y),this.strip()},g.prototype.notn=function(k){return this.clone().inotn(k)},g.prototype.setn=function(k,q){m(typeof k=="number"&&k>=0);var y=k/26|0,B=k%26;return this._expand(y+1),q?this.words[y]=this.words[y]|1<<B:this.words[y]=this.words[y]&~(1<<B),this.strip()},g.prototype.iadd=function(k){var q;if(this.negative!==0&&k.negative===0)return this.negative=0,q=this.isub(k),this.negative^=1,this._normSign();if(this.negative===0&&k.negative!==0)return k.negative=0,q=this.isub(k),k.negative=1,q._normSign();var y,B;this.length>k.length?(y=this,B=k):(y=k,B=this);for(var $=0,I=0;I<B.length;I++)q=(y.words[I]|0)+(B.words[I]|0)+$,this.words[I]=q&67108863,$=q>>>26;for(;$!==0&&I<y.length;I++)q=(y.words[I]|0)+$,this.words[I]=q&67108863,$=q>>>26;if(this.length=y.length,$!==0)this.words[this.length]=$,this.length++;else if(y!==this)for(;I<y.length;I++)this.words[I]=y.words[I];return this},g.prototype.add=function(k){var q;return k.negative!==0&&this.negative===0?(k.negative=0,q=this.sub(k),k.negative^=1,q):k.negative===0&&this.negative!==0?(this.negative=0,q=k.sub(this),this.negative=1,q):this.length>k.length?this.clone().iadd(k):k.clone().iadd(this)},g.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var q=this.iadd(k);return k.negative=1,q._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var y=this.cmp(k);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,$;y>0?(B=this,$=k):(B=k,$=this);for(var I=0,F=0;F<$.length;F++)q=(B.words[F]|0)-($.words[F]|0)+I,I=q>>26,this.words[F]=q&67108863;for(;I!==0&&F<B.length;F++)q=(B.words[F]|0)+I,I=q>>26,this.words[F]=q&67108863;if(I===0&&F<B.length&&B!==this)for(;F<B.length;F++)this.words[F]=B.words[F];return this.length=Math.max(this.length,F),B!==this&&(this.negative=1),this.strip()},g.prototype.sub=function(k){return this.clone().isub(k)};function A(te,k,q){q.negative=k.negative^te.negative;var y=te.length+k.length|0;q.length=y,y=y-1|0;var B=te.words[0]|0,$=k.words[0]|0,I=B*$,F=I&67108863,j=I/67108864|0;q.words[0]=F;for(var D=1;D<y;D++){for(var W=j>>>26,R=j&67108863,z=Math.min(D,k.length-1),ye=Math.max(0,D-te.length+1);ye<=z;ye++){var Ce=D-ye|0;B=te.words[Ce]|0,$=k.words[ye]|0,I=B*$+R,W+=I/67108864|0,R=I&67108863}q.words[D]=R|0,j=W|0}return j!==0?q.words[D]=j|0:q.length--,q.strip()}var T=function(k,q,y){var B=k.words,$=q.words,I=y.words,F=0,j,D,W,R=B[0]|0,z=R&8191,ye=R>>>13,Ce=B[1]|0,me=Ce&8191,ie=Ce>>>13,ee=B[2]|0,pe=ee&8191,be=ee>>>13,ae=B[3]|0,ne=ae&8191,Se=ae>>>13,qe=B[4]|0,Ie=qe&8191,Oe=qe>>>13,Ue=B[5]|0,De=Ue&8191,$e=Ue>>>13,je=B[6]|0,Ye=je&8191,st=je>>>13,Je=B[7]|0,Ge=Je&8191,ut=Je>>>13,gt=B[8]|0,rt=gt&8191,wt=gt>>>13,bt=B[9]|0,le=bt&8191,Z=bt>>>13,J=$[0]|0,ge=J&8191,Ee=J>>>13,Re=$[1]|0,ke=Re&8191,Xe=Re>>>13,He=$[2]|0,Ze=He&8191,xt=He>>>13,tt=$[3]|0,mt=tt&8191,Tt=tt>>>13,St=$[4]|0,lt=St&8191,Mt=St>>>13,Ct=$[5]|0,ce=Ct&8191,Y=Ct>>>13,Q=$[6]|0,ve=Q&8191,fe=Q>>>13,U=$[7]|0,G=U&8191,re=U>>>13,K=$[8]|0,ue=K&8191,Ae=K>>>13,xe=$[9]|0,Te=xe&8191,Pe=xe>>>13;y.negative=k.negative^q.negative,y.length=19,j=Math.imul(z,ge),D=Math.imul(z,Ee),D=D+Math.imul(ye,ge)|0,W=Math.imul(ye,Ee);var Fe=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,j=Math.imul(me,ge),D=Math.imul(me,Ee),D=D+Math.imul(ie,ge)|0,W=Math.imul(ie,Ee),j=j+Math.imul(z,ke)|0,D=D+Math.imul(z,Xe)|0,D=D+Math.imul(ye,ke)|0,W=W+Math.imul(ye,Xe)|0;var Ne=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,j=Math.imul(pe,ge),D=Math.imul(pe,Ee),D=D+Math.imul(be,ge)|0,W=Math.imul(be,Ee),j=j+Math.imul(me,ke)|0,D=D+Math.imul(me,Xe)|0,D=D+Math.imul(ie,ke)|0,W=W+Math.imul(ie,Xe)|0,j=j+Math.imul(z,Ze)|0,D=D+Math.imul(z,xt)|0,D=D+Math.imul(ye,Ze)|0,W=W+Math.imul(ye,xt)|0;var At=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(At>>>26)|0,At&=67108863,j=Math.imul(ne,ge),D=Math.imul(ne,Ee),D=D+Math.imul(Se,ge)|0,W=Math.imul(Se,Ee),j=j+Math.imul(pe,ke)|0,D=D+Math.imul(pe,Xe)|0,D=D+Math.imul(be,ke)|0,W=W+Math.imul(be,Xe)|0,j=j+Math.imul(me,Ze)|0,D=D+Math.imul(me,xt)|0,D=D+Math.imul(ie,Ze)|0,W=W+Math.imul(ie,xt)|0,j=j+Math.imul(z,mt)|0,D=D+Math.imul(z,Tt)|0,D=D+Math.imul(ye,mt)|0,W=W+Math.imul(ye,Tt)|0;var ot=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ot>>>26)|0,ot&=67108863,j=Math.imul(Ie,ge),D=Math.imul(Ie,Ee),D=D+Math.imul(Oe,ge)|0,W=Math.imul(Oe,Ee),j=j+Math.imul(ne,ke)|0,D=D+Math.imul(ne,Xe)|0,D=D+Math.imul(Se,ke)|0,W=W+Math.imul(Se,Xe)|0,j=j+Math.imul(pe,Ze)|0,D=D+Math.imul(pe,xt)|0,D=D+Math.imul(be,Ze)|0,W=W+Math.imul(be,xt)|0,j=j+Math.imul(me,mt)|0,D=D+Math.imul(me,Tt)|0,D=D+Math.imul(ie,mt)|0,W=W+Math.imul(ie,Tt)|0,j=j+Math.imul(z,lt)|0,D=D+Math.imul(z,Mt)|0,D=D+Math.imul(ye,lt)|0,W=W+Math.imul(ye,Mt)|0;var yt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(yt>>>26)|0,yt&=67108863,j=Math.imul(De,ge),D=Math.imul(De,Ee),D=D+Math.imul($e,ge)|0,W=Math.imul($e,Ee),j=j+Math.imul(Ie,ke)|0,D=D+Math.imul(Ie,Xe)|0,D=D+Math.imul(Oe,ke)|0,W=W+Math.imul(Oe,Xe)|0,j=j+Math.imul(ne,Ze)|0,D=D+Math.imul(ne,xt)|0,D=D+Math.imul(Se,Ze)|0,W=W+Math.imul(Se,xt)|0,j=j+Math.imul(pe,mt)|0,D=D+Math.imul(pe,Tt)|0,D=D+Math.imul(be,mt)|0,W=W+Math.imul(be,Tt)|0,j=j+Math.imul(me,lt)|0,D=D+Math.imul(me,Mt)|0,D=D+Math.imul(ie,lt)|0,W=W+Math.imul(ie,Mt)|0,j=j+Math.imul(z,ce)|0,D=D+Math.imul(z,Y)|0,D=D+Math.imul(ye,ce)|0,W=W+Math.imul(ye,Y)|0;var vt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(vt>>>26)|0,vt&=67108863,j=Math.imul(Ye,ge),D=Math.imul(Ye,Ee),D=D+Math.imul(st,ge)|0,W=Math.imul(st,Ee),j=j+Math.imul(De,ke)|0,D=D+Math.imul(De,Xe)|0,D=D+Math.imul($e,ke)|0,W=W+Math.imul($e,Xe)|0,j=j+Math.imul(Ie,Ze)|0,D=D+Math.imul(Ie,xt)|0,D=D+Math.imul(Oe,Ze)|0,W=W+Math.imul(Oe,xt)|0,j=j+Math.imul(ne,mt)|0,D=D+Math.imul(ne,Tt)|0,D=D+Math.imul(Se,mt)|0,W=W+Math.imul(Se,Tt)|0,j=j+Math.imul(pe,lt)|0,D=D+Math.imul(pe,Mt)|0,D=D+Math.imul(be,lt)|0,W=W+Math.imul(be,Mt)|0,j=j+Math.imul(me,ce)|0,D=D+Math.imul(me,Y)|0,D=D+Math.imul(ie,ce)|0,W=W+Math.imul(ie,Y)|0,j=j+Math.imul(z,ve)|0,D=D+Math.imul(z,fe)|0,D=D+Math.imul(ye,ve)|0,W=W+Math.imul(ye,fe)|0;var _t=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(_t>>>26)|0,_t&=67108863,j=Math.imul(Ge,ge),D=Math.imul(Ge,Ee),D=D+Math.imul(ut,ge)|0,W=Math.imul(ut,Ee),j=j+Math.imul(Ye,ke)|0,D=D+Math.imul(Ye,Xe)|0,D=D+Math.imul(st,ke)|0,W=W+Math.imul(st,Xe)|0,j=j+Math.imul(De,Ze)|0,D=D+Math.imul(De,xt)|0,D=D+Math.imul($e,Ze)|0,W=W+Math.imul($e,xt)|0,j=j+Math.imul(Ie,mt)|0,D=D+Math.imul(Ie,Tt)|0,D=D+Math.imul(Oe,mt)|0,W=W+Math.imul(Oe,Tt)|0,j=j+Math.imul(ne,lt)|0,D=D+Math.imul(ne,Mt)|0,D=D+Math.imul(Se,lt)|0,W=W+Math.imul(Se,Mt)|0,j=j+Math.imul(pe,ce)|0,D=D+Math.imul(pe,Y)|0,D=D+Math.imul(be,ce)|0,W=W+Math.imul(be,Y)|0,j=j+Math.imul(me,ve)|0,D=D+Math.imul(me,fe)|0,D=D+Math.imul(ie,ve)|0,W=W+Math.imul(ie,fe)|0,j=j+Math.imul(z,G)|0,D=D+Math.imul(z,re)|0,D=D+Math.imul(ye,G)|0,W=W+Math.imul(ye,re)|0;var Ve=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,j=Math.imul(rt,ge),D=Math.imul(rt,Ee),D=D+Math.imul(wt,ge)|0,W=Math.imul(wt,Ee),j=j+Math.imul(Ge,ke)|0,D=D+Math.imul(Ge,Xe)|0,D=D+Math.imul(ut,ke)|0,W=W+Math.imul(ut,Xe)|0,j=j+Math.imul(Ye,Ze)|0,D=D+Math.imul(Ye,xt)|0,D=D+Math.imul(st,Ze)|0,W=W+Math.imul(st,xt)|0,j=j+Math.imul(De,mt)|0,D=D+Math.imul(De,Tt)|0,D=D+Math.imul($e,mt)|0,W=W+Math.imul($e,Tt)|0,j=j+Math.imul(Ie,lt)|0,D=D+Math.imul(Ie,Mt)|0,D=D+Math.imul(Oe,lt)|0,W=W+Math.imul(Oe,Mt)|0,j=j+Math.imul(ne,ce)|0,D=D+Math.imul(ne,Y)|0,D=D+Math.imul(Se,ce)|0,W=W+Math.imul(Se,Y)|0,j=j+Math.imul(pe,ve)|0,D=D+Math.imul(pe,fe)|0,D=D+Math.imul(be,ve)|0,W=W+Math.imul(be,fe)|0,j=j+Math.imul(me,G)|0,D=D+Math.imul(me,re)|0,D=D+Math.imul(ie,G)|0,W=W+Math.imul(ie,re)|0,j=j+Math.imul(z,ue)|0,D=D+Math.imul(z,Ae)|0,D=D+Math.imul(ye,ue)|0,W=W+Math.imul(ye,Ae)|0;var ft=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ft>>>26)|0,ft&=67108863,j=Math.imul(le,ge),D=Math.imul(le,Ee),D=D+Math.imul(Z,ge)|0,W=Math.imul(Z,Ee),j=j+Math.imul(rt,ke)|0,D=D+Math.imul(rt,Xe)|0,D=D+Math.imul(wt,ke)|0,W=W+Math.imul(wt,Xe)|0,j=j+Math.imul(Ge,Ze)|0,D=D+Math.imul(Ge,xt)|0,D=D+Math.imul(ut,Ze)|0,W=W+Math.imul(ut,xt)|0,j=j+Math.imul(Ye,mt)|0,D=D+Math.imul(Ye,Tt)|0,D=D+Math.imul(st,mt)|0,W=W+Math.imul(st,Tt)|0,j=j+Math.imul(De,lt)|0,D=D+Math.imul(De,Mt)|0,D=D+Math.imul($e,lt)|0,W=W+Math.imul($e,Mt)|0,j=j+Math.imul(Ie,ce)|0,D=D+Math.imul(Ie,Y)|0,D=D+Math.imul(Oe,ce)|0,W=W+Math.imul(Oe,Y)|0,j=j+Math.imul(ne,ve)|0,D=D+Math.imul(ne,fe)|0,D=D+Math.imul(Se,ve)|0,W=W+Math.imul(Se,fe)|0,j=j+Math.imul(pe,G)|0,D=D+Math.imul(pe,re)|0,D=D+Math.imul(be,G)|0,W=W+Math.imul(be,re)|0,j=j+Math.imul(me,ue)|0,D=D+Math.imul(me,Ae)|0,D=D+Math.imul(ie,ue)|0,W=W+Math.imul(ie,Ae)|0,j=j+Math.imul(z,Te)|0,D=D+Math.imul(z,Pe)|0,D=D+Math.imul(ye,Te)|0,W=W+Math.imul(ye,Pe)|0;var et=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(et>>>26)|0,et&=67108863,j=Math.imul(le,ke),D=Math.imul(le,Xe),D=D+Math.imul(Z,ke)|0,W=Math.imul(Z,Xe),j=j+Math.imul(rt,Ze)|0,D=D+Math.imul(rt,xt)|0,D=D+Math.imul(wt,Ze)|0,W=W+Math.imul(wt,xt)|0,j=j+Math.imul(Ge,mt)|0,D=D+Math.imul(Ge,Tt)|0,D=D+Math.imul(ut,mt)|0,W=W+Math.imul(ut,Tt)|0,j=j+Math.imul(Ye,lt)|0,D=D+Math.imul(Ye,Mt)|0,D=D+Math.imul(st,lt)|0,W=W+Math.imul(st,Mt)|0,j=j+Math.imul(De,ce)|0,D=D+Math.imul(De,Y)|0,D=D+Math.imul($e,ce)|0,W=W+Math.imul($e,Y)|0,j=j+Math.imul(Ie,ve)|0,D=D+Math.imul(Ie,fe)|0,D=D+Math.imul(Oe,ve)|0,W=W+Math.imul(Oe,fe)|0,j=j+Math.imul(ne,G)|0,D=D+Math.imul(ne,re)|0,D=D+Math.imul(Se,G)|0,W=W+Math.imul(Se,re)|0,j=j+Math.imul(pe,ue)|0,D=D+Math.imul(pe,Ae)|0,D=D+Math.imul(be,ue)|0,W=W+Math.imul(be,Ae)|0,j=j+Math.imul(me,Te)|0,D=D+Math.imul(me,Pe)|0,D=D+Math.imul(ie,Te)|0,W=W+Math.imul(ie,Pe)|0;var ht=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ht>>>26)|0,ht&=67108863,j=Math.imul(le,Ze),D=Math.imul(le,xt),D=D+Math.imul(Z,Ze)|0,W=Math.imul(Z,xt),j=j+Math.imul(rt,mt)|0,D=D+Math.imul(rt,Tt)|0,D=D+Math.imul(wt,mt)|0,W=W+Math.imul(wt,Tt)|0,j=j+Math.imul(Ge,lt)|0,D=D+Math.imul(Ge,Mt)|0,D=D+Math.imul(ut,lt)|0,W=W+Math.imul(ut,Mt)|0,j=j+Math.imul(Ye,ce)|0,D=D+Math.imul(Ye,Y)|0,D=D+Math.imul(st,ce)|0,W=W+Math.imul(st,Y)|0,j=j+Math.imul(De,ve)|0,D=D+Math.imul(De,fe)|0,D=D+Math.imul($e,ve)|0,W=W+Math.imul($e,fe)|0,j=j+Math.imul(Ie,G)|0,D=D+Math.imul(Ie,re)|0,D=D+Math.imul(Oe,G)|0,W=W+Math.imul(Oe,re)|0,j=j+Math.imul(ne,ue)|0,D=D+Math.imul(ne,Ae)|0,D=D+Math.imul(Se,ue)|0,W=W+Math.imul(Se,Ae)|0,j=j+Math.imul(pe,Te)|0,D=D+Math.imul(pe,Pe)|0,D=D+Math.imul(be,Te)|0,W=W+Math.imul(be,Pe)|0;var it=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(it>>>26)|0,it&=67108863,j=Math.imul(le,mt),D=Math.imul(le,Tt),D=D+Math.imul(Z,mt)|0,W=Math.imul(Z,Tt),j=j+Math.imul(rt,lt)|0,D=D+Math.imul(rt,Mt)|0,D=D+Math.imul(wt,lt)|0,W=W+Math.imul(wt,Mt)|0,j=j+Math.imul(Ge,ce)|0,D=D+Math.imul(Ge,Y)|0,D=D+Math.imul(ut,ce)|0,W=W+Math.imul(ut,Y)|0,j=j+Math.imul(Ye,ve)|0,D=D+Math.imul(Ye,fe)|0,D=D+Math.imul(st,ve)|0,W=W+Math.imul(st,fe)|0,j=j+Math.imul(De,G)|0,D=D+Math.imul(De,re)|0,D=D+Math.imul($e,G)|0,W=W+Math.imul($e,re)|0,j=j+Math.imul(Ie,ue)|0,D=D+Math.imul(Ie,Ae)|0,D=D+Math.imul(Oe,ue)|0,W=W+Math.imul(Oe,Ae)|0,j=j+Math.imul(ne,Te)|0,D=D+Math.imul(ne,Pe)|0,D=D+Math.imul(Se,Te)|0,W=W+Math.imul(Se,Pe)|0;var pt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(pt>>>26)|0,pt&=67108863,j=Math.imul(le,lt),D=Math.imul(le,Mt),D=D+Math.imul(Z,lt)|0,W=Math.imul(Z,Mt),j=j+Math.imul(rt,ce)|0,D=D+Math.imul(rt,Y)|0,D=D+Math.imul(wt,ce)|0,W=W+Math.imul(wt,Y)|0,j=j+Math.imul(Ge,ve)|0,D=D+Math.imul(Ge,fe)|0,D=D+Math.imul(ut,ve)|0,W=W+Math.imul(ut,fe)|0,j=j+Math.imul(Ye,G)|0,D=D+Math.imul(Ye,re)|0,D=D+Math.imul(st,G)|0,W=W+Math.imul(st,re)|0,j=j+Math.imul(De,ue)|0,D=D+Math.imul(De,Ae)|0,D=D+Math.imul($e,ue)|0,W=W+Math.imul($e,Ae)|0,j=j+Math.imul(Ie,Te)|0,D=D+Math.imul(Ie,Pe)|0,D=D+Math.imul(Oe,Te)|0,W=W+Math.imul(Oe,Pe)|0;var at=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(at>>>26)|0,at&=67108863,j=Math.imul(le,ce),D=Math.imul(le,Y),D=D+Math.imul(Z,ce)|0,W=Math.imul(Z,Y),j=j+Math.imul(rt,ve)|0,D=D+Math.imul(rt,fe)|0,D=D+Math.imul(wt,ve)|0,W=W+Math.imul(wt,fe)|0,j=j+Math.imul(Ge,G)|0,D=D+Math.imul(Ge,re)|0,D=D+Math.imul(ut,G)|0,W=W+Math.imul(ut,re)|0,j=j+Math.imul(Ye,ue)|0,D=D+Math.imul(Ye,Ae)|0,D=D+Math.imul(st,ue)|0,W=W+Math.imul(st,Ae)|0,j=j+Math.imul(De,Te)|0,D=D+Math.imul(De,Pe)|0,D=D+Math.imul($e,Te)|0,W=W+Math.imul($e,Pe)|0;var ct=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(ct>>>26)|0,ct&=67108863,j=Math.imul(le,ve),D=Math.imul(le,fe),D=D+Math.imul(Z,ve)|0,W=Math.imul(Z,fe),j=j+Math.imul(rt,G)|0,D=D+Math.imul(rt,re)|0,D=D+Math.imul(wt,G)|0,W=W+Math.imul(wt,re)|0,j=j+Math.imul(Ge,ue)|0,D=D+Math.imul(Ge,Ae)|0,D=D+Math.imul(ut,ue)|0,W=W+Math.imul(ut,Ae)|0,j=j+Math.imul(Ye,Te)|0,D=D+Math.imul(Ye,Pe)|0,D=D+Math.imul(st,Te)|0,W=W+Math.imul(st,Pe)|0;var dt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(dt>>>26)|0,dt&=67108863,j=Math.imul(le,G),D=Math.imul(le,re),D=D+Math.imul(Z,G)|0,W=Math.imul(Z,re),j=j+Math.imul(rt,ue)|0,D=D+Math.imul(rt,Ae)|0,D=D+Math.imul(wt,ue)|0,W=W+Math.imul(wt,Ae)|0,j=j+Math.imul(Ge,Te)|0,D=D+Math.imul(Ge,Pe)|0,D=D+Math.imul(ut,Te)|0,W=W+Math.imul(ut,Pe)|0;var nt=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(nt>>>26)|0,nt&=67108863,j=Math.imul(le,ue),D=Math.imul(le,Ae),D=D+Math.imul(Z,ue)|0,W=Math.imul(Z,Ae),j=j+Math.imul(rt,Te)|0,D=D+Math.imul(rt,Pe)|0,D=D+Math.imul(wt,Te)|0,W=W+Math.imul(wt,Pe)|0;var Le=(F+j|0)+((D&8191)<<13)|0;F=(W+(D>>>13)|0)+(Le>>>26)|0,Le&=67108863,j=Math.imul(le,Te),D=Math.imul(le,Pe),D=D+Math.imul(Z,Te)|0,W=Math.imul(Z,Pe);var Be=(F+j|0)+((D&8191)<<13)|0;return F=(W+(D>>>13)|0)+(Be>>>26)|0,Be&=67108863,I[0]=Fe,I[1]=Ne,I[2]=At,I[3]=ot,I[4]=yt,I[5]=vt,I[6]=_t,I[7]=Ve,I[8]=ft,I[9]=et,I[10]=ht,I[11]=it,I[12]=pt,I[13]=at,I[14]=ct,I[15]=dt,I[16]=nt,I[17]=Le,I[18]=Be,F!==0&&(I[19]=F,y.length++),y};Math.imul||(T=A);function L(te,k,q){q.negative=k.negative^te.negative,q.length=te.length+k.length;for(var y=0,B=0,$=0;$<q.length-1;$++){var I=B;B=0;for(var F=y&67108863,j=Math.min($,k.length-1),D=Math.max(0,$-te.length+1);D<=j;D++){var W=$-D,R=te.words[W]|0,z=k.words[D]|0,ye=R*z,Ce=ye&67108863;I=I+(ye/67108864|0)|0,Ce=Ce+F|0,F=Ce&67108863,I=I+(Ce>>>26)|0,B+=I>>>26,I&=67108863}q.words[$]=F,y=I,I=B}return y!==0?q.words[$]=y:q.length--,q.strip()}function O(te,k,q){var y=new N;return y.mulp(te,k,q)}g.prototype.mulTo=function(k,q){var y,B=this.length+k.length;return this.length===10&&k.length===10?y=T(this,k,q):B<63?y=A(this,k,q):B<1024?y=L(this,k,q):y=O(this,k,q),y};function N(te,k){this.x=te,this.y=k}N.prototype.makeRBT=function(k){for(var q=new Array(k),y=g.prototype._countBits(k)-1,B=0;B<k;B++)q[B]=this.revBin(B,y,k);return q},N.prototype.revBin=function(k,q,y){if(k===0||k===y-1)return k;for(var B=0,$=0;$<q;$++)B|=(k&1)<<q-$-1,k>>=1;return B},N.prototype.permute=function(k,q,y,B,$,I){for(var F=0;F<I;F++)B[F]=q[k[F]],$[F]=y[k[F]]},N.prototype.transform=function(k,q,y,B,$,I){this.permute(I,k,q,y,B,$);for(var F=1;F<$;F<<=1)for(var j=F<<1,D=Math.cos(2*Math.PI/j),W=Math.sin(2*Math.PI/j),R=0;R<$;R+=j)for(var z=D,ye=W,Ce=0;Ce<F;Ce++){var me=y[R+Ce],ie=B[R+Ce],ee=y[R+Ce+F],pe=B[R+Ce+F],be=z*ee-ye*pe;pe=z*pe+ye*ee,ee=be,y[R+Ce]=me+ee,B[R+Ce]=ie+pe,y[R+Ce+F]=me-ee,B[R+Ce+F]=ie-pe,Ce!==j&&(be=D*z-W*ye,ye=D*ye+W*z,z=be)}},N.prototype.guessLen13b=function(k,q){var y=Math.max(q,k)|1,B=y&1,$=0;for(y=y/2|0;y;y=y>>>1)$++;return 1<<$+1+B},N.prototype.conjugate=function(k,q,y){if(!(y<=1))for(var B=0;B<y/2;B++){var $=k[B];k[B]=k[y-B-1],k[y-B-1]=$,$=q[B],q[B]=-q[y-B-1],q[y-B-1]=-$}},N.prototype.normalize13b=function(k,q){for(var y=0,B=0;B<q/2;B++){var $=Math.round(k[2*B+1]/q)*8192+Math.round(k[2*B]/q)+y;k[B]=$&67108863,$<67108864?y=0:y=$/67108864|0}return k},N.prototype.convert13b=function(k,q,y,B){for(var $=0,I=0;I<q;I++)$=$+(k[I]|0),y[2*I]=$&8191,$=$>>>13,y[2*I+1]=$&8191,$=$>>>13;for(I=2*q;I<B;++I)y[I]=0;m($===0),m(($&-8192)===0)},N.prototype.stub=function(k){for(var q=new Array(k),y=0;y<k;y++)q[y]=0;return q},N.prototype.mulp=function(k,q,y){var B=2*this.guessLen13b(k.length,q.length),$=this.makeRBT(B),I=this.stub(B),F=new Array(B),j=new Array(B),D=new Array(B),W=new Array(B),R=new Array(B),z=new Array(B),ye=y.words;ye.length=B,this.convert13b(k.words,k.length,F,B),this.convert13b(q.words,q.length,W,B),this.transform(F,I,j,D,B,$),this.transform(W,I,R,z,B,$);for(var Ce=0;Ce<B;Ce++){var me=j[Ce]*R[Ce]-D[Ce]*z[Ce];D[Ce]=j[Ce]*z[Ce]+D[Ce]*R[Ce],j[Ce]=me}return this.conjugate(j,D,B),this.transform(j,D,ye,I,B,$),this.conjugate(ye,I,B),this.normalize13b(ye,B),y.negative=k.negative^q.negative,y.length=k.length+q.length,y.strip()},g.prototype.mul=function(k){var q=new g(null);return q.words=new Array(this.length+k.length),this.mulTo(k,q)},g.prototype.mulf=function(k){var q=new g(null);return q.words=new Array(this.length+k.length),O(this,k,q)},g.prototype.imul=function(k){return this.clone().mulTo(k,this)},g.prototype.imuln=function(k){m(typeof k=="number"),m(k<67108864);for(var q=0,y=0;y<this.length;y++){var B=(this.words[y]|0)*k,$=(B&67108863)+(q&67108863);q>>=26,q+=B/67108864|0,q+=$>>>26,this.words[y]=$&67108863}return q!==0&&(this.words[y]=q,this.length++),this.length=k===0?1:this.length,this},g.prototype.muln=function(k){return this.clone().imuln(k)},g.prototype.sqr=function(){return this.mul(this)},g.prototype.isqr=function(){return this.imul(this.clone())},g.prototype.pow=function(k){var q=M(k);if(q.length===0)return new g(1);for(var y=this,B=0;B<q.length&&q[B]===0;B++,y=y.sqr());if(++B<q.length)for(var $=y.sqr();B<q.length;B++,$=$.sqr())q[B]!==0&&(y=y.mul($));return y},g.prototype.iushln=function(k){m(typeof k=="number"&&k>=0);var q=k%26,y=(k-q)/26,B=67108863>>>26-q<<26-q,$;if(q!==0){var I=0;for($=0;$<this.length;$++){var F=this.words[$]&B,j=(this.words[$]|0)-F<<q;this.words[$]=j|I,I=F>>>26-q}I&&(this.words[$]=I,this.length++)}if(y!==0){for($=this.length-1;$>=0;$--)this.words[$+y]=this.words[$];for($=0;$<y;$++)this.words[$]=0;this.length+=y}return this.strip()},g.prototype.ishln=function(k){return m(this.negative===0),this.iushln(k)},g.prototype.iushrn=function(k,q,y){m(typeof k=="number"&&k>=0);var B;q?B=(q-q%26)/26:B=0;var $=k%26,I=Math.min((k-$)/26,this.length),F=67108863^67108863>>>$<<$,j=y;if(B-=I,B=Math.max(0,B),j){for(var D=0;D<I;D++)j.words[D]=this.words[D];j.length=I}if(I!==0)if(this.length>I)for(this.length-=I,D=0;D<this.length;D++)this.words[D]=this.words[D+I];else this.words[0]=0,this.length=1;var W=0;for(D=this.length-1;D>=0&&(W!==0||D>=B);D--){var R=this.words[D]|0;this.words[D]=W<<26-$|R>>>$,W=R&F}return j&&W!==0&&(j.words[j.length++]=W),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},g.prototype.ishrn=function(k,q,y){return m(this.negative===0),this.iushrn(k,q,y)},g.prototype.shln=function(k){return this.clone().ishln(k)},g.prototype.ushln=function(k){return this.clone().iushln(k)},g.prototype.shrn=function(k){return this.clone().ishrn(k)},g.prototype.ushrn=function(k){return this.clone().iushrn(k)},g.prototype.testn=function(k){m(typeof k=="number"&&k>=0);var q=k%26,y=(k-q)/26,B=1<<q;if(this.length<=y)return!1;var $=this.words[y];return!!($&B)},g.prototype.imaskn=function(k){m(typeof k=="number"&&k>=0);var q=k%26,y=(k-q)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(q!==0&&y++,this.length=Math.min(y,this.length),q!==0){var B=67108863^67108863>>>q<<q;this.words[this.length-1]&=B}return this.strip()},g.prototype.maskn=function(k){return this.clone().imaskn(k)},g.prototype.iaddn=function(k){return m(typeof k=="number"),m(k<67108864),k<0?this.isubn(-k):this.negative!==0?this.length===1&&(this.words[0]|0)<k?(this.words[0]=k-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(k),this.negative=1,this):this._iaddn(k)},g.prototype._iaddn=function(k){this.words[0]+=k;for(var q=0;q<this.length&&this.words[q]>=67108864;q++)this.words[q]-=67108864,q===this.length-1?this.words[q+1]=1:this.words[q+1]++;return this.length=Math.max(this.length,q+1),this},g.prototype.isubn=function(k){if(m(typeof k=="number"),m(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var q=0;q<this.length&&this.words[q]<0;q++)this.words[q]+=67108864,this.words[q+1]-=1;return this.strip()},g.prototype.addn=function(k){return this.clone().iaddn(k)},g.prototype.subn=function(k){return this.clone().isubn(k)},g.prototype.iabs=function(){return this.negative=0,this},g.prototype.abs=function(){return this.clone().iabs()},g.prototype._ishlnsubmul=function(k,q,y){var B=k.length+y,$;this._expand(B);var I,F=0;for($=0;$<k.length;$++){I=(this.words[$+y]|0)+F;var j=(k.words[$]|0)*q;I-=j&67108863,F=(I>>26)-(j/67108864|0),this.words[$+y]=I&67108863}for(;$<this.length-y;$++)I=(this.words[$+y]|0)+F,F=I>>26,this.words[$+y]=I&67108863;if(F===0)return this.strip();for(m(F===-1),F=0,$=0;$<this.length;$++)I=-(this.words[$]|0)+F,F=I>>26,this.words[$]=I&67108863;return this.negative=1,this.strip()},g.prototype._wordDiv=function(k,q){var y=this.length-k.length,B=this.clone(),$=k,I=$.words[$.length-1]|0,F=this._countBits(I);y=26-F,y!==0&&($=$.ushln(y),B.iushln(y),I=$.words[$.length-1]|0);var j=B.length-$.length,D;if(q!=="mod"){D=new g(null),D.length=j+1,D.words=new Array(D.length);for(var W=0;W<D.length;W++)D.words[W]=0}var R=B.clone()._ishlnsubmul($,1,j);R.negative===0&&(B=R,D&&(D.words[j]=1));for(var z=j-1;z>=0;z--){var ye=(B.words[$.length+z]|0)*67108864+(B.words[$.length+z-1]|0);for(ye=Math.min(ye/I|0,67108863),B._ishlnsubmul($,ye,z);B.negative!==0;)ye--,B.negative=0,B._ishlnsubmul($,1,z),B.isZero()||(B.negative^=1);D&&(D.words[z]=ye)}return D&&D.strip(),B.strip(),q!=="div"&&y!==0&&B.iushrn(y),{div:D||null,mod:B}},g.prototype.divmod=function(k,q,y){if(m(!k.isZero()),this.isZero())return{div:new g(0),mod:new g(0)};var B,$,I;return this.negative!==0&&k.negative===0?(I=this.neg().divmod(k,q),q!=="mod"&&(B=I.div.neg()),q!=="div"&&($=I.mod.neg(),y&&$.negative!==0&&$.iadd(k)),{div:B,mod:$}):this.negative===0&&k.negative!==0?(I=this.divmod(k.neg(),q),q!=="mod"&&(B=I.div.neg()),{div:B,mod:I.mod}):(this.negative&k.negative)!==0?(I=this.neg().divmod(k.neg(),q),q!=="div"&&($=I.mod.neg(),y&&$.negative!==0&&$.isub(k)),{div:I.div,mod:$}):k.length>this.length||this.cmp(k)<0?{div:new g(0),mod:this}:k.length===1?q==="div"?{div:this.divn(k.words[0]),mod:null}:q==="mod"?{div:null,mod:new g(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new g(this.modn(k.words[0]))}:this._wordDiv(k,q)},g.prototype.div=function(k){return this.divmod(k,"div",!1).div},g.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},g.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},g.prototype.divRound=function(k){var q=this.divmod(k);if(q.mod.isZero())return q.div;var y=q.div.negative!==0?q.mod.isub(k):q.mod,B=k.ushrn(1),$=k.andln(1),I=y.cmp(B);return I<0||$===1&&I===0?q.div:q.div.negative!==0?q.div.isubn(1):q.div.iaddn(1)},g.prototype.modn=function(k){m(k<=67108863);for(var q=(1<<26)%k,y=0,B=this.length-1;B>=0;B--)y=(q*y+(this.words[B]|0))%k;return y},g.prototype.idivn=function(k){m(k<=67108863);for(var q=0,y=this.length-1;y>=0;y--){var B=(this.words[y]|0)+q*67108864;this.words[y]=B/k|0,q=B%k}return this.strip()},g.prototype.divn=function(k){return this.clone().idivn(k)},g.prototype.egcd=function(k){m(k.negative===0),m(!k.isZero());var q=this,y=k.clone();q.negative!==0?q=q.umod(k):q=q.clone();for(var B=new g(1),$=new g(0),I=new g(0),F=new g(1),j=0;q.isEven()&&y.isEven();)q.iushrn(1),y.iushrn(1),++j;for(var D=y.clone(),W=q.clone();!q.isZero();){for(var R=0,z=1;(q.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for(q.iushrn(R);R-- >0;)(B.isOdd()||$.isOdd())&&(B.iadd(D),$.isub(W)),B.iushrn(1),$.iushrn(1);for(var ye=0,Ce=1;(y.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(y.iushrn(ye);ye-- >0;)(I.isOdd()||F.isOdd())&&(I.iadd(D),F.isub(W)),I.iushrn(1),F.iushrn(1);q.cmp(y)>=0?(q.isub(y),B.isub(I),$.isub(F)):(y.isub(q),I.isub(B),F.isub($))}return{a:I,b:F,gcd:y.iushln(j)}},g.prototype._invmp=function(k){m(k.negative===0),m(!k.isZero());var q=this,y=k.clone();q.negative!==0?q=q.umod(k):q=q.clone();for(var B=new g(1),$=new g(0),I=y.clone();q.cmpn(1)>0&&y.cmpn(1)>0;){for(var F=0,j=1;(q.words[0]&j)===0&&F<26;++F,j<<=1);if(F>0)for(q.iushrn(F);F-- >0;)B.isOdd()&&B.iadd(I),B.iushrn(1);for(var D=0,W=1;(y.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(y.iushrn(D);D-- >0;)$.isOdd()&&$.iadd(I),$.iushrn(1);q.cmp(y)>=0?(q.isub(y),B.isub($)):(y.isub(q),$.isub(B))}var R;return q.cmpn(1)===0?R=B:R=$,R.cmpn(0)<0&&R.iadd(k),R},g.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var q=this.clone(),y=k.clone();q.negative=0,y.negative=0;for(var B=0;q.isEven()&&y.isEven();B++)q.iushrn(1),y.iushrn(1);do{for(;q.isEven();)q.iushrn(1);for(;y.isEven();)y.iushrn(1);var $=q.cmp(y);if($<0){var I=q;q=y,y=I}else if($===0||y.cmpn(1)===0)break;q.isub(y)}while(!0);return y.iushln(B)},g.prototype.invm=function(k){return this.egcd(k).a.umod(k)},g.prototype.isEven=function(){return(this.words[0]&1)===0},g.prototype.isOdd=function(){return(this.words[0]&1)===1},g.prototype.andln=function(k){return this.words[0]&k},g.prototype.bincn=function(k){m(typeof k=="number");var q=k%26,y=(k-q)/26,B=1<<q;if(this.length<=y)return this._expand(y+1),this.words[y]|=B,this;for(var $=B,I=y;$!==0&&I<this.length;I++){var F=this.words[I]|0;F+=$,$=F>>>26,F&=67108863,this.words[I]=F}return $!==0&&(this.words[I]=$,this.length++),this},g.prototype.isZero=function(){return this.length===1&&this.words[0]===0},g.prototype.cmpn=function(k){var q=k<0;if(this.negative!==0&&!q)return-1;if(this.negative===0&&q)return 1;this.strip();var y;if(this.length>1)y=1;else{q&&(k=-k),m(k<=67108863,"Number is too big");var B=this.words[0]|0;y=B===k?0:B<k?-1:1}return this.negative!==0?-y|0:y},g.prototype.cmp=function(k){if(this.negative!==0&&k.negative===0)return-1;if(this.negative===0&&k.negative!==0)return 1;var q=this.ucmp(k);return this.negative!==0?-q|0:q},g.prototype.ucmp=function(k){if(this.length>k.length)return 1;if(this.length<k.length)return-1;for(var q=0,y=this.length-1;y>=0;y--){var B=this.words[y]|0,$=k.words[y]|0;if(B!==$){B<$?q=-1:B>$&&(q=1);break}}return q},g.prototype.gtn=function(k){return this.cmpn(k)===1},g.prototype.gt=function(k){return this.cmp(k)===1},g.prototype.gten=function(k){return this.cmpn(k)>=0},g.prototype.gte=function(k){return this.cmp(k)>=0},g.prototype.ltn=function(k){return this.cmpn(k)===-1},g.prototype.lt=function(k){return this.cmp(k)===-1},g.prototype.lten=function(k){return this.cmpn(k)<=0},g.prototype.lte=function(k){return this.cmp(k)<=0},g.prototype.eqn=function(k){return this.cmpn(k)===0},g.prototype.eq=function(k){return this.cmp(k)===0},g.red=function(k){return new he(k)},g.prototype.toRed=function(k){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},g.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},g.prototype._forceRed=function(k){return this.red=k,this},g.prototype.forceRed=function(k){return m(!this.red,"Already a number in reduction context"),this._forceRed(k)},g.prototype.redAdd=function(k){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},g.prototype.redIAdd=function(k){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},g.prototype.redSub=function(k){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},g.prototype.redISub=function(k){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},g.prototype.redShl=function(k){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},g.prototype.redMul=function(k){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},g.prototype.redIMul=function(k){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},g.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},g.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},g.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},g.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},g.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},g.prototype.redPow=function(k){return m(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var H={k256:null,p224:null,p192:null,p25519:null};function V(te,k){this.name=te,this.p=new g(k,16),this.n=this.p.bitLength(),this.k=new g(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var k=new g(null);return k.words=new Array(Math.ceil(this.n/13)),k},V.prototype.ireduce=function(k){var q=k,y;do this.split(q,this.tmp),q=this.imulK(q),q=q.iadd(this.tmp),y=q.bitLength();while(y>this.n);var B=y<this.n?-1:q.ucmp(this.p);return B===0?(q.words[0]=0,q.length=1):B>0?q.isub(this.p):q.strip!==void 0?q.strip():q._strip(),q},V.prototype.split=function(k,q){k.iushrn(this.n,0,q)},V.prototype.imulK=function(k){return k.imul(this.k)};function X(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(X,V),X.prototype.split=function(k,q){for(var y=4194303,B=Math.min(k.length,9),$=0;$<B;$++)q.words[$]=k.words[$];if(q.length=B,k.length<=9){k.words[0]=0,k.length=1;return}var I=k.words[9];for(q.words[q.length++]=I&y,$=10;$<k.length;$++){var F=k.words[$]|0;k.words[$-10]=(F&y)<<4|I>>>22,I=F}I>>>=22,k.words[$-10]=I,I===0&&k.length>10?k.length-=10:k.length-=9},X.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var q=0,y=0;y<k.length;y++){var B=k.words[y]|0;q+=B*977,k.words[y]=q&67108863,q=B*64+(q/67108864|0)}return k.words[k.length-1]===0&&(k.length--,k.words[k.length-1]===0&&k.length--),k};function oe(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(oe,V);function se(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(se,V);function de(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(de,V),de.prototype.imulK=function(k){for(var q=0,y=0;y<k.length;y++){var B=(k.words[y]|0)*19+q,$=B&67108863;B>>>=26,k.words[y]=$,q=B}return q!==0&&(k.words[k.length++]=q),k},g._prime=function(k){if(H[k])return H[k];var q;if(k==="k256")q=new X;else if(k==="p224")q=new oe;else if(k==="p192")q=new se;else if(k==="p25519")q=new de;else throw new Error("Unknown prime "+k);return H[k]=q,q};function he(te){if(typeof te=="string"){var k=g._prime(te);this.m=k.p,this.prime=k}else m(te.gtn(1),"modulus must be greater than 1"),this.m=te,this.prime=null}he.prototype._verify1=function(k){m(k.negative===0,"red works only with positives"),m(k.red,"red works only with red numbers")},he.prototype._verify2=function(k,q){m((k.negative|q.negative)===0,"red works only with positives"),m(k.red&&k.red===q.red,"red works only with red numbers")},he.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},he.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},he.prototype.add=function(k,q){this._verify2(k,q);var y=k.add(q);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},he.prototype.iadd=function(k,q){this._verify2(k,q);var y=k.iadd(q);return y.cmp(this.m)>=0&&y.isub(this.m),y},he.prototype.sub=function(k,q){this._verify2(k,q);var y=k.sub(q);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},he.prototype.isub=function(k,q){this._verify2(k,q);var y=k.isub(q);return y.cmpn(0)<0&&y.iadd(this.m),y},he.prototype.shl=function(k,q){return this._verify1(k),this.imod(k.ushln(q))},he.prototype.imul=function(k,q){return this._verify2(k,q),this.imod(k.imul(q))},he.prototype.mul=function(k,q){return this._verify2(k,q),this.imod(k.mul(q))},he.prototype.isqr=function(k){return this.imul(k,k.clone())},he.prototype.sqr=function(k){return this.mul(k,k)},he.prototype.sqrt=function(k){if(k.isZero())return k.clone();var q=this.m.andln(3);if(m(q%2===1),q===3){var y=this.m.add(new g(1)).iushrn(2);return this.pow(k,y)}for(var B=this.m.subn(1),$=0;!B.isZero()&&B.andln(1)===0;)$++,B.iushrn(1);m(!B.isZero());var I=new g(1).toRed(this),F=I.redNeg(),j=this.m.subn(1).iushrn(1),D=this.m.bitLength();for(D=new g(2*D*D).toRed(this);this.pow(D,j).cmp(F)!==0;)D.redIAdd(F);for(var W=this.pow(D,B),R=this.pow(k,B.addn(1).iushrn(1)),z=this.pow(k,B),ye=$;z.cmp(I)!==0;){for(var Ce=z,me=0;Ce.cmp(I)!==0;me++)Ce=Ce.redSqr();m(me<ye);var ie=this.pow(W,new g(1).iushln(ye-me-1));R=R.redMul(ie),W=ie.redSqr(),z=z.redMul(W),ye=me}return R},he.prototype.invm=function(k){var q=k._invmp(this.m);return q.negative!==0?(q.negative=0,this.imod(q).redNeg()):this.imod(q)},he.prototype.pow=function(k,q){if(q.isZero())return new g(1).toRed(this);if(q.cmpn(1)===0)return k.clone();var y=4,B=new Array(1<<y);B[0]=new g(1).toRed(this),B[1]=k;for(var $=2;$<B.length;$++)B[$]=this.mul(B[$-1],k);var I=B[0],F=0,j=0,D=q.bitLength()%26;for(D===0&&(D=26),$=q.length-1;$>=0;$--){for(var W=q.words[$],R=D-1;R>=0;R--){var z=W>>R&1;if(I!==B[0]&&(I=this.sqr(I)),z===0&&F===0){j=0;continue}F<<=1,F|=z,j++,!(j!==y&&($!==0||R!==0))&&(I=this.mul(I,B[F]),j=0,F=0)}D=26}return I},he.prototype.convertTo=function(k){var q=k.umod(this.m);return q===k?q.clone():q},he.prototype.convertFrom=function(k){var q=k.clone();return q.red=null,q},g.mont=function(k){return new we(k)};function we(te){he.call(this,te),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(we,he),we.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},we.prototype.convertFrom=function(k){var q=this.imod(k.mul(this.rinv));return q.red=null,q},we.prototype.imul=function(k,q){if(k.isZero()||q.isZero())return k.words[0]=0,k.length=1,k;var y=k.imul(q),B=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=y.isub(B).iushrn(this.shift),I=$;return $.cmp(this.m)>=0?I=$.isub(this.m):$.cmpn(0)<0&&(I=$.iadd(this.m)),I._forceRed(this)},we.prototype.mul=function(k,q){if(k.isZero()||q.isZero())return new g(0)._forceRed(this);var y=k.mul(q),B=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=y.isub(B).iushrn(this.shift),I=$;return $.cmp(this.m)>=0?I=$.isub(this.m):$.cmpn(0)<0&&(I=$.iadd(this.m)),I._forceRed(this)},we.prototype.invm=function(k){var q=this.imod(k._invmp(this.m).mul(this.r2));return q._forceRed(this)}})(r,bn$4)})(bn$5)),bn$5.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var r;brorand.exports=function(v){return r||(r=new f(null)),r.generate(v)};function f(m){this.rand=m}if(brorand.exports.Rand=f,f.prototype.generate=function(v){return this._rand(v)},f.prototype._rand=function(v){if(this.rand.getBytes)return this.rand.getBytes(v);for(var g=new Uint8Array(v),w=0;w<g.length;w++)g[w]=this.rand.getByte();return g},typeof self=="object")self.crypto&&self.crypto.getRandomValues?f.prototype._rand=function(v){var g=new Uint8Array(v);return self.crypto.getRandomValues(g),g}:self.msCrypto&&self.msCrypto.getRandomValues?f.prototype._rand=function(v){var g=new Uint8Array(v);return self.msCrypto.getRandomValues(g),g}:typeof window=="object"&&(f.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var d=requireCryptoBrowserify();if(typeof d.randomBytes!="function")throw new Error("Not supported");f.prototype._rand=function(v){return d.randomBytes(v)}}catch{}return brorand.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var r=requireBn$2(),f=requireBrorand();function d(m){this.rand=m||new f.Rand}return mr=d,d.create=function(v){return new d(v)},d.prototype._randbelow=function(v){var g=v.bitLength(),w=Math.ceil(g/8);do var x=new r(this.rand.generate(w));while(x.cmp(v)>=0);return x},d.prototype._randrange=function(v,g){var w=g.sub(v);return v.add(this._randbelow(w))},d.prototype.test=function(v,g,w){var x=v.bitLength(),S=r.mont(v),_=new r(1).toRed(S);g||(g=Math.max(1,x/48|0));for(var b=v.subn(1),C=0;!b.testn(C);C++);for(var E=v.shrn(C),M=b.toRed(S),A=!0;g>0;g--){var T=this._randrange(new r(2),b);w&&w(T);var L=T.toRed(S).redPow(E);if(!(L.cmp(_)===0||L.cmp(M)===0)){for(var O=1;O<C;O++){if(L=L.redSqr(),L.cmp(_)===0)return!1;if(L.cmp(M)===0)break}if(O===C)return!1}}return A},d.prototype.getDivisor=function(v,g){var w=v.bitLength(),x=r.mont(v),S=new r(1).toRed(x);g||(g=Math.max(1,w/48|0));for(var _=v.subn(1),b=0;!_.testn(b);b++);for(var C=v.shrn(b),E=_.toRed(x);g>0;g--){var M=this._randrange(new r(2),_),A=v.gcd(M);if(A.cmpn(1)!==0)return A;var T=M.toRed(x).redPow(C);if(!(T.cmp(S)===0||T.cmp(E)===0)){for(var L=1;L<b;L++){if(T=T.redSqr(),T.cmp(S)===0)return T.fromRed().subn(1).gcd(v);if(T.cmp(E)===0)break}if(L===b)return T=T.redSqr(),T.fromRed().subn(1).gcd(v)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var r=requireBrowser$b();generatePrime=L,L.simpleSieve=A,L.fermatTest=T;var f=requireBn$2(),d=new f(24),m=requireMr(),v=new m,g=new f(1),w=new f(2),x=new f(5);new f(16),new f(8);var S=new f(10),_=new f(3);new f(7);var b=new f(11),C=new f(4);new f(12);var E=null;function M(){if(E!==null)return E;var O=1048576,N=[];N[0]=2;for(var H=1,V=3;V<O;V+=2){for(var X=Math.ceil(Math.sqrt(V)),oe=0;oe<H&&N[oe]<=X&&V%N[oe]!==0;oe++);H!==oe&&N[oe]<=X||(N[H++]=V)}return E=N,N}function A(O){for(var N=M(),H=0;H<N.length;H++)if(O.modn(N[H])===0)return O.cmpn(N[H])===0;return!0}function T(O){var N=f.mont(O);return w.toRed(N).redPow(O.subn(1)).fromRed().cmpn(1)===0}function L(O,N){if(O<16)return N===2||N===5?new f([140,123]):new f([140,39]);N=new f(N);for(var H,V;;){for(H=new f(r(Math.ceil(O/8)));H.bitLength()>O;)H.ishrn(1);if(H.isEven()&&H.iadd(g),H.testn(1)||H.iadd(w),N.cmp(w)){if(!N.cmp(x))for(;H.mod(S).cmp(_);)H.iadd(C)}else for(;H.mod(d).cmp(b);)H.iadd(C);if(V=H.shrn(1),A(V)&&A(H)&&T(V)&&T(H)&&v.test(V)&&v.test(H))return H}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var r=requireBn$2(),f=requireMr(),d=new f,m=new r(24),v=new r(11),g=new r(10),w=new r(3),x=new r(7),S=requireGeneratePrime(),_=requireBrowser$b();dh=A;function b(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this._pub=new r(L),this}function C(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this._priv=new r(L),this}var E={};function M(L,O){var N=O.toString("hex"),H=[N,L.toString(16)].join("_");if(H in E)return E[H];var V=0;if(L.isEven()||!S.simpleSieve||!S.fermatTest(L)||!d.test(L))return V+=1,N==="02"||N==="05"?V+=8:V+=4,E[H]=V,V;d.test(L.shrn(1))||(V+=2);var X;switch(N){case"02":L.mod(m).cmp(v)&&(V+=8);break;case"05":X=L.mod(g),X.cmp(w)&&X.cmp(x)&&(V+=8);break;default:V+=4}return E[H]=V,V}function A(L,O,N){this.setGenerator(O),this.__prime=new r(L),this._prime=r.mont(this.__prime),this._primeLen=L.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,N?(this.setPublicKey=b,this.setPrivateKey=C):this._primeCode=8}Object.defineProperty(A.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=M(this.__prime,this.__gen)),this._primeCode}}),A.prototype.generateKeys=function(){return this._priv||(this._priv=new r(_(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},A.prototype.computeSecret=function(L){L=new r(L),L=L.toRed(this._prime);var O=L.redPow(this._priv).fromRed(),N=new Buffer(O.toArray()),H=this.getPrime();if(N.length<H.length){var V=new Buffer(H.length-N.length);V.fill(0),N=Buffer.concat([V,N])}return N},A.prototype.getPublicKey=function(O){return T(this._pub,O)},A.prototype.getPrivateKey=function(O){return T(this._priv,O)},A.prototype.getPrime=function(L){return T(this.__prime,L)},A.prototype.getGenerator=function(L){return T(this._gen,L)},A.prototype.setGenerator=function(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this.__gen=L,this._gen=new r(L),this};function T(L,O){var N=new Buffer(L.toArray());return O?N.toString(O):N}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var r=requireGeneratePrime(),f=require$$1$1,d=requireDh();function m(w){var x=new Buffer(f[w].prime,"hex"),S=new Buffer(f[w].gen,"hex");return new d(x,S)}var v={binary:!0,hex:!0,base64:!0};function g(w,x,S,_){return Buffer.isBuffer(x)||v[x]===void 0?g(w,"binary",x,S):(x=x||"binary",_=_||"binary",S=S||new Buffer([2]),Buffer.isBuffer(S)||(S=new Buffer(S,_)),typeof w=="number"?new d(r(w,S),S,!0):(Buffer.isBuffer(w)||(w=new Buffer(w,x)),new d(w,S,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=m,browser$4.createDiffieHellman=browser$4.DiffieHellman=g,browser$4}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1>"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:r}:processNextickArgs.exports=process$1;function r(f,d,m,v){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var g=arguments.length,w,x;switch(g){case 0:case 1:return process$1.nextTick(f);case 2:return process$1.nextTick(function(){f.call(null,d)});case 3:return process$1.nextTick(function(){f.call(null,d,m)});case 4:return process$1.nextTick(function(){f.call(null,d,m,v)});default:for(w=new Array(g-1),x=0;x<w.length;)w[x++]=arguments[x];return process$1.nextTick(function(){f.apply(null,w)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var r={}.toString;return isarray=Array.isArray||function(f){return r.call(f)=="[object Array]"},isarray}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,(function(r,f){var d=requireDist(),m=d.Buffer;function v(w,x){for(var S in w)x[S]=w[S]}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?r.exports=d:(v(d,f),f.Buffer=g);function g(w,x,S){return m(w,x,S)}v(m,g),g.from=function(w,x,S){if(typeof w=="number")throw new TypeError("Argument must not be a number");return m(w,x,S)},g.alloc=function(w,x,S){if(typeof w!="number")throw new TypeError("Argument must be a number");var _=m(w);return x!==void 0?typeof S=="string"?_.fill(x,S):_.fill(x):_.fill(0),_},g.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return m(w)},g.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(w)}})(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function r(T){return Array.isArray?Array.isArray(T):A(T)==="[object Array]"}util.isArray=r;function f(T){return typeof T=="boolean"}util.isBoolean=f;function d(T){return T===null}util.isNull=d;function m(T){return T==null}util.isNullOrUndefined=m;function v(T){return typeof T=="number"}util.isNumber=v;function g(T){return typeof T=="string"}util.isString=g;function w(T){return typeof T=="symbol"}util.isSymbol=w;function x(T){return T===void 0}util.isUndefined=x;function S(T){return A(T)==="[object RegExp]"}util.isRegExp=S;function _(T){return typeof T=="object"&&T!==null}util.isObject=_;function b(T){return A(T)==="[object Date]"}util.isDate=b;function C(T){return A(T)==="[object Error]"||T instanceof Error}util.isError=C;function E(T){return typeof T=="function"}util.isFunction=E;function M(T){return T===null||typeof T=="boolean"||typeof T=="number"||typeof T=="string"||typeof T=="symbol"||typeof T>"u"}util.isPrimitive=M,util.isBuffer=requireDist().Buffer.isBuffer;function A(T){return Object.prototype.toString.call(T)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,(function(r){function f(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}var d=requireSafeBuffer().Buffer,m=requireUtil$1();function v(g,w,x){g.copy(w,x)}r.exports=(function(){function g(){f(this,g),this.head=null,this.tail=null,this.length=0}return g.prototype.push=function(x){var S={data:x,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length},g.prototype.unshift=function(x){var S={data:x,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length},g.prototype.shift=function(){if(this.length!==0){var x=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,x}},g.prototype.clear=function(){this.head=this.tail=null,this.length=0},g.prototype.join=function(x){if(this.length===0)return"";for(var S=this.head,_=""+S.data;S=S.next;)_+=x+S.data;return _},g.prototype.concat=function(x){if(this.length===0)return d.alloc(0);for(var S=d.allocUnsafe(x>>>0),_=this.head,b=0;_;)v(_.data,S,b),b+=_.data.length,_=_.next;return S},g})(),m&&m.inspect&&m.inspect.custom&&(r.exports.prototype[m.inspect.custom]=function(){var g=m.inspect({length:this.length});return this.constructor.name+" "+g})})(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var r=requireProcessNextickArgs();function f(v,g){var w=this,x=this._readableState&&this._readableState.destroyed,S=this._writableState&&this._writableState.destroyed;return x||S?(g?g(v):v&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(m,this,v)):r.nextTick(m,this,v)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(v||null,function(_){!g&&_?w._writableState?w._writableState.errorEmitted||(w._writableState.errorEmitted=!0,r.nextTick(m,w,_)):r.nextTick(m,w,_):g&&g(_)}),this)}function d(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function m(v,g){v.emit("error",g)}return destroy_1={destroy:f,undestroy:d},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var r=requireProcessNextickArgs();_stream_writable=T;function f(I){var F=this;this.next=null,this.entry=null,this.finish=function(){$(F,I)}}var d=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:r.nextTick,m;T.WritableState=M;var v=Object.create(requireUtil());v.inherits=requireInherits_browser();var g={deprecate:requireBrowser$a()},w=requireStreamBrowser(),x=requireSafeBuffer().Buffer,S=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _(I){return x.from(I)}function b(I){return x.isBuffer(I)||I instanceof S}var C=requireDestroy();v.inherits(T,w);function E(){}function M(I,F){m=m||require_stream_duplex(),I=I||{};var j=F instanceof m;this.objectMode=!!I.objectMode,j&&(this.objectMode=this.objectMode||!!I.writableObjectMode);var D=I.highWaterMark,W=I.writableHighWaterMark,R=this.objectMode?16:16*1024;D||D===0?this.highWaterMark=D:j&&(W||W===0)?this.highWaterMark=W:this.highWaterMark=R,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=I.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){se(F,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}M.prototype.getBuffer=function(){for(var F=this.bufferedRequest,j=[];F;)j.push(F),F=F.next;return j},(function(){try{Object.defineProperty(M.prototype,"buffer",{get:g.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var A;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(A=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(I){return A.call(this,I)?!0:this!==T?!1:I&&I._writableState instanceof M}})):A=function(I){return I instanceof this};function T(I){if(m=m||require_stream_duplex(),!A.call(T,this)&&!(this instanceof m))return new T(I);this._writableState=new M(I,this),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),w.call(this)}T.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function L(I,F){var j=new Error("write after end");I.emit("error",j),r.nextTick(F,j)}function O(I,F,j,D){var W=!0,R=!1;return j===null?R=new TypeError("May not write null values to stream"):typeof j!="string"&&j!==void 0&&!F.objectMode&&(R=new TypeError("Invalid non-string/buffer chunk")),R&&(I.emit("error",R),r.nextTick(D,R),W=!1),W}T.prototype.write=function(I,F,j){var D=this._writableState,W=!1,R=!D.objectMode&&b(I);return R&&!x.isBuffer(I)&&(I=_(I)),typeof F=="function"&&(j=F,F=null),R?F="buffer":F||(F=D.defaultEncoding),typeof j!="function"&&(j=E),D.ended?L(this,j):(R||O(this,D,I,j))&&(D.pendingcb++,W=H(this,D,R,I,F,j)),W},T.prototype.cork=function(){var I=this._writableState;I.corked++},T.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&we(this,I))},T.prototype.setDefaultEncoding=function(F){if(typeof F=="string"&&(F=F.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+F);return this._writableState.defaultEncoding=F,this};function N(I,F,j){return!I.objectMode&&I.decodeStrings!==!1&&typeof F=="string"&&(F=x.from(F,j)),F}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function H(I,F,j,D,W,R){if(!j){var z=N(F,D,W);D!==z&&(j=!0,W="buffer",D=z)}var ye=F.objectMode?1:D.length;F.length+=ye;var Ce=F.length<F.highWaterMark;if(Ce||(F.needDrain=!0),F.writing||F.corked){var me=F.lastBufferedRequest;F.lastBufferedRequest={chunk:D,encoding:W,isBuf:j,callback:R,next:null},me?me.next=F.lastBufferedRequest:F.bufferedRequest=F.lastBufferedRequest,F.bufferedRequestCount+=1}else V(I,F,!1,ye,D,W,R);return Ce}function V(I,F,j,D,W,R,z){F.writelen=D,F.writecb=z,F.writing=!0,F.sync=!0,j?I._writev(W,F.onwrite):I._write(W,R,F.onwrite),F.sync=!1}function X(I,F,j,D,W){--F.pendingcb,j?(r.nextTick(W,D),r.nextTick(y,I,F),I._writableState.errorEmitted=!0,I.emit("error",D)):(W(D),I._writableState.errorEmitted=!0,I.emit("error",D),y(I,F))}function oe(I){I.writing=!1,I.writecb=null,I.length-=I.writelen,I.writelen=0}function se(I,F){var j=I._writableState,D=j.sync,W=j.writecb;if(oe(j),F)X(I,j,D,F,W);else{var R=te(j);!R&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&we(I,j),D?d(de,I,j,R,W):de(I,j,R,W)}}function de(I,F,j,D){j||he(I,F),F.pendingcb--,D(),y(I,F)}function he(I,F){F.length===0&&F.needDrain&&(F.needDrain=!1,I.emit("drain"))}function we(I,F){F.bufferProcessing=!0;var j=F.bufferedRequest;if(I._writev&&j&&j.next){var D=F.bufferedRequestCount,W=new Array(D),R=F.corkedRequestsFree;R.entry=j;for(var z=0,ye=!0;j;)W[z]=j,j.isBuf||(ye=!1),j=j.next,z+=1;W.allBuffers=ye,V(I,F,!0,F.length,W,"",R.finish),F.pendingcb++,F.lastBufferedRequest=null,R.next?(F.corkedRequestsFree=R.next,R.next=null):F.corkedRequestsFree=new f(F),F.bufferedRequestCount=0}else{for(;j;){var Ce=j.chunk,me=j.encoding,ie=j.callback,ee=F.objectMode?1:Ce.length;if(V(I,F,!1,ee,Ce,me,ie),j=j.next,F.bufferedRequestCount--,F.writing)break}j===null&&(F.lastBufferedRequest=null)}F.bufferedRequest=j,F.bufferProcessing=!1}T.prototype._write=function(I,F,j){j(new Error("_write() is not implemented"))},T.prototype._writev=null,T.prototype.end=function(I,F,j){var D=this._writableState;typeof I=="function"?(j=I,I=null,F=null):typeof F=="function"&&(j=F,F=null),I!=null&&this.write(I,F),D.corked&&(D.corked=1,this.uncork()),D.ending||B(this,D,j)};function te(I){return I.ending&&I.length===0&&I.bufferedRequest===null&&!I.finished&&!I.writing}function k(I,F){I._final(function(j){F.pendingcb--,j&&I.emit("error",j),F.prefinished=!0,I.emit("prefinish"),y(I,F)})}function q(I,F){!F.prefinished&&!F.finalCalled&&(typeof I._final=="function"?(F.pendingcb++,F.finalCalled=!0,r.nextTick(k,I,F)):(F.prefinished=!0,I.emit("prefinish")))}function y(I,F){var j=te(F);return j&&(q(I,F),F.pendingcb===0&&(F.finished=!0,I.emit("finish"))),j}function B(I,F,j){F.ending=!0,y(I,F),j&&(F.finished?r.nextTick(j):I.once("finish",j)),F.ended=!0,I.writable=!1}function $(I,F,j){var D=I.entry;for(I.entry=null;D;){var W=D.callback;F.pendingcb--,W(j),D=D.next}F.corkedRequestsFree.next=I}return Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(I){this._writableState&&(this._writableState.destroyed=I)}}),T.prototype.destroy=C.destroy,T.prototype._undestroy=C.undestroy,T.prototype._destroy=function(I,F){this.end(),F(I)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var r=requireProcessNextickArgs(),f=Object.keys||function(C){var E=[];for(var M in C)E.push(M);return E};_stream_duplex=S;var d=Object.create(requireUtil());d.inherits=requireInherits_browser();var m=require_stream_readable(),v=require_stream_writable();d.inherits(S,m);for(var g=f(v.prototype),w=0;w<g.length;w++){var x=g[w];S.prototype[x]||(S.prototype[x]=v.prototype[x])}function S(C){if(!(this instanceof S))return new S(C);m.call(this,C),v.call(this,C),C&&C.readable===!1&&(this.readable=!1),C&&C.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,C&&C.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",_)}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function _(){this.allowHalfOpen||this._writableState.ended||r.nextTick(b,this)}function b(C){C.end()}return Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(C){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=C,this._writableState.destroyed=C)}}),S.prototype._destroy=function(C,E){this.push(null),this.end(),r.nextTick(E,C)},_stream_duplex}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var r=requireProcessNextickArgs();_stream_readable=N;var f=requireIsarray(),d;N.ReadableState=O,requireEvents().EventEmitter;var m=function(ie,ee){return ie.listeners(ee).length},v=requireStreamBrowser(),g=requireSafeBuffer().Buffer,w=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function x(ie){return g.from(ie)}function S(ie){return g.isBuffer(ie)||ie instanceof w}var _=Object.create(requireUtil());_.inherits=requireInherits_browser();var b=requireUtil$1(),C=void 0;b&&b.debuglog?C=b.debuglog("stream"):C=function(){};var E=requireBufferList(),M=requireDestroy(),A;_.inherits(N,v);var T=["error","close","destroy","pause","resume"];function L(ie,ee,pe){if(typeof ie.prependListener=="function")return ie.prependListener(ee,pe);!ie._events||!ie._events[ee]?ie.on(ee,pe):f(ie._events[ee])?ie._events[ee].unshift(pe):ie._events[ee]=[pe,ie._events[ee]]}function O(ie,ee){d=d||require_stream_duplex(),ie=ie||{};var pe=ee instanceof d;this.objectMode=!!ie.objectMode,pe&&(this.objectMode=this.objectMode||!!ie.readableObjectMode);var be=ie.highWaterMark,ae=ie.readableHighWaterMark,ne=this.objectMode?16:16*1024;be||be===0?this.highWaterMark=be:pe&&(ae||ae===0)?this.highWaterMark=ae:this.highWaterMark=ne,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new E,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ie.encoding&&(A||(A=requireString_decoder().StringDecoder),this.decoder=new A(ie.encoding),this.encoding=ie.encoding)}function N(ie){if(d=d||require_stream_duplex(),!(this instanceof N))return new N(ie);this._readableState=new O(ie,this),this.readable=!0,ie&&(typeof ie.read=="function"&&(this._read=ie.read),typeof ie.destroy=="function"&&(this._destroy=ie.destroy)),v.call(this)}Object.defineProperty(N.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ie){this._readableState&&(this._readableState.destroyed=ie)}}),N.prototype.destroy=M.destroy,N.prototype._undestroy=M.undestroy,N.prototype._destroy=function(ie,ee){this.push(null),ee(ie)},N.prototype.push=function(ie,ee){var pe=this._readableState,be;return pe.objectMode?be=!0:typeof ie=="string"&&(ee=ee||pe.defaultEncoding,ee!==pe.encoding&&(ie=g.from(ie,ee),ee=""),be=!0),H(this,ie,ee,!1,be)},N.prototype.unshift=function(ie){return H(this,ie,null,!0,!1)};function H(ie,ee,pe,be,ae){var ne=ie._readableState;if(ee===null)ne.reading=!1,we(ie,ne);else{var Se;ae||(Se=X(ne,ee)),Se?ie.emit("error",Se):ne.objectMode||ee&&ee.length>0?(typeof ee!="string"&&!ne.objectMode&&Object.getPrototypeOf(ee)!==g.prototype&&(ee=x(ee)),be?ne.endEmitted?ie.emit("error",new Error("stream.unshift() after end event")):V(ie,ne,ee,!0):ne.ended?ie.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!pe?(ee=ne.decoder.write(ee),ne.objectMode||ee.length!==0?V(ie,ne,ee,!1):q(ie,ne)):V(ie,ne,ee,!1))):be||(ne.reading=!1)}return oe(ne)}function V(ie,ee,pe,be){ee.flowing&&ee.length===0&&!ee.sync?(ie.emit("data",pe),ie.read(0)):(ee.length+=ee.objectMode?1:pe.length,be?ee.buffer.unshift(pe):ee.buffer.push(pe),ee.needReadable&&te(ie)),q(ie,ee)}function X(ie,ee){var pe;return!S(ee)&&typeof ee!="string"&&ee!==void 0&&!ie.objectMode&&(pe=new TypeError("Invalid non-string/buffer chunk")),pe}function oe(ie){return!ie.ended&&(ie.needReadable||ie.length<ie.highWaterMark||ie.length===0)}N.prototype.isPaused=function(){return this._readableState.flowing===!1},N.prototype.setEncoding=function(ie){return A||(A=requireString_decoder().StringDecoder),this._readableState.decoder=new A(ie),this._readableState.encoding=ie,this};var se=8388608;function de(ie){return ie>=se?ie=se:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function he(ie,ee){return ie<=0||ee.length===0&&ee.ended?0:ee.objectMode?1:ie!==ie?ee.flowing&&ee.length?ee.buffer.head.data.length:ee.length:(ie>ee.highWaterMark&&(ee.highWaterMark=de(ie)),ie<=ee.length?ie:ee.ended?ee.length:(ee.needReadable=!0,0))}N.prototype.read=function(ie){C("read",ie),ie=parseInt(ie,10);var ee=this._readableState,pe=ie;if(ie!==0&&(ee.emittedReadable=!1),ie===0&&ee.needReadable&&(ee.length>=ee.highWaterMark||ee.ended))return C("read: emitReadable",ee.length,ee.ended),ee.length===0&&ee.ended?ye(this):te(this),null;if(ie=he(ie,ee),ie===0&&ee.ended)return ee.length===0&&ye(this),null;var be=ee.needReadable;C("need readable",be),(ee.length===0||ee.length-ie<ee.highWaterMark)&&(be=!0,C("length less than watermark",be)),ee.ended||ee.reading?(be=!1,C("reading or ended",be)):be&&(C("do read"),ee.reading=!0,ee.sync=!0,ee.length===0&&(ee.needReadable=!0),this._read(ee.highWaterMark),ee.sync=!1,ee.reading||(ie=he(pe,ee)));var ae;return ie>0?ae=D(ie,ee):ae=null,ae===null?(ee.needReadable=!0,ie=0):ee.length-=ie,ee.length===0&&(ee.ended||(ee.needReadable=!0),pe!==ie&&ee.ended&&ye(this)),ae!==null&&this.emit("data",ae),ae};function we(ie,ee){if(!ee.ended){if(ee.decoder){var pe=ee.decoder.end();pe&&pe.length&&(ee.buffer.push(pe),ee.length+=ee.objectMode?1:pe.length)}ee.ended=!0,te(ie)}}function te(ie){var ee=ie._readableState;ee.needReadable=!1,ee.emittedReadable||(C("emitReadable",ee.flowing),ee.emittedReadable=!0,ee.sync?r.nextTick(k,ie):k(ie))}function k(ie){C("emit readable"),ie.emit("readable"),j(ie)}function q(ie,ee){ee.readingMore||(ee.readingMore=!0,r.nextTick(y,ie,ee))}function y(ie,ee){for(var pe=ee.length;!ee.reading&&!ee.flowing&&!ee.ended&&ee.length<ee.highWaterMark&&(C("maybeReadMore read 0"),ie.read(0),pe!==ee.length);)pe=ee.length;ee.readingMore=!1}N.prototype._read=function(ie){this.emit("error",new Error("_read() is not implemented"))},N.prototype.pipe=function(ie,ee){var pe=this,be=this._readableState;switch(be.pipesCount){case 0:be.pipes=ie;break;case 1:be.pipes=[be.pipes,ie];break;default:be.pipes.push(ie);break}be.pipesCount+=1,C("pipe count=%d opts=%j",be.pipesCount,ee);var ae=(!ee||ee.end!==!1)&&ie!==process$1.stdout&&ie!==process$1.stderr,ne=ae?qe:Je;be.endEmitted?r.nextTick(ne):pe.once("end",ne),ie.on("unpipe",Se);function Se(Ge,ut){C("onunpipe"),Ge===pe&&ut&&ut.hasUnpiped===!1&&(ut.hasUnpiped=!0,Ue())}function qe(){C("onend"),ie.end()}var Ie=B(pe);ie.on("drain",Ie);var Oe=!1;function Ue(){C("cleanup"),ie.removeListener("close",Ye),ie.removeListener("finish",st),ie.removeListener("drain",Ie),ie.removeListener("error",je),ie.removeListener("unpipe",Se),pe.removeListener("end",qe),pe.removeListener("end",Je),pe.removeListener("data",$e),Oe=!0,be.awaitDrain&&(!ie._writableState||ie._writableState.needDrain)&&Ie()}var De=!1;pe.on("data",$e);function $e(Ge){C("ondata"),De=!1;var ut=ie.write(Ge);ut===!1&&!De&&((be.pipesCount===1&&be.pipes===ie||be.pipesCount>1&&me(be.pipes,ie)!==-1)&&!Oe&&(C("false write response, pause",be.awaitDrain),be.awaitDrain++,De=!0),pe.pause())}function je(Ge){C("onerror",Ge),Je(),ie.removeListener("error",je),m(ie,"error")===0&&ie.emit("error",Ge)}L(ie,"error",je);function Ye(){ie.removeListener("finish",st),Je()}ie.once("close",Ye);function st(){C("onfinish"),ie.removeListener("close",Ye),Je()}ie.once("finish",st);function Je(){C("unpipe"),pe.unpipe(ie)}return ie.emit("pipe",pe),be.flowing||(C("pipe resume"),pe.resume()),ie};function B(ie){return function(){var ee=ie._readableState;C("pipeOnDrain",ee.awaitDrain),ee.awaitDrain&&ee.awaitDrain--,ee.awaitDrain===0&&m(ie,"data")&&(ee.flowing=!0,j(ie))}}N.prototype.unpipe=function(ie){var ee=this._readableState,pe={hasUnpiped:!1};if(ee.pipesCount===0)return this;if(ee.pipesCount===1)return ie&&ie!==ee.pipes?this:(ie||(ie=ee.pipes),ee.pipes=null,ee.pipesCount=0,ee.flowing=!1,ie&&ie.emit("unpipe",this,pe),this);if(!ie){var be=ee.pipes,ae=ee.pipesCount;ee.pipes=null,ee.pipesCount=0,ee.flowing=!1;for(var ne=0;ne<ae;ne++)be[ne].emit("unpipe",this,{hasUnpiped:!1});return this}var Se=me(ee.pipes,ie);return Se===-1?this:(ee.pipes.splice(Se,1),ee.pipesCount-=1,ee.pipesCount===1&&(ee.pipes=ee.pipes[0]),ie.emit("unpipe",this,pe),this)},N.prototype.on=function(ie,ee){var pe=v.prototype.on.call(this,ie,ee);if(ie==="data")this._readableState.flowing!==!1&&this.resume();else if(ie==="readable"){var be=this._readableState;!be.endEmitted&&!be.readableListening&&(be.readableListening=be.needReadable=!0,be.emittedReadable=!1,be.reading?be.length&&te(this):r.nextTick($,this))}return pe},N.prototype.addListener=N.prototype.on;function $(ie){C("readable nexttick read 0"),ie.read(0)}N.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(C("resume"),ie.flowing=!0,I(this,ie)),this};function I(ie,ee){ee.resumeScheduled||(ee.resumeScheduled=!0,r.nextTick(F,ie,ee))}function F(ie,ee){ee.reading||(C("resume read 0"),ie.read(0)),ee.resumeScheduled=!1,ee.awaitDrain=0,ie.emit("resume"),j(ie),ee.flowing&&!ee.reading&&ie.read(0)}N.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function j(ie){var ee=ie._readableState;for(C("flow",ee.flowing);ee.flowing&&ie.read()!==null;);}N.prototype.wrap=function(ie){var ee=this,pe=this._readableState,be=!1;ie.on("end",function(){if(C("wrapped end"),pe.decoder&&!pe.ended){var Se=pe.decoder.end();Se&&Se.length&&ee.push(Se)}ee.push(null)}),ie.on("data",function(Se){if(C("wrapped data"),pe.decoder&&(Se=pe.decoder.write(Se)),!(pe.objectMode&&Se==null)&&!(!pe.objectMode&&(!Se||!Se.length))){var qe=ee.push(Se);qe||(be=!0,ie.pause())}});for(var ae in ie)this[ae]===void 0&&typeof ie[ae]=="function"&&(this[ae]=(function(Se){return function(){return ie[Se].apply(ie,arguments)}})(ae));for(var ne=0;ne<T.length;ne++)ie.on(T[ne],this.emit.bind(this,T[ne]));return this._read=function(Se){C("wrapped _read",Se),be&&(be=!1,ie.resume())},this},Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),N._fromList=D;function D(ie,ee){if(ee.length===0)return null;var pe;return ee.objectMode?pe=ee.buffer.shift():!ie||ie>=ee.length?(ee.decoder?pe=ee.buffer.join(""):ee.buffer.length===1?pe=ee.buffer.head.data:pe=ee.buffer.concat(ee.length),ee.buffer.clear()):pe=W(ie,ee.buffer,ee.decoder),pe}function W(ie,ee,pe){var be;return ie<ee.head.data.length?(be=ee.head.data.slice(0,ie),ee.head.data=ee.head.data.slice(ie)):ie===ee.head.data.length?be=ee.shift():be=pe?R(ie,ee):z(ie,ee),be}function R(ie,ee){var pe=ee.head,be=1,ae=pe.data;for(ie-=ae.length;pe=pe.next;){var ne=pe.data,Se=ie>ne.length?ne.length:ie;if(Se===ne.length?ae+=ne:ae+=ne.slice(0,ie),ie-=Se,ie===0){Se===ne.length?(++be,pe.next?ee.head=pe.next:ee.head=ee.tail=null):(ee.head=pe,pe.data=ne.slice(Se));break}++be}return ee.length-=be,ae}function z(ie,ee){var pe=g.allocUnsafe(ie),be=ee.head,ae=1;for(be.data.copy(pe),ie-=be.data.length;be=be.next;){var ne=be.data,Se=ie>ne.length?ne.length:ie;if(ne.copy(pe,pe.length-ie,0,Se),ie-=Se,ie===0){Se===ne.length?(++ae,be.next?ee.head=be.next:ee.head=ee.tail=null):(ee.head=be,be.data=ne.slice(Se));break}++ae}return ee.length-=ae,pe}function ye(ie){var ee=ie._readableState;if(ee.length>0)throw new Error('"endReadable()" called on non-empty stream');ee.endEmitted||(ee.ended=!0,r.nextTick(Ce,ee,ie))}function Ce(ie,ee){!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,ee.readable=!1,ee.emit("end"))}function me(ie,ee){for(var pe=0,be=ie.length;pe<be;pe++)if(ie[pe]===ee)return pe;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=m;var r=require_stream_duplex(),f=Object.create(requireUtil());f.inherits=requireInherits_browser(),f.inherits(m,r);function d(w,x){var S=this._transformState;S.transforming=!1;var _=S.writecb;if(!_)return this.emit("error",new Error("write callback called multiple times"));S.writechunk=null,S.writecb=null,x!=null&&this.push(x),_(w);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function m(w){if(!(this instanceof m))return new m(w);r.call(this,w),this._transformState={afterTransform:d.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,w&&(typeof w.transform=="function"&&(this._transform=w.transform),typeof w.flush=="function"&&(this._flush=w.flush)),this.on("prefinish",v)}function v(){var w=this;typeof this._flush=="function"?this._flush(function(x,S){g(w,x,S)}):g(this,null,null)}m.prototype.push=function(w,x){return this._transformState.needTransform=!1,r.prototype.push.call(this,w,x)},m.prototype._transform=function(w,x,S){throw new Error("_transform() is not implemented")},m.prototype._write=function(w,x,S){var _=this._transformState;if(_.writecb=S,_.writechunk=w,_.writeencoding=x,!_.transforming){var b=this._readableState;(_.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},m.prototype._read=function(w){var x=this._transformState;x.writechunk!==null&&x.writecb&&!x.transforming?(x.transforming=!0,this._transform(x.writechunk,x.writeencoding,x.afterTransform)):x.needTransform=!0},m.prototype._destroy=function(w,x){var S=this;r.prototype._destroy.call(this,w,function(_){x(_),S.emit("close")})};function g(w,x,S){if(x)return w.emit("error",x);if(S!=null&&w.push(S),w._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(w._transformState.transforming)throw new Error("Calling transform done when still transforming");return w.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=d;var r=require_stream_transform(),f=Object.create(requireUtil());f.inherits=requireInherits_browser(),f.inherits(d,r);function d(m){if(!(this instanceof d))return new d(m);r.call(this,m)}return d.prototype._transform=function(m,v,g){g(null,m)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,(function(r,f){f=r.exports=require_stream_readable(),f.Stream=f,f.Readable=f,f.Writable=require_stream_writable(),f.Duplex=require_stream_duplex(),f.Transform=require_stream_transform(),f.PassThrough=require_stream_passthrough()})(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var sign={exports:{}},bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,(function(r){(function(f,d){function m(q,y){if(!q)throw new Error(y||"Assertion failed")}function v(q,y){q.super_=y;var B=function(){};B.prototype=y.prototype,q.prototype=new B,q.prototype.constructor=q}function g(q,y,B){if(g.isBN(q))return q;this.negative=0,this.words=null,this.length=0,this.red=null,q!==null&&((y==="le"||y==="be")&&(B=y,y=10),this._init(q||0,y||10,B||"be"))}typeof f=="object"?f.exports=g:d.BN=g,g.BN=g,g.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}g.isBN=function(y){return y instanceof g?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===g.wordSize&&Array.isArray(y.words)},g.max=function(y,B){return y.cmp(B)>0?y:B},g.min=function(y,B){return y.cmp(B)<0?y:B},g.prototype._init=function(y,B,$){if(typeof y=="number")return this._initNumber(y,B,$);if(typeof y=="object")return this._initArray(y,B,$);B==="hex"&&(B=16),m(B===(B|0)&&B>=2&&B<=36),y=y.toString().replace(/\s+/g,"");var I=0;y[0]==="-"&&(I++,this.negative=1),I<y.length&&(B===16?this._parseHex(y,I,$):(this._parseBase(y,B,I),$==="le"&&this._initArray(this.toArray(),B,$)))},g.prototype._initNumber=function(y,B,$){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(m(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),B,$)},g.prototype._initArray=function(y,B,$){if(m(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F,j,D=0;if($==="be")for(I=y.length-1,F=0;I>=0;I-=3)j=y[I]|y[I-1]<<8|y[I-2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);else if($==="le")for(I=0,F=0;I<y.length;I+=3)j=y[I]|y[I+1]<<8|y[I+2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);return this._strip()};function x(q,y){var B=q.charCodeAt(y);if(B>=48&&B<=57)return B-48;if(B>=65&&B<=70)return B-55;if(B>=97&&B<=102)return B-87;m(!1,"Invalid character in "+q)}function S(q,y,B){var $=x(q,B);return B-1>=y&&($|=x(q,B-1)<<4),$}g.prototype._parseHex=function(y,B,$){this.length=Math.ceil((y.length-B)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F=0,j=0,D;if($==="be")for(I=y.length-1;I>=B;I-=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8;else{var W=y.length-B;for(I=W%2===0?B+1:B;I<y.length;I+=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8}this._strip()};function _(q,y,B,$){for(var I=0,F=0,j=Math.min(q.length,B),D=y;D<j;D++){var W=q.charCodeAt(D)-48;I*=$,W>=49?F=W-49+10:W>=17?F=W-17+10:F=W,m(W>=0&&F<$,"Invalid character"),I+=F}return I}g.prototype._parseBase=function(y,B,$){this.words=[0],this.length=1;for(var I=0,F=1;F<=67108863;F*=B)I++;I--,F=F/B|0;for(var j=y.length-$,D=j%I,W=Math.min(j,j-D)+$,R=0,z=$;z<W;z+=I)R=_(y,z,z+I,B),this.imuln(F),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(D!==0){var ye=1;for(R=_(y,z,y.length,B),z=0;z<D;z++)ye*=B;this.imuln(ye),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},g.prototype.copy=function(y){y.words=new Array(this.length);for(var B=0;B<this.length;B++)y.words[B]=this.words[B];y.length=this.length,y.negative=this.negative,y.red=this.red};function b(q,y){q.words=y.words,q.length=y.length,q.negative=y.negative,q.red=y.red}if(g.prototype._move=function(y){b(y,this)},g.prototype.clone=function(){var y=new g(null);return this.copy(y),y},g.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},g.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},g.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{g.prototype[Symbol.for("nodejs.util.inspect.custom")]=C}catch{g.prototype.inspect=C}else g.prototype.inspect=C;function C(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];g.prototype.toString=function(y,B){y=y||10,B=B|0||1;var $;if(y===16||y==="hex"){$="";for(var I=0,F=0,j=0;j<this.length;j++){var D=this.words[j],W=((D<<I|F)&16777215).toString(16);F=D>>>24-I&16777215,I+=2,I>=26&&(I-=26,j--),F!==0||j!==this.length-1?$=E[6-W.length]+W+$:$=W+$}for(F!==0&&($=F.toString(16)+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(y===(y|0)&&y>=2&&y<=36){var R=M[y],z=A[y];$="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var Ce=ye.modrn(z).toString(y);ye=ye.idivn(z),ye.isZero()?$=Ce+$:$=E[R-Ce.length]+Ce+$}for(this.isZero()&&($="0"+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}m(!1,"Base should be between 2 and 36")},g.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},g.prototype.toJSON=function(){return this.toString(16,2)},w&&(g.prototype.toBuffer=function(y,B){return this.toArrayLike(w,y,B)}),g.prototype.toArray=function(y,B){return this.toArrayLike(Array,y,B)};var T=function(y,B){return y.allocUnsafe?y.allocUnsafe(B):new y(B)};g.prototype.toArrayLike=function(y,B,$){this._strip();var I=this.byteLength(),F=$||Math.max(1,I);m(I<=F,"byte array longer than desired length"),m(F>0,"Requested array length <= 0");var j=T(y,F),D=B==="le"?"LE":"BE";return this["_toArrayLike"+D](j,I),j},g.prototype._toArrayLikeLE=function(y,B){for(var $=0,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$++]=D&255,$<y.length&&(y[$++]=D>>8&255),$<y.length&&(y[$++]=D>>16&255),j===6?($<y.length&&(y[$++]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($<y.length)for(y[$++]=I;$<y.length;)y[$++]=0},g.prototype._toArrayLikeBE=function(y,B){for(var $=y.length-1,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$--]=D&255,$>=0&&(y[$--]=D>>8&255),$>=0&&(y[$--]=D>>16&255),j===6?($>=0&&(y[$--]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($>=0)for(y[$--]=I;$>=0;)y[$--]=0},Math.clz32?g.prototype._countBits=function(y){return 32-Math.clz32(y)}:g.prototype._countBits=function(y){var B=y,$=0;return B>=4096&&($+=13,B>>>=13),B>=64&&($+=7,B>>>=7),B>=8&&($+=4,B>>>=4),B>=2&&($+=2,B>>>=2),$+B},g.prototype._zeroBits=function(y){if(y===0)return 26;var B=y,$=0;return(B&8191)===0&&($+=13,B>>>=13),(B&127)===0&&($+=7,B>>>=7),(B&15)===0&&($+=4,B>>>=4),(B&3)===0&&($+=2,B>>>=2),(B&1)===0&&$++,$},g.prototype.bitLength=function(){var y=this.words[this.length-1],B=this._countBits(y);return(this.length-1)*26+B};function L(q){for(var y=new Array(q.bitLength()),B=0;B<y.length;B++){var $=B/26|0,I=B%26;y[B]=q.words[$]>>>I&1}return y}g.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,B=0;B<this.length;B++){var $=this._zeroBits(this.words[B]);if(y+=$,$!==26)break}return y},g.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},g.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},g.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},g.prototype.isNeg=function(){return this.negative!==0},g.prototype.neg=function(){return this.clone().ineg()},g.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},g.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var B=0;B<y.length;B++)this.words[B]=this.words[B]|y.words[B];return this._strip()},g.prototype.ior=function(y){return m((this.negative|y.negative)===0),this.iuor(y)},g.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},g.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},g.prototype.iuand=function(y){var B;this.length>y.length?B=y:B=this;for(var $=0;$<B.length;$++)this.words[$]=this.words[$]&y.words[$];return this.length=B.length,this._strip()},g.prototype.iand=function(y){return m((this.negative|y.negative)===0),this.iuand(y)},g.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},g.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},g.prototype.iuxor=function(y){var B,$;this.length>y.length?(B=this,$=y):(B=y,$=this);for(var I=0;I<$.length;I++)this.words[I]=B.words[I]^$.words[I];if(this!==B)for(;I<B.length;I++)this.words[I]=B.words[I];return this.length=B.length,this._strip()},g.prototype.ixor=function(y){return m((this.negative|y.negative)===0),this.iuxor(y)},g.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},g.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},g.prototype.inotn=function(y){m(typeof y=="number"&&y>=0);var B=Math.ceil(y/26)|0,$=y%26;this._expand(B),$>0&&B--;for(var I=0;I<B;I++)this.words[I]=~this.words[I]&67108863;return $>0&&(this.words[I]=~this.words[I]&67108863>>26-$),this._strip()},g.prototype.notn=function(y){return this.clone().inotn(y)},g.prototype.setn=function(y,B){m(typeof y=="number"&&y>=0);var $=y/26|0,I=y%26;return this._expand($+1),B?this.words[$]=this.words[$]|1<<I:this.words[$]=this.words[$]&~(1<<I),this._strip()},g.prototype.iadd=function(y){var B;if(this.negative!==0&&y.negative===0)return this.negative=0,B=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,B=this.isub(y),y.negative=1,B._normSign();var $,I;this.length>y.length?($=this,I=y):($=y,I=this);for(var F=0,j=0;j<I.length;j++)B=($.words[j]|0)+(I.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;for(;F!==0&&j<$.length;j++)B=($.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;if(this.length=$.length,F!==0)this.words[this.length]=F,this.length++;else if($!==this)for(;j<$.length;j++)this.words[j]=$.words[j];return this},g.prototype.add=function(y){var B;return y.negative!==0&&this.negative===0?(y.negative=0,B=this.sub(y),y.negative^=1,B):y.negative===0&&this.negative!==0?(this.negative=0,B=y.sub(this),this.negative=1,B):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},g.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var B=this.iadd(y);return y.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var $=this.cmp(y);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,F;$>0?(I=this,F=y):(I=y,F=this);for(var j=0,D=0;D<F.length;D++)B=(I.words[D]|0)-(F.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;for(;j!==0&&D<I.length;D++)B=(I.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;if(j===0&&D<I.length&&I!==this)for(;D<I.length;D++)this.words[D]=I.words[D];return this.length=Math.max(this.length,D),I!==this&&(this.negative=1),this._strip()},g.prototype.sub=function(y){return this.clone().isub(y)};function O(q,y,B){B.negative=y.negative^q.negative;var $=q.length+y.length|0;B.length=$,$=$-1|0;var I=q.words[0]|0,F=y.words[0]|0,j=I*F,D=j&67108863,W=j/67108864|0;B.words[0]=D;for(var R=1;R<$;R++){for(var z=W>>>26,ye=W&67108863,Ce=Math.min(R,y.length-1),me=Math.max(0,R-q.length+1);me<=Ce;me++){var ie=R-me|0;I=q.words[ie]|0,F=y.words[me]|0,j=I*F+ye,z+=j/67108864|0,ye=j&67108863}B.words[R]=ye|0,W=z|0}return W!==0?B.words[R]=W|0:B.length--,B._strip()}var N=function(y,B,$){var I=y.words,F=B.words,j=$.words,D=0,W,R,z,ye=I[0]|0,Ce=ye&8191,me=ye>>>13,ie=I[1]|0,ee=ie&8191,pe=ie>>>13,be=I[2]|0,ae=be&8191,ne=be>>>13,Se=I[3]|0,qe=Se&8191,Ie=Se>>>13,Oe=I[4]|0,Ue=Oe&8191,De=Oe>>>13,$e=I[5]|0,je=$e&8191,Ye=$e>>>13,st=I[6]|0,Je=st&8191,Ge=st>>>13,ut=I[7]|0,gt=ut&8191,rt=ut>>>13,wt=I[8]|0,bt=wt&8191,le=wt>>>13,Z=I[9]|0,J=Z&8191,ge=Z>>>13,Ee=F[0]|0,Re=Ee&8191,ke=Ee>>>13,Xe=F[1]|0,He=Xe&8191,Ze=Xe>>>13,xt=F[2]|0,tt=xt&8191,mt=xt>>>13,Tt=F[3]|0,St=Tt&8191,lt=Tt>>>13,Mt=F[4]|0,Ct=Mt&8191,ce=Mt>>>13,Y=F[5]|0,Q=Y&8191,ve=Y>>>13,fe=F[6]|0,U=fe&8191,G=fe>>>13,re=F[7]|0,K=re&8191,ue=re>>>13,Ae=F[8]|0,xe=Ae&8191,Te=Ae>>>13,Pe=F[9]|0,Fe=Pe&8191,Ne=Pe>>>13;$.negative=y.negative^B.negative,$.length=19,W=Math.imul(Ce,Re),R=Math.imul(Ce,ke),R=R+Math.imul(me,Re)|0,z=Math.imul(me,ke);var At=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(At>>>26)|0,At&=67108863,W=Math.imul(ee,Re),R=Math.imul(ee,ke),R=R+Math.imul(pe,Re)|0,z=Math.imul(pe,ke),W=W+Math.imul(Ce,He)|0,R=R+Math.imul(Ce,Ze)|0,R=R+Math.imul(me,He)|0,z=z+Math.imul(me,Ze)|0;var ot=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ot>>>26)|0,ot&=67108863,W=Math.imul(ae,Re),R=Math.imul(ae,ke),R=R+Math.imul(ne,Re)|0,z=Math.imul(ne,ke),W=W+Math.imul(ee,He)|0,R=R+Math.imul(ee,Ze)|0,R=R+Math.imul(pe,He)|0,z=z+Math.imul(pe,Ze)|0,W=W+Math.imul(Ce,tt)|0,R=R+Math.imul(Ce,mt)|0,R=R+Math.imul(me,tt)|0,z=z+Math.imul(me,mt)|0;var yt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(yt>>>26)|0,yt&=67108863,W=Math.imul(qe,Re),R=Math.imul(qe,ke),R=R+Math.imul(Ie,Re)|0,z=Math.imul(Ie,ke),W=W+Math.imul(ae,He)|0,R=R+Math.imul(ae,Ze)|0,R=R+Math.imul(ne,He)|0,z=z+Math.imul(ne,Ze)|0,W=W+Math.imul(ee,tt)|0,R=R+Math.imul(ee,mt)|0,R=R+Math.imul(pe,tt)|0,z=z+Math.imul(pe,mt)|0,W=W+Math.imul(Ce,St)|0,R=R+Math.imul(Ce,lt)|0,R=R+Math.imul(me,St)|0,z=z+Math.imul(me,lt)|0;var vt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(vt>>>26)|0,vt&=67108863,W=Math.imul(Ue,Re),R=Math.imul(Ue,ke),R=R+Math.imul(De,Re)|0,z=Math.imul(De,ke),W=W+Math.imul(qe,He)|0,R=R+Math.imul(qe,Ze)|0,R=R+Math.imul(Ie,He)|0,z=z+Math.imul(Ie,Ze)|0,W=W+Math.imul(ae,tt)|0,R=R+Math.imul(ae,mt)|0,R=R+Math.imul(ne,tt)|0,z=z+Math.imul(ne,mt)|0,W=W+Math.imul(ee,St)|0,R=R+Math.imul(ee,lt)|0,R=R+Math.imul(pe,St)|0,z=z+Math.imul(pe,lt)|0,W=W+Math.imul(Ce,Ct)|0,R=R+Math.imul(Ce,ce)|0,R=R+Math.imul(me,Ct)|0,z=z+Math.imul(me,ce)|0;var _t=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(_t>>>26)|0,_t&=67108863,W=Math.imul(je,Re),R=Math.imul(je,ke),R=R+Math.imul(Ye,Re)|0,z=Math.imul(Ye,ke),W=W+Math.imul(Ue,He)|0,R=R+Math.imul(Ue,Ze)|0,R=R+Math.imul(De,He)|0,z=z+Math.imul(De,Ze)|0,W=W+Math.imul(qe,tt)|0,R=R+Math.imul(qe,mt)|0,R=R+Math.imul(Ie,tt)|0,z=z+Math.imul(Ie,mt)|0,W=W+Math.imul(ae,St)|0,R=R+Math.imul(ae,lt)|0,R=R+Math.imul(ne,St)|0,z=z+Math.imul(ne,lt)|0,W=W+Math.imul(ee,Ct)|0,R=R+Math.imul(ee,ce)|0,R=R+Math.imul(pe,Ct)|0,z=z+Math.imul(pe,ce)|0,W=W+Math.imul(Ce,Q)|0,R=R+Math.imul(Ce,ve)|0,R=R+Math.imul(me,Q)|0,z=z+Math.imul(me,ve)|0;var Ve=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,W=Math.imul(Je,Re),R=Math.imul(Je,ke),R=R+Math.imul(Ge,Re)|0,z=Math.imul(Ge,ke),W=W+Math.imul(je,He)|0,R=R+Math.imul(je,Ze)|0,R=R+Math.imul(Ye,He)|0,z=z+Math.imul(Ye,Ze)|0,W=W+Math.imul(Ue,tt)|0,R=R+Math.imul(Ue,mt)|0,R=R+Math.imul(De,tt)|0,z=z+Math.imul(De,mt)|0,W=W+Math.imul(qe,St)|0,R=R+Math.imul(qe,lt)|0,R=R+Math.imul(Ie,St)|0,z=z+Math.imul(Ie,lt)|0,W=W+Math.imul(ae,Ct)|0,R=R+Math.imul(ae,ce)|0,R=R+Math.imul(ne,Ct)|0,z=z+Math.imul(ne,ce)|0,W=W+Math.imul(ee,Q)|0,R=R+Math.imul(ee,ve)|0,R=R+Math.imul(pe,Q)|0,z=z+Math.imul(pe,ve)|0,W=W+Math.imul(Ce,U)|0,R=R+Math.imul(Ce,G)|0,R=R+Math.imul(me,U)|0,z=z+Math.imul(me,G)|0;var ft=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ft>>>26)|0,ft&=67108863,W=Math.imul(gt,Re),R=Math.imul(gt,ke),R=R+Math.imul(rt,Re)|0,z=Math.imul(rt,ke),W=W+Math.imul(Je,He)|0,R=R+Math.imul(Je,Ze)|0,R=R+Math.imul(Ge,He)|0,z=z+Math.imul(Ge,Ze)|0,W=W+Math.imul(je,tt)|0,R=R+Math.imul(je,mt)|0,R=R+Math.imul(Ye,tt)|0,z=z+Math.imul(Ye,mt)|0,W=W+Math.imul(Ue,St)|0,R=R+Math.imul(Ue,lt)|0,R=R+Math.imul(De,St)|0,z=z+Math.imul(De,lt)|0,W=W+Math.imul(qe,Ct)|0,R=R+Math.imul(qe,ce)|0,R=R+Math.imul(Ie,Ct)|0,z=z+Math.imul(Ie,ce)|0,W=W+Math.imul(ae,Q)|0,R=R+Math.imul(ae,ve)|0,R=R+Math.imul(ne,Q)|0,z=z+Math.imul(ne,ve)|0,W=W+Math.imul(ee,U)|0,R=R+Math.imul(ee,G)|0,R=R+Math.imul(pe,U)|0,z=z+Math.imul(pe,G)|0,W=W+Math.imul(Ce,K)|0,R=R+Math.imul(Ce,ue)|0,R=R+Math.imul(me,K)|0,z=z+Math.imul(me,ue)|0;var et=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(et>>>26)|0,et&=67108863,W=Math.imul(bt,Re),R=Math.imul(bt,ke),R=R+Math.imul(le,Re)|0,z=Math.imul(le,ke),W=W+Math.imul(gt,He)|0,R=R+Math.imul(gt,Ze)|0,R=R+Math.imul(rt,He)|0,z=z+Math.imul(rt,Ze)|0,W=W+Math.imul(Je,tt)|0,R=R+Math.imul(Je,mt)|0,R=R+Math.imul(Ge,tt)|0,z=z+Math.imul(Ge,mt)|0,W=W+Math.imul(je,St)|0,R=R+Math.imul(je,lt)|0,R=R+Math.imul(Ye,St)|0,z=z+Math.imul(Ye,lt)|0,W=W+Math.imul(Ue,Ct)|0,R=R+Math.imul(Ue,ce)|0,R=R+Math.imul(De,Ct)|0,z=z+Math.imul(De,ce)|0,W=W+Math.imul(qe,Q)|0,R=R+Math.imul(qe,ve)|0,R=R+Math.imul(Ie,Q)|0,z=z+Math.imul(Ie,ve)|0,W=W+Math.imul(ae,U)|0,R=R+Math.imul(ae,G)|0,R=R+Math.imul(ne,U)|0,z=z+Math.imul(ne,G)|0,W=W+Math.imul(ee,K)|0,R=R+Math.imul(ee,ue)|0,R=R+Math.imul(pe,K)|0,z=z+Math.imul(pe,ue)|0,W=W+Math.imul(Ce,xe)|0,R=R+Math.imul(Ce,Te)|0,R=R+Math.imul(me,xe)|0,z=z+Math.imul(me,Te)|0;var ht=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ht>>>26)|0,ht&=67108863,W=Math.imul(J,Re),R=Math.imul(J,ke),R=R+Math.imul(ge,Re)|0,z=Math.imul(ge,ke),W=W+Math.imul(bt,He)|0,R=R+Math.imul(bt,Ze)|0,R=R+Math.imul(le,He)|0,z=z+Math.imul(le,Ze)|0,W=W+Math.imul(gt,tt)|0,R=R+Math.imul(gt,mt)|0,R=R+Math.imul(rt,tt)|0,z=z+Math.imul(rt,mt)|0,W=W+Math.imul(Je,St)|0,R=R+Math.imul(Je,lt)|0,R=R+Math.imul(Ge,St)|0,z=z+Math.imul(Ge,lt)|0,W=W+Math.imul(je,Ct)|0,R=R+Math.imul(je,ce)|0,R=R+Math.imul(Ye,Ct)|0,z=z+Math.imul(Ye,ce)|0,W=W+Math.imul(Ue,Q)|0,R=R+Math.imul(Ue,ve)|0,R=R+Math.imul(De,Q)|0,z=z+Math.imul(De,ve)|0,W=W+Math.imul(qe,U)|0,R=R+Math.imul(qe,G)|0,R=R+Math.imul(Ie,U)|0,z=z+Math.imul(Ie,G)|0,W=W+Math.imul(ae,K)|0,R=R+Math.imul(ae,ue)|0,R=R+Math.imul(ne,K)|0,z=z+Math.imul(ne,ue)|0,W=W+Math.imul(ee,xe)|0,R=R+Math.imul(ee,Te)|0,R=R+Math.imul(pe,xe)|0,z=z+Math.imul(pe,Te)|0,W=W+Math.imul(Ce,Fe)|0,R=R+Math.imul(Ce,Ne)|0,R=R+Math.imul(me,Fe)|0,z=z+Math.imul(me,Ne)|0;var it=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(it>>>26)|0,it&=67108863,W=Math.imul(J,He),R=Math.imul(J,Ze),R=R+Math.imul(ge,He)|0,z=Math.imul(ge,Ze),W=W+Math.imul(bt,tt)|0,R=R+Math.imul(bt,mt)|0,R=R+Math.imul(le,tt)|0,z=z+Math.imul(le,mt)|0,W=W+Math.imul(gt,St)|0,R=R+Math.imul(gt,lt)|0,R=R+Math.imul(rt,St)|0,z=z+Math.imul(rt,lt)|0,W=W+Math.imul(Je,Ct)|0,R=R+Math.imul(Je,ce)|0,R=R+Math.imul(Ge,Ct)|0,z=z+Math.imul(Ge,ce)|0,W=W+Math.imul(je,Q)|0,R=R+Math.imul(je,ve)|0,R=R+Math.imul(Ye,Q)|0,z=z+Math.imul(Ye,ve)|0,W=W+Math.imul(Ue,U)|0,R=R+Math.imul(Ue,G)|0,R=R+Math.imul(De,U)|0,z=z+Math.imul(De,G)|0,W=W+Math.imul(qe,K)|0,R=R+Math.imul(qe,ue)|0,R=R+Math.imul(Ie,K)|0,z=z+Math.imul(Ie,ue)|0,W=W+Math.imul(ae,xe)|0,R=R+Math.imul(ae,Te)|0,R=R+Math.imul(ne,xe)|0,z=z+Math.imul(ne,Te)|0,W=W+Math.imul(ee,Fe)|0,R=R+Math.imul(ee,Ne)|0,R=R+Math.imul(pe,Fe)|0,z=z+Math.imul(pe,Ne)|0;var pt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(pt>>>26)|0,pt&=67108863,W=Math.imul(J,tt),R=Math.imul(J,mt),R=R+Math.imul(ge,tt)|0,z=Math.imul(ge,mt),W=W+Math.imul(bt,St)|0,R=R+Math.imul(bt,lt)|0,R=R+Math.imul(le,St)|0,z=z+Math.imul(le,lt)|0,W=W+Math.imul(gt,Ct)|0,R=R+Math.imul(gt,ce)|0,R=R+Math.imul(rt,Ct)|0,z=z+Math.imul(rt,ce)|0,W=W+Math.imul(Je,Q)|0,R=R+Math.imul(Je,ve)|0,R=R+Math.imul(Ge,Q)|0,z=z+Math.imul(Ge,ve)|0,W=W+Math.imul(je,U)|0,R=R+Math.imul(je,G)|0,R=R+Math.imul(Ye,U)|0,z=z+Math.imul(Ye,G)|0,W=W+Math.imul(Ue,K)|0,R=R+Math.imul(Ue,ue)|0,R=R+Math.imul(De,K)|0,z=z+Math.imul(De,ue)|0,W=W+Math.imul(qe,xe)|0,R=R+Math.imul(qe,Te)|0,R=R+Math.imul(Ie,xe)|0,z=z+Math.imul(Ie,Te)|0,W=W+Math.imul(ae,Fe)|0,R=R+Math.imul(ae,Ne)|0,R=R+Math.imul(ne,Fe)|0,z=z+Math.imul(ne,Ne)|0;var at=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(at>>>26)|0,at&=67108863,W=Math.imul(J,St),R=Math.imul(J,lt),R=R+Math.imul(ge,St)|0,z=Math.imul(ge,lt),W=W+Math.imul(bt,Ct)|0,R=R+Math.imul(bt,ce)|0,R=R+Math.imul(le,Ct)|0,z=z+Math.imul(le,ce)|0,W=W+Math.imul(gt,Q)|0,R=R+Math.imul(gt,ve)|0,R=R+Math.imul(rt,Q)|0,z=z+Math.imul(rt,ve)|0,W=W+Math.imul(Je,U)|0,R=R+Math.imul(Je,G)|0,R=R+Math.imul(Ge,U)|0,z=z+Math.imul(Ge,G)|0,W=W+Math.imul(je,K)|0,R=R+Math.imul(je,ue)|0,R=R+Math.imul(Ye,K)|0,z=z+Math.imul(Ye,ue)|0,W=W+Math.imul(Ue,xe)|0,R=R+Math.imul(Ue,Te)|0,R=R+Math.imul(De,xe)|0,z=z+Math.imul(De,Te)|0,W=W+Math.imul(qe,Fe)|0,R=R+Math.imul(qe,Ne)|0,R=R+Math.imul(Ie,Fe)|0,z=z+Math.imul(Ie,Ne)|0;var ct=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ct>>>26)|0,ct&=67108863,W=Math.imul(J,Ct),R=Math.imul(J,ce),R=R+Math.imul(ge,Ct)|0,z=Math.imul(ge,ce),W=W+Math.imul(bt,Q)|0,R=R+Math.imul(bt,ve)|0,R=R+Math.imul(le,Q)|0,z=z+Math.imul(le,ve)|0,W=W+Math.imul(gt,U)|0,R=R+Math.imul(gt,G)|0,R=R+Math.imul(rt,U)|0,z=z+Math.imul(rt,G)|0,W=W+Math.imul(Je,K)|0,R=R+Math.imul(Je,ue)|0,R=R+Math.imul(Ge,K)|0,z=z+Math.imul(Ge,ue)|0,W=W+Math.imul(je,xe)|0,R=R+Math.imul(je,Te)|0,R=R+Math.imul(Ye,xe)|0,z=z+Math.imul(Ye,Te)|0,W=W+Math.imul(Ue,Fe)|0,R=R+Math.imul(Ue,Ne)|0,R=R+Math.imul(De,Fe)|0,z=z+Math.imul(De,Ne)|0;var dt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(dt>>>26)|0,dt&=67108863,W=Math.imul(J,Q),R=Math.imul(J,ve),R=R+Math.imul(ge,Q)|0,z=Math.imul(ge,ve),W=W+Math.imul(bt,U)|0,R=R+Math.imul(bt,G)|0,R=R+Math.imul(le,U)|0,z=z+Math.imul(le,G)|0,W=W+Math.imul(gt,K)|0,R=R+Math.imul(gt,ue)|0,R=R+Math.imul(rt,K)|0,z=z+Math.imul(rt,ue)|0,W=W+Math.imul(Je,xe)|0,R=R+Math.imul(Je,Te)|0,R=R+Math.imul(Ge,xe)|0,z=z+Math.imul(Ge,Te)|0,W=W+Math.imul(je,Fe)|0,R=R+Math.imul(je,Ne)|0,R=R+Math.imul(Ye,Fe)|0,z=z+Math.imul(Ye,Ne)|0;var nt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(nt>>>26)|0,nt&=67108863,W=Math.imul(J,U),R=Math.imul(J,G),R=R+Math.imul(ge,U)|0,z=Math.imul(ge,G),W=W+Math.imul(bt,K)|0,R=R+Math.imul(bt,ue)|0,R=R+Math.imul(le,K)|0,z=z+Math.imul(le,ue)|0,W=W+Math.imul(gt,xe)|0,R=R+Math.imul(gt,Te)|0,R=R+Math.imul(rt,xe)|0,z=z+Math.imul(rt,Te)|0,W=W+Math.imul(Je,Fe)|0,R=R+Math.imul(Je,Ne)|0,R=R+Math.imul(Ge,Fe)|0,z=z+Math.imul(Ge,Ne)|0;var Le=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Le>>>26)|0,Le&=67108863,W=Math.imul(J,K),R=Math.imul(J,ue),R=R+Math.imul(ge,K)|0,z=Math.imul(ge,ue),W=W+Math.imul(bt,xe)|0,R=R+Math.imul(bt,Te)|0,R=R+Math.imul(le,xe)|0,z=z+Math.imul(le,Te)|0,W=W+Math.imul(gt,Fe)|0,R=R+Math.imul(gt,Ne)|0,R=R+Math.imul(rt,Fe)|0,z=z+Math.imul(rt,Ne)|0;var Be=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Be>>>26)|0,Be&=67108863,W=Math.imul(J,xe),R=Math.imul(J,Te),R=R+Math.imul(ge,xe)|0,z=Math.imul(ge,Te),W=W+Math.imul(bt,Fe)|0,R=R+Math.imul(bt,Ne)|0,R=R+Math.imul(le,Fe)|0,z=z+Math.imul(le,Ne)|0;var Ke=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,W=Math.imul(J,Fe),R=Math.imul(J,Ne),R=R+Math.imul(ge,Fe)|0,z=Math.imul(ge,Ne);var We=(D+W|0)+((R&8191)<<13)|0;return D=(z+(R>>>13)|0)+(We>>>26)|0,We&=67108863,j[0]=At,j[1]=ot,j[2]=yt,j[3]=vt,j[4]=_t,j[5]=Ve,j[6]=ft,j[7]=et,j[8]=ht,j[9]=it,j[10]=pt,j[11]=at,j[12]=ct,j[13]=dt,j[14]=nt,j[15]=Le,j[16]=Be,j[17]=Ke,j[18]=We,D!==0&&(j[19]=D,$.length++),$};Math.imul||(N=O);function H(q,y,B){B.negative=y.negative^q.negative,B.length=q.length+y.length;for(var $=0,I=0,F=0;F<B.length-1;F++){var j=I;I=0;for(var D=$&67108863,W=Math.min(F,y.length-1),R=Math.max(0,F-q.length+1);R<=W;R++){var z=F-R,ye=q.words[z]|0,Ce=y.words[R]|0,me=ye*Ce,ie=me&67108863;j=j+(me/67108864|0)|0,ie=ie+D|0,D=ie&67108863,j=j+(ie>>>26)|0,I+=j>>>26,j&=67108863}B.words[F]=D,$=j,j=I}return $!==0?B.words[F]=$:B.length--,B._strip()}function V(q,y,B){return H(q,y,B)}g.prototype.mulTo=function(y,B){var $,I=this.length+y.length;return this.length===10&&y.length===10?$=N(this,y,B):I<63?$=O(this,y,B):I<1024?$=H(this,y,B):$=V(this,y,B),$},g.prototype.mul=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),this.mulTo(y,B)},g.prototype.mulf=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),V(this,y,B)},g.prototype.imul=function(y){return this.clone().mulTo(y,this)},g.prototype.imuln=function(y){var B=y<0;B&&(y=-y),m(typeof y=="number"),m(y<67108864);for(var $=0,I=0;I<this.length;I++){var F=(this.words[I]|0)*y,j=(F&67108863)+($&67108863);$>>=26,$+=F/67108864|0,$+=j>>>26,this.words[I]=j&67108863}return $!==0&&(this.words[I]=$,this.length++),this.length=y===0?1:this.length,B?this.ineg():this},g.prototype.muln=function(y){return this.clone().imuln(y)},g.prototype.sqr=function(){return this.mul(this)},g.prototype.isqr=function(){return this.imul(this.clone())},g.prototype.pow=function(y){var B=L(y);if(B.length===0)return new g(1);for(var $=this,I=0;I<B.length&&B[I]===0;I++,$=$.sqr());if(++I<B.length)for(var F=$.sqr();I<B.length;I++,F=F.sqr())B[I]!==0&&($=$.mul(F));return $},g.prototype.iushln=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=67108863>>>26-B<<26-B,F;if(B!==0){var j=0;for(F=0;F<this.length;F++){var D=this.words[F]&I,W=(this.words[F]|0)-D<<B;this.words[F]=W|j,j=D>>>26-B}j&&(this.words[F]=j,this.length++)}if($!==0){for(F=this.length-1;F>=0;F--)this.words[F+$]=this.words[F];for(F=0;F<$;F++)this.words[F]=0;this.length+=$}return this._strip()},g.prototype.ishln=function(y){return m(this.negative===0),this.iushln(y)},g.prototype.iushrn=function(y,B,$){m(typeof y=="number"&&y>=0);var I;B?I=(B-B%26)/26:I=0;var F=y%26,j=Math.min((y-F)/26,this.length),D=67108863^67108863>>>F<<F,W=$;if(I-=j,I=Math.max(0,I),W){for(var R=0;R<j;R++)W.words[R]=this.words[R];W.length=j}if(j!==0)if(this.length>j)for(this.length-=j,R=0;R<this.length;R++)this.words[R]=this.words[R+j];else this.words[0]=0,this.length=1;var z=0;for(R=this.length-1;R>=0&&(z!==0||R>=I);R--){var ye=this.words[R]|0;this.words[R]=z<<26-F|ye>>>F,z=ye&D}return W&&z!==0&&(W.words[W.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},g.prototype.ishrn=function(y,B,$){return m(this.negative===0),this.iushrn(y,B,$)},g.prototype.shln=function(y){return this.clone().ishln(y)},g.prototype.ushln=function(y){return this.clone().iushln(y)},g.prototype.shrn=function(y){return this.clone().ishrn(y)},g.prototype.ushrn=function(y){return this.clone().iushrn(y)},g.prototype.testn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return!1;var F=this.words[$];return!!(F&I)},g.prototype.imaskn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(B!==0&&$++,this.length=Math.min($,this.length),B!==0){var I=67108863^67108863>>>B<<B;this.words[this.length-1]&=I}return this._strip()},g.prototype.maskn=function(y){return this.clone().imaskn(y)},g.prototype.iaddn=function(y){return m(typeof y=="number"),m(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},g.prototype._iaddn=function(y){this.words[0]+=y;for(var B=0;B<this.length&&this.words[B]>=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},g.prototype.isubn=function(y){if(m(typeof y=="number"),m(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B<this.length&&this.words[B]<0;B++)this.words[B]+=67108864,this.words[B+1]-=1;return this._strip()},g.prototype.addn=function(y){return this.clone().iaddn(y)},g.prototype.subn=function(y){return this.clone().isubn(y)},g.prototype.iabs=function(){return this.negative=0,this},g.prototype.abs=function(){return this.clone().iabs()},g.prototype._ishlnsubmul=function(y,B,$){var I=y.length+$,F;this._expand(I);var j,D=0;for(F=0;F<y.length;F++){j=(this.words[F+$]|0)+D;var W=(y.words[F]|0)*B;j-=W&67108863,D=(j>>26)-(W/67108864|0),this.words[F+$]=j&67108863}for(;F<this.length-$;F++)j=(this.words[F+$]|0)+D,D=j>>26,this.words[F+$]=j&67108863;if(D===0)return this._strip();for(m(D===-1),D=0,F=0;F<this.length;F++)j=-(this.words[F]|0)+D,D=j>>26,this.words[F]=j&67108863;return this.negative=1,this._strip()},g.prototype._wordDiv=function(y,B){var $=this.length-y.length,I=this.clone(),F=y,j=F.words[F.length-1]|0,D=this._countBits(j);$=26-D,$!==0&&(F=F.ushln($),I.iushln($),j=F.words[F.length-1]|0);var W=I.length-F.length,R;if(B!=="mod"){R=new g(null),R.length=W+1,R.words=new Array(R.length);for(var z=0;z<R.length;z++)R.words[z]=0}var ye=I.clone()._ishlnsubmul(F,1,W);ye.negative===0&&(I=ye,R&&(R.words[W]=1));for(var Ce=W-1;Ce>=0;Ce--){var me=(I.words[F.length+Ce]|0)*67108864+(I.words[F.length+Ce-1]|0);for(me=Math.min(me/j|0,67108863),I._ishlnsubmul(F,me,Ce);I.negative!==0;)me--,I.negative=0,I._ishlnsubmul(F,1,Ce),I.isZero()||(I.negative^=1);R&&(R.words[Ce]=me)}return R&&R._strip(),I._strip(),B!=="div"&&$!==0&&I.iushrn($),{div:R||null,mod:I}},g.prototype.divmod=function(y,B,$){if(m(!y.isZero()),this.isZero())return{div:new g(0),mod:new g(0)};var I,F,j;return this.negative!==0&&y.negative===0?(j=this.neg().divmod(y,B),B!=="mod"&&(I=j.div.neg()),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.iadd(y)),{div:I,mod:F}):this.negative===0&&y.negative!==0?(j=this.divmod(y.neg(),B),B!=="mod"&&(I=j.div.neg()),{div:I,mod:j.mod}):(this.negative&y.negative)!==0?(j=this.neg().divmod(y.neg(),B),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.isub(y)),{div:j.div,mod:F}):y.length>this.length||this.cmp(y)<0?{div:new g(0),mod:this}:y.length===1?B==="div"?{div:this.divn(y.words[0]),mod:null}:B==="mod"?{div:null,mod:new g(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new g(this.modrn(y.words[0]))}:this._wordDiv(y,B)},g.prototype.div=function(y){return this.divmod(y,"div",!1).div},g.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},g.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},g.prototype.divRound=function(y){var B=this.divmod(y);if(B.mod.isZero())return B.div;var $=B.div.negative!==0?B.mod.isub(y):B.mod,I=y.ushrn(1),F=y.andln(1),j=$.cmp(I);return j<0||F===1&&j===0?B.div:B.div.negative!==0?B.div.isubn(1):B.div.iaddn(1)},g.prototype.modrn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=(1<<26)%y,I=0,F=this.length-1;F>=0;F--)I=($*I+(this.words[F]|0))%y;return B?-I:I},g.prototype.modn=function(y){return this.modrn(y)},g.prototype.idivn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=0,I=this.length-1;I>=0;I--){var F=(this.words[I]|0)+$*67108864;this.words[I]=F/y|0,$=F%y}return this._strip(),B?this.ineg():this},g.prototype.divn=function(y){return this.clone().idivn(y)},g.prototype.egcd=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),F=new g(0),j=new g(0),D=new g(1),W=0;B.isEven()&&$.isEven();)B.iushrn(1),$.iushrn(1),++W;for(var R=$.clone(),z=B.clone();!B.isZero();){for(var ye=0,Ce=1;(B.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(B.iushrn(ye);ye-- >0;)(I.isOdd()||F.isOdd())&&(I.iadd(R),F.isub(z)),I.iushrn(1),F.iushrn(1);for(var me=0,ie=1;($.words[0]&ie)===0&&me<26;++me,ie<<=1);if(me>0)for($.iushrn(me);me-- >0;)(j.isOdd()||D.isOdd())&&(j.iadd(R),D.isub(z)),j.iushrn(1),D.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(j),F.isub(D)):($.isub(B),j.isub(I),D.isub(F))}return{a:j,b:D,gcd:$.iushln(W)}},g.prototype._invmp=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),F=new g(0),j=$.clone();B.cmpn(1)>0&&$.cmpn(1)>0;){for(var D=0,W=1;(B.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(B.iushrn(D);D-- >0;)I.isOdd()&&I.iadd(j),I.iushrn(1);for(var R=0,z=1;($.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for($.iushrn(R);R-- >0;)F.isOdd()&&F.iadd(j),F.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(F)):($.isub(B),F.isub(I))}var ye;return B.cmpn(1)===0?ye=I:ye=F,ye.cmpn(0)<0&&ye.iadd(y),ye},g.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var B=this.clone(),$=y.clone();B.negative=0,$.negative=0;for(var I=0;B.isEven()&&$.isEven();I++)B.iushrn(1),$.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;$.isEven();)$.iushrn(1);var F=B.cmp($);if(F<0){var j=B;B=$,$=j}else if(F===0||$.cmpn(1)===0)break;B.isub($)}while(!0);return $.iushln(I)},g.prototype.invm=function(y){return this.egcd(y).a.umod(y)},g.prototype.isEven=function(){return(this.words[0]&1)===0},g.prototype.isOdd=function(){return(this.words[0]&1)===1},g.prototype.andln=function(y){return this.words[0]&y},g.prototype.bincn=function(y){m(typeof y=="number");var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return this._expand($+1),this.words[$]|=I,this;for(var F=I,j=$;F!==0&&j<this.length;j++){var D=this.words[j]|0;D+=F,F=D>>>26,D&=67108863,this.words[j]=D}return F!==0&&(this.words[j]=F,this.length++),this},g.prototype.isZero=function(){return this.length===1&&this.words[0]===0},g.prototype.cmpn=function(y){var B=y<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this._strip();var $;if(this.length>1)$=1;else{B&&(y=-y),m(y<=67108863,"Number is too big");var I=this.words[0]|0;$=I===y?0:I<y?-1:1}return this.negative!==0?-$|0:$},g.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var B=this.ucmp(y);return this.negative!==0?-B|0:B},g.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var B=0,$=this.length-1;$>=0;$--){var I=this.words[$]|0,F=y.words[$]|0;if(I!==F){I<F?B=-1:I>F&&(B=1);break}}return B},g.prototype.gtn=function(y){return this.cmpn(y)===1},g.prototype.gt=function(y){return this.cmp(y)===1},g.prototype.gten=function(y){return this.cmpn(y)>=0},g.prototype.gte=function(y){return this.cmp(y)>=0},g.prototype.ltn=function(y){return this.cmpn(y)===-1},g.prototype.lt=function(y){return this.cmp(y)===-1},g.prototype.lten=function(y){return this.cmpn(y)<=0},g.prototype.lte=function(y){return this.cmp(y)<=0},g.prototype.eqn=function(y){return this.cmpn(y)===0},g.prototype.eq=function(y){return this.cmp(y)===0},g.red=function(y){return new te(y)},g.prototype.toRed=function(y){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},g.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},g.prototype._forceRed=function(y){return this.red=y,this},g.prototype.forceRed=function(y){return m(!this.red,"Already a number in reduction context"),this._forceRed(y)},g.prototype.redAdd=function(y){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},g.prototype.redIAdd=function(y){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},g.prototype.redSub=function(y){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},g.prototype.redISub=function(y){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},g.prototype.redShl=function(y){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},g.prototype.redMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},g.prototype.redIMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},g.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},g.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},g.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},g.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},g.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},g.prototype.redPow=function(y){return m(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var X={k256:null,p224:null,p192:null,p25519:null};function oe(q,y){this.name=q,this.p=new g(y,16),this.n=this.p.bitLength(),this.k=new g(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}oe.prototype._tmp=function(){var y=new g(null);return y.words=new Array(Math.ceil(this.n/13)),y},oe.prototype.ireduce=function(y){var B=y,$;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),$=B.bitLength();while($>this.n);var I=$<this.n?-1:B.ucmp(this.p);return I===0?(B.words[0]=0,B.length=1):I>0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},oe.prototype.split=function(y,B){y.iushrn(this.n,0,B)},oe.prototype.imulK=function(y){return y.imul(this.k)};function se(){oe.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(se,oe),se.prototype.split=function(y,B){for(var $=4194303,I=Math.min(y.length,9),F=0;F<I;F++)B.words[F]=y.words[F];if(B.length=I,y.length<=9){y.words[0]=0,y.length=1;return}var j=y.words[9];for(B.words[B.length++]=j&$,F=10;F<y.length;F++){var D=y.words[F]|0;y.words[F-10]=(D&$)<<4|j>>>22,j=D}j>>>=22,y.words[F-10]=j,j===0&&y.length>10?y.length-=10:y.length-=9},se.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var B=0,$=0;$<y.length;$++){var I=y.words[$]|0;B+=I*977,y.words[$]=B&67108863,B=I*64+(B/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function de(){oe.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(de,oe);function he(){oe.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(he,oe);function we(){oe.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(we,oe),we.prototype.imulK=function(y){for(var B=0,$=0;$<y.length;$++){var I=(y.words[$]|0)*19+B,F=I&67108863;I>>>=26,y.words[$]=F,B=I}return B!==0&&(y.words[y.length++]=B),y},g._prime=function(y){if(X[y])return X[y];var B;if(y==="k256")B=new se;else if(y==="p224")B=new de;else if(y==="p192")B=new he;else if(y==="p25519")B=new we;else throw new Error("Unknown prime "+y);return X[y]=B,B};function te(q){if(typeof q=="string"){var y=g._prime(q);this.m=y.p,this.prime=y}else m(q.gtn(1),"modulus must be greater than 1"),this.m=q,this.prime=null}te.prototype._verify1=function(y){m(y.negative===0,"red works only with positives"),m(y.red,"red works only with red numbers")},te.prototype._verify2=function(y,B){m((y.negative|B.negative)===0,"red works only with positives"),m(y.red&&y.red===B.red,"red works only with red numbers")},te.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(b(y,y.umod(this.m)._forceRed(this)),y)},te.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},te.prototype.add=function(y,B){this._verify2(y,B);var $=y.add(B);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},te.prototype.iadd=function(y,B){this._verify2(y,B);var $=y.iadd(B);return $.cmp(this.m)>=0&&$.isub(this.m),$},te.prototype.sub=function(y,B){this._verify2(y,B);var $=y.sub(B);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},te.prototype.isub=function(y,B){this._verify2(y,B);var $=y.isub(B);return $.cmpn(0)<0&&$.iadd(this.m),$},te.prototype.shl=function(y,B){return this._verify1(y),this.imod(y.ushln(B))},te.prototype.imul=function(y,B){return this._verify2(y,B),this.imod(y.imul(B))},te.prototype.mul=function(y,B){return this._verify2(y,B),this.imod(y.mul(B))},te.prototype.isqr=function(y){return this.imul(y,y.clone())},te.prototype.sqr=function(y){return this.mul(y,y)},te.prototype.sqrt=function(y){if(y.isZero())return y.clone();var B=this.m.andln(3);if(m(B%2===1),B===3){var $=this.m.add(new g(1)).iushrn(2);return this.pow(y,$)}for(var I=this.m.subn(1),F=0;!I.isZero()&&I.andln(1)===0;)F++,I.iushrn(1);m(!I.isZero());var j=new g(1).toRed(this),D=j.redNeg(),W=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new g(2*R*R).toRed(this);this.pow(R,W).cmp(D)!==0;)R.redIAdd(D);for(var z=this.pow(R,I),ye=this.pow(y,I.addn(1).iushrn(1)),Ce=this.pow(y,I),me=F;Ce.cmp(j)!==0;){for(var ie=Ce,ee=0;ie.cmp(j)!==0;ee++)ie=ie.redSqr();m(ee<me);var pe=this.pow(z,new g(1).iushln(me-ee-1));ye=ye.redMul(pe),z=pe.redSqr(),Ce=Ce.redMul(z),me=ee}return ye},te.prototype.invm=function(y){var B=y._invmp(this.m);return B.negative!==0?(B.negative=0,this.imod(B).redNeg()):this.imod(B)},te.prototype.pow=function(y,B){if(B.isZero())return new g(1).toRed(this);if(B.cmpn(1)===0)return y.clone();var $=4,I=new Array(1<<$);I[0]=new g(1).toRed(this),I[1]=y;for(var F=2;F<I.length;F++)I[F]=this.mul(I[F-1],y);var j=I[0],D=0,W=0,R=B.bitLength()%26;for(R===0&&(R=26),F=B.length-1;F>=0;F--){for(var z=B.words[F],ye=R-1;ye>=0;ye--){var Ce=z>>ye&1;if(j!==I[0]&&(j=this.sqr(j)),Ce===0&&D===0){W=0;continue}D<<=1,D|=Ce,W++,!(W!==$&&(F!==0||ye!==0))&&(j=this.mul(j,I[D]),W=0,D=0)}R=26}return j},te.prototype.convertTo=function(y){var B=y.umod(this.m);return B===y?B.clone():B},te.prototype.convertFrom=function(y){var B=y.clone();return B.red=null,B},g.mont=function(y){return new k(y)};function k(q){te.call(this,q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(k,te),k.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},k.prototype.convertFrom=function(y){var B=this.imod(y.mul(this.rinv));return B.red=null,B},k.prototype.imul=function(y,B){if(y.isZero()||B.isZero())return y.words[0]=0,y.length=1,y;var $=y.imul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},k.prototype.mul=function(y,B){if(y.isZero()||B.isZero())return new g(0)._forceRed(this);var $=y.mul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},k.prototype.invm=function(y){var B=this.imod(y._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(r,bn$2)})(bn$3)),bn$3.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var r=requireBn$1(),f=requireBrowser$b(),d=requireSafeBuffer$1().Buffer;function m(w){var x=w.modulus.byteLength(),S;do S=new r(f(x));while(S.cmp(w.modulus)>=0||!S.umod(w.prime1)||!S.umod(w.prime2));return S}function v(w){var x=m(w),S=x.toRed(r.mont(w.modulus)).redPow(new r(w.publicExponent)).fromRed();return{blinder:S,unblinder:x.invm(w.modulus)}}function g(w,x){var S=v(x),_=x.modulus.byteLength(),b=new r(w).mul(S.blinder).umod(x.modulus),C=b.toRed(r.mont(x.prime1)),E=b.toRed(r.mont(x.prime2)),M=x.coefficient,A=x.prime1,T=x.prime2,L=C.redPow(x.exponent1).fromRed(),O=E.redPow(x.exponent2).fromRed(),N=L.isub(O).imul(M).umod(A).imul(T);return O.iadd(N).imul(S.unblinder).umod(x.modulus).toArrayLike(d,"be",_)}return g.getr=m,browserifyRsa=g,browserifyRsa}var elliptic={};const version="6.6.1",require$$0={version};var utils$2={},utils$1={},hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,(function(r){var f=r;function d(g,w){if(Array.isArray(g))return g.slice();if(!g)return[];var x=[];if(typeof g!="string"){for(var S=0;S<g.length;S++)x[S]=g[S]|0;return x}if(w==="hex"){g=g.replace(/[^a-z0-9]+/ig,""),g.length%2!==0&&(g="0"+g);for(var S=0;S<g.length;S+=2)x.push(parseInt(g[S]+g[S+1],16))}else for(var S=0;S<g.length;S++){var _=g.charCodeAt(S),b=_>>8,C=_&255;b?x.push(b,C):x.push(C)}return x}f.toArray=d;function m(g){return g.length===1?"0"+g:g}f.zero2=m;function v(g){for(var w="",x=0;x<g.length;x++)w+=m(g[x].toString(16));return w}f.toHex=v,f.encode=function(w,x){return x==="hex"?v(w):w}})(utils$1)),utils$1}var hasRequiredUtils$1;function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,(function(r){var f=r,d=requireBn$2(),m=requireMinimalisticAssert(),v=requireUtils$2();f.assert=m,f.toArray=v.toArray,f.zero2=v.zero2,f.toHex=v.toHex,f.encode=v.encode;function g(b,C,E){var M=new Array(Math.max(b.bitLength(),E)+1),A;for(A=0;A<M.length;A+=1)M[A]=0;var T=1<<C+1,L=b.clone();for(A=0;A<M.length;A++){var O,N=L.andln(T-1);L.isOdd()?(N>(T>>1)-1?O=(T>>1)-N:O=N,L.isubn(O)):O=0,M[A]=O,L.iushrn(1)}return M}f.getNAF=g;function w(b,C){var E=[[],[]];b=b.clone(),C=C.clone();for(var M=0,A=0,T;b.cmpn(-M)>0||C.cmpn(-A)>0;){var L=b.andln(3)+M&3,O=C.andln(3)+A&3;L===3&&(L=-1),O===3&&(O=-1);var N;(L&1)===0?N=0:(T=b.andln(7)+M&7,(T===3||T===5)&&O===2?N=-L:N=L),E[0].push(N);var H;(O&1)===0?H=0:(T=C.andln(7)+A&7,(T===3||T===5)&&L===2?H=-O:H=O),E[1].push(H),2*M===N+1&&(M=1-M),2*A===H+1&&(A=1-A),b.iushrn(1),C.iushrn(1)}return E}f.getJSF=w;function x(b,C,E){var M="_"+C;b.prototype[C]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}f.cachedProperty=x;function S(b){return typeof b=="string"?f.toArray(b,"hex"):b}f.parseBytes=S;function _(b){return new d(b,"hex","le")}f.intFromLE=_})(utils$2)),utils$2}var curve={},base$1,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.getNAF,m=f.getJSF,v=f.assert;function g(x,S){this.type=x,this.p=new r(S.p,16),this.red=S.prime?r.red(S.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=S.n&&new r(S.n,16),this.g=S.g&&this.pointFromJSON(S.g,S.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var _=this.n&&this.p.div(this.n);!_||_.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$1=g,g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(S,_){v(S.precomputed);var b=S._getDoubles(),C=d(_,1,this._bitLength),E=(1<<b.step+1)-(b.step%2===0?2:1);E/=3;var M=[],A,T;for(A=0;A<C.length;A+=b.step){T=0;for(var L=A+b.step-1;L>=A;L--)T=(T<<1)+C[L];M.push(T)}for(var O=this.jpoint(null,null,null),N=this.jpoint(null,null,null),H=E;H>0;H--){for(A=0;A<M.length;A++)T=M[A],T===H?N=N.mixedAdd(b.points[A]):T===-H&&(N=N.mixedAdd(b.points[A].neg()));O=O.add(N)}return O.toP()},g.prototype._wnafMul=function(S,_){var b=4,C=S._getNAFPoints(b);b=C.wnd;for(var E=C.points,M=d(_,b,this._bitLength),A=this.jpoint(null,null,null),T=M.length-1;T>=0;T--){for(var L=0;T>=0&&M[T]===0;T--)L++;if(T>=0&&L++,A=A.dblp(L),T<0)break;var O=M[T];v(O!==0),S.type==="affine"?O>0?A=A.mixedAdd(E[O-1>>1]):A=A.mixedAdd(E[-O-1>>1].neg()):O>0?A=A.add(E[O-1>>1]):A=A.add(E[-O-1>>1].neg())}return S.type==="affine"?A.toP():A},g.prototype._wnafMulAdd=function(S,_,b,C,E){var M=this._wnafT1,A=this._wnafT2,T=this._wnafT3,L=0,O,N,H;for(O=0;O<C;O++){H=_[O];var V=H._getNAFPoints(S);M[O]=V.wnd,A[O]=V.points}for(O=C-1;O>=1;O-=2){var X=O-1,oe=O;if(M[X]!==1||M[oe]!==1){T[X]=d(b[X],M[X],this._bitLength),T[oe]=d(b[oe],M[oe],this._bitLength),L=Math.max(T[X].length,L),L=Math.max(T[oe].length,L);continue}var se=[_[X],null,null,_[oe]];_[X].y.cmp(_[oe].y)===0?(se[1]=_[X].add(_[oe]),se[2]=_[X].toJ().mixedAdd(_[oe].neg())):_[X].y.cmp(_[oe].y.redNeg())===0?(se[1]=_[X].toJ().mixedAdd(_[oe]),se[2]=_[X].add(_[oe].neg())):(se[1]=_[X].toJ().mixedAdd(_[oe]),se[2]=_[X].toJ().mixedAdd(_[oe].neg()));var de=[-3,-1,-5,-7,0,7,5,1,3],he=m(b[X],b[oe]);for(L=Math.max(he[0].length,L),T[X]=new Array(L),T[oe]=new Array(L),N=0;N<L;N++){var we=he[0][N]|0,te=he[1][N]|0;T[X][N]=de[(we+1)*3+(te+1)],T[oe][N]=0,A[X]=se}}var k=this.jpoint(null,null,null),q=this._wnafT4;for(O=L;O>=0;O--){for(var y=0;O>=0;){var B=!0;for(N=0;N<C;N++)q[N]=T[N][O]|0,q[N]!==0&&(B=!1);if(!B)break;y++,O--}if(O>=0&&y++,k=k.dblp(y),O<0)break;for(N=0;N<C;N++){var $=q[N];$!==0&&($>0?H=A[N][$-1>>1]:$<0&&(H=A[N][-$-1>>1].neg()),H.type==="affine"?k=k.mixedAdd(H):k=k.add(H))}}for(O=0;O<C;O++)A[O]=null;return E?k:k.toP()};function w(x,S){this.curve=x,this.type=S,this.precomputed=null}return g.BasePoint=w,w.prototype.eq=function(){throw new Error("Not implemented")},w.prototype.validate=function(){return this.curve.validate(this)},g.prototype.decodePoint=function(S,_){S=f.toArray(S,_);var b=this.p.byteLength();if((S[0]===4||S[0]===6||S[0]===7)&&S.length-1===2*b){S[0]===6?v(S[S.length-1]%2===0):S[0]===7&&v(S[S.length-1]%2===1);var C=this.point(S.slice(1,1+b),S.slice(1+b,1+2*b));return C}else if((S[0]===2||S[0]===3)&&S.length-1===b)return this.pointFromX(S.slice(1,1+b),S[0]===3);throw new Error("Unknown point format")},w.prototype.encodeCompressed=function(S){return this.encode(S,!0)},w.prototype._encode=function(S){var _=this.curve.p.byteLength(),b=this.getX().toArray("be",_);return S?[this.getY().isEven()?2:3].concat(b):[4].concat(b,this.getY().toArray("be",_))},w.prototype.encode=function(S,_){return f.encode(this._encode(_),S)},w.prototype.precompute=function(S){if(this.precomputed)return this;var _={doubles:null,naf:null,beta:null};return _.naf=this._getNAFPoints(8),_.doubles=this._getDoubles(4,S),_.beta=this._getBeta(),this.precomputed=_,this},w.prototype._hasDoubles=function(S){if(!this.precomputed)return!1;var _=this.precomputed.doubles;return _?_.points.length>=Math.ceil((S.bitLength()+1)/_.step):!1},w.prototype._getDoubles=function(S,_){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var b=[this],C=this,E=0;E<_;E+=S){for(var M=0;M<S;M++)C=C.dbl();b.push(C)}return{step:S,points:b}},w.prototype._getNAFPoints=function(S){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var _=[this],b=(1<<S)-1,C=b===1?null:this.dbl(),E=1;E<b;E++)_[E]=_[E-1].add(C);return{wnd:S,points:_}},w.prototype._getBeta=function(){return null},w.prototype.dblp=function(S){for(var _=this,b=0;b<S;b++)_=_.dbl();return _},base$1}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var r=requireUtils$1(),f=requireBn$2(),d=requireInherits_browser(),m=requireBase$1(),v=r.assert;function g(S){m.call(this,"short",S),this.a=new f(S.a,16).toRed(this.red),this.b=new f(S.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(S),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}d(g,m),short=g,g.prototype._getEndomorphism=function(_){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var b,C;if(_.beta)b=new f(_.beta,16).toRed(this.red);else{var E=this._getEndoRoots(this.p);b=E[0].cmp(E[1])<0?E[0]:E[1],b=b.toRed(this.red)}if(_.lambda)C=new f(_.lambda,16);else{var M=this._getEndoRoots(this.n);this.g.mul(M[0]).x.cmp(this.g.x.redMul(b))===0?C=M[0]:(C=M[1],v(this.g.mul(C).x.cmp(this.g.x.redMul(b))===0))}var A;return _.basis?A=_.basis.map(function(T){return{a:new f(T.a,16),b:new f(T.b,16)}}):A=this._getEndoBasis(C),{beta:b,lambda:C,basis:A}}},g.prototype._getEndoRoots=function(_){var b=_===this.p?this.red:f.mont(_),C=new f(2).toRed(b).redInvm(),E=C.redNeg(),M=new f(3).toRed(b).redNeg().redSqrt().redMul(C),A=E.redAdd(M).fromRed(),T=E.redSub(M).fromRed();return[A,T]},g.prototype._getEndoBasis=function(_){for(var b=this.n.ushrn(Math.floor(this.n.bitLength()/2)),C=_,E=this.n.clone(),M=new f(1),A=new f(0),T=new f(0),L=new f(1),O,N,H,V,X,oe,se,de=0,he,we;C.cmpn(0)!==0;){var te=E.div(C);he=E.sub(te.mul(C)),we=T.sub(te.mul(M));var k=L.sub(te.mul(A));if(!H&&he.cmp(b)<0)O=se.neg(),N=M,H=he.neg(),V=we;else if(H&&++de===2)break;se=he,E=C,C=he,T=M,M=we,L=A,A=k}X=he.neg(),oe=we;var q=H.sqr().add(V.sqr()),y=X.sqr().add(oe.sqr());return y.cmp(q)>=0&&(X=O,oe=N),H.negative&&(H=H.neg(),V=V.neg()),X.negative&&(X=X.neg(),oe=oe.neg()),[{a:H,b:V},{a:X,b:oe}]},g.prototype._endoSplit=function(_){var b=this.endo.basis,C=b[0],E=b[1],M=E.b.mul(_).divRound(this.n),A=C.b.neg().mul(_).divRound(this.n),T=M.mul(C.a),L=A.mul(E.a),O=M.mul(C.b),N=A.mul(E.b),H=_.sub(T).sub(L),V=O.add(N).neg();return{k1:H,k2:V}},g.prototype.pointFromX=function(_,b){_=new f(_,16),_.red||(_=_.toRed(this.red));var C=_.redSqr().redMul(_).redIAdd(_.redMul(this.a)).redIAdd(this.b),E=C.redSqrt();if(E.redSqr().redSub(C).cmp(this.zero)!==0)throw new Error("invalid point");var M=E.fromRed().isOdd();return(b&&!M||!b&&M)&&(E=E.redNeg()),this.point(_,E)},g.prototype.validate=function(_){if(_.inf)return!0;var b=_.x,C=_.y,E=this.a.redMul(b),M=b.redSqr().redMul(b).redIAdd(E).redIAdd(this.b);return C.redSqr().redISub(M).cmpn(0)===0},g.prototype._endoWnafMulAdd=function(_,b,C){for(var E=this._endoWnafT1,M=this._endoWnafT2,A=0;A<_.length;A++){var T=this._endoSplit(b[A]),L=_[A],O=L._getBeta();T.k1.negative&&(T.k1.ineg(),L=L.neg(!0)),T.k2.negative&&(T.k2.ineg(),O=O.neg(!0)),E[A*2]=L,E[A*2+1]=O,M[A*2]=T.k1,M[A*2+1]=T.k2}for(var N=this._wnafMulAdd(1,E,M,A*2,C),H=0;H<A*2;H++)E[H]=null,M[H]=null;return N};function w(S,_,b,C){m.BasePoint.call(this,S,"affine"),_===null&&b===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(_,16),this.y=new f(b,16),C&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}d(w,m.BasePoint),g.prototype.point=function(_,b,C){return new w(this,_,b,C)},g.prototype.pointFromJSON=function(_,b){return w.fromJSON(this,_,b)},w.prototype._getBeta=function(){if(this.curve.endo){var _=this.precomputed;if(_&&_.beta)return _.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(_){var C=this.curve,E=function(M){return C.point(M.x.redMul(C.endo.beta),M.y)};_.beta=b,b.precomputed={beta:null,naf:_.naf&&{wnd:_.naf.wnd,points:_.naf.points.map(E)},doubles:_.doubles&&{step:_.doubles.step,points:_.doubles.points.map(E)}}}return b}},w.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},w.fromJSON=function(_,b,C){typeof b=="string"&&(b=JSON.parse(b));var E=_.point(b[0],b[1],C);if(!b[2])return E;function M(T){return _.point(T[0],T[1],C)}var A=b[2];return E.precomputed={beta:null,doubles:A.doubles&&{step:A.doubles.step,points:[E].concat(A.doubles.points.map(M))},naf:A.naf&&{wnd:A.naf.wnd,points:[E].concat(A.naf.points.map(M))}},E},w.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},w.prototype.isInfinity=function(){return this.inf},w.prototype.add=function(_){if(this.inf)return _;if(_.inf)return this;if(this.eq(_))return this.dbl();if(this.neg().eq(_))return this.curve.point(null,null);if(this.x.cmp(_.x)===0)return this.curve.point(null,null);var b=this.y.redSub(_.y);b.cmpn(0)!==0&&(b=b.redMul(this.x.redSub(_.x).redInvm()));var C=b.redSqr().redISub(this.x).redISub(_.x),E=b.redMul(this.x.redSub(C)).redISub(this.y);return this.curve.point(C,E)},w.prototype.dbl=function(){if(this.inf)return this;var _=this.y.redAdd(this.y);if(_.cmpn(0)===0)return this.curve.point(null,null);var b=this.curve.a,C=this.x.redSqr(),E=_.redInvm(),M=C.redAdd(C).redIAdd(C).redIAdd(b).redMul(E),A=M.redSqr().redISub(this.x.redAdd(this.x)),T=M.redMul(this.x.redSub(A)).redISub(this.y);return this.curve.point(A,T)},w.prototype.getX=function(){return this.x.fromRed()},w.prototype.getY=function(){return this.y.fromRed()},w.prototype.mul=function(_){return _=new f(_,16),this.isInfinity()?this:this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve.endo?this.curve._endoWnafMulAdd([this],[_]):this.curve._wnafMul(this,_)},w.prototype.mulAdd=function(_,b,C){var E=[this,b],M=[_,C];return this.curve.endo?this.curve._endoWnafMulAdd(E,M):this.curve._wnafMulAdd(1,E,M,2)},w.prototype.jmulAdd=function(_,b,C){var E=[this,b],M=[_,C];return this.curve.endo?this.curve._endoWnafMulAdd(E,M,!0):this.curve._wnafMulAdd(1,E,M,2,!0)},w.prototype.eq=function(_){return this===_||this.inf===_.inf&&(this.inf||this.x.cmp(_.x)===0&&this.y.cmp(_.y)===0)},w.prototype.neg=function(_){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(_&&this.precomputed){var C=this.precomputed,E=function(M){return M.neg()};b.precomputed={naf:C.naf&&{wnd:C.naf.wnd,points:C.naf.points.map(E)},doubles:C.doubles&&{step:C.doubles.step,points:C.doubles.points.map(E)}}}return b},w.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var _=this.curve.jpoint(this.x,this.y,this.curve.one);return _};function x(S,_,b,C){m.BasePoint.call(this,S,"jacobian"),_===null&&b===null&&C===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(_,16),this.y=new f(b,16),this.z=new f(C,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return d(x,m.BasePoint),g.prototype.jpoint=function(_,b,C){return new x(this,_,b,C)},x.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var _=this.z.redInvm(),b=_.redSqr(),C=this.x.redMul(b),E=this.y.redMul(b).redMul(_);return this.curve.point(C,E)},x.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},x.prototype.add=function(_){if(this.isInfinity())return _;if(_.isInfinity())return this;var b=_.z.redSqr(),C=this.z.redSqr(),E=this.x.redMul(b),M=_.x.redMul(C),A=this.y.redMul(b.redMul(_.z)),T=_.y.redMul(C.redMul(this.z)),L=E.redSub(M),O=A.redSub(T);if(L.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var N=L.redSqr(),H=N.redMul(L),V=E.redMul(N),X=O.redSqr().redIAdd(H).redISub(V).redISub(V),oe=O.redMul(V.redISub(X)).redISub(A.redMul(H)),se=this.z.redMul(_.z).redMul(L);return this.curve.jpoint(X,oe,se)},x.prototype.mixedAdd=function(_){if(this.isInfinity())return _.toJ();if(_.isInfinity())return this;var b=this.z.redSqr(),C=this.x,E=_.x.redMul(b),M=this.y,A=_.y.redMul(b).redMul(this.z),T=C.redSub(E),L=M.redSub(A);if(T.cmpn(0)===0)return L.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=T.redSqr(),N=O.redMul(T),H=C.redMul(O),V=L.redSqr().redIAdd(N).redISub(H).redISub(H),X=L.redMul(H.redISub(V)).redISub(M.redMul(N)),oe=this.z.redMul(T);return this.curve.jpoint(V,X,oe)},x.prototype.dblp=function(_){if(_===0)return this;if(this.isInfinity())return this;if(!_)return this.dbl();var b;if(this.curve.zeroA||this.curve.threeA){var C=this;for(b=0;b<_;b++)C=C.dbl();return C}var E=this.curve.a,M=this.curve.tinv,A=this.x,T=this.y,L=this.z,O=L.redSqr().redSqr(),N=T.redAdd(T);for(b=0;b<_;b++){var H=A.redSqr(),V=N.redSqr(),X=V.redSqr(),oe=H.redAdd(H).redIAdd(H).redIAdd(E.redMul(O)),se=A.redMul(V),de=oe.redSqr().redISub(se.redAdd(se)),he=se.redISub(de),we=oe.redMul(he);we=we.redIAdd(we).redISub(X);var te=N.redMul(L);b+1<_&&(O=O.redMul(X)),A=de,L=te,N=we}return this.curve.jpoint(A,N.redMul(M),L)},x.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},x.prototype._zeroDbl=function(){var _,b,C;if(this.zOne){var E=this.x.redSqr(),M=this.y.redSqr(),A=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(E).redISub(A);T=T.redIAdd(T);var L=E.redAdd(E).redIAdd(E),O=L.redSqr().redISub(T).redISub(T),N=A.redIAdd(A);N=N.redIAdd(N),N=N.redIAdd(N),_=O,b=L.redMul(T.redISub(O)).redISub(N),C=this.y.redAdd(this.y)}else{var H=this.x.redSqr(),V=this.y.redSqr(),X=V.redSqr(),oe=this.x.redAdd(V).redSqr().redISub(H).redISub(X);oe=oe.redIAdd(oe);var se=H.redAdd(H).redIAdd(H),de=se.redSqr(),he=X.redIAdd(X);he=he.redIAdd(he),he=he.redIAdd(he),_=de.redISub(oe).redISub(oe),b=se.redMul(oe.redISub(_)).redISub(he),C=this.y.redMul(this.z),C=C.redIAdd(C)}return this.curve.jpoint(_,b,C)},x.prototype._threeDbl=function(){var _,b,C;if(this.zOne){var E=this.x.redSqr(),M=this.y.redSqr(),A=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(E).redISub(A);T=T.redIAdd(T);var L=E.redAdd(E).redIAdd(E).redIAdd(this.curve.a),O=L.redSqr().redISub(T).redISub(T);_=O;var N=A.redIAdd(A);N=N.redIAdd(N),N=N.redIAdd(N),b=L.redMul(T.redISub(O)).redISub(N),C=this.y.redAdd(this.y)}else{var H=this.z.redSqr(),V=this.y.redSqr(),X=this.x.redMul(V),oe=this.x.redSub(H).redMul(this.x.redAdd(H));oe=oe.redAdd(oe).redIAdd(oe);var se=X.redIAdd(X);se=se.redIAdd(se);var de=se.redAdd(se);_=oe.redSqr().redISub(de),C=this.y.redAdd(this.z).redSqr().redISub(V).redISub(H);var he=V.redSqr();he=he.redIAdd(he),he=he.redIAdd(he),he=he.redIAdd(he),b=oe.redMul(se.redISub(_)).redISub(he)}return this.curve.jpoint(_,b,C)},x.prototype._dbl=function(){var _=this.curve.a,b=this.x,C=this.y,E=this.z,M=E.redSqr().redSqr(),A=b.redSqr(),T=C.redSqr(),L=A.redAdd(A).redIAdd(A).redIAdd(_.redMul(M)),O=b.redAdd(b);O=O.redIAdd(O);var N=O.redMul(T),H=L.redSqr().redISub(N.redAdd(N)),V=N.redISub(H),X=T.redSqr();X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X);var oe=L.redMul(V).redISub(X),se=C.redAdd(C).redMul(E);return this.curve.jpoint(H,oe,se)},x.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var _=this.x.redSqr(),b=this.y.redSqr(),C=this.z.redSqr(),E=b.redSqr(),M=_.redAdd(_).redIAdd(_),A=M.redSqr(),T=this.x.redAdd(b).redSqr().redISub(_).redISub(E);T=T.redIAdd(T),T=T.redAdd(T).redIAdd(T),T=T.redISub(A);var L=T.redSqr(),O=E.redIAdd(E);O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var N=M.redIAdd(T).redSqr().redISub(A).redISub(L).redISub(O),H=b.redMul(N);H=H.redIAdd(H),H=H.redIAdd(H);var V=this.x.redMul(L).redISub(H);V=V.redIAdd(V),V=V.redIAdd(V);var X=this.y.redMul(N.redMul(O.redISub(N)).redISub(T.redMul(L)));X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X);var oe=this.z.redAdd(T).redSqr().redISub(C).redISub(L);return this.curve.jpoint(V,X,oe)},x.prototype.mul=function(_,b){return _=new f(_,b),this.curve._wnafMul(this,_)},x.prototype.eq=function(_){if(_.type==="affine")return this.eq(_.toJ());if(this===_)return!0;var b=this.z.redSqr(),C=_.z.redSqr();if(this.x.redMul(C).redISub(_.x.redMul(b)).cmpn(0)!==0)return!1;var E=b.redMul(this.z),M=C.redMul(_.z);return this.y.redMul(M).redISub(_.y.redMul(E)).cmpn(0)===0},x.prototype.eqXToP=function(_){var b=this.z.redSqr(),C=_.toRed(this.curve.red).redMul(b);if(this.x.cmp(C)===0)return!0;for(var E=_.clone(),M=this.curve.redN.redMul(b);;){if(E.iadd(this.curve.n),E.cmp(this.curve.p)>=0)return!1;if(C.redIAdd(M),this.x.cmp(C)===0)return!0}},x.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},x.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var r=requireBn$2(),f=requireInherits_browser(),d=requireBase$1(),m=requireUtils$1();function v(w){d.call(this,"mont",w),this.a=new r(w.a,16).toRed(this.red),this.b=new r(w.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}f(v,d),mont=v,v.prototype.validate=function(x){var S=x.normalize().x,_=S.redSqr(),b=_.redMul(S).redAdd(_.redMul(this.a)).redAdd(S),C=b.redSqrt();return C.redSqr().cmp(b)===0};function g(w,x,S){d.BasePoint.call(this,w,"projective"),x===null&&S===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(x,16),this.z=new r(S,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return f(g,d.BasePoint),v.prototype.decodePoint=function(x,S){return this.point(m.toArray(x,S),1)},v.prototype.point=function(x,S){return new g(this,x,S)},v.prototype.pointFromJSON=function(x){return g.fromJSON(this,x)},g.prototype.precompute=function(){},g.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},g.fromJSON=function(x,S){return new g(x,S[0],S[1]||x.one)},g.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},g.prototype.isInfinity=function(){return this.z.cmpn(0)===0},g.prototype.dbl=function(){var x=this.x.redAdd(this.z),S=x.redSqr(),_=this.x.redSub(this.z),b=_.redSqr(),C=S.redSub(b),E=S.redMul(b),M=C.redMul(b.redAdd(this.curve.a24.redMul(C)));return this.curve.point(E,M)},g.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},g.prototype.diffAdd=function(x,S){var _=this.x.redAdd(this.z),b=this.x.redSub(this.z),C=x.x.redAdd(x.z),E=x.x.redSub(x.z),M=E.redMul(_),A=C.redMul(b),T=S.z.redMul(M.redAdd(A).redSqr()),L=S.x.redMul(M.redISub(A).redSqr());return this.curve.point(T,L)},g.prototype.mul=function(x){for(var S=x.clone(),_=this,b=this.curve.point(null,null),C=this,E=[];S.cmpn(0)!==0;S.iushrn(1))E.push(S.andln(1));for(var M=E.length-1;M>=0;M--)E[M]===0?(_=_.diffAdd(b,C),b=b.dbl()):(b=_.diffAdd(b,C),_=_.dbl());return b},g.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},g.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},g.prototype.eq=function(x){return this.getX().cmp(x.getX())===0},g.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var r=requireUtils$1(),f=requireBn$2(),d=requireInherits_browser(),m=requireBase$1(),v=r.assert;function g(x){this.twisted=(x.a|0)!==1,this.mOneA=this.twisted&&(x.a|0)===-1,this.extended=this.mOneA,m.call(this,"edwards",x),this.a=new f(x.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new f(x.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new f(x.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),v(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(x.c|0)===1}d(g,m),edwards=g,g.prototype._mulA=function(S){return this.mOneA?S.redNeg():this.a.redMul(S)},g.prototype._mulC=function(S){return this.oneC?S:this.c.redMul(S)},g.prototype.jpoint=function(S,_,b,C){return this.point(S,_,b,C)},g.prototype.pointFromX=function(S,_){S=new f(S,16),S.red||(S=S.toRed(this.red));var b=S.redSqr(),C=this.c2.redSub(this.a.redMul(b)),E=this.one.redSub(this.c2.redMul(this.d).redMul(b)),M=C.redMul(E.redInvm()),A=M.redSqrt();if(A.redSqr().redSub(M).cmp(this.zero)!==0)throw new Error("invalid point");var T=A.fromRed().isOdd();return(_&&!T||!_&&T)&&(A=A.redNeg()),this.point(S,A)},g.prototype.pointFromY=function(S,_){S=new f(S,16),S.red||(S=S.toRed(this.red));var b=S.redSqr(),C=b.redSub(this.c2),E=b.redMul(this.d).redMul(this.c2).redSub(this.a),M=C.redMul(E.redInvm());if(M.cmp(this.zero)===0){if(_)throw new Error("invalid point");return this.point(this.zero,S)}var A=M.redSqrt();if(A.redSqr().redSub(M).cmp(this.zero)!==0)throw new Error("invalid point");return A.fromRed().isOdd()!==_&&(A=A.redNeg()),this.point(A,S)},g.prototype.validate=function(S){if(S.isInfinity())return!0;S.normalize();var _=S.x.redSqr(),b=S.y.redSqr(),C=_.redMul(this.a).redAdd(b),E=this.c2.redMul(this.one.redAdd(this.d.redMul(_).redMul(b)));return C.cmp(E)===0};function w(x,S,_,b,C){m.BasePoint.call(this,x,"projective"),S===null&&_===null&&b===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new f(S,16),this.y=new f(_,16),this.z=b?new f(b,16):this.curve.one,this.t=C&&new f(C,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return d(w,m.BasePoint),g.prototype.pointFromJSON=function(S){return w.fromJSON(this,S)},g.prototype.point=function(S,_,b,C){return new w(this,S,_,b,C)},w.fromJSON=function(S,_){return new w(S,_[0],_[1],_[2])},w.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},w.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},w.prototype._extDbl=function(){var S=this.x.redSqr(),_=this.y.redSqr(),b=this.z.redSqr();b=b.redIAdd(b);var C=this.curve._mulA(S),E=this.x.redAdd(this.y).redSqr().redISub(S).redISub(_),M=C.redAdd(_),A=M.redSub(b),T=C.redSub(_),L=E.redMul(A),O=M.redMul(T),N=E.redMul(T),H=A.redMul(M);return this.curve.point(L,O,H,N)},w.prototype._projDbl=function(){var S=this.x.redAdd(this.y).redSqr(),_=this.x.redSqr(),b=this.y.redSqr(),C,E,M,A,T,L;if(this.curve.twisted){A=this.curve._mulA(_);var O=A.redAdd(b);this.zOne?(C=S.redSub(_).redSub(b).redMul(O.redSub(this.curve.two)),E=O.redMul(A.redSub(b)),M=O.redSqr().redSub(O).redSub(O)):(T=this.z.redSqr(),L=O.redSub(T).redISub(T),C=S.redSub(_).redISub(b).redMul(L),E=O.redMul(A.redSub(b)),M=O.redMul(L))}else A=_.redAdd(b),T=this.curve._mulC(this.z).redSqr(),L=A.redSub(T).redSub(T),C=this.curve._mulC(S.redISub(A)).redMul(L),E=this.curve._mulC(A).redMul(_.redISub(b)),M=A.redMul(L);return this.curve.point(C,E,M)},w.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},w.prototype._extAdd=function(S){var _=this.y.redSub(this.x).redMul(S.y.redSub(S.x)),b=this.y.redAdd(this.x).redMul(S.y.redAdd(S.x)),C=this.t.redMul(this.curve.dd).redMul(S.t),E=this.z.redMul(S.z.redAdd(S.z)),M=b.redSub(_),A=E.redSub(C),T=E.redAdd(C),L=b.redAdd(_),O=M.redMul(A),N=T.redMul(L),H=M.redMul(L),V=A.redMul(T);return this.curve.point(O,N,V,H)},w.prototype._projAdd=function(S){var _=this.z.redMul(S.z),b=_.redSqr(),C=this.x.redMul(S.x),E=this.y.redMul(S.y),M=this.curve.d.redMul(C).redMul(E),A=b.redSub(M),T=b.redAdd(M),L=this.x.redAdd(this.y).redMul(S.x.redAdd(S.y)).redISub(C).redISub(E),O=_.redMul(A).redMul(L),N,H;return this.curve.twisted?(N=_.redMul(T).redMul(E.redSub(this.curve._mulA(C))),H=A.redMul(T)):(N=_.redMul(T).redMul(E.redSub(C)),H=this.curve._mulC(A).redMul(T)),this.curve.point(O,N,H)},w.prototype.add=function(S){return this.isInfinity()?S:S.isInfinity()?this:this.curve.extended?this._extAdd(S):this._projAdd(S)},w.prototype.mul=function(S){return this._hasDoubles(S)?this.curve._fixedNafMul(this,S):this.curve._wnafMul(this,S)},w.prototype.mulAdd=function(S,_,b){return this.curve._wnafMulAdd(1,[this,_],[S,b],2,!1)},w.prototype.jmulAdd=function(S,_,b){return this.curve._wnafMulAdd(1,[this,_],[S,b],2,!0)},w.prototype.normalize=function(){if(this.zOne)return this;var S=this.z.redInvm();return this.x=this.x.redMul(S),this.y=this.y.redMul(S),this.t&&(this.t=this.t.redMul(S)),this.z=this.curve.one,this.zOne=!0,this},w.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},w.prototype.getX=function(){return this.normalize(),this.x.fromRed()},w.prototype.getY=function(){return this.normalize(),this.y.fromRed()},w.prototype.eq=function(S){return this===S||this.getX().cmp(S.getX())===0&&this.getY().cmp(S.getY())===0},w.prototype.eqXToP=function(S){var _=S.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(_)===0)return!0;for(var b=S.clone(),C=this.curve.redN.redMul(this.z);;){if(b.iadd(this.curve.n),b.cmp(this.curve.p)>=0)return!1;if(_.redIAdd(C),this.x.cmp(_)===0)return!0}},w.prototype.toP=w.prototype.normalize,w.prototype.mixedAdd=w.prototype.add,edwards}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(function(r){var f=r;f.base=requireBase$1(),f.short=requireShort(),f.mont=requireMont(),f.edwards=requireEdwards()})(curve)),curve}var curves={},hash={},utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var r=requireMinimalisticAssert(),f=requireInherits_browser();utils.inherits=f;function d(k,q){return(k.charCodeAt(q)&64512)!==55296||q<0||q+1>=k.length?!1:(k.charCodeAt(q+1)&64512)===56320}function m(k,q){if(Array.isArray(k))return k.slice();if(!k)return[];var y=[];if(typeof k=="string")if(q){if(q==="hex")for(k=k.replace(/[^a-z0-9]+/ig,""),k.length%2!==0&&(k="0"+k),$=0;$<k.length;$+=2)y.push(parseInt(k[$]+k[$+1],16))}else for(var B=0,$=0;$<k.length;$++){var I=k.charCodeAt($);I<128?y[B++]=I:I<2048?(y[B++]=I>>6|192,y[B++]=I&63|128):d(k,$)?(I=65536+((I&1023)<<10)+(k.charCodeAt(++$)&1023),y[B++]=I>>18|240,y[B++]=I>>12&63|128,y[B++]=I>>6&63|128,y[B++]=I&63|128):(y[B++]=I>>12|224,y[B++]=I>>6&63|128,y[B++]=I&63|128)}else for($=0;$<k.length;$++)y[$]=k[$]|0;return y}utils.toArray=m;function v(k){for(var q="",y=0;y<k.length;y++)q+=x(k[y].toString(16));return q}utils.toHex=v;function g(k){var q=k>>>24|k>>>8&65280|k<<8&16711680|(k&255)<<24;return q>>>0}utils.htonl=g;function w(k,q){for(var y="",B=0;B<k.length;B++){var $=k[B];q==="little"&&($=g($)),y+=S($.toString(16))}return y}utils.toHex32=w;function x(k){return k.length===1?"0"+k:k}utils.zero2=x;function S(k){return k.length===7?"0"+k:k.length===6?"00"+k:k.length===5?"000"+k:k.length===4?"0000"+k:k.length===3?"00000"+k:k.length===2?"000000"+k:k.length===1?"0000000"+k:k}utils.zero8=S;function _(k,q,y,B){var $=y-q;r($%4===0);for(var I=new Array($/4),F=0,j=q;F<I.length;F++,j+=4){var D;B==="big"?D=k[j]<<24|k[j+1]<<16|k[j+2]<<8|k[j+3]:D=k[j+3]<<24|k[j+2]<<16|k[j+1]<<8|k[j],I[F]=D>>>0}return I}utils.join32=_;function b(k,q){for(var y=new Array(k.length*4),B=0,$=0;B<k.length;B++,$+=4){var I=k[B];q==="big"?(y[$]=I>>>24,y[$+1]=I>>>16&255,y[$+2]=I>>>8&255,y[$+3]=I&255):(y[$+3]=I>>>24,y[$+2]=I>>>16&255,y[$+1]=I>>>8&255,y[$]=I&255)}return y}utils.split32=b;function C(k,q){return k>>>q|k<<32-q}utils.rotr32=C;function E(k,q){return k<<q|k>>>32-q}utils.rotl32=E;function M(k,q){return k+q>>>0}utils.sum32=M;function A(k,q,y){return k+q+y>>>0}utils.sum32_3=A;function T(k,q,y,B){return k+q+y+B>>>0}utils.sum32_4=T;function L(k,q,y,B,$){return k+q+y+B+$>>>0}utils.sum32_5=L;function O(k,q,y,B){var $=k[q],I=k[q+1],F=B+I>>>0,j=(F<B?1:0)+y+$;k[q]=j>>>0,k[q+1]=F}utils.sum64=O;function N(k,q,y,B){var $=q+B>>>0,I=($<q?1:0)+k+y;return I>>>0}utils.sum64_hi=N;function H(k,q,y,B){var $=q+B;return $>>>0}utils.sum64_lo=H;function V(k,q,y,B,$,I,F,j){var D=0,W=q;W=W+B>>>0,D+=W<q?1:0,W=W+I>>>0,D+=W<I?1:0,W=W+j>>>0,D+=W<j?1:0;var R=k+y+$+F+D;return R>>>0}utils.sum64_4_hi=V;function X(k,q,y,B,$,I,F,j){var D=q+B+I+j;return D>>>0}utils.sum64_4_lo=X;function oe(k,q,y,B,$,I,F,j,D,W){var R=0,z=q;z=z+B>>>0,R+=z<q?1:0,z=z+I>>>0,R+=z<I?1:0,z=z+j>>>0,R+=z<j?1:0,z=z+W>>>0,R+=z<W?1:0;var ye=k+y+$+F+D+R;return ye>>>0}utils.sum64_5_hi=oe;function se(k,q,y,B,$,I,F,j,D,W){var R=q+B+I+j+W;return R>>>0}utils.sum64_5_lo=se;function de(k,q,y){var B=q<<32-y|k>>>y;return B>>>0}utils.rotr64_hi=de;function he(k,q,y){var B=k<<32-y|q>>>y;return B>>>0}utils.rotr64_lo=he;function we(k,q,y){return k>>>y}utils.shr64_hi=we;function te(k,q,y){var B=k<<32-y|q>>>y;return B>>>0}return utils.shr64_lo=te,utils}var common$3={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$3;hasRequiredCommon$1=1;var r=requireUtils(),f=requireMinimalisticAssert();function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$3.BlockHash=d,d.prototype.update=function(v,g){if(v=r.toArray(v,g),this.pending?this.pending=this.pending.concat(v):this.pending=v,this.pendingTotal+=v.length,this.pending.length>=this._delta8){v=this.pending;var w=v.length%this._delta8;this.pending=v.slice(v.length-w,v.length),this.pending.length===0&&(this.pending=null),v=r.join32(v,0,v.length-w,this.endian);for(var x=0;x<v.length;x+=this._delta32)this._update(v,x,x+this._delta32)}return this},d.prototype.digest=function(v){return this.update(this._pad()),f(this.pending===null),this._digest(v)},d.prototype._pad=function(){var v=this.pendingTotal,g=this._delta8,w=g-(v+this.padLength)%g,x=new Array(w+this.padLength);x[0]=128;for(var S=1;S<w;S++)x[S]=0;if(v<<=3,this.endian==="big"){for(var _=8;_<this.padLength;_++)x[S++]=0;x[S++]=0,x[S++]=0,x[S++]=0,x[S++]=0,x[S++]=v>>>24&255,x[S++]=v>>>16&255,x[S++]=v>>>8&255,x[S++]=v&255}else for(x[S++]=v&255,x[S++]=v>>>8&255,x[S++]=v>>>16&255,x[S++]=v>>>24&255,x[S++]=0,x[S++]=0,x[S++]=0,x[S++]=0,_=8;_<this.padLength;_++)x[S++]=0;return x},common$3}var sha={},common$2={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common$2;hasRequiredCommon=1;var r=requireUtils(),f=r.rotr32;function d(b,C,E,M){if(b===0)return m(C,E,M);if(b===1||b===3)return g(C,E,M);if(b===2)return v(C,E,M)}common$2.ft_1=d;function m(b,C,E){return b&C^~b&E}common$2.ch32=m;function v(b,C,E){return b&C^b&E^C&E}common$2.maj32=v;function g(b,C,E){return b^C^E}common$2.p32=g;function w(b){return f(b,2)^f(b,13)^f(b,22)}common$2.s0_256=w;function x(b){return f(b,6)^f(b,11)^f(b,25)}common$2.s1_256=x;function S(b){return f(b,7)^f(b,18)^b>>>3}common$2.g0_256=S;function _(b){return f(b,17)^f(b,19)^b>>>10}return common$2.g1_256=_,common$2}var _1,hasRequired_1;function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var r=requireUtils(),f=requireCommon$1(),d=requireCommon(),m=r.rotl32,v=r.sum32,g=r.sum32_5,w=d.ft_1,x=f.BlockHash,S=[1518500249,1859775393,2400959708,3395469782];function _(){if(!(this instanceof _))return new _;x.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return r.inherits(_,x),_1=_,_.blockSize=512,_.outSize=160,_.hmacStrength=80,_.padLength=64,_.prototype._update=function(C,E){for(var M=this.W,A=0;A<16;A++)M[A]=C[E+A];for(;A<M.length;A++)M[A]=m(M[A-3]^M[A-8]^M[A-14]^M[A-16],1);var T=this.h[0],L=this.h[1],O=this.h[2],N=this.h[3],H=this.h[4];for(A=0;A<M.length;A++){var V=~~(A/20),X=g(m(T,5),w(V,L,O,N),H,M[A],S[V]);H=N,N=O,O=m(L,30),L=T,T=X}this.h[0]=v(this.h[0],T),this.h[1]=v(this.h[1],L),this.h[2]=v(this.h[2],O),this.h[3]=v(this.h[3],N),this.h[4]=v(this.h[4],H)},_.prototype._digest=function(C){return C==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},_1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var r=requireUtils(),f=requireCommon$1(),d=requireCommon(),m=requireMinimalisticAssert(),v=r.sum32,g=r.sum32_4,w=r.sum32_5,x=d.ch32,S=d.maj32,_=d.s0_256,b=d.s1_256,C=d.g0_256,E=d.g1_256,M=f.BlockHash,A=[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];function T(){if(!(this instanceof T))return new T;M.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=A,this.W=new Array(64)}return r.inherits(T,M),_256=T,T.blockSize=512,T.outSize=256,T.hmacStrength=192,T.padLength=64,T.prototype._update=function(O,N){for(var H=this.W,V=0;V<16;V++)H[V]=O[N+V];for(;V<H.length;V++)H[V]=g(E(H[V-2]),H[V-7],C(H[V-15]),H[V-16]);var X=this.h[0],oe=this.h[1],se=this.h[2],de=this.h[3],he=this.h[4],we=this.h[5],te=this.h[6],k=this.h[7];for(m(this.k.length===H.length),V=0;V<H.length;V++){var q=w(k,b(he),x(he,we,te),this.k[V],H[V]),y=v(_(X),S(X,oe,se));k=te,te=we,we=he,he=v(de,q),de=se,se=oe,oe=X,X=v(q,y)}this.h[0]=v(this.h[0],X),this.h[1]=v(this.h[1],oe),this.h[2]=v(this.h[2],se),this.h[3]=v(this.h[3],de),this.h[4]=v(this.h[4],he),this.h[5]=v(this.h[5],we),this.h[6]=v(this.h[6],te),this.h[7]=v(this.h[7],k)},T.prototype._digest=function(O){return O==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var r=requireUtils(),f=require_256();function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return r.inherits(d,f),_224=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(v){return v==="hex"?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var r=requireUtils(),f=requireCommon$1(),d=requireMinimalisticAssert(),m=r.rotr64_hi,v=r.rotr64_lo,g=r.shr64_hi,w=r.shr64_lo,x=r.sum64,S=r.sum64_hi,_=r.sum64_lo,b=r.sum64_4_hi,C=r.sum64_4_lo,E=r.sum64_5_hi,M=r.sum64_5_lo,A=f.BlockHash,T=[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];function L(){if(!(this instanceof L))return new L;A.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=T,this.W=new Array(160)}r.inherits(L,A),_512=L,L.blockSize=1024,L.outSize=512,L.hmacStrength=192,L.padLength=128,L.prototype._prepareBlock=function(y,B){for(var $=this.W,I=0;I<32;I++)$[I]=y[B+I];for(;I<$.length;I+=2){var F=te($[I-4],$[I-3]),j=k($[I-4],$[I-3]),D=$[I-14],W=$[I-13],R=he($[I-30],$[I-29]),z=we($[I-30],$[I-29]),ye=$[I-32],Ce=$[I-31];$[I]=b(F,j,D,W,R,z,ye,Ce),$[I+1]=C(F,j,D,W,R,z,ye,Ce)}},L.prototype._update=function(y,B){this._prepareBlock(y,B);var $=this.W,I=this.h[0],F=this.h[1],j=this.h[2],D=this.h[3],W=this.h[4],R=this.h[5],z=this.h[6],ye=this.h[7],Ce=this.h[8],me=this.h[9],ie=this.h[10],ee=this.h[11],pe=this.h[12],be=this.h[13],ae=this.h[14],ne=this.h[15];d(this.k.length===$.length);for(var Se=0;Se<$.length;Se+=2){var qe=ae,Ie=ne,Oe=se(Ce,me),Ue=de(Ce,me),De=O(Ce,me,ie,ee,pe),$e=N(Ce,me,ie,ee,pe,be),je=this.k[Se],Ye=this.k[Se+1],st=$[Se],Je=$[Se+1],Ge=E(qe,Ie,Oe,Ue,De,$e,je,Ye,st,Je),ut=M(qe,Ie,Oe,Ue,De,$e,je,Ye,st,Je);qe=X(I,F),Ie=oe(I,F),Oe=H(I,F,j,D,W),Ue=V(I,F,j,D,W,R);var gt=S(qe,Ie,Oe,Ue),rt=_(qe,Ie,Oe,Ue);ae=pe,ne=be,pe=ie,be=ee,ie=Ce,ee=me,Ce=S(z,ye,Ge,ut),me=_(ye,ye,Ge,ut),z=W,ye=R,W=j,R=D,j=I,D=F,I=S(Ge,ut,gt,rt),F=_(Ge,ut,gt,rt)}x(this.h,0,I,F),x(this.h,2,j,D),x(this.h,4,W,R),x(this.h,6,z,ye),x(this.h,8,Ce,me),x(this.h,10,ie,ee),x(this.h,12,pe,be),x(this.h,14,ae,ne)},L.prototype._digest=function(y){return y==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")};function O(q,y,B,$,I){var F=q&B^~q&I;return F<0&&(F+=4294967296),F}function N(q,y,B,$,I,F){var j=y&$^~y&F;return j<0&&(j+=4294967296),j}function H(q,y,B,$,I){var F=q&B^q&I^B&I;return F<0&&(F+=4294967296),F}function V(q,y,B,$,I,F){var j=y&$^y&F^$&F;return j<0&&(j+=4294967296),j}function X(q,y){var B=m(q,y,28),$=m(y,q,2),I=m(y,q,7),F=B^$^I;return F<0&&(F+=4294967296),F}function oe(q,y){var B=v(q,y,28),$=v(y,q,2),I=v(y,q,7),F=B^$^I;return F<0&&(F+=4294967296),F}function se(q,y){var B=m(q,y,14),$=m(q,y,18),I=m(y,q,9),F=B^$^I;return F<0&&(F+=4294967296),F}function de(q,y){var B=v(q,y,14),$=v(q,y,18),I=v(y,q,9),F=B^$^I;return F<0&&(F+=4294967296),F}function he(q,y){var B=m(q,y,1),$=m(q,y,8),I=g(q,y,7),F=B^$^I;return F<0&&(F+=4294967296),F}function we(q,y){var B=v(q,y,1),$=v(q,y,8),I=w(q,y,7),F=B^$^I;return F<0&&(F+=4294967296),F}function te(q,y){var B=m(q,y,19),$=m(y,q,29),I=g(q,y,6),F=B^$^I;return F<0&&(F+=4294967296),F}function k(q,y){var B=v(q,y,19),$=v(y,q,29),I=w(q,y,6),F=B^$^I;return F<0&&(F+=4294967296),F}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var r=requireUtils(),f=require_512();function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return r.inherits(d,f),_384=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(v){return v==="hex"?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var r=requireUtils(),f=requireCommon$1(),d=r.rotl32,m=r.sum32,v=r.sum32_3,g=r.sum32_4,w=f.BlockHash;function x(){if(!(this instanceof x))return new x;w.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}r.inherits(x,w),ripemd.ripemd160=x,x.blockSize=512,x.outSize=160,x.hmacStrength=192,x.padLength=64,x.prototype._update=function(L,O){for(var N=this.h[0],H=this.h[1],V=this.h[2],X=this.h[3],oe=this.h[4],se=N,de=H,he=V,we=X,te=oe,k=0;k<80;k++){var q=m(d(g(N,S(k,H,V,X),L[C[k]+O],_(k)),M[k]),oe);N=oe,oe=X,X=d(V,10),V=H,H=q,q=m(d(g(se,S(79-k,de,he,we),L[E[k]+O],b(k)),A[k]),te),se=te,te=we,we=d(he,10),he=de,de=q}q=v(this.h[1],V,we),this.h[1]=v(this.h[2],X,te),this.h[2]=v(this.h[3],oe,se),this.h[3]=v(this.h[4],N,de),this.h[4]=v(this.h[0],H,he),this.h[0]=q},x.prototype._digest=function(L){return L==="hex"?r.toHex32(this.h,"little"):r.split32(this.h,"little")};function S(T,L,O,N){return T<=15?L^O^N:T<=31?L&O|~L&N:T<=47?(L|~O)^N:T<=63?L&N|O&~N:L^(O|~N)}function _(T){return T<=15?0:T<=31?1518500249:T<=47?1859775393:T<=63?2400959708:2840853838}function b(T){return T<=15?1352829926:T<=31?1548603684:T<=47?1836072691:T<=63?2053994217:0}var C=[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],E=[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],M=[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],A=[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];return ripemd}var hmac,hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;var r=requireUtils(),f=requireMinimalisticAssert();function d(m,v,g){if(!(this instanceof d))return new d(m,v,g);this.Hash=m,this.blockSize=m.blockSize/8,this.outSize=m.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(v,g))}return hmac=d,d.prototype._init=function(v){v.length>this.blockSize&&(v=new this.Hash().update(v).digest()),f(v.length<=this.blockSize);for(var g=v.length;g<this.blockSize;g++)v.push(0);for(g=0;g<v.length;g++)v[g]^=54;for(this.inner=new this.Hash().update(v),g=0;g<v.length;g++)v[g]^=106;this.outer=new this.Hash().update(v)},d.prototype.update=function(v,g){return this.inner.update(v,g),this},d.prototype.digest=function(v){return this.outer.update(this.inner.digest()),this.outer.digest(v)},hmac}var hasRequiredHash;function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(function(r){var f=r;f.utils=requireUtils(),f.common=requireCommon$1(),f.sha=requireSha(),f.ripemd=requireRipemd(),f.hmac=requireHmac(),f.sha1=f.sha.sha1,f.sha256=f.sha.sha256,f.sha224=f.sha.sha224,f.sha384=f.sha.sha384,f.sha512=f.sha.sha512,f.ripemd160=f.ripemd.ripemd160})(hash)),hash}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,(function(r){var f=r,d=requireHash(),m=requireCurve(),v=requireUtils$1(),g=v.assert;function w(_){_.type==="short"?this.curve=new m.short(_):_.type==="edwards"?this.curve=new m.edwards(_):this.curve=new m.mont(_),this.g=this.curve.g,this.n=this.curve.n,this.hash=_.hash,g(this.g.validate(),"Invalid curve"),g(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}f.PresetCurve=w;function x(_,b){Object.defineProperty(f,_,{configurable:!0,enumerable:!0,get:function(){var C=new w(b);return Object.defineProperty(f,_,{configurable:!0,enumerable:!0,value:C}),C}})}x("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:d.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),x("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:d.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),x("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:d.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),x("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:d.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),x("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:d.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),x("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["9"]}),x("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var S;try{S=requireSecp256k1()}catch{S=void 0}x("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:d.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",S]})})(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var r=requireHash(),f=requireUtils$2(),d=requireMinimalisticAssert();function m(v){if(!(this instanceof m))return new m(v);this.hash=v.hash,this.predResist=!!v.predResist,this.outLen=this.hash.outSize,this.minEntropy=v.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var g=f.toArray(v.entropy,v.entropyEnc||"hex"),w=f.toArray(v.nonce,v.nonceEnc||"hex"),x=f.toArray(v.pers,v.persEnc||"hex");d(g.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(g,w,x)}return hmacDrbg=m,m.prototype._init=function(g,w,x){var S=g.concat(w).concat(x);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var _=0;_<this.V.length;_++)this.K[_]=0,this.V[_]=1;this._update(S),this._reseed=1,this.reseedInterval=281474976710656},m.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},m.prototype._update=function(g){var w=this._hmac().update(this.V).update([0]);g&&(w=w.update(g)),this.K=w.digest(),this.V=this._hmac().update(this.V).digest(),g&&(this.K=this._hmac().update(this.V).update([1]).update(g).digest(),this.V=this._hmac().update(this.V).digest())},m.prototype.reseed=function(g,w,x,S){typeof w!="string"&&(S=x,x=w,w=null),g=f.toArray(g,w),x=f.toArray(x,S),d(g.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(g.concat(x||[])),this._reseed=1},m.prototype.generate=function(g,w,x,S){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof w!="string"&&(S=x,x=w,w=null),x&&(x=f.toArray(x,S||"hex"),this._update(x));for(var _=[];_.length<g;)this.V=this._hmac().update(this.V).digest(),_=_.concat(this.V);var b=_.slice(0,g);return this._update(x),this._reseed++,f.encode(b,w)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert;function m(v,g){this.ec=v,this.priv=null,this.pub=null,g.priv&&this._importPrivate(g.priv,g.privEnc),g.pub&&this._importPublic(g.pub,g.pubEnc)}return key$1=m,m.fromPublic=function(g,w,x){return w instanceof m?w:new m(g,{pub:w,pubEnc:x})},m.fromPrivate=function(g,w,x){return w instanceof m?w:new m(g,{priv:w,privEnc:x})},m.prototype.validate=function(){var g=this.getPublic();return g.isInfinity()?{result:!1,reason:"Invalid public key"}:g.validate()?g.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},m.prototype.getPublic=function(g,w){return typeof g=="string"&&(w=g,g=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),w?this.pub.encode(w,g):this.pub},m.prototype.getPrivate=function(g){return g==="hex"?this.priv.toString(16,2):this.priv},m.prototype._importPrivate=function(g,w){this.priv=new r(g,w||16),this.priv=this.priv.umod(this.ec.curve.n)},m.prototype._importPublic=function(g,w){if(g.x||g.y){this.ec.curve.type==="mont"?d(g.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&d(g.x&&g.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(g.x,g.y);return}this.pub=this.ec.curve.decodePoint(g,w)},m.prototype.derive=function(g){return g.validate()||d(g.validate(),"public point not validated"),g.mul(this.priv).getX()},m.prototype.sign=function(g,w,x){return this.ec.sign(g,this,w,x)},m.prototype.verify=function(g,w,x){return this.ec.verify(g,w,this,void 0,x)},m.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert;function m(S,_){if(S instanceof m)return S;this._importDER(S,_)||(d(S.r&&S.s,"Signature without r or s"),this.r=new r(S.r,16),this.s=new r(S.s,16),S.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=S.recoveryParam)}signature$1=m;function v(){this.place=0}function g(S,_){var b=S[_.place++];if(!(b&128))return b;var C=b&15;if(C===0||C>4||S[_.place]===0)return!1;for(var E=0,M=0,A=_.place;M<C;M++,A++)E<<=8,E|=S[A],E>>>=0;return E<=127?!1:(_.place=A,E)}function w(S){for(var _=0,b=S.length-1;!S[_]&&!(S[_+1]&128)&&_<b;)_++;return _===0?S:S.slice(_)}m.prototype._importDER=function(_,b){_=f.toArray(_,b);var C=new v;if(_[C.place++]!==48)return!1;var E=g(_,C);if(E===!1||E+C.place!==_.length||_[C.place++]!==2)return!1;var M=g(_,C);if(M===!1||(_[C.place]&128)!==0)return!1;var A=_.slice(C.place,M+C.place);if(C.place+=M,_[C.place++]!==2)return!1;var T=g(_,C);if(T===!1||_.length!==T+C.place||(_[C.place]&128)!==0)return!1;var L=_.slice(C.place,T+C.place);if(A[0]===0)if(A[1]&128)A=A.slice(1);else return!1;if(L[0]===0)if(L[1]&128)L=L.slice(1);else return!1;return this.r=new r(A),this.s=new r(L),this.recoveryParam=null,!0};function x(S,_){if(_<128){S.push(_);return}var b=1+(Math.log(_)/Math.LN2>>>3);for(S.push(b|128);--b;)S.push(_>>>(b<<3)&255);S.push(_)}return m.prototype.toDER=function(_){var b=this.r.toArray(),C=this.s.toArray();for(b[0]&128&&(b=[0].concat(b)),C[0]&128&&(C=[0].concat(C)),b=w(b),C=w(C);!C[0]&&!(C[1]&128);)C=C.slice(1);var E=[2];x(E,b.length),E=E.concat(b),E.push(2),x(E,C.length);var M=E.concat(C),A=[48];return x(A,M.length),A=A.concat(M),f.encode(A,_)},signature$1}var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var r=requireBn$2(),f=requireHmacDrbg(),d=requireUtils$1(),m=requireCurves(),v=requireBrorand(),g=d.assert,w=requireKey$1(),x=requireSignature$1();function S(_){if(!(this instanceof S))return new S(_);typeof _=="string"&&(g(Object.prototype.hasOwnProperty.call(m,_),"Unknown curve "+_),_=m[_]),_ instanceof m.PresetCurve&&(_={curve:_}),this.curve=_.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=_.curve.g,this.g.precompute(_.curve.n.bitLength()+1),this.hash=_.hash||_.curve.hash}return ec=S,S.prototype.keyPair=function(b){return new w(this,b)},S.prototype.keyFromPrivate=function(b,C){return w.fromPrivate(this,b,C)},S.prototype.keyFromPublic=function(b,C){return w.fromPublic(this,b,C)},S.prototype.genKeyPair=function(b){b||(b={});for(var C=new f({hash:this.hash,pers:b.pers,persEnc:b.persEnc||"utf8",entropy:b.entropy||v(this.hash.hmacStrength),entropyEnc:b.entropy&&b.entropyEnc||"utf8",nonce:this.n.toArray()}),E=this.n.byteLength(),M=this.n.sub(new r(2));;){var A=new r(C.generate(E));if(!(A.cmp(M)>0))return A.iaddn(1),this.keyFromPrivate(A)}},S.prototype._truncateToN=function(b,C,E){var M;if(r.isBN(b)||typeof b=="number")b=new r(b,16),M=b.byteLength();else if(typeof b=="object")M=b.length,b=new r(b,16);else{var A=b.toString();M=A.length+1>>>1,b=new r(A,16)}typeof E!="number"&&(E=M*8);var T=E-this.n.bitLength();return T>0&&(b=b.ushrn(T)),!C&&b.cmp(this.n)>=0?b.sub(this.n):b},S.prototype.sign=function(b,C,E,M){if(typeof E=="object"&&(M=E,E=null),M||(M={}),typeof b!="string"&&typeof b!="number"&&!r.isBN(b)){g(typeof b=="object"&&b&&typeof b.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),g(b.length>>>0===b.length);for(var A=0;A<b.length;A++)g((b[A]&255)===b[A])}C=this.keyFromPrivate(C,E),b=this._truncateToN(b,!1,M.msgBitLength),g(!b.isNeg(),"Can not sign a negative message");var T=this.n.byteLength(),L=C.getPrivate().toArray("be",T),O=b.toArray("be",T);g(new r(O).eq(b),"Can not sign message");for(var N=new f({hash:this.hash,entropy:L,nonce:O,pers:M.pers,persEnc:M.persEnc||"utf8"}),H=this.n.sub(new r(1)),V=0;;V++){var X=M.k?M.k(V):new r(N.generate(this.n.byteLength()));if(X=this._truncateToN(X,!0),!(X.cmpn(1)<=0||X.cmp(H)>=0)){var oe=this.g.mul(X);if(!oe.isInfinity()){var se=oe.getX(),de=se.umod(this.n);if(de.cmpn(0)!==0){var he=X.invm(this.n).mul(de.mul(C.getPrivate()).iadd(b));if(he=he.umod(this.n),he.cmpn(0)!==0){var we=(oe.getY().isOdd()?1:0)|(se.cmp(de)!==0?2:0);return M.canonical&&he.cmp(this.nh)>0&&(he=this.n.sub(he),we^=1),new x({r:de,s:he,recoveryParam:we})}}}}}},S.prototype.verify=function(b,C,E,M,A){A||(A={}),b=this._truncateToN(b,!1,A.msgBitLength),E=this.keyFromPublic(E,M),C=new x(C,"hex");var T=C.r,L=C.s;if(T.cmpn(1)<0||T.cmp(this.n)>=0||L.cmpn(1)<0||L.cmp(this.n)>=0)return!1;var O=L.invm(this.n),N=O.mul(b).umod(this.n),H=O.mul(T).umod(this.n),V;return this.curve._maxwellTrick?(V=this.g.jmulAdd(N,E.getPublic(),H),V.isInfinity()?!1:V.eqXToP(T)):(V=this.g.mulAdd(N,E.getPublic(),H),V.isInfinity()?!1:V.getX().umod(this.n).cmp(T)===0)},S.prototype.recoverPubKey=function(_,b,C,E){g((3&C)===C,"The recovery param is more than two bits"),b=new x(b,E);var M=this.n,A=new r(_),T=b.r,L=b.s,O=C&1,N=C>>1;if(T.cmp(this.curve.p.umod(this.curve.n))>=0&&N)throw new Error("Unable to find sencond key candinate");N?T=this.curve.pointFromX(T.add(this.curve.n),O):T=this.curve.pointFromX(T,O);var H=b.r.invm(M),V=M.sub(A).mul(H).umod(M),X=L.mul(H).umod(M);return this.g.mulAdd(V,T,X)},S.prototype.getKeyRecoveryParam=function(_,b,C,E){if(b=new x(b,E),b.recoveryParam!==null)return b.recoveryParam;for(var M=0;M<4;M++){var A;try{A=this.recoverPubKey(_,b,M)}catch{continue}if(A.eq(C))return M}throw new Error("Unable to find valid recovery factor")},ec}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var r=requireUtils$1(),f=r.assert,d=r.parseBytes,m=r.cachedProperty;function v(g,w){this.eddsa=g,this._secret=d(w.secret),g.isPoint(w.pub)?this._pub=w.pub:this._pubBytes=d(w.pub)}return v.fromPublic=function(w,x){return x instanceof v?x:new v(w,{pub:x})},v.fromSecret=function(w,x){return x instanceof v?x:new v(w,{secret:x})},v.prototype.secret=function(){return this._secret},m(v,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),m(v,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),m(v,"privBytes",function(){var w=this.eddsa,x=this.hash(),S=w.encodingLength-1,_=x.slice(0,w.encodingLength);return _[0]&=248,_[S]&=127,_[S]|=64,_}),m(v,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),m(v,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),m(v,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),v.prototype.sign=function(w){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(w,this)},v.prototype.verify=function(w,x){return this.eddsa.verify(w,x,this)},v.prototype.getSecret=function(w){return f(this._secret,"KeyPair is public only"),r.encode(this.secret(),w)},v.prototype.getPublic=function(w){return r.encode(this.pubBytes(),w)},key=v,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert,m=f.cachedProperty,v=f.parseBytes;function g(w,x){this.eddsa=w,typeof x!="object"&&(x=v(x)),Array.isArray(x)&&(d(x.length===w.encodingLength*2,"Signature has invalid size"),x={R:x.slice(0,w.encodingLength),S:x.slice(w.encodingLength)}),d(x.R&&x.S,"Signature without R or S"),w.isPoint(x.R)&&(this._R=x.R),x.S instanceof r&&(this._S=x.S),this._Rencoded=Array.isArray(x.R)?x.R:x.Rencoded,this._Sencoded=Array.isArray(x.S)?x.S:x.Sencoded}return m(g,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),m(g,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),m(g,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),m(g,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),g.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},g.prototype.toHex=function(){return f.encode(this.toBytes(),"hex").toUpperCase()},signature=g,signature}var eddsa,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var r=requireHash(),f=requireCurves(),d=requireUtils$1(),m=d.assert,v=d.parseBytes,g=requireKey(),w=requireSignature();function x(S){if(m(S==="ed25519","only tested with ed25519 so far"),!(this instanceof x))return new x(S);S=f[S].curve,this.curve=S,this.g=S.g,this.g.precompute(S.n.bitLength()+1),this.pointClass=S.point().constructor,this.encodingLength=Math.ceil(S.n.bitLength()/8),this.hash=r.sha512}return eddsa=x,x.prototype.sign=function(_,b){_=v(_);var C=this.keyFromSecret(b),E=this.hashInt(C.messagePrefix(),_),M=this.g.mul(E),A=this.encodePoint(M),T=this.hashInt(A,C.pubBytes(),_).mul(C.priv()),L=E.add(T).umod(this.curve.n);return this.makeSignature({R:M,S:L,Rencoded:A})},x.prototype.verify=function(_,b,C){if(_=v(_),b=this.makeSignature(b),b.S().gte(b.eddsa.curve.n)||b.S().isNeg())return!1;var E=this.keyFromPublic(C),M=this.hashInt(b.Rencoded(),E.pubBytes(),_),A=this.g.mul(b.S()),T=b.R().add(E.pub().mul(M));return T.eq(A)},x.prototype.hashInt=function(){for(var _=this.hash(),b=0;b<arguments.length;b++)_.update(arguments[b]);return d.intFromLE(_.digest()).umod(this.curve.n)},x.prototype.keyFromPublic=function(_){return g.fromPublic(this,_)},x.prototype.keyFromSecret=function(_){return g.fromSecret(this,_)},x.prototype.makeSignature=function(_){return _ instanceof w?_:new w(this,_)},x.prototype.encodePoint=function(_){var b=_.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=_.getX().isOdd()?128:0,b},x.prototype.decodePoint=function(_){_=d.parseBytes(_);var b=_.length-1,C=_.slice(0,b).concat(_[b]&-129),E=(_[b]&128)!==0,M=d.intFromLE(C);return this.curve.pointFromY(M,E)},x.prototype.encodeInt=function(_){return _.toArray("le",this.encodingLength)},x.prototype.decodeInt=function(_){return d.intFromLE(_)},x.prototype.isPoint=function(_){return _ instanceof this.pointClass},eddsa}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(function(r){var f=r;f.version=require$$0.version,f.utils=requireUtils$1(),f.rand=requireBrorand(),f.curve=requireCurve(),f.curves=requireCurves(),f.ec=requireEc(),f.eddsa=requireEddsa()})(elliptic)),elliptic}var bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,(function(r){(function(f,d){function m(q,y){if(!q)throw new Error(y||"Assertion failed")}function v(q,y){q.super_=y;var B=function(){};B.prototype=y.prototype,q.prototype=new B,q.prototype.constructor=q}function g(q,y,B){if(g.isBN(q))return q;this.negative=0,this.words=null,this.length=0,this.red=null,q!==null&&((y==="le"||y==="be")&&(B=y,y=10),this._init(q||0,y||10,B||"be"))}typeof f=="object"?f.exports=g:d.BN=g,g.BN=g,g.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}g.isBN=function(y){return y instanceof g?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===g.wordSize&&Array.isArray(y.words)},g.max=function(y,B){return y.cmp(B)>0?y:B},g.min=function(y,B){return y.cmp(B)<0?y:B},g.prototype._init=function(y,B,$){if(typeof y=="number")return this._initNumber(y,B,$);if(typeof y=="object")return this._initArray(y,B,$);B==="hex"&&(B=16),m(B===(B|0)&&B>=2&&B<=36),y=y.toString().replace(/\s+/g,"");var I=0;y[0]==="-"&&(I++,this.negative=1),I<y.length&&(B===16?this._parseHex(y,I,$):(this._parseBase(y,B,I),$==="le"&&this._initArray(this.toArray(),B,$)))},g.prototype._initNumber=function(y,B,$){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(m(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),B,$)},g.prototype._initArray=function(y,B,$){if(m(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F,j,D=0;if($==="be")for(I=y.length-1,F=0;I>=0;I-=3)j=y[I]|y[I-1]<<8|y[I-2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);else if($==="le")for(I=0,F=0;I<y.length;I+=3)j=y[I]|y[I+1]<<8|y[I+2]<<16,this.words[F]|=j<<D&67108863,this.words[F+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,F++);return this._strip()};function x(q,y){var B=q.charCodeAt(y);if(B>=48&&B<=57)return B-48;if(B>=65&&B<=70)return B-55;if(B>=97&&B<=102)return B-87;m(!1,"Invalid character in "+q)}function S(q,y,B){var $=x(q,B);return B-1>=y&&($|=x(q,B-1)<<4),$}g.prototype._parseHex=function(y,B,$){this.length=Math.ceil((y.length-B)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var F=0,j=0,D;if($==="be")for(I=y.length-1;I>=B;I-=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8;else{var W=y.length-B;for(I=W%2===0?B+1:B;I<y.length;I+=2)D=S(y,B,I)<<F,this.words[j]|=D&67108863,F>=18?(F-=18,j+=1,this.words[j]|=D>>>26):F+=8}this._strip()};function _(q,y,B,$){for(var I=0,F=0,j=Math.min(q.length,B),D=y;D<j;D++){var W=q.charCodeAt(D)-48;I*=$,W>=49?F=W-49+10:W>=17?F=W-17+10:F=W,m(W>=0&&F<$,"Invalid character"),I+=F}return I}g.prototype._parseBase=function(y,B,$){this.words=[0],this.length=1;for(var I=0,F=1;F<=67108863;F*=B)I++;I--,F=F/B|0;for(var j=y.length-$,D=j%I,W=Math.min(j,j-D)+$,R=0,z=$;z<W;z+=I)R=_(y,z,z+I,B),this.imuln(F),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(D!==0){var ye=1;for(R=_(y,z,y.length,B),z=0;z<D;z++)ye*=B;this.imuln(ye),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},g.prototype.copy=function(y){y.words=new Array(this.length);for(var B=0;B<this.length;B++)y.words[B]=this.words[B];y.length=this.length,y.negative=this.negative,y.red=this.red};function b(q,y){q.words=y.words,q.length=y.length,q.negative=y.negative,q.red=y.red}if(g.prototype._move=function(y){b(y,this)},g.prototype.clone=function(){var y=new g(null);return this.copy(y),y},g.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},g.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},g.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{g.prototype[Symbol.for("nodejs.util.inspect.custom")]=C}catch{g.prototype.inspect=C}else g.prototype.inspect=C;function C(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];g.prototype.toString=function(y,B){y=y||10,B=B|0||1;var $;if(y===16||y==="hex"){$="";for(var I=0,F=0,j=0;j<this.length;j++){var D=this.words[j],W=((D<<I|F)&16777215).toString(16);F=D>>>24-I&16777215,I+=2,I>=26&&(I-=26,j--),F!==0||j!==this.length-1?$=E[6-W.length]+W+$:$=W+$}for(F!==0&&($=F.toString(16)+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(y===(y|0)&&y>=2&&y<=36){var R=M[y],z=A[y];$="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var Ce=ye.modrn(z).toString(y);ye=ye.idivn(z),ye.isZero()?$=Ce+$:$=E[R-Ce.length]+Ce+$}for(this.isZero()&&($="0"+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}m(!1,"Base should be between 2 and 36")},g.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},g.prototype.toJSON=function(){return this.toString(16,2)},w&&(g.prototype.toBuffer=function(y,B){return this.toArrayLike(w,y,B)}),g.prototype.toArray=function(y,B){return this.toArrayLike(Array,y,B)};var T=function(y,B){return y.allocUnsafe?y.allocUnsafe(B):new y(B)};g.prototype.toArrayLike=function(y,B,$){this._strip();var I=this.byteLength(),F=$||Math.max(1,I);m(I<=F,"byte array longer than desired length"),m(F>0,"Requested array length <= 0");var j=T(y,F),D=B==="le"?"LE":"BE";return this["_toArrayLike"+D](j,I),j},g.prototype._toArrayLikeLE=function(y,B){for(var $=0,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$++]=D&255,$<y.length&&(y[$++]=D>>8&255),$<y.length&&(y[$++]=D>>16&255),j===6?($<y.length&&(y[$++]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($<y.length)for(y[$++]=I;$<y.length;)y[$++]=0},g.prototype._toArrayLikeBE=function(y,B){for(var $=y.length-1,I=0,F=0,j=0;F<this.length;F++){var D=this.words[F]<<j|I;y[$--]=D&255,$>=0&&(y[$--]=D>>8&255),$>=0&&(y[$--]=D>>16&255),j===6?($>=0&&(y[$--]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($>=0)for(y[$--]=I;$>=0;)y[$--]=0},Math.clz32?g.prototype._countBits=function(y){return 32-Math.clz32(y)}:g.prototype._countBits=function(y){var B=y,$=0;return B>=4096&&($+=13,B>>>=13),B>=64&&($+=7,B>>>=7),B>=8&&($+=4,B>>>=4),B>=2&&($+=2,B>>>=2),$+B},g.prototype._zeroBits=function(y){if(y===0)return 26;var B=y,$=0;return(B&8191)===0&&($+=13,B>>>=13),(B&127)===0&&($+=7,B>>>=7),(B&15)===0&&($+=4,B>>>=4),(B&3)===0&&($+=2,B>>>=2),(B&1)===0&&$++,$},g.prototype.bitLength=function(){var y=this.words[this.length-1],B=this._countBits(y);return(this.length-1)*26+B};function L(q){for(var y=new Array(q.bitLength()),B=0;B<y.length;B++){var $=B/26|0,I=B%26;y[B]=q.words[$]>>>I&1}return y}g.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,B=0;B<this.length;B++){var $=this._zeroBits(this.words[B]);if(y+=$,$!==26)break}return y},g.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},g.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},g.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},g.prototype.isNeg=function(){return this.negative!==0},g.prototype.neg=function(){return this.clone().ineg()},g.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},g.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var B=0;B<y.length;B++)this.words[B]=this.words[B]|y.words[B];return this._strip()},g.prototype.ior=function(y){return m((this.negative|y.negative)===0),this.iuor(y)},g.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},g.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},g.prototype.iuand=function(y){var B;this.length>y.length?B=y:B=this;for(var $=0;$<B.length;$++)this.words[$]=this.words[$]&y.words[$];return this.length=B.length,this._strip()},g.prototype.iand=function(y){return m((this.negative|y.negative)===0),this.iuand(y)},g.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},g.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},g.prototype.iuxor=function(y){var B,$;this.length>y.length?(B=this,$=y):(B=y,$=this);for(var I=0;I<$.length;I++)this.words[I]=B.words[I]^$.words[I];if(this!==B)for(;I<B.length;I++)this.words[I]=B.words[I];return this.length=B.length,this._strip()},g.prototype.ixor=function(y){return m((this.negative|y.negative)===0),this.iuxor(y)},g.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},g.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},g.prototype.inotn=function(y){m(typeof y=="number"&&y>=0);var B=Math.ceil(y/26)|0,$=y%26;this._expand(B),$>0&&B--;for(var I=0;I<B;I++)this.words[I]=~this.words[I]&67108863;return $>0&&(this.words[I]=~this.words[I]&67108863>>26-$),this._strip()},g.prototype.notn=function(y){return this.clone().inotn(y)},g.prototype.setn=function(y,B){m(typeof y=="number"&&y>=0);var $=y/26|0,I=y%26;return this._expand($+1),B?this.words[$]=this.words[$]|1<<I:this.words[$]=this.words[$]&~(1<<I),this._strip()},g.prototype.iadd=function(y){var B;if(this.negative!==0&&y.negative===0)return this.negative=0,B=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,B=this.isub(y),y.negative=1,B._normSign();var $,I;this.length>y.length?($=this,I=y):($=y,I=this);for(var F=0,j=0;j<I.length;j++)B=($.words[j]|0)+(I.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;for(;F!==0&&j<$.length;j++)B=($.words[j]|0)+F,this.words[j]=B&67108863,F=B>>>26;if(this.length=$.length,F!==0)this.words[this.length]=F,this.length++;else if($!==this)for(;j<$.length;j++)this.words[j]=$.words[j];return this},g.prototype.add=function(y){var B;return y.negative!==0&&this.negative===0?(y.negative=0,B=this.sub(y),y.negative^=1,B):y.negative===0&&this.negative!==0?(this.negative=0,B=y.sub(this),this.negative=1,B):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},g.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var B=this.iadd(y);return y.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var $=this.cmp(y);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,F;$>0?(I=this,F=y):(I=y,F=this);for(var j=0,D=0;D<F.length;D++)B=(I.words[D]|0)-(F.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;for(;j!==0&&D<I.length;D++)B=(I.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;if(j===0&&D<I.length&&I!==this)for(;D<I.length;D++)this.words[D]=I.words[D];return this.length=Math.max(this.length,D),I!==this&&(this.negative=1),this._strip()},g.prototype.sub=function(y){return this.clone().isub(y)};function O(q,y,B){B.negative=y.negative^q.negative;var $=q.length+y.length|0;B.length=$,$=$-1|0;var I=q.words[0]|0,F=y.words[0]|0,j=I*F,D=j&67108863,W=j/67108864|0;B.words[0]=D;for(var R=1;R<$;R++){for(var z=W>>>26,ye=W&67108863,Ce=Math.min(R,y.length-1),me=Math.max(0,R-q.length+1);me<=Ce;me++){var ie=R-me|0;I=q.words[ie]|0,F=y.words[me]|0,j=I*F+ye,z+=j/67108864|0,ye=j&67108863}B.words[R]=ye|0,W=z|0}return W!==0?B.words[R]=W|0:B.length--,B._strip()}var N=function(y,B,$){var I=y.words,F=B.words,j=$.words,D=0,W,R,z,ye=I[0]|0,Ce=ye&8191,me=ye>>>13,ie=I[1]|0,ee=ie&8191,pe=ie>>>13,be=I[2]|0,ae=be&8191,ne=be>>>13,Se=I[3]|0,qe=Se&8191,Ie=Se>>>13,Oe=I[4]|0,Ue=Oe&8191,De=Oe>>>13,$e=I[5]|0,je=$e&8191,Ye=$e>>>13,st=I[6]|0,Je=st&8191,Ge=st>>>13,ut=I[7]|0,gt=ut&8191,rt=ut>>>13,wt=I[8]|0,bt=wt&8191,le=wt>>>13,Z=I[9]|0,J=Z&8191,ge=Z>>>13,Ee=F[0]|0,Re=Ee&8191,ke=Ee>>>13,Xe=F[1]|0,He=Xe&8191,Ze=Xe>>>13,xt=F[2]|0,tt=xt&8191,mt=xt>>>13,Tt=F[3]|0,St=Tt&8191,lt=Tt>>>13,Mt=F[4]|0,Ct=Mt&8191,ce=Mt>>>13,Y=F[5]|0,Q=Y&8191,ve=Y>>>13,fe=F[6]|0,U=fe&8191,G=fe>>>13,re=F[7]|0,K=re&8191,ue=re>>>13,Ae=F[8]|0,xe=Ae&8191,Te=Ae>>>13,Pe=F[9]|0,Fe=Pe&8191,Ne=Pe>>>13;$.negative=y.negative^B.negative,$.length=19,W=Math.imul(Ce,Re),R=Math.imul(Ce,ke),R=R+Math.imul(me,Re)|0,z=Math.imul(me,ke);var At=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(At>>>26)|0,At&=67108863,W=Math.imul(ee,Re),R=Math.imul(ee,ke),R=R+Math.imul(pe,Re)|0,z=Math.imul(pe,ke),W=W+Math.imul(Ce,He)|0,R=R+Math.imul(Ce,Ze)|0,R=R+Math.imul(me,He)|0,z=z+Math.imul(me,Ze)|0;var ot=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ot>>>26)|0,ot&=67108863,W=Math.imul(ae,Re),R=Math.imul(ae,ke),R=R+Math.imul(ne,Re)|0,z=Math.imul(ne,ke),W=W+Math.imul(ee,He)|0,R=R+Math.imul(ee,Ze)|0,R=R+Math.imul(pe,He)|0,z=z+Math.imul(pe,Ze)|0,W=W+Math.imul(Ce,tt)|0,R=R+Math.imul(Ce,mt)|0,R=R+Math.imul(me,tt)|0,z=z+Math.imul(me,mt)|0;var yt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(yt>>>26)|0,yt&=67108863,W=Math.imul(qe,Re),R=Math.imul(qe,ke),R=R+Math.imul(Ie,Re)|0,z=Math.imul(Ie,ke),W=W+Math.imul(ae,He)|0,R=R+Math.imul(ae,Ze)|0,R=R+Math.imul(ne,He)|0,z=z+Math.imul(ne,Ze)|0,W=W+Math.imul(ee,tt)|0,R=R+Math.imul(ee,mt)|0,R=R+Math.imul(pe,tt)|0,z=z+Math.imul(pe,mt)|0,W=W+Math.imul(Ce,St)|0,R=R+Math.imul(Ce,lt)|0,R=R+Math.imul(me,St)|0,z=z+Math.imul(me,lt)|0;var vt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(vt>>>26)|0,vt&=67108863,W=Math.imul(Ue,Re),R=Math.imul(Ue,ke),R=R+Math.imul(De,Re)|0,z=Math.imul(De,ke),W=W+Math.imul(qe,He)|0,R=R+Math.imul(qe,Ze)|0,R=R+Math.imul(Ie,He)|0,z=z+Math.imul(Ie,Ze)|0,W=W+Math.imul(ae,tt)|0,R=R+Math.imul(ae,mt)|0,R=R+Math.imul(ne,tt)|0,z=z+Math.imul(ne,mt)|0,W=W+Math.imul(ee,St)|0,R=R+Math.imul(ee,lt)|0,R=R+Math.imul(pe,St)|0,z=z+Math.imul(pe,lt)|0,W=W+Math.imul(Ce,Ct)|0,R=R+Math.imul(Ce,ce)|0,R=R+Math.imul(me,Ct)|0,z=z+Math.imul(me,ce)|0;var _t=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(_t>>>26)|0,_t&=67108863,W=Math.imul(je,Re),R=Math.imul(je,ke),R=R+Math.imul(Ye,Re)|0,z=Math.imul(Ye,ke),W=W+Math.imul(Ue,He)|0,R=R+Math.imul(Ue,Ze)|0,R=R+Math.imul(De,He)|0,z=z+Math.imul(De,Ze)|0,W=W+Math.imul(qe,tt)|0,R=R+Math.imul(qe,mt)|0,R=R+Math.imul(Ie,tt)|0,z=z+Math.imul(Ie,mt)|0,W=W+Math.imul(ae,St)|0,R=R+Math.imul(ae,lt)|0,R=R+Math.imul(ne,St)|0,z=z+Math.imul(ne,lt)|0,W=W+Math.imul(ee,Ct)|0,R=R+Math.imul(ee,ce)|0,R=R+Math.imul(pe,Ct)|0,z=z+Math.imul(pe,ce)|0,W=W+Math.imul(Ce,Q)|0,R=R+Math.imul(Ce,ve)|0,R=R+Math.imul(me,Q)|0,z=z+Math.imul(me,ve)|0;var Ve=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,W=Math.imul(Je,Re),R=Math.imul(Je,ke),R=R+Math.imul(Ge,Re)|0,z=Math.imul(Ge,ke),W=W+Math.imul(je,He)|0,R=R+Math.imul(je,Ze)|0,R=R+Math.imul(Ye,He)|0,z=z+Math.imul(Ye,Ze)|0,W=W+Math.imul(Ue,tt)|0,R=R+Math.imul(Ue,mt)|0,R=R+Math.imul(De,tt)|0,z=z+Math.imul(De,mt)|0,W=W+Math.imul(qe,St)|0,R=R+Math.imul(qe,lt)|0,R=R+Math.imul(Ie,St)|0,z=z+Math.imul(Ie,lt)|0,W=W+Math.imul(ae,Ct)|0,R=R+Math.imul(ae,ce)|0,R=R+Math.imul(ne,Ct)|0,z=z+Math.imul(ne,ce)|0,W=W+Math.imul(ee,Q)|0,R=R+Math.imul(ee,ve)|0,R=R+Math.imul(pe,Q)|0,z=z+Math.imul(pe,ve)|0,W=W+Math.imul(Ce,U)|0,R=R+Math.imul(Ce,G)|0,R=R+Math.imul(me,U)|0,z=z+Math.imul(me,G)|0;var ft=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ft>>>26)|0,ft&=67108863,W=Math.imul(gt,Re),R=Math.imul(gt,ke),R=R+Math.imul(rt,Re)|0,z=Math.imul(rt,ke),W=W+Math.imul(Je,He)|0,R=R+Math.imul(Je,Ze)|0,R=R+Math.imul(Ge,He)|0,z=z+Math.imul(Ge,Ze)|0,W=W+Math.imul(je,tt)|0,R=R+Math.imul(je,mt)|0,R=R+Math.imul(Ye,tt)|0,z=z+Math.imul(Ye,mt)|0,W=W+Math.imul(Ue,St)|0,R=R+Math.imul(Ue,lt)|0,R=R+Math.imul(De,St)|0,z=z+Math.imul(De,lt)|0,W=W+Math.imul(qe,Ct)|0,R=R+Math.imul(qe,ce)|0,R=R+Math.imul(Ie,Ct)|0,z=z+Math.imul(Ie,ce)|0,W=W+Math.imul(ae,Q)|0,R=R+Math.imul(ae,ve)|0,R=R+Math.imul(ne,Q)|0,z=z+Math.imul(ne,ve)|0,W=W+Math.imul(ee,U)|0,R=R+Math.imul(ee,G)|0,R=R+Math.imul(pe,U)|0,z=z+Math.imul(pe,G)|0,W=W+Math.imul(Ce,K)|0,R=R+Math.imul(Ce,ue)|0,R=R+Math.imul(me,K)|0,z=z+Math.imul(me,ue)|0;var et=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(et>>>26)|0,et&=67108863,W=Math.imul(bt,Re),R=Math.imul(bt,ke),R=R+Math.imul(le,Re)|0,z=Math.imul(le,ke),W=W+Math.imul(gt,He)|0,R=R+Math.imul(gt,Ze)|0,R=R+Math.imul(rt,He)|0,z=z+Math.imul(rt,Ze)|0,W=W+Math.imul(Je,tt)|0,R=R+Math.imul(Je,mt)|0,R=R+Math.imul(Ge,tt)|0,z=z+Math.imul(Ge,mt)|0,W=W+Math.imul(je,St)|0,R=R+Math.imul(je,lt)|0,R=R+Math.imul(Ye,St)|0,z=z+Math.imul(Ye,lt)|0,W=W+Math.imul(Ue,Ct)|0,R=R+Math.imul(Ue,ce)|0,R=R+Math.imul(De,Ct)|0,z=z+Math.imul(De,ce)|0,W=W+Math.imul(qe,Q)|0,R=R+Math.imul(qe,ve)|0,R=R+Math.imul(Ie,Q)|0,z=z+Math.imul(Ie,ve)|0,W=W+Math.imul(ae,U)|0,R=R+Math.imul(ae,G)|0,R=R+Math.imul(ne,U)|0,z=z+Math.imul(ne,G)|0,W=W+Math.imul(ee,K)|0,R=R+Math.imul(ee,ue)|0,R=R+Math.imul(pe,K)|0,z=z+Math.imul(pe,ue)|0,W=W+Math.imul(Ce,xe)|0,R=R+Math.imul(Ce,Te)|0,R=R+Math.imul(me,xe)|0,z=z+Math.imul(me,Te)|0;var ht=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ht>>>26)|0,ht&=67108863,W=Math.imul(J,Re),R=Math.imul(J,ke),R=R+Math.imul(ge,Re)|0,z=Math.imul(ge,ke),W=W+Math.imul(bt,He)|0,R=R+Math.imul(bt,Ze)|0,R=R+Math.imul(le,He)|0,z=z+Math.imul(le,Ze)|0,W=W+Math.imul(gt,tt)|0,R=R+Math.imul(gt,mt)|0,R=R+Math.imul(rt,tt)|0,z=z+Math.imul(rt,mt)|0,W=W+Math.imul(Je,St)|0,R=R+Math.imul(Je,lt)|0,R=R+Math.imul(Ge,St)|0,z=z+Math.imul(Ge,lt)|0,W=W+Math.imul(je,Ct)|0,R=R+Math.imul(je,ce)|0,R=R+Math.imul(Ye,Ct)|0,z=z+Math.imul(Ye,ce)|0,W=W+Math.imul(Ue,Q)|0,R=R+Math.imul(Ue,ve)|0,R=R+Math.imul(De,Q)|0,z=z+Math.imul(De,ve)|0,W=W+Math.imul(qe,U)|0,R=R+Math.imul(qe,G)|0,R=R+Math.imul(Ie,U)|0,z=z+Math.imul(Ie,G)|0,W=W+Math.imul(ae,K)|0,R=R+Math.imul(ae,ue)|0,R=R+Math.imul(ne,K)|0,z=z+Math.imul(ne,ue)|0,W=W+Math.imul(ee,xe)|0,R=R+Math.imul(ee,Te)|0,R=R+Math.imul(pe,xe)|0,z=z+Math.imul(pe,Te)|0,W=W+Math.imul(Ce,Fe)|0,R=R+Math.imul(Ce,Ne)|0,R=R+Math.imul(me,Fe)|0,z=z+Math.imul(me,Ne)|0;var it=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(it>>>26)|0,it&=67108863,W=Math.imul(J,He),R=Math.imul(J,Ze),R=R+Math.imul(ge,He)|0,z=Math.imul(ge,Ze),W=W+Math.imul(bt,tt)|0,R=R+Math.imul(bt,mt)|0,R=R+Math.imul(le,tt)|0,z=z+Math.imul(le,mt)|0,W=W+Math.imul(gt,St)|0,R=R+Math.imul(gt,lt)|0,R=R+Math.imul(rt,St)|0,z=z+Math.imul(rt,lt)|0,W=W+Math.imul(Je,Ct)|0,R=R+Math.imul(Je,ce)|0,R=R+Math.imul(Ge,Ct)|0,z=z+Math.imul(Ge,ce)|0,W=W+Math.imul(je,Q)|0,R=R+Math.imul(je,ve)|0,R=R+Math.imul(Ye,Q)|0,z=z+Math.imul(Ye,ve)|0,W=W+Math.imul(Ue,U)|0,R=R+Math.imul(Ue,G)|0,R=R+Math.imul(De,U)|0,z=z+Math.imul(De,G)|0,W=W+Math.imul(qe,K)|0,R=R+Math.imul(qe,ue)|0,R=R+Math.imul(Ie,K)|0,z=z+Math.imul(Ie,ue)|0,W=W+Math.imul(ae,xe)|0,R=R+Math.imul(ae,Te)|0,R=R+Math.imul(ne,xe)|0,z=z+Math.imul(ne,Te)|0,W=W+Math.imul(ee,Fe)|0,R=R+Math.imul(ee,Ne)|0,R=R+Math.imul(pe,Fe)|0,z=z+Math.imul(pe,Ne)|0;var pt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(pt>>>26)|0,pt&=67108863,W=Math.imul(J,tt),R=Math.imul(J,mt),R=R+Math.imul(ge,tt)|0,z=Math.imul(ge,mt),W=W+Math.imul(bt,St)|0,R=R+Math.imul(bt,lt)|0,R=R+Math.imul(le,St)|0,z=z+Math.imul(le,lt)|0,W=W+Math.imul(gt,Ct)|0,R=R+Math.imul(gt,ce)|0,R=R+Math.imul(rt,Ct)|0,z=z+Math.imul(rt,ce)|0,W=W+Math.imul(Je,Q)|0,R=R+Math.imul(Je,ve)|0,R=R+Math.imul(Ge,Q)|0,z=z+Math.imul(Ge,ve)|0,W=W+Math.imul(je,U)|0,R=R+Math.imul(je,G)|0,R=R+Math.imul(Ye,U)|0,z=z+Math.imul(Ye,G)|0,W=W+Math.imul(Ue,K)|0,R=R+Math.imul(Ue,ue)|0,R=R+Math.imul(De,K)|0,z=z+Math.imul(De,ue)|0,W=W+Math.imul(qe,xe)|0,R=R+Math.imul(qe,Te)|0,R=R+Math.imul(Ie,xe)|0,z=z+Math.imul(Ie,Te)|0,W=W+Math.imul(ae,Fe)|0,R=R+Math.imul(ae,Ne)|0,R=R+Math.imul(ne,Fe)|0,z=z+Math.imul(ne,Ne)|0;var at=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(at>>>26)|0,at&=67108863,W=Math.imul(J,St),R=Math.imul(J,lt),R=R+Math.imul(ge,St)|0,z=Math.imul(ge,lt),W=W+Math.imul(bt,Ct)|0,R=R+Math.imul(bt,ce)|0,R=R+Math.imul(le,Ct)|0,z=z+Math.imul(le,ce)|0,W=W+Math.imul(gt,Q)|0,R=R+Math.imul(gt,ve)|0,R=R+Math.imul(rt,Q)|0,z=z+Math.imul(rt,ve)|0,W=W+Math.imul(Je,U)|0,R=R+Math.imul(Je,G)|0,R=R+Math.imul(Ge,U)|0,z=z+Math.imul(Ge,G)|0,W=W+Math.imul(je,K)|0,R=R+Math.imul(je,ue)|0,R=R+Math.imul(Ye,K)|0,z=z+Math.imul(Ye,ue)|0,W=W+Math.imul(Ue,xe)|0,R=R+Math.imul(Ue,Te)|0,R=R+Math.imul(De,xe)|0,z=z+Math.imul(De,Te)|0,W=W+Math.imul(qe,Fe)|0,R=R+Math.imul(qe,Ne)|0,R=R+Math.imul(Ie,Fe)|0,z=z+Math.imul(Ie,Ne)|0;var ct=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ct>>>26)|0,ct&=67108863,W=Math.imul(J,Ct),R=Math.imul(J,ce),R=R+Math.imul(ge,Ct)|0,z=Math.imul(ge,ce),W=W+Math.imul(bt,Q)|0,R=R+Math.imul(bt,ve)|0,R=R+Math.imul(le,Q)|0,z=z+Math.imul(le,ve)|0,W=W+Math.imul(gt,U)|0,R=R+Math.imul(gt,G)|0,R=R+Math.imul(rt,U)|0,z=z+Math.imul(rt,G)|0,W=W+Math.imul(Je,K)|0,R=R+Math.imul(Je,ue)|0,R=R+Math.imul(Ge,K)|0,z=z+Math.imul(Ge,ue)|0,W=W+Math.imul(je,xe)|0,R=R+Math.imul(je,Te)|0,R=R+Math.imul(Ye,xe)|0,z=z+Math.imul(Ye,Te)|0,W=W+Math.imul(Ue,Fe)|0,R=R+Math.imul(Ue,Ne)|0,R=R+Math.imul(De,Fe)|0,z=z+Math.imul(De,Ne)|0;var dt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(dt>>>26)|0,dt&=67108863,W=Math.imul(J,Q),R=Math.imul(J,ve),R=R+Math.imul(ge,Q)|0,z=Math.imul(ge,ve),W=W+Math.imul(bt,U)|0,R=R+Math.imul(bt,G)|0,R=R+Math.imul(le,U)|0,z=z+Math.imul(le,G)|0,W=W+Math.imul(gt,K)|0,R=R+Math.imul(gt,ue)|0,R=R+Math.imul(rt,K)|0,z=z+Math.imul(rt,ue)|0,W=W+Math.imul(Je,xe)|0,R=R+Math.imul(Je,Te)|0,R=R+Math.imul(Ge,xe)|0,z=z+Math.imul(Ge,Te)|0,W=W+Math.imul(je,Fe)|0,R=R+Math.imul(je,Ne)|0,R=R+Math.imul(Ye,Fe)|0,z=z+Math.imul(Ye,Ne)|0;var nt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(nt>>>26)|0,nt&=67108863,W=Math.imul(J,U),R=Math.imul(J,G),R=R+Math.imul(ge,U)|0,z=Math.imul(ge,G),W=W+Math.imul(bt,K)|0,R=R+Math.imul(bt,ue)|0,R=R+Math.imul(le,K)|0,z=z+Math.imul(le,ue)|0,W=W+Math.imul(gt,xe)|0,R=R+Math.imul(gt,Te)|0,R=R+Math.imul(rt,xe)|0,z=z+Math.imul(rt,Te)|0,W=W+Math.imul(Je,Fe)|0,R=R+Math.imul(Je,Ne)|0,R=R+Math.imul(Ge,Fe)|0,z=z+Math.imul(Ge,Ne)|0;var Le=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Le>>>26)|0,Le&=67108863,W=Math.imul(J,K),R=Math.imul(J,ue),R=R+Math.imul(ge,K)|0,z=Math.imul(ge,ue),W=W+Math.imul(bt,xe)|0,R=R+Math.imul(bt,Te)|0,R=R+Math.imul(le,xe)|0,z=z+Math.imul(le,Te)|0,W=W+Math.imul(gt,Fe)|0,R=R+Math.imul(gt,Ne)|0,R=R+Math.imul(rt,Fe)|0,z=z+Math.imul(rt,Ne)|0;var Be=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Be>>>26)|0,Be&=67108863,W=Math.imul(J,xe),R=Math.imul(J,Te),R=R+Math.imul(ge,xe)|0,z=Math.imul(ge,Te),W=W+Math.imul(bt,Fe)|0,R=R+Math.imul(bt,Ne)|0,R=R+Math.imul(le,Fe)|0,z=z+Math.imul(le,Ne)|0;var Ke=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,W=Math.imul(J,Fe),R=Math.imul(J,Ne),R=R+Math.imul(ge,Fe)|0,z=Math.imul(ge,Ne);var We=(D+W|0)+((R&8191)<<13)|0;return D=(z+(R>>>13)|0)+(We>>>26)|0,We&=67108863,j[0]=At,j[1]=ot,j[2]=yt,j[3]=vt,j[4]=_t,j[5]=Ve,j[6]=ft,j[7]=et,j[8]=ht,j[9]=it,j[10]=pt,j[11]=at,j[12]=ct,j[13]=dt,j[14]=nt,j[15]=Le,j[16]=Be,j[17]=Ke,j[18]=We,D!==0&&(j[19]=D,$.length++),$};Math.imul||(N=O);function H(q,y,B){B.negative=y.negative^q.negative,B.length=q.length+y.length;for(var $=0,I=0,F=0;F<B.length-1;F++){var j=I;I=0;for(var D=$&67108863,W=Math.min(F,y.length-1),R=Math.max(0,F-q.length+1);R<=W;R++){var z=F-R,ye=q.words[z]|0,Ce=y.words[R]|0,me=ye*Ce,ie=me&67108863;j=j+(me/67108864|0)|0,ie=ie+D|0,D=ie&67108863,j=j+(ie>>>26)|0,I+=j>>>26,j&=67108863}B.words[F]=D,$=j,j=I}return $!==0?B.words[F]=$:B.length--,B._strip()}function V(q,y,B){return H(q,y,B)}g.prototype.mulTo=function(y,B){var $,I=this.length+y.length;return this.length===10&&y.length===10?$=N(this,y,B):I<63?$=O(this,y,B):I<1024?$=H(this,y,B):$=V(this,y,B),$},g.prototype.mul=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),this.mulTo(y,B)},g.prototype.mulf=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),V(this,y,B)},g.prototype.imul=function(y){return this.clone().mulTo(y,this)},g.prototype.imuln=function(y){var B=y<0;B&&(y=-y),m(typeof y=="number"),m(y<67108864);for(var $=0,I=0;I<this.length;I++){var F=(this.words[I]|0)*y,j=(F&67108863)+($&67108863);$>>=26,$+=F/67108864|0,$+=j>>>26,this.words[I]=j&67108863}return $!==0&&(this.words[I]=$,this.length++),this.length=y===0?1:this.length,B?this.ineg():this},g.prototype.muln=function(y){return this.clone().imuln(y)},g.prototype.sqr=function(){return this.mul(this)},g.prototype.isqr=function(){return this.imul(this.clone())},g.prototype.pow=function(y){var B=L(y);if(B.length===0)return new g(1);for(var $=this,I=0;I<B.length&&B[I]===0;I++,$=$.sqr());if(++I<B.length)for(var F=$.sqr();I<B.length;I++,F=F.sqr())B[I]!==0&&($=$.mul(F));return $},g.prototype.iushln=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=67108863>>>26-B<<26-B,F;if(B!==0){var j=0;for(F=0;F<this.length;F++){var D=this.words[F]&I,W=(this.words[F]|0)-D<<B;this.words[F]=W|j,j=D>>>26-B}j&&(this.words[F]=j,this.length++)}if($!==0){for(F=this.length-1;F>=0;F--)this.words[F+$]=this.words[F];for(F=0;F<$;F++)this.words[F]=0;this.length+=$}return this._strip()},g.prototype.ishln=function(y){return m(this.negative===0),this.iushln(y)},g.prototype.iushrn=function(y,B,$){m(typeof y=="number"&&y>=0);var I;B?I=(B-B%26)/26:I=0;var F=y%26,j=Math.min((y-F)/26,this.length),D=67108863^67108863>>>F<<F,W=$;if(I-=j,I=Math.max(0,I),W){for(var R=0;R<j;R++)W.words[R]=this.words[R];W.length=j}if(j!==0)if(this.length>j)for(this.length-=j,R=0;R<this.length;R++)this.words[R]=this.words[R+j];else this.words[0]=0,this.length=1;var z=0;for(R=this.length-1;R>=0&&(z!==0||R>=I);R--){var ye=this.words[R]|0;this.words[R]=z<<26-F|ye>>>F,z=ye&D}return W&&z!==0&&(W.words[W.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},g.prototype.ishrn=function(y,B,$){return m(this.negative===0),this.iushrn(y,B,$)},g.prototype.shln=function(y){return this.clone().ishln(y)},g.prototype.ushln=function(y){return this.clone().iushln(y)},g.prototype.shrn=function(y){return this.clone().ishrn(y)},g.prototype.ushrn=function(y){return this.clone().iushrn(y)},g.prototype.testn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return!1;var F=this.words[$];return!!(F&I)},g.prototype.imaskn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(B!==0&&$++,this.length=Math.min($,this.length),B!==0){var I=67108863^67108863>>>B<<B;this.words[this.length-1]&=I}return this._strip()},g.prototype.maskn=function(y){return this.clone().imaskn(y)},g.prototype.iaddn=function(y){return m(typeof y=="number"),m(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},g.prototype._iaddn=function(y){this.words[0]+=y;for(var B=0;B<this.length&&this.words[B]>=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},g.prototype.isubn=function(y){if(m(typeof y=="number"),m(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B<this.length&&this.words[B]<0;B++)this.words[B]+=67108864,this.words[B+1]-=1;return this._strip()},g.prototype.addn=function(y){return this.clone().iaddn(y)},g.prototype.subn=function(y){return this.clone().isubn(y)},g.prototype.iabs=function(){return this.negative=0,this},g.prototype.abs=function(){return this.clone().iabs()},g.prototype._ishlnsubmul=function(y,B,$){var I=y.length+$,F;this._expand(I);var j,D=0;for(F=0;F<y.length;F++){j=(this.words[F+$]|0)+D;var W=(y.words[F]|0)*B;j-=W&67108863,D=(j>>26)-(W/67108864|0),this.words[F+$]=j&67108863}for(;F<this.length-$;F++)j=(this.words[F+$]|0)+D,D=j>>26,this.words[F+$]=j&67108863;if(D===0)return this._strip();for(m(D===-1),D=0,F=0;F<this.length;F++)j=-(this.words[F]|0)+D,D=j>>26,this.words[F]=j&67108863;return this.negative=1,this._strip()},g.prototype._wordDiv=function(y,B){var $=this.length-y.length,I=this.clone(),F=y,j=F.words[F.length-1]|0,D=this._countBits(j);$=26-D,$!==0&&(F=F.ushln($),I.iushln($),j=F.words[F.length-1]|0);var W=I.length-F.length,R;if(B!=="mod"){R=new g(null),R.length=W+1,R.words=new Array(R.length);for(var z=0;z<R.length;z++)R.words[z]=0}var ye=I.clone()._ishlnsubmul(F,1,W);ye.negative===0&&(I=ye,R&&(R.words[W]=1));for(var Ce=W-1;Ce>=0;Ce--){var me=(I.words[F.length+Ce]|0)*67108864+(I.words[F.length+Ce-1]|0);for(me=Math.min(me/j|0,67108863),I._ishlnsubmul(F,me,Ce);I.negative!==0;)me--,I.negative=0,I._ishlnsubmul(F,1,Ce),I.isZero()||(I.negative^=1);R&&(R.words[Ce]=me)}return R&&R._strip(),I._strip(),B!=="div"&&$!==0&&I.iushrn($),{div:R||null,mod:I}},g.prototype.divmod=function(y,B,$){if(m(!y.isZero()),this.isZero())return{div:new g(0),mod:new g(0)};var I,F,j;return this.negative!==0&&y.negative===0?(j=this.neg().divmod(y,B),B!=="mod"&&(I=j.div.neg()),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.iadd(y)),{div:I,mod:F}):this.negative===0&&y.negative!==0?(j=this.divmod(y.neg(),B),B!=="mod"&&(I=j.div.neg()),{div:I,mod:j.mod}):(this.negative&y.negative)!==0?(j=this.neg().divmod(y.neg(),B),B!=="div"&&(F=j.mod.neg(),$&&F.negative!==0&&F.isub(y)),{div:j.div,mod:F}):y.length>this.length||this.cmp(y)<0?{div:new g(0),mod:this}:y.length===1?B==="div"?{div:this.divn(y.words[0]),mod:null}:B==="mod"?{div:null,mod:new g(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new g(this.modrn(y.words[0]))}:this._wordDiv(y,B)},g.prototype.div=function(y){return this.divmod(y,"div",!1).div},g.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},g.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},g.prototype.divRound=function(y){var B=this.divmod(y);if(B.mod.isZero())return B.div;var $=B.div.negative!==0?B.mod.isub(y):B.mod,I=y.ushrn(1),F=y.andln(1),j=$.cmp(I);return j<0||F===1&&j===0?B.div:B.div.negative!==0?B.div.isubn(1):B.div.iaddn(1)},g.prototype.modrn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=(1<<26)%y,I=0,F=this.length-1;F>=0;F--)I=($*I+(this.words[F]|0))%y;return B?-I:I},g.prototype.modn=function(y){return this.modrn(y)},g.prototype.idivn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=0,I=this.length-1;I>=0;I--){var F=(this.words[I]|0)+$*67108864;this.words[I]=F/y|0,$=F%y}return this._strip(),B?this.ineg():this},g.prototype.divn=function(y){return this.clone().idivn(y)},g.prototype.egcd=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),F=new g(0),j=new g(0),D=new g(1),W=0;B.isEven()&&$.isEven();)B.iushrn(1),$.iushrn(1),++W;for(var R=$.clone(),z=B.clone();!B.isZero();){for(var ye=0,Ce=1;(B.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(B.iushrn(ye);ye-- >0;)(I.isOdd()||F.isOdd())&&(I.iadd(R),F.isub(z)),I.iushrn(1),F.iushrn(1);for(var me=0,ie=1;($.words[0]&ie)===0&&me<26;++me,ie<<=1);if(me>0)for($.iushrn(me);me-- >0;)(j.isOdd()||D.isOdd())&&(j.iadd(R),D.isub(z)),j.iushrn(1),D.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(j),F.isub(D)):($.isub(B),j.isub(I),D.isub(F))}return{a:j,b:D,gcd:$.iushln(W)}},g.prototype._invmp=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),F=new g(0),j=$.clone();B.cmpn(1)>0&&$.cmpn(1)>0;){for(var D=0,W=1;(B.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(B.iushrn(D);D-- >0;)I.isOdd()&&I.iadd(j),I.iushrn(1);for(var R=0,z=1;($.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for($.iushrn(R);R-- >0;)F.isOdd()&&F.iadd(j),F.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(F)):($.isub(B),F.isub(I))}var ye;return B.cmpn(1)===0?ye=I:ye=F,ye.cmpn(0)<0&&ye.iadd(y),ye},g.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var B=this.clone(),$=y.clone();B.negative=0,$.negative=0;for(var I=0;B.isEven()&&$.isEven();I++)B.iushrn(1),$.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;$.isEven();)$.iushrn(1);var F=B.cmp($);if(F<0){var j=B;B=$,$=j}else if(F===0||$.cmpn(1)===0)break;B.isub($)}while(!0);return $.iushln(I)},g.prototype.invm=function(y){return this.egcd(y).a.umod(y)},g.prototype.isEven=function(){return(this.words[0]&1)===0},g.prototype.isOdd=function(){return(this.words[0]&1)===1},g.prototype.andln=function(y){return this.words[0]&y},g.prototype.bincn=function(y){m(typeof y=="number");var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return this._expand($+1),this.words[$]|=I,this;for(var F=I,j=$;F!==0&&j<this.length;j++){var D=this.words[j]|0;D+=F,F=D>>>26,D&=67108863,this.words[j]=D}return F!==0&&(this.words[j]=F,this.length++),this},g.prototype.isZero=function(){return this.length===1&&this.words[0]===0},g.prototype.cmpn=function(y){var B=y<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this._strip();var $;if(this.length>1)$=1;else{B&&(y=-y),m(y<=67108863,"Number is too big");var I=this.words[0]|0;$=I===y?0:I<y?-1:1}return this.negative!==0?-$|0:$},g.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var B=this.ucmp(y);return this.negative!==0?-B|0:B},g.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var B=0,$=this.length-1;$>=0;$--){var I=this.words[$]|0,F=y.words[$]|0;if(I!==F){I<F?B=-1:I>F&&(B=1);break}}return B},g.prototype.gtn=function(y){return this.cmpn(y)===1},g.prototype.gt=function(y){return this.cmp(y)===1},g.prototype.gten=function(y){return this.cmpn(y)>=0},g.prototype.gte=function(y){return this.cmp(y)>=0},g.prototype.ltn=function(y){return this.cmpn(y)===-1},g.prototype.lt=function(y){return this.cmp(y)===-1},g.prototype.lten=function(y){return this.cmpn(y)<=0},g.prototype.lte=function(y){return this.cmp(y)<=0},g.prototype.eqn=function(y){return this.cmpn(y)===0},g.prototype.eq=function(y){return this.cmp(y)===0},g.red=function(y){return new te(y)},g.prototype.toRed=function(y){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},g.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},g.prototype._forceRed=function(y){return this.red=y,this},g.prototype.forceRed=function(y){return m(!this.red,"Already a number in reduction context"),this._forceRed(y)},g.prototype.redAdd=function(y){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},g.prototype.redIAdd=function(y){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},g.prototype.redSub=function(y){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},g.prototype.redISub=function(y){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},g.prototype.redShl=function(y){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},g.prototype.redMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},g.prototype.redIMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},g.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},g.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},g.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},g.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},g.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},g.prototype.redPow=function(y){return m(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var X={k256:null,p224:null,p192:null,p25519:null};function oe(q,y){this.name=q,this.p=new g(y,16),this.n=this.p.bitLength(),this.k=new g(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}oe.prototype._tmp=function(){var y=new g(null);return y.words=new Array(Math.ceil(this.n/13)),y},oe.prototype.ireduce=function(y){var B=y,$;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),$=B.bitLength();while($>this.n);var I=$<this.n?-1:B.ucmp(this.p);return I===0?(B.words[0]=0,B.length=1):I>0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},oe.prototype.split=function(y,B){y.iushrn(this.n,0,B)},oe.prototype.imulK=function(y){return y.imul(this.k)};function se(){oe.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(se,oe),se.prototype.split=function(y,B){for(var $=4194303,I=Math.min(y.length,9),F=0;F<I;F++)B.words[F]=y.words[F];if(B.length=I,y.length<=9){y.words[0]=0,y.length=1;return}var j=y.words[9];for(B.words[B.length++]=j&$,F=10;F<y.length;F++){var D=y.words[F]|0;y.words[F-10]=(D&$)<<4|j>>>22,j=D}j>>>=22,y.words[F-10]=j,j===0&&y.length>10?y.length-=10:y.length-=9},se.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var B=0,$=0;$<y.length;$++){var I=y.words[$]|0;B+=I*977,y.words[$]=B&67108863,B=I*64+(B/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function de(){oe.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(de,oe);function he(){oe.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(he,oe);function we(){oe.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(we,oe),we.prototype.imulK=function(y){for(var B=0,$=0;$<y.length;$++){var I=(y.words[$]|0)*19+B,F=I&67108863;I>>>=26,y.words[$]=F,B=I}return B!==0&&(y.words[y.length++]=B),y},g._prime=function(y){if(X[y])return X[y];var B;if(y==="k256")B=new se;else if(y==="p224")B=new de;else if(y==="p192")B=new he;else if(y==="p25519")B=new we;else throw new Error("Unknown prime "+y);return X[y]=B,B};function te(q){if(typeof q=="string"){var y=g._prime(q);this.m=y.p,this.prime=y}else m(q.gtn(1),"modulus must be greater than 1"),this.m=q,this.prime=null}te.prototype._verify1=function(y){m(y.negative===0,"red works only with positives"),m(y.red,"red works only with red numbers")},te.prototype._verify2=function(y,B){m((y.negative|B.negative)===0,"red works only with positives"),m(y.red&&y.red===B.red,"red works only with red numbers")},te.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(b(y,y.umod(this.m)._forceRed(this)),y)},te.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},te.prototype.add=function(y,B){this._verify2(y,B);var $=y.add(B);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},te.prototype.iadd=function(y,B){this._verify2(y,B);var $=y.iadd(B);return $.cmp(this.m)>=0&&$.isub(this.m),$},te.prototype.sub=function(y,B){this._verify2(y,B);var $=y.sub(B);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},te.prototype.isub=function(y,B){this._verify2(y,B);var $=y.isub(B);return $.cmpn(0)<0&&$.iadd(this.m),$},te.prototype.shl=function(y,B){return this._verify1(y),this.imod(y.ushln(B))},te.prototype.imul=function(y,B){return this._verify2(y,B),this.imod(y.imul(B))},te.prototype.mul=function(y,B){return this._verify2(y,B),this.imod(y.mul(B))},te.prototype.isqr=function(y){return this.imul(y,y.clone())},te.prototype.sqr=function(y){return this.mul(y,y)},te.prototype.sqrt=function(y){if(y.isZero())return y.clone();var B=this.m.andln(3);if(m(B%2===1),B===3){var $=this.m.add(new g(1)).iushrn(2);return this.pow(y,$)}for(var I=this.m.subn(1),F=0;!I.isZero()&&I.andln(1)===0;)F++,I.iushrn(1);m(!I.isZero());var j=new g(1).toRed(this),D=j.redNeg(),W=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new g(2*R*R).toRed(this);this.pow(R,W).cmp(D)!==0;)R.redIAdd(D);for(var z=this.pow(R,I),ye=this.pow(y,I.addn(1).iushrn(1)),Ce=this.pow(y,I),me=F;Ce.cmp(j)!==0;){for(var ie=Ce,ee=0;ie.cmp(j)!==0;ee++)ie=ie.redSqr();m(ee<me);var pe=this.pow(z,new g(1).iushln(me-ee-1));ye=ye.redMul(pe),z=pe.redSqr(),Ce=Ce.redMul(z),me=ee}return ye},te.prototype.invm=function(y){var B=y._invmp(this.m);return B.negative!==0?(B.negative=0,this.imod(B).redNeg()):this.imod(B)},te.prototype.pow=function(y,B){if(B.isZero())return new g(1).toRed(this);if(B.cmpn(1)===0)return y.clone();var $=4,I=new Array(1<<$);I[0]=new g(1).toRed(this),I[1]=y;for(var F=2;F<I.length;F++)I[F]=this.mul(I[F-1],y);var j=I[0],D=0,W=0,R=B.bitLength()%26;for(R===0&&(R=26),F=B.length-1;F>=0;F--){for(var z=B.words[F],ye=R-1;ye>=0;ye--){var Ce=z>>ye&1;if(j!==I[0]&&(j=this.sqr(j)),Ce===0&&D===0){W=0;continue}D<<=1,D|=Ce,W++,!(W!==$&&(F!==0||ye!==0))&&(j=this.mul(j,I[D]),W=0,D=0)}R=26}return j},te.prototype.convertTo=function(y){var B=y.umod(this.m);return B===y?B.clone():B},te.prototype.convertFrom=function(y){var B=y.clone();return B.red=null,B},g.mont=function(y){return new k(y)};function k(q){te.call(this,q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(k,te),k.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},k.prototype.convertFrom=function(y){var B=this.imod(y.mul(this.rinv));return B.red=null,B},k.prototype.imul=function(y,B){if(y.isZero()||B.isZero())return y.words[0]=0,y.length=1,y;var $=y.imul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},k.prototype.mul=function(y,B){if(y.isZero()||B.isZero())return new g(0)._forceRed(this);var $=y.mul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),F=$.isub(I).iushrn(this.shift),j=F;return F.cmp(this.m)>=0?j=F.isub(this.m):F.cmpn(0)<0&&(j=F.iadd(this.m)),j._forceRed(this)},k.prototype.invm=function(y){var B=this.imod(y._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(r,bn)})(bn$1)),bn$1.exports}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,(function(exports){var indexOf=function(r,f){if(r.indexOf)return r.indexOf(f);for(var d=0;d<r.length;d++)if(r[d]===f)return d;return-1},Object_keys=function(r){if(Object.keys)return Object.keys(r);var f=[];for(var d in r)f.push(d);return f},forEach=function(r,f){if(r.forEach)return r.forEach(f);for(var d=0;d<r.length;d++)f(r[d],d,r)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(r,f,d){Object.defineProperty(r,f,{writable:!0,enumerable:!1,configurable:!0,value:d})}}catch{return function(f,d,m){f[d]=m}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(f){if(!(this instanceof Script))return new Script(f);this.code=f};Script.prototype.runInContext=function(r){if(!(r instanceof Context))throw new TypeError("needs a 'context' argument.");var f=document.createElement("iframe");f.style||(f.style={}),f.style.display="none",document.body.appendChild(f);var d=f.contentWindow,m=d.eval,v=d.execScript;!m&&v&&(v.call(d,"null"),m=d.eval),forEach(Object_keys(r),function(x){d[x]=r[x]}),forEach(globals,function(x){r[x]&&(d[x]=r[x])});var g=Object_keys(d),w=m.call(d,this.code);return forEach(Object_keys(d),function(x){(x in r||indexOf(g,x)===-1)&&(r[x]=d[x])}),forEach(globals,function(x){x in r||defineProp(r,x,d[x])}),document.body.removeChild(f),w},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(r){var f=Script.createContext(r),d=this.runInContext(f);return r&&forEach(Object_keys(f),function(m){r[m]=f[m]}),d},forEach(Object_keys(Script.prototype),function(r){exports[r]=Script[r]=function(f){var d=Script(f);return d[r].apply(d,[].slice.call(arguments,1))}}),exports.isContext=function(r){return r instanceof Context},exports.createScript=function(r){return exports.Script(r)},exports.createContext=Script.createContext=function(r){var f=new Context;return typeof r=="object"&&forEach(Object_keys(r),function(d){f[d]=r[d]}),f}})(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,(function(r){var f=requireAsn1$1(),d=requireInherits_browser(),m=r;m.define=function(w,x){return new v(w,x)};function v(g,w){this.name=g,this.body=w,this.decoders={},this.encoders={}}v.prototype._createNamed=function(w){var x;try{x=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
26
+ `)+" "+ye[1]:ye[0]+z+" "+R.join(", ")+" "+ye[1]}r.types=requireTypes();function L(R){return Array.isArray(R)}r.isArray=L;function O(R){return typeof R=="boolean"}r.isBoolean=O;function N(R){return R===null}r.isNull=N;function H(R){return R==null}r.isNullOrUndefined=H;function V(R){return typeof R=="number"}r.isNumber=V;function X(R){return typeof R=="string"}r.isString=X;function oe(R){return typeof R=="symbol"}r.isSymbol=oe;function se(R){return R===void 0}r.isUndefined=se;function de(R){return he(R)&&y(R)==="[object RegExp]"}r.isRegExp=de,r.types.isRegExp=de;function he(R){return typeof R=="object"&&R!==null}r.isObject=he;function we(R){return he(R)&&y(R)==="[object Date]"}r.isDate=we,r.types.isDate=we;function te(R){return he(R)&&(y(R)==="[object Error]"||R instanceof Error)}r.isError=te,r.types.isNativeError=te;function k(R){return typeof R=="function"}r.isFunction=k;function q(R){return R===null||typeof R=="boolean"||typeof R=="number"||typeof R=="string"||typeof R=="symbol"||typeof R>"u"}r.isPrimitive=q,r.isBuffer=requireIsBufferBrowser();function y(R){return Object.prototype.toString.call(R)}function B(R){return R<10?"0"+R.toString(10):R.toString(10)}var $=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var R=new Date,z=[B(R.getHours()),B(R.getMinutes()),B(R.getSeconds())].join(":");return[R.getDate(),$[R.getMonth()],z].join(" ")}r.log=function(){},r.inherits=requireInherits_browser(),r._extend=function(R,z){if(!z||!he(z))return R;for(var ye=Object.keys(z),Ce=ye.length;Ce--;)R[ye[Ce]]=z[ye[Ce]];return R};function U(R,z){return Object.prototype.hasOwnProperty.call(R,z)}var j=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;r.promisify=function(z){if(typeof z!="function")throw new TypeError('The "original" argument must be of type Function');if(j&&z[j]){var ye=z[j];if(typeof ye!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ye,j,{value:ye,enumerable:!1,writable:!1,configurable:!0}),ye}function ye(){for(var Ce,me,ie=new Promise(function(be,ae){Ce=be,me=ae}),ee=[],pe=0;pe<arguments.length;pe++)ee.push(arguments[pe]);ee.push(function(be,ae){be?me(be):Ce(ae)});try{z.apply(this,ee)}catch(be){me(be)}return ie}return Object.setPrototypeOf(ye,Object.getPrototypeOf(z)),j&&Object.defineProperty(ye,j,{value:ye,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ye,f(z))},r.promisify.custom=j;function D(R,z){if(!R){var ye=new Error("Promise was rejected with a falsy value");ye.reason=R,R=ye}return z(R)}function W(R){if(typeof R!="function")throw new TypeError('The "original" argument must be of type Function');function z(){for(var ye=[],Ce=0;Ce<arguments.length;Ce++)ye.push(arguments[Ce]);var me=ye.pop();if(typeof me!="function")throw new TypeError("The last argument must be of type Function");var ie=this,ee=function(){return me.apply(ie,arguments)};R.apply(this,ye).then(function(pe){process$1.nextTick(ee.bind(null,null,pe))},function(pe){process$1.nextTick(D.bind(null,pe,ee))})}return Object.setPrototypeOf(z,Object.getPrototypeOf(R)),Object.defineProperties(z,f(R)),z}r.callbackify=W})(util$1)),util$1}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function r(A,T){var L=Object.keys(A);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(A);T&&(O=O.filter(function(N){return Object.getOwnPropertyDescriptor(A,N).enumerable})),L.push.apply(L,O)}return L}function f(A){for(var T=1;T<arguments.length;T++){var L=arguments[T]!=null?arguments[T]:{};T%2?r(Object(L),!0).forEach(function(O){d(A,O,L[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(L)):r(Object(L)).forEach(function(O){Object.defineProperty(A,O,Object.getOwnPropertyDescriptor(L,O))})}return A}function d(A,T,L){return T=w(T),T in A?Object.defineProperty(A,T,{value:L,enumerable:!0,configurable:!0,writable:!0}):A[T]=L,A}function m(A,T){if(!(A instanceof T))throw new TypeError("Cannot call a class as a function")}function v(A,T){for(var L=0;L<T.length;L++){var O=T[L];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(A,w(O.key),O)}}function g(A,T,L){return T&&v(A.prototype,T),Object.defineProperty(A,"prototype",{writable:!1}),A}function w(A){var T=x(A,"string");return typeof T=="symbol"?T:String(T)}function x(A,T){if(typeof A!="object"||A===null)return A;var L=A[Symbol.toPrimitive];if(L!==void 0){var O=L.call(A,T);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}var S=requireDist(),_=S.Buffer,b=requireUtil$1(),C=b.inspect,E=C&&C.custom||"inspect";function M(A,T,L){_.prototype.copy.call(A,T,L)}return buffer_list=(function(){function A(){m(this,A),this.head=null,this.tail=null,this.length=0}return g(A,[{key:"push",value:function(L){var O={data:L,next:null};this.length>0?this.tail.next=O:this.head=O,this.tail=O,++this.length}},{key:"unshift",value:function(L){var O={data:L,next:this.head};this.length===0&&(this.tail=O),this.head=O,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var O=this.head,N=""+O.data;O=O.next;)N+=L+O.data;return N}},{key:"concat",value:function(L){if(this.length===0)return _.alloc(0);for(var O=_.allocUnsafe(L>>>0),N=this.head,H=0;N;)M(N.data,O,H),H+=N.data.length,N=N.next;return O}},{key:"consume",value:function(L,O){var N;return L<this.head.data.length?(N=this.head.data.slice(0,L),this.head.data=this.head.data.slice(L)):L===this.head.data.length?N=this.shift():N=O?this._getString(L):this._getBuffer(L),N}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(L){var O=this.head,N=1,H=O.data;for(L-=H.length;O=O.next;){var V=O.data,X=L>V.length?V.length:L;if(X===V.length?H+=V:H+=V.slice(0,L),L-=X,L===0){X===V.length?(++N,O.next?this.head=O.next:this.head=this.tail=null):(this.head=O,O.data=V.slice(X));break}++N}return this.length-=N,H}},{key:"_getBuffer",value:function(L){var O=_.allocUnsafe(L),N=this.head,H=1;for(N.data.copy(O),L-=N.data.length;N=N.next;){var V=N.data,X=L>V.length?V.length:L;if(V.copy(O,O.length-L,0,X),L-=X,L===0){X===V.length?(++H,N.next?this.head=N.next:this.head=this.tail=null):(this.head=N,N.data=V.slice(X));break}++H}return this.length-=H,O}},{key:E,value:function(L,O){return C(this,f(f({},O),{},{depth:0,customInspect:!1}))}}]),A})(),buffer_list}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;function r(w,x){var S=this,_=this._readableState&&this._readableState.destroyed,b=this._writableState&&this._writableState.destroyed;return _||b?(x?x(w):w&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(v,this,w)):process$1.nextTick(v,this,w)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(w||null,function(C){!x&&C?S._writableState?S._writableState.errorEmitted?process$1.nextTick(d,S):(S._writableState.errorEmitted=!0,process$1.nextTick(f,S,C)):process$1.nextTick(f,S,C):x?(process$1.nextTick(d,S),x(C)):process$1.nextTick(d,S)}),this)}function f(w,x){v(w,x),d(w)}function d(w){w._writableState&&!w._writableState.emitClose||w._readableState&&!w._readableState.emitClose||w.emit("close")}function m(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function v(w,x){w.emit("error",x)}function g(w,x){var S=w._readableState,_=w._writableState;S&&S.autoDestroy||_&&_.autoDestroy?w.destroy(x):w.emit("error",x)}return destroy_1$1={destroy:r,undestroy:m,errorOrDestroy:g},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function r(x,S){x.prototype=Object.create(S.prototype),x.prototype.constructor=x,x.__proto__=S}var f={};function d(x,S,_){_||(_=Error);function b(E,M,A){return typeof S=="string"?S:S(E,M,A)}var C=(function(E){r(M,E);function M(A,T,L){return E.call(this,b(A,T,L))||this}return M})(_);C.prototype.name=_.name,C.prototype.code=x,f[x]=C}function m(x,S){if(Array.isArray(x)){var _=x.length;return x=x.map(function(b){return String(b)}),_>2?"one of ".concat(S," ").concat(x.slice(0,_-1).join(", "),", or ")+x[_-1]:_===2?"one of ".concat(S," ").concat(x[0]," or ").concat(x[1]):"of ".concat(S," ").concat(x[0])}else return"of ".concat(S," ").concat(String(x))}function v(x,S,_){return x.substr(0,S.length)===S}function g(x,S,_){return(_===void 0||_>x.length)&&(_=x.length),x.substring(_-S.length,_)===S}function w(x,S,_){return typeof _!="number"&&(_=0),_+S.length>x.length?!1:x.indexOf(S,_)!==-1}return d("ERR_INVALID_OPT_VALUE",function(x,S){return'The value "'+S+'" is invalid for option "'+x+'"'},TypeError),d("ERR_INVALID_ARG_TYPE",function(x,S,_){var b;typeof S=="string"&&v(S,"not ")?(b="must not be",S=S.replace(/^not /,"")):b="must be";var C;if(g(x," argument"))C="The ".concat(x," ").concat(b," ").concat(m(S,"type"));else{var E=w(x,".")?"property":"argument";C='The "'.concat(x,'" ').concat(E," ").concat(b," ").concat(m(S,"type"))}return C+=". Received type ".concat(typeof _),C},TypeError),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),d("ERR_METHOD_NOT_IMPLEMENTED",function(x){return"The "+x+" method is not implemented"}),d("ERR_STREAM_PREMATURE_CLOSE","Premature close"),d("ERR_STREAM_DESTROYED",function(x){return"Cannot call "+x+" after a stream was destroyed"}),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),d("ERR_STREAM_WRITE_AFTER_END","write after end"),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_UNKNOWN_ENCODING",function(x){return"Unknown encoding: "+x},TypeError),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=f,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var r=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function f(m,v,g){return m.highWaterMark!=null?m.highWaterMark:v?m[g]:null}function d(m,v,g,w){var x=f(v,w,g);if(x!=null){if(!(isFinite(x)&&Math.floor(x)===x)||x<0){var S=w?g:"highWaterMark";throw new r(S,x)}return Math.floor(x)}return m.objectMode?16:16*1024}return state={getHighWaterMark:d},state}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=r;function r(d,m){if(f("noDeprecation"))return d;var v=!1;function g(){if(!v){if(f("throwDeprecation"))throw new Error(m);f("traceDeprecation"),v=!0}return d.apply(this,arguments)}return g}function f(d){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var m=commonjsGlobal.localStorage[d];return m==null?!1:String(m).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=de;function r(me){var ie=this;this.next=null,this.entry=null,this.finish=function(){Ce(ie,me)}}var f;de.WritableState=oe;var d={deprecate:requireBrowser$a()},m=requireStreamBrowser$1(),v=requireDist().Buffer,g=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function w(me){return v.from(me)}function x(me){return v.isBuffer(me)||me instanceof g}var S=requireDestroy$1(),_=requireState(),b=_.getHighWaterMark,C=requireErrorsBrowser().codes,E=C.ERR_INVALID_ARG_TYPE,M=C.ERR_METHOD_NOT_IMPLEMENTED,A=C.ERR_MULTIPLE_CALLBACK,T=C.ERR_STREAM_CANNOT_PIPE,L=C.ERR_STREAM_DESTROYED,O=C.ERR_STREAM_NULL_VALUES,N=C.ERR_STREAM_WRITE_AFTER_END,H=C.ERR_UNKNOWN_ENCODING,V=S.errorOrDestroy;requireInherits_browser()(de,m);function X(){}function oe(me,ie,ee){f=f||require_stream_duplex$1(),me=me||{},typeof ee!="boolean"&&(ee=ie instanceof f),this.objectMode=!!me.objectMode,ee&&(this.objectMode=this.objectMode||!!me.writableObjectMode),this.highWaterMark=b(this,me,"writableHighWaterMark",ee),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var pe=me.decodeStrings===!1;this.decodeStrings=!pe,this.defaultEncoding=me.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(be){$(ie,be)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=me.emitClose!==!1,this.autoDestroy=!!me.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}oe.prototype.getBuffer=function(){for(var ie=this.bufferedRequest,ee=[];ie;)ee.push(ie),ie=ie.next;return ee},(function(){try{Object.defineProperty(oe.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var se;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(se=Function.prototype[Symbol.hasInstance],Object.defineProperty(de,Symbol.hasInstance,{value:function(ie){return se.call(this,ie)?!0:this!==de?!1:ie&&ie._writableState instanceof oe}})):se=function(ie){return ie instanceof this};function de(me){f=f||require_stream_duplex$1();var ie=this instanceof f;if(!ie&&!se.call(de,this))return new de(me);this._writableState=new oe(me,this,ie),this.writable=!0,me&&(typeof me.write=="function"&&(this._write=me.write),typeof me.writev=="function"&&(this._writev=me.writev),typeof me.destroy=="function"&&(this._destroy=me.destroy),typeof me.final=="function"&&(this._final=me.final)),m.call(this)}de.prototype.pipe=function(){V(this,new T)};function he(me,ie){var ee=new N;V(me,ee),process$1.nextTick(ie,ee)}function we(me,ie,ee,pe){var be;return ee===null?be=new O:typeof ee!="string"&&!ie.objectMode&&(be=new E("chunk",["string","Buffer"],ee)),be?(V(me,be),process$1.nextTick(pe,be),!1):!0}de.prototype.write=function(me,ie,ee){var pe=this._writableState,be=!1,ae=!pe.objectMode&&x(me);return ae&&!v.isBuffer(me)&&(me=w(me)),typeof ie=="function"&&(ee=ie,ie=null),ae?ie="buffer":ie||(ie=pe.defaultEncoding),typeof ee!="function"&&(ee=X),pe.ending?he(this,ee):(ae||we(this,pe,me,ee))&&(pe.pendingcb++,be=k(this,pe,ae,me,ie,ee)),be},de.prototype.cork=function(){this._writableState.corked++},de.prototype.uncork=function(){var me=this._writableState;me.corked&&(me.corked--,!me.writing&&!me.corked&&!me.bufferProcessing&&me.bufferedRequest&&j(this,me))},de.prototype.setDefaultEncoding=function(ie){if(typeof ie=="string"&&(ie=ie.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ie+"").toLowerCase())>-1))throw new H(ie);return this._writableState.defaultEncoding=ie,this},Object.defineProperty(de.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function te(me,ie,ee){return!me.objectMode&&me.decodeStrings!==!1&&typeof ie=="string"&&(ie=v.from(ie,ee)),ie}Object.defineProperty(de.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function k(me,ie,ee,pe,be,ae){if(!ee){var ne=te(ie,pe,be);pe!==ne&&(ee=!0,be="buffer",pe=ne)}var Se=ie.objectMode?1:pe.length;ie.length+=Se;var qe=ie.length<ie.highWaterMark;if(qe||(ie.needDrain=!0),ie.writing||ie.corked){var Ie=ie.lastBufferedRequest;ie.lastBufferedRequest={chunk:pe,encoding:be,isBuf:ee,callback:ae,next:null},Ie?Ie.next=ie.lastBufferedRequest:ie.bufferedRequest=ie.lastBufferedRequest,ie.bufferedRequestCount+=1}else q(me,ie,!1,Se,pe,be,ae);return qe}function q(me,ie,ee,pe,be,ae,ne){ie.writelen=pe,ie.writecb=ne,ie.writing=!0,ie.sync=!0,ie.destroyed?ie.onwrite(new L("write")):ee?me._writev(be,ie.onwrite):me._write(be,ae,ie.onwrite),ie.sync=!1}function y(me,ie,ee,pe,be){--ie.pendingcb,ee?(process$1.nextTick(be,pe),process$1.nextTick(z,me,ie),me._writableState.errorEmitted=!0,V(me,pe)):(be(pe),me._writableState.errorEmitted=!0,V(me,pe),z(me,ie))}function B(me){me.writing=!1,me.writecb=null,me.length-=me.writelen,me.writelen=0}function $(me,ie){var ee=me._writableState,pe=ee.sync,be=ee.writecb;if(typeof be!="function")throw new A;if(B(ee),ie)y(me,ee,pe,ie,be);else{var ae=D(ee)||me.destroyed;!ae&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&j(me,ee),pe?process$1.nextTick(I,me,ee,ae,be):I(me,ee,ae,be)}}function I(me,ie,ee,pe){ee||U(me,ie),ie.pendingcb--,pe(),z(me,ie)}function U(me,ie){ie.length===0&&ie.needDrain&&(ie.needDrain=!1,me.emit("drain"))}function j(me,ie){ie.bufferProcessing=!0;var ee=ie.bufferedRequest;if(me._writev&&ee&&ee.next){var pe=ie.bufferedRequestCount,be=new Array(pe),ae=ie.corkedRequestsFree;ae.entry=ee;for(var ne=0,Se=!0;ee;)be[ne]=ee,ee.isBuf||(Se=!1),ee=ee.next,ne+=1;be.allBuffers=Se,q(me,ie,!0,ie.length,be,"",ae.finish),ie.pendingcb++,ie.lastBufferedRequest=null,ae.next?(ie.corkedRequestsFree=ae.next,ae.next=null):ie.corkedRequestsFree=new r(ie),ie.bufferedRequestCount=0}else{for(;ee;){var qe=ee.chunk,Ie=ee.encoding,Oe=ee.callback,Fe=ie.objectMode?1:qe.length;if(q(me,ie,!1,Fe,qe,Ie,Oe),ee=ee.next,ie.bufferedRequestCount--,ie.writing)break}ee===null&&(ie.lastBufferedRequest=null)}ie.bufferedRequest=ee,ie.bufferProcessing=!1}de.prototype._write=function(me,ie,ee){ee(new M("_write()"))},de.prototype._writev=null,de.prototype.end=function(me,ie,ee){var pe=this._writableState;return typeof me=="function"?(ee=me,me=null,ie=null):typeof ie=="function"&&(ee=ie,ie=null),me!=null&&this.write(me,ie),pe.corked&&(pe.corked=1,this.uncork()),pe.ending||ye(this,pe,ee),this},Object.defineProperty(de.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function D(me){return me.ending&&me.length===0&&me.bufferedRequest===null&&!me.finished&&!me.writing}function W(me,ie){me._final(function(ee){ie.pendingcb--,ee&&V(me,ee),ie.prefinished=!0,me.emit("prefinish"),z(me,ie)})}function R(me,ie){!ie.prefinished&&!ie.finalCalled&&(typeof me._final=="function"&&!ie.destroyed?(ie.pendingcb++,ie.finalCalled=!0,process$1.nextTick(W,me,ie)):(ie.prefinished=!0,me.emit("prefinish")))}function z(me,ie){var ee=D(ie);if(ee&&(R(me,ie),ie.pendingcb===0&&(ie.finished=!0,me.emit("finish"),ie.autoDestroy))){var pe=me._readableState;(!pe||pe.autoDestroy&&pe.endEmitted)&&me.destroy()}return ee}function ye(me,ie,ee){ie.ending=!0,z(me,ie),ee&&(ie.finished?process$1.nextTick(ee):me.once("finish",ee)),ie.ended=!0,me.writable=!1}function Ce(me,ie,ee){var pe=me.entry;for(me.entry=null;pe;){var be=pe.callback;ie.pendingcb--,be(ee),pe=pe.next}ie.corkedRequestsFree.next=me}return Object.defineProperty(de.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(ie){this._writableState&&(this._writableState.destroyed=ie)}}),de.prototype.destroy=S.destroy,de.prototype._undestroy=S.undestroy,de.prototype._destroy=function(me,ie){ie(me)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var r=Object.keys||function(_){var b=[];for(var C in _)b.push(C);return b};_stream_duplex$1=w;var f=require_stream_readable$1(),d=require_stream_writable$1();requireInherits_browser()(w,f);for(var m=r(d.prototype),v=0;v<m.length;v++){var g=m[v];w.prototype[g]||(w.prototype[g]=d.prototype[g])}function w(_){if(!(this instanceof w))return new w(_);f.call(this,_),d.call(this,_),this.allowHalfOpen=!0,_&&(_.readable===!1&&(this.readable=!1),_.writable===!1&&(this.writable=!1),_.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",x)))}Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function x(){this._writableState.ended||process$1.nextTick(S,this)}function S(_){_.end()}return Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(b){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=b,this._writableState.destroyed=b)}}),_stream_duplex$1}var string_decoder={},hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var r=requireSafeBuffer$1().Buffer,f=r.isEncoding||function(O){switch(O=""+O,O&&O.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 d(O){if(!O)return"utf8";for(var N;;)switch(O){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 O;default:if(N)return;O=(""+O).toLowerCase(),N=!0}}function m(O){var N=d(O);if(typeof N!="string"&&(r.isEncoding===f||!f(O)))throw new Error("Unknown encoding: "+O);return N||O}string_decoder.StringDecoder=v;function v(O){this.encoding=m(O);var N;switch(this.encoding){case"utf16le":this.text=C,this.end=E,N=4;break;case"utf8":this.fillLast=S,N=4;break;case"base64":this.text=M,this.end=A,N=3;break;default:this.write=T,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(N)}v.prototype.write=function(O){if(O.length===0)return"";var N,H;if(this.lastNeed){if(N=this.fillLast(O),N===void 0)return"";H=this.lastNeed,this.lastNeed=0}else H=0;return H<O.length?N?N+this.text(O,H):this.text(O,H):N||""},v.prototype.end=b,v.prototype.text=_,v.prototype.fillLast=function(O){if(this.lastNeed<=O.length)return O.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);O.copy(this.lastChar,this.lastTotal-this.lastNeed,0,O.length),this.lastNeed-=O.length};function g(O){return O<=127?0:O>>5===6?2:O>>4===14?3:O>>3===30?4:O>>6===2?-1:-2}function w(O,N,H){var V=N.length-1;if(V<H)return 0;var X=g(N[V]);return X>=0?(X>0&&(O.lastNeed=X-1),X):--V<H||X===-2?0:(X=g(N[V]),X>=0?(X>0&&(O.lastNeed=X-2),X):--V<H||X===-2?0:(X=g(N[V]),X>=0?(X>0&&(X===2?X=0:O.lastNeed=X-3),X):0))}function x(O,N,H){if((N[0]&192)!==128)return O.lastNeed=0,"�";if(O.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return O.lastNeed=1,"�";if(O.lastNeed>2&&N.length>2&&(N[2]&192)!==128)return O.lastNeed=2,"�"}}function S(O){var N=this.lastTotal-this.lastNeed,H=x(this,O);if(H!==void 0)return H;if(this.lastNeed<=O.length)return O.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);O.copy(this.lastChar,N,0,O.length),this.lastNeed-=O.length}function _(O,N){var H=w(this,O,N);if(!this.lastNeed)return O.toString("utf8",N);this.lastTotal=H;var V=O.length-(H-this.lastNeed);return O.copy(this.lastChar,0,V),O.toString("utf8",N,V)}function b(O){var N=O&&O.length?this.write(O):"";return this.lastNeed?N+"�":N}function C(O,N){if((O.length-N)%2===0){var H=O.toString("utf16le",N);if(H){var V=H.charCodeAt(H.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=O[O.length-2],this.lastChar[1]=O[O.length-1],H.slice(0,-1)}return H}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=O[O.length-1],O.toString("utf16le",N,O.length-1)}function E(O){var N=O&&O.length?this.write(O):"";if(this.lastNeed){var H=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,H)}return N}function M(O,N){var H=(O.length-N)%3;return H===0?O.toString("base64",N):(this.lastNeed=3-H,this.lastTotal=3,H===1?this.lastChar[0]=O[O.length-1]:(this.lastChar[0]=O[O.length-2],this.lastChar[1]=O[O.length-1]),O.toString("base64",N,O.length-H))}function A(O){var N=O&&O.length?this.write(O):"";return this.lastNeed?N+this.lastChar.toString("base64",0,3-this.lastNeed):N}function T(O){return O.toString(this.encoding)}function L(O){return O&&O.length?this.write(O):""}return string_decoder}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var r=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function f(g){var w=!1;return function(){if(!w){w=!0;for(var x=arguments.length,S=new Array(x),_=0;_<x;_++)S[_]=arguments[_];g.apply(this,S)}}}function d(){}function m(g){return g.setHeader&&typeof g.abort=="function"}function v(g,w,x){if(typeof w=="function")return v(g,null,w);w||(w={}),x=f(x||d);var S=w.readable||w.readable!==!1&&g.readable,_=w.writable||w.writable!==!1&&g.writable,b=function(){g.writable||E()},C=g._writableState&&g._writableState.finished,E=function(){_=!1,C=!0,S||x.call(g)},M=g._readableState&&g._readableState.endEmitted,A=function(){S=!1,M=!0,_||x.call(g)},T=function(H){x.call(g,H)},L=function(){var H;if(S&&!M)return(!g._readableState||!g._readableState.ended)&&(H=new r),x.call(g,H);if(_&&!C)return(!g._writableState||!g._writableState.ended)&&(H=new r),x.call(g,H)},O=function(){g.req.on("finish",E)};return m(g)?(g.on("complete",E),g.on("abort",L),g.req?O():g.on("request",O)):_&&!g._writableState&&(g.on("end",b),g.on("close",b)),g.on("end",A),g.on("finish",E),w.error!==!1&&g.on("error",T),g.on("close",L),function(){g.removeListener("complete",E),g.removeListener("abort",L),g.removeListener("request",O),g.req&&g.req.removeListener("finish",E),g.removeListener("end",b),g.removeListener("close",b),g.removeListener("finish",E),g.removeListener("end",A),g.removeListener("error",T),g.removeListener("close",L)}}return endOfStream=v,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var r;function f(H,V,X){return V=d(V),V in H?Object.defineProperty(H,V,{value:X,enumerable:!0,configurable:!0,writable:!0}):H[V]=X,H}function d(H){var V=m(H,"string");return typeof V=="symbol"?V:String(V)}function m(H,V){if(typeof H!="object"||H===null)return H;var X=H[Symbol.toPrimitive];if(X!==void 0){var oe=X.call(H,V);if(typeof oe!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)(H)}var v=requireEndOfStream(),g=Symbol("lastResolve"),w=Symbol("lastReject"),x=Symbol("error"),S=Symbol("ended"),_=Symbol("lastPromise"),b=Symbol("handlePromise"),C=Symbol("stream");function E(H,V){return{value:H,done:V}}function M(H){var V=H[g];if(V!==null){var X=H[C].read();X!==null&&(H[_]=null,H[g]=null,H[w]=null,V(E(X,!1)))}}function A(H){process$1.nextTick(M,H)}function T(H,V){return function(X,oe){H.then(function(){if(V[S]){X(E(void 0,!0));return}V[b](X,oe)},oe)}}var L=Object.getPrototypeOf(function(){}),O=Object.setPrototypeOf((r={get stream(){return this[C]},next:function(){var V=this,X=this[x];if(X!==null)return Promise.reject(X);if(this[S])return Promise.resolve(E(void 0,!0));if(this[C].destroyed)return new Promise(function(he,we){process$1.nextTick(function(){V[x]?we(V[x]):he(E(void 0,!0))})});var oe=this[_],se;if(oe)se=new Promise(T(oe,this));else{var de=this[C].read();if(de!==null)return Promise.resolve(E(de,!1));se=new Promise(this[b])}return this[_]=se,se}},f(r,Symbol.asyncIterator,function(){return this}),f(r,"return",function(){var V=this;return new Promise(function(X,oe){V[C].destroy(null,function(se){if(se){oe(se);return}X(E(void 0,!0))})})}),r),L),N=function(V){var X,oe=Object.create(O,(X={},f(X,C,{value:V,writable:!0}),f(X,g,{value:null,writable:!0}),f(X,w,{value:null,writable:!0}),f(X,x,{value:null,writable:!0}),f(X,S,{value:V._readableState.endEmitted,writable:!0}),f(X,b,{value:function(de,he){var we=oe[C].read();we?(oe[_]=null,oe[g]=null,oe[w]=null,de(E(we,!1))):(oe[g]=de,oe[w]=he)},writable:!0}),X));return oe[_]=null,v(V,function(se){if(se&&se.code!=="ERR_STREAM_PREMATURE_CLOSE"){var de=oe[w];de!==null&&(oe[_]=null,oe[g]=null,oe[w]=null,de(se)),oe[x]=se;return}var he=oe[g];he!==null&&(oe[_]=null,oe[g]=null,oe[w]=null,he(E(void 0,!0))),oe[S]=!0}),V.on("readable",A.bind(null,oe)),oe};return async_iterator=N,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=he;var r;he.ReadableState=de,requireEvents().EventEmitter;var f=function(ne,Se){return ne.listeners(Se).length},d=requireStreamBrowser$1(),m=requireDist().Buffer,v=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function g(ae){return m.from(ae)}function w(ae){return m.isBuffer(ae)||ae instanceof v}var x=requireUtil$1(),S;x&&x.debuglog?S=x.debuglog("stream"):S=function(){};var _=requireBuffer_list(),b=requireDestroy$1(),C=requireState(),E=C.getHighWaterMark,M=requireErrorsBrowser().codes,A=M.ERR_INVALID_ARG_TYPE,T=M.ERR_STREAM_PUSH_AFTER_EOF,L=M.ERR_METHOD_NOT_IMPLEMENTED,O=M.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,N,H,V;requireInherits_browser()(he,d);var X=b.errorOrDestroy,oe=["error","close","destroy","pause","resume"];function se(ae,ne,Se){if(typeof ae.prependListener=="function")return ae.prependListener(ne,Se);!ae._events||!ae._events[ne]?ae.on(ne,Se):Array.isArray(ae._events[ne])?ae._events[ne].unshift(Se):ae._events[ne]=[Se,ae._events[ne]]}function de(ae,ne,Se){r=r||require_stream_duplex$1(),ae=ae||{},typeof Se!="boolean"&&(Se=ne instanceof r),this.objectMode=!!ae.objectMode,Se&&(this.objectMode=this.objectMode||!!ae.readableObjectMode),this.highWaterMark=E(this,ae,"readableHighWaterMark",Se),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=ae.emitClose!==!1,this.autoDestroy=!!ae.autoDestroy,this.destroyed=!1,this.defaultEncoding=ae.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ae.encoding&&(N||(N=requireString_decoder().StringDecoder),this.decoder=new N(ae.encoding),this.encoding=ae.encoding)}function he(ae){if(r=r||require_stream_duplex$1(),!(this instanceof he))return new he(ae);var ne=this instanceof r;this._readableState=new de(ae,this,ne),this.readable=!0,ae&&(typeof ae.read=="function"&&(this._read=ae.read),typeof ae.destroy=="function"&&(this._destroy=ae.destroy)),d.call(this)}Object.defineProperty(he.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ne){this._readableState&&(this._readableState.destroyed=ne)}}),he.prototype.destroy=b.destroy,he.prototype._undestroy=b.undestroy,he.prototype._destroy=function(ae,ne){ne(ae)},he.prototype.push=function(ae,ne){var Se=this._readableState,qe;return Se.objectMode?qe=!0:typeof ae=="string"&&(ne=ne||Se.defaultEncoding,ne!==Se.encoding&&(ae=m.from(ae,ne),ne=""),qe=!0),we(this,ae,ne,!1,qe)},he.prototype.unshift=function(ae){return we(this,ae,null,!0,!1)};function we(ae,ne,Se,qe,Ie){S("readableAddChunk",ne);var Oe=ae._readableState;if(ne===null)Oe.reading=!1,$(ae,Oe);else{var Fe;if(Ie||(Fe=k(Oe,ne)),Fe)X(ae,Fe);else if(Oe.objectMode||ne&&ne.length>0)if(typeof ne!="string"&&!Oe.objectMode&&Object.getPrototypeOf(ne)!==m.prototype&&(ne=g(ne)),qe)Oe.endEmitted?X(ae,new O):te(ae,Oe,ne,!0);else if(Oe.ended)X(ae,new T);else{if(Oe.destroyed)return!1;Oe.reading=!1,Oe.decoder&&!Se?(ne=Oe.decoder.write(ne),Oe.objectMode||ne.length!==0?te(ae,Oe,ne,!1):j(ae,Oe)):te(ae,Oe,ne,!1)}else qe||(Oe.reading=!1,j(ae,Oe))}return!Oe.ended&&(Oe.length<Oe.highWaterMark||Oe.length===0)}function te(ae,ne,Se,qe){ne.flowing&&ne.length===0&&!ne.sync?(ne.awaitDrain=0,ae.emit("data",Se)):(ne.length+=ne.objectMode?1:Se.length,qe?ne.buffer.unshift(Se):ne.buffer.push(Se),ne.needReadable&&I(ae)),j(ae,ne)}function k(ae,ne){var Se;return!w(ne)&&typeof ne!="string"&&ne!==void 0&&!ae.objectMode&&(Se=new A("chunk",["string","Buffer","Uint8Array"],ne)),Se}he.prototype.isPaused=function(){return this._readableState.flowing===!1},he.prototype.setEncoding=function(ae){N||(N=requireString_decoder().StringDecoder);var ne=new N(ae);this._readableState.decoder=ne,this._readableState.encoding=this._readableState.decoder.encoding;for(var Se=this._readableState.buffer.head,qe="";Se!==null;)qe+=ne.write(Se.data),Se=Se.next;return this._readableState.buffer.clear(),qe!==""&&this._readableState.buffer.push(qe),this._readableState.length=qe.length,this};var q=1073741824;function y(ae){return ae>=q?ae=q:(ae--,ae|=ae>>>1,ae|=ae>>>2,ae|=ae>>>4,ae|=ae>>>8,ae|=ae>>>16,ae++),ae}function B(ae,ne){return ae<=0||ne.length===0&&ne.ended?0:ne.objectMode?1:ae!==ae?ne.flowing&&ne.length?ne.buffer.head.data.length:ne.length:(ae>ne.highWaterMark&&(ne.highWaterMark=y(ae)),ae<=ne.length?ae:ne.ended?ne.length:(ne.needReadable=!0,0))}he.prototype.read=function(ae){S("read",ae),ae=parseInt(ae,10);var ne=this._readableState,Se=ae;if(ae!==0&&(ne.emittedReadable=!1),ae===0&&ne.needReadable&&((ne.highWaterMark!==0?ne.length>=ne.highWaterMark:ne.length>0)||ne.ended))return S("read: emitReadable",ne.length,ne.ended),ne.length===0&&ne.ended?ee(this):I(this),null;if(ae=B(ae,ne),ae===0&&ne.ended)return ne.length===0&&ee(this),null;var qe=ne.needReadable;S("need readable",qe),(ne.length===0||ne.length-ae<ne.highWaterMark)&&(qe=!0,S("length less than watermark",qe)),ne.ended||ne.reading?(qe=!1,S("reading or ended",qe)):qe&&(S("do read"),ne.reading=!0,ne.sync=!0,ne.length===0&&(ne.needReadable=!0),this._read(ne.highWaterMark),ne.sync=!1,ne.reading||(ae=B(Se,ne)));var Ie;return ae>0?Ie=ie(ae,ne):Ie=null,Ie===null?(ne.needReadable=ne.length<=ne.highWaterMark,ae=0):(ne.length-=ae,ne.awaitDrain=0),ne.length===0&&(ne.ended||(ne.needReadable=!0),Se!==ae&&ne.ended&&ee(this)),Ie!==null&&this.emit("data",Ie),Ie};function $(ae,ne){if(S("onEofChunk"),!ne.ended){if(ne.decoder){var Se=ne.decoder.end();Se&&Se.length&&(ne.buffer.push(Se),ne.length+=ne.objectMode?1:Se.length)}ne.ended=!0,ne.sync?I(ae):(ne.needReadable=!1,ne.emittedReadable||(ne.emittedReadable=!0,U(ae)))}}function I(ae){var ne=ae._readableState;S("emitReadable",ne.needReadable,ne.emittedReadable),ne.needReadable=!1,ne.emittedReadable||(S("emitReadable",ne.flowing),ne.emittedReadable=!0,process$1.nextTick(U,ae))}function U(ae){var ne=ae._readableState;S("emitReadable_",ne.destroyed,ne.length,ne.ended),!ne.destroyed&&(ne.length||ne.ended)&&(ae.emit("readable"),ne.emittedReadable=!1),ne.needReadable=!ne.flowing&&!ne.ended&&ne.length<=ne.highWaterMark,me(ae)}function j(ae,ne){ne.readingMore||(ne.readingMore=!0,process$1.nextTick(D,ae,ne))}function D(ae,ne){for(;!ne.reading&&!ne.ended&&(ne.length<ne.highWaterMark||ne.flowing&&ne.length===0);){var Se=ne.length;if(S("maybeReadMore read 0"),ae.read(0),Se===ne.length)break}ne.readingMore=!1}he.prototype._read=function(ae){X(this,new L("_read()"))},he.prototype.pipe=function(ae,ne){var Se=this,qe=this._readableState;switch(qe.pipesCount){case 0:qe.pipes=ae;break;case 1:qe.pipes=[qe.pipes,ae];break;default:qe.pipes.push(ae);break}qe.pipesCount+=1,S("pipe count=%d opts=%j",qe.pipesCount,ne);var Ie=(!ne||ne.end!==!1)&&ae!==process$1.stdout&&ae!==process$1.stderr,Oe=Ie?De:gt;qe.endEmitted?process$1.nextTick(Oe):Se.once("end",Oe),ae.on("unpipe",Fe);function Fe(rt,wt){S("onunpipe"),rt===Se&&wt&&wt.hasUnpiped===!1&&(wt.hasUnpiped=!0,Ye())}function De(){S("onend"),ae.end()}var $e=W(Se);ae.on("drain",$e);var je=!1;function Ye(){S("cleanup"),ae.removeListener("close",Ge),ae.removeListener("finish",ut),ae.removeListener("drain",$e),ae.removeListener("error",Je),ae.removeListener("unpipe",Fe),Se.removeListener("end",De),Se.removeListener("end",gt),Se.removeListener("data",st),je=!0,qe.awaitDrain&&(!ae._writableState||ae._writableState.needDrain)&&$e()}Se.on("data",st);function st(rt){S("ondata");var wt=ae.write(rt);S("dest.write",wt),wt===!1&&((qe.pipesCount===1&&qe.pipes===ae||qe.pipesCount>1&&be(qe.pipes,ae)!==-1)&&!je&&(S("false write response, pause",qe.awaitDrain),qe.awaitDrain++),Se.pause())}function Je(rt){S("onerror",rt),gt(),ae.removeListener("error",Je),f(ae,"error")===0&&X(ae,rt)}se(ae,"error",Je);function Ge(){ae.removeListener("finish",ut),gt()}ae.once("close",Ge);function ut(){S("onfinish"),ae.removeListener("close",Ge),gt()}ae.once("finish",ut);function gt(){S("unpipe"),Se.unpipe(ae)}return ae.emit("pipe",Se),qe.flowing||(S("pipe resume"),Se.resume()),ae};function W(ae){return function(){var Se=ae._readableState;S("pipeOnDrain",Se.awaitDrain),Se.awaitDrain&&Se.awaitDrain--,Se.awaitDrain===0&&f(ae,"data")&&(Se.flowing=!0,me(ae))}}he.prototype.unpipe=function(ae){var ne=this._readableState,Se={hasUnpiped:!1};if(ne.pipesCount===0)return this;if(ne.pipesCount===1)return ae&&ae!==ne.pipes?this:(ae||(ae=ne.pipes),ne.pipes=null,ne.pipesCount=0,ne.flowing=!1,ae&&ae.emit("unpipe",this,Se),this);if(!ae){var qe=ne.pipes,Ie=ne.pipesCount;ne.pipes=null,ne.pipesCount=0,ne.flowing=!1;for(var Oe=0;Oe<Ie;Oe++)qe[Oe].emit("unpipe",this,{hasUnpiped:!1});return this}var Fe=be(ne.pipes,ae);return Fe===-1?this:(ne.pipes.splice(Fe,1),ne.pipesCount-=1,ne.pipesCount===1&&(ne.pipes=ne.pipes[0]),ae.emit("unpipe",this,Se),this)},he.prototype.on=function(ae,ne){var Se=d.prototype.on.call(this,ae,ne),qe=this._readableState;return ae==="data"?(qe.readableListening=this.listenerCount("readable")>0,qe.flowing!==!1&&this.resume()):ae==="readable"&&!qe.endEmitted&&!qe.readableListening&&(qe.readableListening=qe.needReadable=!0,qe.flowing=!1,qe.emittedReadable=!1,S("on readable",qe.length,qe.reading),qe.length?I(this):qe.reading||process$1.nextTick(z,this)),Se},he.prototype.addListener=he.prototype.on,he.prototype.removeListener=function(ae,ne){var Se=d.prototype.removeListener.call(this,ae,ne);return ae==="readable"&&process$1.nextTick(R,this),Se},he.prototype.removeAllListeners=function(ae){var ne=d.prototype.removeAllListeners.apply(this,arguments);return(ae==="readable"||ae===void 0)&&process$1.nextTick(R,this),ne};function R(ae){var ne=ae._readableState;ne.readableListening=ae.listenerCount("readable")>0,ne.resumeScheduled&&!ne.paused?ne.flowing=!0:ae.listenerCount("data")>0&&ae.resume()}function z(ae){S("readable nexttick read 0"),ae.read(0)}he.prototype.resume=function(){var ae=this._readableState;return ae.flowing||(S("resume"),ae.flowing=!ae.readableListening,ye(this,ae)),ae.paused=!1,this};function ye(ae,ne){ne.resumeScheduled||(ne.resumeScheduled=!0,process$1.nextTick(Ce,ae,ne))}function Ce(ae,ne){S("resume",ne.reading),ne.reading||ae.read(0),ne.resumeScheduled=!1,ae.emit("resume"),me(ae),ne.flowing&&!ne.reading&&ae.read(0)}he.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function me(ae){var ne=ae._readableState;for(S("flow",ne.flowing);ne.flowing&&ae.read()!==null;);}he.prototype.wrap=function(ae){var ne=this,Se=this._readableState,qe=!1;ae.on("end",function(){if(S("wrapped end"),Se.decoder&&!Se.ended){var Fe=Se.decoder.end();Fe&&Fe.length&&ne.push(Fe)}ne.push(null)}),ae.on("data",function(Fe){if(S("wrapped data"),Se.decoder&&(Fe=Se.decoder.write(Fe)),!(Se.objectMode&&Fe==null)&&!(!Se.objectMode&&(!Fe||!Fe.length))){var De=ne.push(Fe);De||(qe=!0,ae.pause())}});for(var Ie in ae)this[Ie]===void 0&&typeof ae[Ie]=="function"&&(this[Ie]=(function(De){return function(){return ae[De].apply(ae,arguments)}})(Ie));for(var Oe=0;Oe<oe.length;Oe++)ae.on(oe[Oe],this.emit.bind(this,oe[Oe]));return this._read=function(Fe){S("wrapped _read",Fe),qe&&(qe=!1,ae.resume())},this},typeof Symbol=="function"&&(he.prototype[Symbol.asyncIterator]=function(){return H===void 0&&(H=requireAsync_iterator()),H(this)}),Object.defineProperty(he.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(he.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(he.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ne){this._readableState&&(this._readableState.flowing=ne)}}),he._fromList=ie,Object.defineProperty(he.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ie(ae,ne){if(ne.length===0)return null;var Se;return ne.objectMode?Se=ne.buffer.shift():!ae||ae>=ne.length?(ne.decoder?Se=ne.buffer.join(""):ne.buffer.length===1?Se=ne.buffer.first():Se=ne.buffer.concat(ne.length),ne.buffer.clear()):Se=ne.buffer.consume(ae,ne.decoder),Se}function ee(ae){var ne=ae._readableState;S("endReadable",ne.endEmitted),ne.endEmitted||(ne.ended=!0,process$1.nextTick(pe,ne,ae))}function pe(ae,ne){if(S("endReadableNT",ae.endEmitted,ae.length),!ae.endEmitted&&ae.length===0&&(ae.endEmitted=!0,ne.readable=!1,ne.emit("end"),ae.autoDestroy)){var Se=ne._writableState;(!Se||Se.autoDestroy&&Se.finished)&&ne.destroy()}}typeof Symbol=="function"&&(he.from=function(ae,ne){return V===void 0&&(V=requireFromBrowser()),V(he,ae,ne)});function be(ae,ne){for(var Se=0,qe=ae.length;Se<qe;Se++)if(ae[Se]===ne)return Se;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=x;var r=requireErrorsBrowser().codes,f=r.ERR_METHOD_NOT_IMPLEMENTED,d=r.ERR_MULTIPLE_CALLBACK,m=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,v=r.ERR_TRANSFORM_WITH_LENGTH_0,g=require_stream_duplex$1();requireInherits_browser()(x,g);function w(b,C){var E=this._transformState;E.transforming=!1;var M=E.writecb;if(M===null)return this.emit("error",new d);E.writechunk=null,E.writecb=null,C!=null&&this.push(C),M(b);var A=this._readableState;A.reading=!1,(A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}function x(b){if(!(this instanceof x))return new x(b);g.call(this,b),this._transformState={afterTransform:w.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",S)}function S(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(C,E){_(b,C,E)}):_(this,null,null)}x.prototype.push=function(b,C){return this._transformState.needTransform=!1,g.prototype.push.call(this,b,C)},x.prototype._transform=function(b,C,E){E(new f("_transform()"))},x.prototype._write=function(b,C,E){var M=this._transformState;if(M.writecb=E,M.writechunk=b,M.writeencoding=C,!M.transforming){var A=this._readableState;(M.needTransform||A.needReadable||A.length<A.highWaterMark)&&this._read(A.highWaterMark)}},x.prototype._read=function(b){var C=this._transformState;C.writechunk!==null&&!C.transforming?(C.transforming=!0,this._transform(C.writechunk,C.writeencoding,C.afterTransform)):C.needTransform=!0},x.prototype._destroy=function(b,C){g.prototype._destroy.call(this,b,function(E){C(E)})};function _(b,C,E){if(C)return b.emit("error",C);if(E!=null&&b.push(E),b._writableState.length)throw new v;if(b._transformState.transforming)throw new m;return b.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=f;var r=require_stream_transform$1();requireInherits_browser()(f,r);function f(d){if(!(this instanceof f))return new f(d);r.call(this,d)}return f.prototype._transform=function(d,m,v){v(null,d)},_stream_passthrough$1}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var r;function f(E){var M=!1;return function(){M||(M=!0,E.apply(void 0,arguments))}}var d=requireErrorsBrowser().codes,m=d.ERR_MISSING_ARGS,v=d.ERR_STREAM_DESTROYED;function g(E){if(E)throw E}function w(E){return E.setHeader&&typeof E.abort=="function"}function x(E,M,A,T){T=f(T);var L=!1;E.on("close",function(){L=!0}),r===void 0&&(r=requireEndOfStream()),r(E,{readable:M,writable:A},function(N){if(N)return T(N);L=!0,T()});var O=!1;return function(N){if(!L&&!O){if(O=!0,w(E))return E.abort();if(typeof E.destroy=="function")return E.destroy();T(N||new v("pipe"))}}}function S(E){E()}function _(E,M){return E.pipe(M)}function b(E){return!E.length||typeof E[E.length-1]!="function"?g:E.pop()}function C(){for(var E=arguments.length,M=new Array(E),A=0;A<E;A++)M[A]=arguments[A];var T=b(M);if(Array.isArray(M[0])&&(M=M[0]),M.length<2)throw new m("streams");var L,O=M.map(function(N,H){var V=H<M.length-1,X=H>0;return x(N,V,X,function(oe){L||(L=oe),oe&&O.forEach(S),!V&&(O.forEach(S),T(L))})});return M.reduce(_)}return pipeline_1=C,pipeline_1}var hasRequiredReadableBrowser$1;function requireReadableBrowser$1(){return hasRequiredReadableBrowser$1||(hasRequiredReadableBrowser$1=1,(function(r,f){f=r.exports=require_stream_readable$1(),f.Stream=f,f.Readable=f,f.Writable=require_stream_writable$1(),f.Duplex=require_stream_duplex$1(),f.Transform=require_stream_transform$1(),f.PassThrough=require_stream_passthrough$1(),f.finished=requireEndOfStream(),f.pipeline=requirePipeline()})(readableBrowser$1,readableBrowser$1.exports)),readableBrowser$1.exports}var hashBase$2,hasRequiredHashBase$2;function requireHashBase$2(){if(hasRequiredHashBase$2)return hashBase$2;hasRequiredHashBase$2=1;var r=requireSafeBuffer$1().Buffer,f=requireReadableBrowser$1().Transform,d=requireInherits_browser();function m(g,w){if(!r.isBuffer(g)&&typeof g!="string")throw new TypeError(w+" must be a string or a buffer")}function v(g){f.call(this),this._block=r.allocUnsafe(g),this._blockSize=g,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return d(v,f),v.prototype._transform=function(g,w,x){var S=null;try{this.update(g,w)}catch(_){S=_}x(S)},v.prototype._flush=function(g){var w=null;try{this.push(this.digest())}catch(x){w=x}g(w)},v.prototype.update=function(g,w){if(m(g,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(g)||(g=r.from(g,w));for(var x=this._block,S=0;this._blockOffset+g.length-S>=this._blockSize;){for(var _=this._blockOffset;_<this._blockSize;)x[_++]=g[S++];this._update(),this._blockOffset=0}for(;S<g.length;)x[this._blockOffset++]=g[S++];for(var b=0,C=g.length*8;C>0;++b)this._length[b]+=C,C=this._length[b]/4294967296|0,C>0&&(this._length[b]-=4294967296*C);return this},v.prototype._update=function(){throw new Error("_update is not implemented")},v.prototype.digest=function(g){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var w=this._digest();g!==void 0&&(w=w.toString(g)),this._block.fill(0),this._blockOffset=0;for(var x=0;x<4;++x)this._length[x]=0;return w},v.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$2=v,hashBase$2}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var r=requireInherits_browser(),f=requireHashBase$2(),d=requireSafeBuffer$1().Buffer,m=new Array(16);function v(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}r(v,f),v.prototype._update=function(){for(var b=m,C=0;C<16;++C)b[C]=this._block.readInt32LE(C*4);var E=this._a,M=this._b,A=this._c,T=this._d;E=w(E,M,A,T,b[0],3614090360,7),T=w(T,E,M,A,b[1],3905402710,12),A=w(A,T,E,M,b[2],606105819,17),M=w(M,A,T,E,b[3],3250441966,22),E=w(E,M,A,T,b[4],4118548399,7),T=w(T,E,M,A,b[5],1200080426,12),A=w(A,T,E,M,b[6],2821735955,17),M=w(M,A,T,E,b[7],4249261313,22),E=w(E,M,A,T,b[8],1770035416,7),T=w(T,E,M,A,b[9],2336552879,12),A=w(A,T,E,M,b[10],4294925233,17),M=w(M,A,T,E,b[11],2304563134,22),E=w(E,M,A,T,b[12],1804603682,7),T=w(T,E,M,A,b[13],4254626195,12),A=w(A,T,E,M,b[14],2792965006,17),M=w(M,A,T,E,b[15],1236535329,22),E=x(E,M,A,T,b[1],4129170786,5),T=x(T,E,M,A,b[6],3225465664,9),A=x(A,T,E,M,b[11],643717713,14),M=x(M,A,T,E,b[0],3921069994,20),E=x(E,M,A,T,b[5],3593408605,5),T=x(T,E,M,A,b[10],38016083,9),A=x(A,T,E,M,b[15],3634488961,14),M=x(M,A,T,E,b[4],3889429448,20),E=x(E,M,A,T,b[9],568446438,5),T=x(T,E,M,A,b[14],3275163606,9),A=x(A,T,E,M,b[3],4107603335,14),M=x(M,A,T,E,b[8],1163531501,20),E=x(E,M,A,T,b[13],2850285829,5),T=x(T,E,M,A,b[2],4243563512,9),A=x(A,T,E,M,b[7],1735328473,14),M=x(M,A,T,E,b[12],2368359562,20),E=S(E,M,A,T,b[5],4294588738,4),T=S(T,E,M,A,b[8],2272392833,11),A=S(A,T,E,M,b[11],1839030562,16),M=S(M,A,T,E,b[14],4259657740,23),E=S(E,M,A,T,b[1],2763975236,4),T=S(T,E,M,A,b[4],1272893353,11),A=S(A,T,E,M,b[7],4139469664,16),M=S(M,A,T,E,b[10],3200236656,23),E=S(E,M,A,T,b[13],681279174,4),T=S(T,E,M,A,b[0],3936430074,11),A=S(A,T,E,M,b[3],3572445317,16),M=S(M,A,T,E,b[6],76029189,23),E=S(E,M,A,T,b[9],3654602809,4),T=S(T,E,M,A,b[12],3873151461,11),A=S(A,T,E,M,b[15],530742520,16),M=S(M,A,T,E,b[2],3299628645,23),E=_(E,M,A,T,b[0],4096336452,6),T=_(T,E,M,A,b[7],1126891415,10),A=_(A,T,E,M,b[14],2878612391,15),M=_(M,A,T,E,b[5],4237533241,21),E=_(E,M,A,T,b[12],1700485571,6),T=_(T,E,M,A,b[3],2399980690,10),A=_(A,T,E,M,b[10],4293915773,15),M=_(M,A,T,E,b[1],2240044497,21),E=_(E,M,A,T,b[8],1873313359,6),T=_(T,E,M,A,b[15],4264355552,10),A=_(A,T,E,M,b[6],2734768916,15),M=_(M,A,T,E,b[13],1309151649,21),E=_(E,M,A,T,b[4],4149444226,6),T=_(T,E,M,A,b[11],3174756917,10),A=_(A,T,E,M,b[2],718787259,15),M=_(M,A,T,E,b[9],3951481745,21),this._a=this._a+E|0,this._b=this._b+M|0,this._c=this._c+A|0,this._d=this._d+T|0},v.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 b=d.allocUnsafe(16);return b.writeInt32LE(this._a,0),b.writeInt32LE(this._b,4),b.writeInt32LE(this._c,8),b.writeInt32LE(this._d,12),b};function g(b,C){return b<<C|b>>>32-C}function w(b,C,E,M,A,T,L){return g(b+(C&E|~C&M)+A+T|0,L)+C|0}function x(b,C,E,M,A,T,L){return g(b+(C&M|E&~M)+A+T|0,L)+C|0}function S(b,C,E,M,A,T,L){return g(b+(C^E^M)+A+T|0,L)+C|0}function _(b,C,E,M,A,T,L){return g(b+(E^(C|~M))+A+T|0,L)+C|0}return md5_js=v,md5_js}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var r=requireSafeBuffer$1().Buffer,f=requireReadableBrowser$1().Transform,d=requireInherits_browser();function m(g,w){if(!r.isBuffer(g)&&typeof g!="string")throw new TypeError(w+" must be a string or a buffer")}function v(g){f.call(this),this._block=r.allocUnsafe(g),this._blockSize=g,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return d(v,f),v.prototype._transform=function(g,w,x){var S=null;try{this.update(g,w)}catch(_){S=_}x(S)},v.prototype._flush=function(g){var w=null;try{this.push(this.digest())}catch(x){w=x}g(w)},v.prototype.update=function(g,w){if(m(g,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(g)||(g=r.from(g,w));for(var x=this._block,S=0;this._blockOffset+g.length-S>=this._blockSize;){for(var _=this._blockOffset;_<this._blockSize;)x[_++]=g[S++];this._update(),this._blockOffset=0}for(;S<g.length;)x[this._blockOffset++]=g[S++];for(var b=0,C=g.length*8;C>0;++b)this._length[b]+=C,C=this._length[b]/4294967296|0,C>0&&(this._length[b]-=4294967296*C);return this},v.prototype._update=function(){throw new Error("_update is not implemented")},v.prototype.digest=function(g){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var w=this._digest();g!==void 0&&(w=w.toString(g)),this._block.fill(0),this._blockOffset=0;for(var x=0;x<4;++x)this._length[x]=0;return w},v.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=v,hashBase$1}var ripemd160$1,hasRequiredRipemd160$1;function requireRipemd160$1(){if(hasRequiredRipemd160$1)return ripemd160$1;hasRequiredRipemd160$1=1;var r=requireDist().Buffer,f=requireInherits_browser(),d=requireHashBase$1(),m=new Array(16),v=[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],g=[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],w=[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],x=[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],S=[0,1518500249,1859775393,2400959708,2840853838],_=[1352829926,1548603684,1836072691,2053994217,0];function b(){d.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}f(b,d),b.prototype._update=function(){for(var O=m,N=0;N<16;++N)O[N]=this._block.readInt32LE(N*4);for(var H=this._a|0,V=this._b|0,X=this._c|0,oe=this._d|0,se=this._e|0,de=this._a|0,he=this._b|0,we=this._c|0,te=this._d|0,k=this._e|0,q=0;q<80;q+=1){var y,B;q<16?(y=E(H,V,X,oe,se,O[v[q]],S[0],w[q]),B=L(de,he,we,te,k,O[g[q]],_[0],x[q])):q<32?(y=M(H,V,X,oe,se,O[v[q]],S[1],w[q]),B=T(de,he,we,te,k,O[g[q]],_[1],x[q])):q<48?(y=A(H,V,X,oe,se,O[v[q]],S[2],w[q]),B=A(de,he,we,te,k,O[g[q]],_[2],x[q])):q<64?(y=T(H,V,X,oe,se,O[v[q]],S[3],w[q]),B=M(de,he,we,te,k,O[g[q]],_[3],x[q])):(y=L(H,V,X,oe,se,O[v[q]],S[4],w[q]),B=E(de,he,we,te,k,O[g[q]],_[4],x[q])),H=se,se=oe,oe=C(X,10),X=V,V=y,de=k,k=te,te=C(we,10),we=he,he=B}var $=this._b+X+te|0;this._b=this._c+oe+k|0,this._c=this._d+se+de|0,this._d=this._e+H+he|0,this._e=this._a+V+we|0,this._a=$},b.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 O=r.alloc?r.alloc(20):new r(20);return O.writeInt32LE(this._a,0),O.writeInt32LE(this._b,4),O.writeInt32LE(this._c,8),O.writeInt32LE(this._d,12),O.writeInt32LE(this._e,16),O};function C(O,N){return O<<N|O>>>32-N}function E(O,N,H,V,X,oe,se,de){return C(O+(N^H^V)+oe+se|0,de)+X|0}function M(O,N,H,V,X,oe,se,de){return C(O+(N&H|~N&V)+oe+se|0,de)+X|0}function A(O,N,H,V,X,oe,se,de){return C(O+((N|~H)^V)+oe+se|0,de)+X|0}function T(O,N,H,V,X,oe,se,de){return C(O+(N&V|H&~V)+oe+se|0,de)+X|0}function L(O,N,H,V,X,oe,se,de){return C(O+(N^(H|~V))+oe+se|0,de)+X|0}return ripemd160$1=b,ripemd160$1}var sha_js={exports:{}},isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var r={}.toString;return isarray$1=Array.isArray||function(f){return r.call(f)=="[object Array]"},isarray$1}var typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var r=requireType(),f=requireCallBound(),d=f("TypedArray.prototype.buffer",!0),m=requireIsTypedArray();return typedArrayBuffer=d||function(g){if(!m(g))throw new r("Not a Typed Array");return g.buffer},typedArrayBuffer}var toBuffer,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer;hasRequiredToBuffer$1=1;var r=requireSafeBuffer$1().Buffer,f=requireIsarray$1(),d=requireTypedArrayBuffer(),m=ArrayBuffer.isView||function(S){try{return d(S),!0}catch{return!1}},v=typeof Uint8Array<"u",g=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",w=g&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);return toBuffer=function(S,_){if(S instanceof r)return S;if(typeof S=="string")return r.from(S,_);if(g&&m(S)){if(S.byteLength===0)return r.alloc(0);if(w){var b=r.from(S.buffer,S.byteOffset,S.byteLength);if(b.byteLength===S.byteLength)return b}var C=S instanceof Uint8Array?S:new Uint8Array(S.buffer,S.byteOffset,S.byteLength),E=r.from(C);if(E.length===S.byteLength)return E}if(v&&S instanceof Uint8Array)return r.from(S);var M=f(S);if(M)for(var A=0;A<S.length;A+=1){var T=S[A];if(typeof T!="number"||T<0||T>255||~~T!==T)throw new RangeError("Array items must be numbers in the range 0-255.")}if(M||r.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S))return r.from(S);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer}var hash$1,hasRequiredHash$1;function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var r=requireSafeBuffer$1().Buffer,f=requireToBuffer$1();function d(m,v){this._block=r.alloc(m),this._finalSize=v,this._blockSize=m,this._len=0}return d.prototype.update=function(m,v){m=f(m,v||"utf8");for(var g=this._block,w=this._blockSize,x=m.length,S=this._len,_=0;_<x;){for(var b=S%w,C=Math.min(x-_,w-b),E=0;E<C;E++)g[b+E]=m[_+E];S+=C,_+=C,S%w===0&&this._update(g)}return this._len+=x,this},d.prototype.digest=function(m){var v=this._len%this._blockSize;this._block[v]=128,this._block.fill(0,v+1),v>=this._finalSize&&(this._update(this._block),this._block.fill(0));var g=this._len*8;if(g<=4294967295)this._block.writeUInt32BE(g,this._blockSize-4);else{var w=(g&4294967295)>>>0,x=(g-w)/4294967296;this._block.writeUInt32BE(x,this._blockSize-8),this._block.writeUInt32BE(w,this._blockSize-4)}this._update(this._block);var S=this._hash();return m?S.toString(m):S},d.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=d,hash$1}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[1518500249,1859775393,-1894007588,-899497514],v=new Array(80);function g(){this.init(),this._w=v,f.call(this,64,56)}r(g,f),g.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function w(_){return _<<5|_>>>27}function x(_){return _<<30|_>>>2}function S(_,b,C,E){return _===0?b&C|~b&E:_===2?b&C|b&E|C&E:b^C^E}return g.prototype._update=function(_){for(var b=this._w,C=this._a|0,E=this._b|0,M=this._c|0,A=this._d|0,T=this._e|0,L=0;L<16;++L)b[L]=_.readInt32BE(L*4);for(;L<80;++L)b[L]=b[L-3]^b[L-8]^b[L-14]^b[L-16];for(var O=0;O<80;++O){var N=~~(O/20),H=w(C)+S(N,E,M,A)+T+b[O]+m[N]|0;T=A,A=M,M=x(E),E=C,C=H}this._a=C+this._a|0,this._b=E+this._b|0,this._c=M+this._c|0,this._d=A+this._d|0,this._e=T+this._e|0},g.prototype._hash=function(){var _=d.allocUnsafe(20);return _.writeInt32BE(this._a|0,0),_.writeInt32BE(this._b|0,4),_.writeInt32BE(this._c|0,8),_.writeInt32BE(this._d|0,12),_.writeInt32BE(this._e|0,16),_},sha$1=g,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[1518500249,1859775393,-1894007588,-899497514],v=new Array(80);function g(){this.init(),this._w=v,f.call(this,64,56)}r(g,f),g.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function w(b){return b<<1|b>>>31}function x(b){return b<<5|b>>>27}function S(b){return b<<30|b>>>2}function _(b,C,E,M){return b===0?C&E|~C&M:b===2?C&E|C&M|E&M:C^E^M}return g.prototype._update=function(b){for(var C=this._w,E=this._a|0,M=this._b|0,A=this._c|0,T=this._d|0,L=this._e|0,O=0;O<16;++O)C[O]=b.readInt32BE(O*4);for(;O<80;++O)C[O]=w(C[O-3]^C[O-8]^C[O-14]^C[O-16]);for(var N=0;N<80;++N){var H=~~(N/20),V=x(E)+_(H,M,A,T)+L+C[N]+m[H]|0;L=T,T=A,A=S(M),M=E,E=V}this._a=E+this._a|0,this._b=M+this._b|0,this._c=A+this._c|0,this._d=T+this._d|0,this._e=L+this._e|0},g.prototype._hash=function(){var b=d.allocUnsafe(20);return b.writeInt32BE(this._a|0,0),b.writeInt32BE(this._b|0,4),b.writeInt32BE(this._c|0,8),b.writeInt32BE(this._d|0,12),b.writeInt32BE(this._e|0,16),b},sha1=g,sha1}var sha256$1,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[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],v=new Array(64);function g(){this.init(),this._w=v,f.call(this,64,56)}r(g,f),g.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 w(E,M,A){return A^E&(M^A)}function x(E,M,A){return E&M|A&(E|M)}function S(E){return(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10)}function _(E){return(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7)}function b(E){return(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3}function C(E){return(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10}return g.prototype._update=function(E){for(var M=this._w,A=this._a|0,T=this._b|0,L=this._c|0,O=this._d|0,N=this._e|0,H=this._f|0,V=this._g|0,X=this._h|0,oe=0;oe<16;++oe)M[oe]=E.readInt32BE(oe*4);for(;oe<64;++oe)M[oe]=C(M[oe-2])+M[oe-7]+b(M[oe-15])+M[oe-16]|0;for(var se=0;se<64;++se){var de=X+_(N)+w(N,H,V)+m[se]+M[se]|0,he=S(A)+x(A,T,L)|0;X=V,V=H,H=N,N=O+de|0,O=L,L=T,T=A,A=de+he|0}this._a=A+this._a|0,this._b=T+this._b|0,this._c=L+this._c|0,this._d=O+this._d|0,this._e=N+this._e|0,this._f=H+this._f|0,this._g=V+this._g|0,this._h=X+this._h|0},g.prototype._hash=function(){var E=d.allocUnsafe(32);return E.writeInt32BE(this._a,0),E.writeInt32BE(this._b,4),E.writeInt32BE(this._c,8),E.writeInt32BE(this._d,12),E.writeInt32BE(this._e,16),E.writeInt32BE(this._f,20),E.writeInt32BE(this._g,24),E.writeInt32BE(this._h,28),E},sha256$1=g,sha256$1}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var r=requireInherits_browser(),f=requireSha256(),d=requireHash$1(),m=requireSafeBuffer$1().Buffer,v=new Array(64);function g(){this.init(),this._w=v,d.call(this,64,56)}return r(g,f),g.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},g.prototype._hash=function(){var w=m.allocUnsafe(28);return w.writeInt32BE(this._a,0),w.writeInt32BE(this._b,4),w.writeInt32BE(this._c,8),w.writeInt32BE(this._d,12),w.writeInt32BE(this._e,16),w.writeInt32BE(this._f,20),w.writeInt32BE(this._g,24),w},sha224$1=g,sha224$1}var sha512$1,hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var r=requireInherits_browser(),f=requireHash$1(),d=requireSafeBuffer$1().Buffer,m=[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],v=new Array(160);function g(){this.init(),this._w=v,f.call(this,128,112)}r(g,f),g.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 w(T,L,O){return O^T&(L^O)}function x(T,L,O){return T&L|O&(T|L)}function S(T,L){return(T>>>28|L<<4)^(L>>>2|T<<30)^(L>>>7|T<<25)}function _(T,L){return(T>>>14|L<<18)^(T>>>18|L<<14)^(L>>>9|T<<23)}function b(T,L){return(T>>>1|L<<31)^(T>>>8|L<<24)^T>>>7}function C(T,L){return(T>>>1|L<<31)^(T>>>8|L<<24)^(T>>>7|L<<25)}function E(T,L){return(T>>>19|L<<13)^(L>>>29|T<<3)^T>>>6}function M(T,L){return(T>>>19|L<<13)^(L>>>29|T<<3)^(T>>>6|L<<26)}function A(T,L){return T>>>0<L>>>0?1:0}return g.prototype._update=function(T){for(var L=this._w,O=this._ah|0,N=this._bh|0,H=this._ch|0,V=this._dh|0,X=this._eh|0,oe=this._fh|0,se=this._gh|0,de=this._hh|0,he=this._al|0,we=this._bl|0,te=this._cl|0,k=this._dl|0,q=this._el|0,y=this._fl|0,B=this._gl|0,$=this._hl|0,I=0;I<32;I+=2)L[I]=T.readInt32BE(I*4),L[I+1]=T.readInt32BE(I*4+4);for(;I<160;I+=2){var U=L[I-30],j=L[I-30+1],D=b(U,j),W=C(j,U);U=L[I-4],j=L[I-4+1];var R=E(U,j),z=M(j,U),ye=L[I-14],Ce=L[I-14+1],me=L[I-32],ie=L[I-32+1],ee=W+Ce|0,pe=D+ye+A(ee,W)|0;ee=ee+z|0,pe=pe+R+A(ee,z)|0,ee=ee+ie|0,pe=pe+me+A(ee,ie)|0,L[I]=pe,L[I+1]=ee}for(var be=0;be<160;be+=2){pe=L[be],ee=L[be+1];var ae=x(O,N,H),ne=x(he,we,te),Se=S(O,he),qe=S(he,O),Ie=_(X,q),Oe=_(q,X),Fe=m[be],De=m[be+1],$e=w(X,oe,se),je=w(q,y,B),Ye=$+Oe|0,st=de+Ie+A(Ye,$)|0;Ye=Ye+je|0,st=st+$e+A(Ye,je)|0,Ye=Ye+De|0,st=st+Fe+A(Ye,De)|0,Ye=Ye+ee|0,st=st+pe+A(Ye,ee)|0;var Je=qe+ne|0,Ge=Se+ae+A(Je,qe)|0;de=se,$=B,se=oe,B=y,oe=X,y=q,q=k+Ye|0,X=V+st+A(q,k)|0,V=H,k=te,H=N,te=we,N=O,we=he,he=Ye+Je|0,O=st+Ge+A(he,Ye)|0}this._al=this._al+he|0,this._bl=this._bl+we|0,this._cl=this._cl+te|0,this._dl=this._dl+k|0,this._el=this._el+q|0,this._fl=this._fl+y|0,this._gl=this._gl+B|0,this._hl=this._hl+$|0,this._ah=this._ah+O+A(this._al,he)|0,this._bh=this._bh+N+A(this._bl,we)|0,this._ch=this._ch+H+A(this._cl,te)|0,this._dh=this._dh+V+A(this._dl,k)|0,this._eh=this._eh+X+A(this._el,q)|0,this._fh=this._fh+oe+A(this._fl,y)|0,this._gh=this._gh+se+A(this._gl,B)|0,this._hh=this._hh+de+A(this._hl,$)|0},g.prototype._hash=function(){var T=d.allocUnsafe(64);function L(O,N,H){T.writeInt32BE(O,H),T.writeInt32BE(N,H+4)}return L(this._ah,this._al,0),L(this._bh,this._bl,8),L(this._ch,this._cl,16),L(this._dh,this._dl,24),L(this._eh,this._el,32),L(this._fh,this._fl,40),L(this._gh,this._gl,48),L(this._hh,this._hl,56),T},sha512$1=g,sha512$1}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var r=requireInherits_browser(),f=requireSha512(),d=requireHash$1(),m=requireSafeBuffer$1().Buffer,v=new Array(160);function g(){this.init(),this._w=v,d.call(this,128,112)}return r(g,f),g.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},g.prototype._hash=function(){var w=m.allocUnsafe(48);function x(S,_,b){w.writeInt32BE(S,b),w.writeInt32BE(_,b+4)}return x(this._ah,this._al,0),x(this._bh,this._bl,8),x(this._ch,this._cl,16),x(this._dh,this._dl,24),x(this._eh,this._el,32),x(this._fh,this._fl,40),w},sha384$1=g,sha384$1}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(function(r){r.exports=function(d){var m=d.toLowerCase(),v=r.exports[m];if(!v)throw new Error(m+" is not supported (we accept pull requests)");return new v},r.exports.sha=requireSha$1(),r.exports.sha1=requireSha1(),r.exports.sha224=requireSha224(),r.exports.sha256=requireSha256(),r.exports.sha384=requireSha384(),r.exports.sha512=requireSha512()})(sha_js)),sha_js.exports}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=d;var r=requireEvents().EventEmitter,f=requireInherits_browser();f(d,r),d.Readable=require_stream_readable$1(),d.Writable=require_stream_writable$1(),d.Duplex=require_stream_duplex$1(),d.Transform=require_stream_transform$1(),d.PassThrough=require_stream_passthrough$1(),d.finished=requireEndOfStream(),d.pipeline=requirePipeline(),d.Stream=d;function d(){r.call(this)}return d.prototype.pipe=function(m,v){var g=this;function w(M){m.writable&&m.write(M)===!1&&g.pause&&g.pause()}g.on("data",w);function x(){g.readable&&g.resume&&g.resume()}m.on("drain",x),!m._isStdio&&(!v||v.end!==!1)&&(g.on("end",_),g.on("close",b));var S=!1;function _(){S||(S=!0,m.end())}function b(){S||(S=!0,typeof m.destroy=="function"&&m.destroy())}function C(M){if(E(),r.listenerCount(this,"error")===0)throw M}g.on("error",C),m.on("error",C);function E(){g.removeListener("data",w),m.removeListener("drain",x),g.removeListener("end",_),g.removeListener("close",b),g.removeListener("error",C),m.removeListener("error",C),g.removeListener("end",E),g.removeListener("close",E),m.removeListener("close",E)}return g.on("end",E),g.on("close",E),m.on("close",E),m.emit("pipe",g),m},streamBrowserify}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var r=requireSafeBuffer$1().Buffer,f=requireStreamBrowserify().Transform,d=requireString_decoder().StringDecoder,m=requireInherits_browser();function v(S){f.call(this),this.hashMode=typeof S=="string",this.hashMode?this[S]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}m(v,f);var g=typeof Uint8Array<"u",w=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);function x(S,_){if(S instanceof r)return S;if(typeof S=="string")return r.from(S,_);if(w&&ArrayBuffer.isView(S)){if(S.byteLength===0)return r.alloc(0);var b=r.from(S.buffer,S.byteOffset,S.byteLength);if(b.byteLength===S.byteLength)return b}if(g&&S instanceof Uint8Array||r.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer=="function"&&S.constructor.isBuffer(S))return r.from(S);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return v.prototype.update=function(S,_,b){var C=x(S,_),E=this._update(C);return this.hashMode?this:(b&&(E=this._toString(E,b)),E)},v.prototype.setAutoPadding=function(){},v.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},v.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},v.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},v.prototype._transform=function(S,_,b){var C;try{this.hashMode?this._update(S):this.push(this._update(S))}catch(E){C=E}finally{b(C)}},v.prototype._flush=function(S){var _;try{this.push(this.__final())}catch(b){_=b}S(_)},v.prototype._finalOrDigest=function(S){var _=this.__final()||r.alloc(0);return S&&(_=this._toString(_,S,!0)),_},v.prototype._toString=function(S,_,b){if(this._decoder||(this._decoder=new d(_),this._encoding=_),this._encoding!==_)throw new Error("can’t switch encodings");var C=this._decoder.write(S);return b&&(C+=this._decoder.end()),C},cipherBase=v,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var r=requireInherits_browser(),f=requireMd5_js(),d=requireRipemd160$1(),m=requireSha_js(),v=requireCipherBase();function g(w){v.call(this,"digest"),this._hash=w}return r(g,v),g.prototype._update=function(w){this._hash.update(w)},g.prototype._final=function(){return this._hash.digest()},browser$9=function(x){return x=x.toLowerCase(),x==="md5"?new f:x==="rmd160"||x==="ripemd160"?new d:new g(m(x))},browser$9}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var r=requireInherits_browser(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),m=f.alloc(128),v=64;function g(w,x){d.call(this,"digest"),typeof x=="string"&&(x=f.from(x)),this._alg=w,this._key=x,x.length>v?x=w(x):x.length<v&&(x=f.concat([x,m],v));for(var S=this._ipad=f.allocUnsafe(v),_=this._opad=f.allocUnsafe(v),b=0;b<v;b++)S[b]=x[b]^54,_[b]=x[b]^92;this._hash=[S]}return r(g,d),g.prototype._update=function(w){this._hash.push(w)},g.prototype._final=function(){var w=this._alg(f.concat(this._hash));return this._alg(f.concat([this._opad,w]))},legacy=g,legacy}var md5$1,hasRequiredMd5$1;function requireMd5$1(){if(hasRequiredMd5$1)return md5$1;hasRequiredMd5$1=1;var r=requireMd5_js();return md5$1=function(f){return new r().update(f).digest()},md5$1}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var r=requireInherits_browser(),f=requireLegacy(),d=requireCipherBase(),m=requireSafeBuffer$1().Buffer,v=requireMd5$1(),g=requireRipemd160$1(),w=requireSha_js(),x=m.alloc(128);function S(_,b){d.call(this,"digest"),typeof b=="string"&&(b=m.from(b));var C=_==="sha512"||_==="sha384"?128:64;if(this._alg=_,this._key=b,b.length>C){var E=_==="rmd160"?new g:w(_);b=E.update(b).digest()}else b.length<C&&(b=m.concat([b,x],C));for(var M=this._ipad=m.allocUnsafe(C),A=this._opad=m.allocUnsafe(C),T=0;T<C;T++)M[T]=b[T]^54,A[T]=b[T]^92;this._hash=_==="rmd160"?new g:w(_),this._hash.update(M)}return r(S,d),S.prototype._update=function(_){this._hash.update(_)},S.prototype._final=function(){var _=this._hash.digest(),b=this._alg==="rmd160"?new g:w(this._alg);return b.update(this._opad).update(_).digest()},browser$8=function(b,C){return b=b.toLowerCase(),b==="rmd160"||b==="ripemd160"?new S("rmd160",C):b==="md5"?new f(v,C):new S(b,C)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},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={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"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,sha224,sha384,sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"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,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var r=Math.pow(2,30)-1;return precondition=function(f,d){if(typeof f!="number")throw new TypeError("Iterations not a number");if(f<0)throw new TypeError("Bad iterations");if(typeof d!="number")throw new TypeError("Key length not a number");if(d<0||d>r||d!==d)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var r;if(commonjsGlobal.process&&commonjsGlobal.process.browser)r="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var f=parseInt(process$1.version.split(".")[0].slice(1),10);r=f>=6?"utf-8":"binary"}else r="utf-8";return defaultEncoding_1=r,defaultEncoding_1}var makeHash,hasRequiredMakeHash;function requireMakeHash(){if(hasRequiredMakeHash)return makeHash;hasRequiredMakeHash=1;var r=4,f=new Buffer(r);f.fill(0);var d=8,m=16;function v(g){if(g.length%r!==0){var w=g.length+(r-g.length%r);g=Buffer.concat([g,f],w)}for(var x=new Array(g.length>>>2),S=0,_=0;S<g.length;S+=r,_++)x[_]=g.readInt32LE(S);return x}return makeHash=function(w,x){var S=x(v(w),w.length*d);w=new Buffer(m);for(var _=0;_<S.length;_++)w.writeInt32LE(S[_],_<<2,!0);return w},makeHash}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var r=requireMakeHash();function f(_,b){_[b>>5]|=128<<b%32,_[(b+64>>>9<<4)+14]=b;for(var C=1732584193,E=-271733879,M=-1732584194,A=271733878,T=0;T<_.length;T+=16){var L=C,O=E,N=M,H=A;C=m(C,E,M,A,_[T+0],7,-680876936),A=m(A,C,E,M,_[T+1],12,-389564586),M=m(M,A,C,E,_[T+2],17,606105819),E=m(E,M,A,C,_[T+3],22,-1044525330),C=m(C,E,M,A,_[T+4],7,-176418897),A=m(A,C,E,M,_[T+5],12,1200080426),M=m(M,A,C,E,_[T+6],17,-1473231341),E=m(E,M,A,C,_[T+7],22,-45705983),C=m(C,E,M,A,_[T+8],7,1770035416),A=m(A,C,E,M,_[T+9],12,-1958414417),M=m(M,A,C,E,_[T+10],17,-42063),E=m(E,M,A,C,_[T+11],22,-1990404162),C=m(C,E,M,A,_[T+12],7,1804603682),A=m(A,C,E,M,_[T+13],12,-40341101),M=m(M,A,C,E,_[T+14],17,-1502002290),E=m(E,M,A,C,_[T+15],22,1236535329),C=v(C,E,M,A,_[T+1],5,-165796510),A=v(A,C,E,M,_[T+6],9,-1069501632),M=v(M,A,C,E,_[T+11],14,643717713),E=v(E,M,A,C,_[T+0],20,-373897302),C=v(C,E,M,A,_[T+5],5,-701558691),A=v(A,C,E,M,_[T+10],9,38016083),M=v(M,A,C,E,_[T+15],14,-660478335),E=v(E,M,A,C,_[T+4],20,-405537848),C=v(C,E,M,A,_[T+9],5,568446438),A=v(A,C,E,M,_[T+14],9,-1019803690),M=v(M,A,C,E,_[T+3],14,-187363961),E=v(E,M,A,C,_[T+8],20,1163531501),C=v(C,E,M,A,_[T+13],5,-1444681467),A=v(A,C,E,M,_[T+2],9,-51403784),M=v(M,A,C,E,_[T+7],14,1735328473),E=v(E,M,A,C,_[T+12],20,-1926607734),C=g(C,E,M,A,_[T+5],4,-378558),A=g(A,C,E,M,_[T+8],11,-2022574463),M=g(M,A,C,E,_[T+11],16,1839030562),E=g(E,M,A,C,_[T+14],23,-35309556),C=g(C,E,M,A,_[T+1],4,-1530992060),A=g(A,C,E,M,_[T+4],11,1272893353),M=g(M,A,C,E,_[T+7],16,-155497632),E=g(E,M,A,C,_[T+10],23,-1094730640),C=g(C,E,M,A,_[T+13],4,681279174),A=g(A,C,E,M,_[T+0],11,-358537222),M=g(M,A,C,E,_[T+3],16,-722521979),E=g(E,M,A,C,_[T+6],23,76029189),C=g(C,E,M,A,_[T+9],4,-640364487),A=g(A,C,E,M,_[T+12],11,-421815835),M=g(M,A,C,E,_[T+15],16,530742520),E=g(E,M,A,C,_[T+2],23,-995338651),C=w(C,E,M,A,_[T+0],6,-198630844),A=w(A,C,E,M,_[T+7],10,1126891415),M=w(M,A,C,E,_[T+14],15,-1416354905),E=w(E,M,A,C,_[T+5],21,-57434055),C=w(C,E,M,A,_[T+12],6,1700485571),A=w(A,C,E,M,_[T+3],10,-1894986606),M=w(M,A,C,E,_[T+10],15,-1051523),E=w(E,M,A,C,_[T+1],21,-2054922799),C=w(C,E,M,A,_[T+8],6,1873313359),A=w(A,C,E,M,_[T+15],10,-30611744),M=w(M,A,C,E,_[T+6],15,-1560198380),E=w(E,M,A,C,_[T+13],21,1309151649),C=w(C,E,M,A,_[T+4],6,-145523070),A=w(A,C,E,M,_[T+11],10,-1120210379),M=w(M,A,C,E,_[T+2],15,718787259),E=w(E,M,A,C,_[T+9],21,-343485551),C=x(C,L),E=x(E,O),M=x(M,N),A=x(A,H)}return[C,E,M,A]}function d(_,b,C,E,M,A){return x(S(x(x(b,_),x(E,A)),M),C)}function m(_,b,C,E,M,A,T){return d(b&C|~b&E,_,b,M,A,T)}function v(_,b,C,E,M,A,T){return d(b&E|C&~E,_,b,M,A,T)}function g(_,b,C,E,M,A,T){return d(b^C^E,_,b,M,A,T)}function w(_,b,C,E,M,A,T){return d(C^(b|~E),_,b,M,A,T)}function x(_,b){var C=(_&65535)+(b&65535),E=(_>>16)+(b>>16)+(C>>16);return E<<16|C&65535}function S(_,b){return _<<b|_>>>32-b}return md5=function(b){return r(b,f)},md5}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var r=requireStreamBrowserify().Transform,f=requireInherits_browser();function d(m){r.call(this),this._block=new Buffer(m),this._blockSize=m,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return f(d,r),d.prototype._transform=function(m,v,g){var w=null;try{v!=="buffer"&&(m=new Buffer(m,v)),this.update(m)}catch(x){w=x}g(w)},d.prototype._flush=function(m){var v=null;try{this.push(this._digest())}catch(g){v=g}m(v)},d.prototype.update=function(m,v){if(!Buffer.isBuffer(m)&&typeof m!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(m)||(m=new Buffer(m,v||"binary"));for(var g=this._block,w=0;this._blockOffset+m.length-w>=this._blockSize;){for(var x=this._blockOffset;x<this._blockSize;)g[x++]=m[w++];this._update(),this._blockOffset=0}for(;w<m.length;)g[this._blockOffset++]=m[w++];for(var S=0,_=m.length*8;_>0;++S)this._length[S]+=_,_=this._length[S]/4294967296|0,_>0&&(this._length[S]-=4294967296*_);return this},d.prototype._update=function(m){throw new Error("_update is not implemented")},d.prototype.digest=function(m){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var v=this._digest();return m!==void 0&&(v=v.toString(m)),v},d.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=d,hashBase}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var r=requireInherits_browser(),f=requireHashBase();function d(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}r(d,f),d.prototype._update=function(){for(var _=new Array(16),b=0;b<16;++b)_[b]=this._block.readInt32LE(b*4);var C=this._a,E=this._b,M=this._c,A=this._d,T=this._e;C=v(C,E,M,A,T,_[0],0,11),M=m(M,10),T=v(T,C,E,M,A,_[1],0,14),E=m(E,10),A=v(A,T,C,E,M,_[2],0,15),C=m(C,10),M=v(M,A,T,C,E,_[3],0,12),T=m(T,10),E=v(E,M,A,T,C,_[4],0,5),A=m(A,10),C=v(C,E,M,A,T,_[5],0,8),M=m(M,10),T=v(T,C,E,M,A,_[6],0,7),E=m(E,10),A=v(A,T,C,E,M,_[7],0,9),C=m(C,10),M=v(M,A,T,C,E,_[8],0,11),T=m(T,10),E=v(E,M,A,T,C,_[9],0,13),A=m(A,10),C=v(C,E,M,A,T,_[10],0,14),M=m(M,10),T=v(T,C,E,M,A,_[11],0,15),E=m(E,10),A=v(A,T,C,E,M,_[12],0,6),C=m(C,10),M=v(M,A,T,C,E,_[13],0,7),T=m(T,10),E=v(E,M,A,T,C,_[14],0,9),A=m(A,10),C=v(C,E,M,A,T,_[15],0,8),M=m(M,10),T=g(T,C,E,M,A,_[7],1518500249,7),E=m(E,10),A=g(A,T,C,E,M,_[4],1518500249,6),C=m(C,10),M=g(M,A,T,C,E,_[13],1518500249,8),T=m(T,10),E=g(E,M,A,T,C,_[1],1518500249,13),A=m(A,10),C=g(C,E,M,A,T,_[10],1518500249,11),M=m(M,10),T=g(T,C,E,M,A,_[6],1518500249,9),E=m(E,10),A=g(A,T,C,E,M,_[15],1518500249,7),C=m(C,10),M=g(M,A,T,C,E,_[3],1518500249,15),T=m(T,10),E=g(E,M,A,T,C,_[12],1518500249,7),A=m(A,10),C=g(C,E,M,A,T,_[0],1518500249,12),M=m(M,10),T=g(T,C,E,M,A,_[9],1518500249,15),E=m(E,10),A=g(A,T,C,E,M,_[5],1518500249,9),C=m(C,10),M=g(M,A,T,C,E,_[2],1518500249,11),T=m(T,10),E=g(E,M,A,T,C,_[14],1518500249,7),A=m(A,10),C=g(C,E,M,A,T,_[11],1518500249,13),M=m(M,10),T=g(T,C,E,M,A,_[8],1518500249,12),E=m(E,10),A=w(A,T,C,E,M,_[3],1859775393,11),C=m(C,10),M=w(M,A,T,C,E,_[10],1859775393,13),T=m(T,10),E=w(E,M,A,T,C,_[14],1859775393,6),A=m(A,10),C=w(C,E,M,A,T,_[4],1859775393,7),M=m(M,10),T=w(T,C,E,M,A,_[9],1859775393,14),E=m(E,10),A=w(A,T,C,E,M,_[15],1859775393,9),C=m(C,10),M=w(M,A,T,C,E,_[8],1859775393,13),T=m(T,10),E=w(E,M,A,T,C,_[1],1859775393,15),A=m(A,10),C=w(C,E,M,A,T,_[2],1859775393,14),M=m(M,10),T=w(T,C,E,M,A,_[7],1859775393,8),E=m(E,10),A=w(A,T,C,E,M,_[0],1859775393,13),C=m(C,10),M=w(M,A,T,C,E,_[6],1859775393,6),T=m(T,10),E=w(E,M,A,T,C,_[13],1859775393,5),A=m(A,10),C=w(C,E,M,A,T,_[11],1859775393,12),M=m(M,10),T=w(T,C,E,M,A,_[5],1859775393,7),E=m(E,10),A=w(A,T,C,E,M,_[12],1859775393,5),C=m(C,10),M=x(M,A,T,C,E,_[1],2400959708,11),T=m(T,10),E=x(E,M,A,T,C,_[9],2400959708,12),A=m(A,10),C=x(C,E,M,A,T,_[11],2400959708,14),M=m(M,10),T=x(T,C,E,M,A,_[10],2400959708,15),E=m(E,10),A=x(A,T,C,E,M,_[0],2400959708,14),C=m(C,10),M=x(M,A,T,C,E,_[8],2400959708,15),T=m(T,10),E=x(E,M,A,T,C,_[12],2400959708,9),A=m(A,10),C=x(C,E,M,A,T,_[4],2400959708,8),M=m(M,10),T=x(T,C,E,M,A,_[13],2400959708,9),E=m(E,10),A=x(A,T,C,E,M,_[3],2400959708,14),C=m(C,10),M=x(M,A,T,C,E,_[7],2400959708,5),T=m(T,10),E=x(E,M,A,T,C,_[15],2400959708,6),A=m(A,10),C=x(C,E,M,A,T,_[14],2400959708,8),M=m(M,10),T=x(T,C,E,M,A,_[5],2400959708,6),E=m(E,10),A=x(A,T,C,E,M,_[6],2400959708,5),C=m(C,10),M=x(M,A,T,C,E,_[2],2400959708,12),T=m(T,10),E=S(E,M,A,T,C,_[4],2840853838,9),A=m(A,10),C=S(C,E,M,A,T,_[0],2840853838,15),M=m(M,10),T=S(T,C,E,M,A,_[5],2840853838,5),E=m(E,10),A=S(A,T,C,E,M,_[9],2840853838,11),C=m(C,10),M=S(M,A,T,C,E,_[7],2840853838,6),T=m(T,10),E=S(E,M,A,T,C,_[12],2840853838,8),A=m(A,10),C=S(C,E,M,A,T,_[2],2840853838,13),M=m(M,10),T=S(T,C,E,M,A,_[10],2840853838,12),E=m(E,10),A=S(A,T,C,E,M,_[14],2840853838,5),C=m(C,10),M=S(M,A,T,C,E,_[1],2840853838,12),T=m(T,10),E=S(E,M,A,T,C,_[3],2840853838,13),A=m(A,10),C=S(C,E,M,A,T,_[8],2840853838,14),M=m(M,10),T=S(T,C,E,M,A,_[11],2840853838,11),E=m(E,10),A=S(A,T,C,E,M,_[6],2840853838,8),C=m(C,10),M=S(M,A,T,C,E,_[15],2840853838,5),T=m(T,10),E=S(E,M,A,T,C,_[13],2840853838,6),A=m(A,10);var L=this._a,O=this._b,N=this._c,H=this._d,V=this._e;L=S(L,O,N,H,V,_[5],1352829926,8),N=m(N,10),V=S(V,L,O,N,H,_[14],1352829926,9),O=m(O,10),H=S(H,V,L,O,N,_[7],1352829926,9),L=m(L,10),N=S(N,H,V,L,O,_[0],1352829926,11),V=m(V,10),O=S(O,N,H,V,L,_[9],1352829926,13),H=m(H,10),L=S(L,O,N,H,V,_[2],1352829926,15),N=m(N,10),V=S(V,L,O,N,H,_[11],1352829926,15),O=m(O,10),H=S(H,V,L,O,N,_[4],1352829926,5),L=m(L,10),N=S(N,H,V,L,O,_[13],1352829926,7),V=m(V,10),O=S(O,N,H,V,L,_[6],1352829926,7),H=m(H,10),L=S(L,O,N,H,V,_[15],1352829926,8),N=m(N,10),V=S(V,L,O,N,H,_[8],1352829926,11),O=m(O,10),H=S(H,V,L,O,N,_[1],1352829926,14),L=m(L,10),N=S(N,H,V,L,O,_[10],1352829926,14),V=m(V,10),O=S(O,N,H,V,L,_[3],1352829926,12),H=m(H,10),L=S(L,O,N,H,V,_[12],1352829926,6),N=m(N,10),V=x(V,L,O,N,H,_[6],1548603684,9),O=m(O,10),H=x(H,V,L,O,N,_[11],1548603684,13),L=m(L,10),N=x(N,H,V,L,O,_[3],1548603684,15),V=m(V,10),O=x(O,N,H,V,L,_[7],1548603684,7),H=m(H,10),L=x(L,O,N,H,V,_[0],1548603684,12),N=m(N,10),V=x(V,L,O,N,H,_[13],1548603684,8),O=m(O,10),H=x(H,V,L,O,N,_[5],1548603684,9),L=m(L,10),N=x(N,H,V,L,O,_[10],1548603684,11),V=m(V,10),O=x(O,N,H,V,L,_[14],1548603684,7),H=m(H,10),L=x(L,O,N,H,V,_[15],1548603684,7),N=m(N,10),V=x(V,L,O,N,H,_[8],1548603684,12),O=m(O,10),H=x(H,V,L,O,N,_[12],1548603684,7),L=m(L,10),N=x(N,H,V,L,O,_[4],1548603684,6),V=m(V,10),O=x(O,N,H,V,L,_[9],1548603684,15),H=m(H,10),L=x(L,O,N,H,V,_[1],1548603684,13),N=m(N,10),V=x(V,L,O,N,H,_[2],1548603684,11),O=m(O,10),H=w(H,V,L,O,N,_[15],1836072691,9),L=m(L,10),N=w(N,H,V,L,O,_[5],1836072691,7),V=m(V,10),O=w(O,N,H,V,L,_[1],1836072691,15),H=m(H,10),L=w(L,O,N,H,V,_[3],1836072691,11),N=m(N,10),V=w(V,L,O,N,H,_[7],1836072691,8),O=m(O,10),H=w(H,V,L,O,N,_[14],1836072691,6),L=m(L,10),N=w(N,H,V,L,O,_[6],1836072691,6),V=m(V,10),O=w(O,N,H,V,L,_[9],1836072691,14),H=m(H,10),L=w(L,O,N,H,V,_[11],1836072691,12),N=m(N,10),V=w(V,L,O,N,H,_[8],1836072691,13),O=m(O,10),H=w(H,V,L,O,N,_[12],1836072691,5),L=m(L,10),N=w(N,H,V,L,O,_[2],1836072691,14),V=m(V,10),O=w(O,N,H,V,L,_[10],1836072691,13),H=m(H,10),L=w(L,O,N,H,V,_[0],1836072691,13),N=m(N,10),V=w(V,L,O,N,H,_[4],1836072691,7),O=m(O,10),H=w(H,V,L,O,N,_[13],1836072691,5),L=m(L,10),N=g(N,H,V,L,O,_[8],2053994217,15),V=m(V,10),O=g(O,N,H,V,L,_[6],2053994217,5),H=m(H,10),L=g(L,O,N,H,V,_[4],2053994217,8),N=m(N,10),V=g(V,L,O,N,H,_[1],2053994217,11),O=m(O,10),H=g(H,V,L,O,N,_[3],2053994217,14),L=m(L,10),N=g(N,H,V,L,O,_[11],2053994217,14),V=m(V,10),O=g(O,N,H,V,L,_[15],2053994217,6),H=m(H,10),L=g(L,O,N,H,V,_[0],2053994217,14),N=m(N,10),V=g(V,L,O,N,H,_[5],2053994217,6),O=m(O,10),H=g(H,V,L,O,N,_[12],2053994217,9),L=m(L,10),N=g(N,H,V,L,O,_[2],2053994217,12),V=m(V,10),O=g(O,N,H,V,L,_[13],2053994217,9),H=m(H,10),L=g(L,O,N,H,V,_[9],2053994217,12),N=m(N,10),V=g(V,L,O,N,H,_[7],2053994217,5),O=m(O,10),H=g(H,V,L,O,N,_[10],2053994217,15),L=m(L,10),N=g(N,H,V,L,O,_[14],2053994217,8),V=m(V,10),O=v(O,N,H,V,L,_[12],0,8),H=m(H,10),L=v(L,O,N,H,V,_[15],0,5),N=m(N,10),V=v(V,L,O,N,H,_[10],0,12),O=m(O,10),H=v(H,V,L,O,N,_[4],0,9),L=m(L,10),N=v(N,H,V,L,O,_[1],0,12),V=m(V,10),O=v(O,N,H,V,L,_[5],0,5),H=m(H,10),L=v(L,O,N,H,V,_[8],0,14),N=m(N,10),V=v(V,L,O,N,H,_[7],0,6),O=m(O,10),H=v(H,V,L,O,N,_[6],0,8),L=m(L,10),N=v(N,H,V,L,O,_[2],0,13),V=m(V,10),O=v(O,N,H,V,L,_[13],0,6),H=m(H,10),L=v(L,O,N,H,V,_[14],0,5),N=m(N,10),V=v(V,L,O,N,H,_[0],0,15),O=m(O,10),H=v(H,V,L,O,N,_[3],0,13),L=m(L,10),N=v(N,H,V,L,O,_[9],0,11),V=m(V,10),O=v(O,N,H,V,L,_[11],0,11),H=m(H,10);var X=this._b+M+H|0;this._b=this._c+A+V|0,this._c=this._d+T+L|0,this._d=this._e+C+O|0,this._e=this._a+E+N|0,this._a=X},d.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 _=new Buffer(20);return _.writeInt32LE(this._a,0),_.writeInt32LE(this._b,4),_.writeInt32LE(this._c,8),_.writeInt32LE(this._d,12),_.writeInt32LE(this._e,16),_};function m(_,b){return _<<b|_>>>32-b}function v(_,b,C,E,M,A,T,L){return m(_+(b^C^E)+A+T|0,L)+M|0}function g(_,b,C,E,M,A,T,L){return m(_+(b&C|~b&E)+A+T|0,L)+M|0}function w(_,b,C,E,M,A,T,L){return m(_+((b|~C)^E)+A+T|0,L)+M|0}function x(_,b,C,E,M,A,T,L){return m(_+(b&E|C&~E)+A+T|0,L)+M|0}function S(_,b,C,E,M,A,T,L){return m(_+(b^(C|~E))+A+T|0,L)+M|0}return ripemd160=d,ripemd160}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var r=requireSafeBuffer$1().Buffer,f=requireToBuffer$1(),d=typeof Uint8Array<"u",m=d&&typeof ArrayBuffer<"u",v=m&&ArrayBuffer.isView;return toBuffer_1=function(g,w,x){if(typeof g=="string"||r.isBuffer(g)||d&&g instanceof Uint8Array||v&&v(g))return f(g,w);throw new TypeError(x+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var r=requireMd5(),f=requireRipemd160(),d=requireSha_js(),m=requireSafeBuffer$1().Buffer,v=requirePrecondition(),g=requireDefaultEncoding(),w=requireToBuffer(),x=m.alloc(128),S={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},_={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function b(A){return new f().update(A).digest()}function C(A){function T(L){return d(A).update(L).digest()}return A==="rmd160"||A==="ripemd160"?b:A==="md5"?r:T}function E(A,T,L){var O=C(A),N=A==="sha512"||A==="sha384"?128:64;T.length>N?T=O(T):T.length<N&&(T=m.concat([T,x],N));for(var H=m.allocUnsafe(N+S[A]),V=m.allocUnsafe(N+S[A]),X=0;X<N;X++)H[X]=T[X]^54,V[X]=T[X]^92;var oe=m.allocUnsafe(N+L+4);H.copy(oe,0,0,N),this.ipad1=oe,this.ipad2=H,this.opad=V,this.alg=A,this.blocksize=N,this.hash=O,this.size=S[A]}E.prototype.run=function(A,T){A.copy(T,this.blocksize);var L=this.hash(T);return L.copy(this.opad,this.blocksize),this.hash(this.opad)};function M(A,T,L,O,N){v(L,O),A=w(A,g,"Password"),T=w(T,g,"Salt");var H=(N||"sha1").toLowerCase(),V=_[H]||H,X=S[V];if(typeof X!="number"||!X)throw new TypeError("Digest algorithm not supported: "+N);var oe=new E(V,A,T.length),se=m.allocUnsafe(O),de=m.allocUnsafe(T.length+4);T.copy(de,0,0,T.length);for(var he=0,we=X,te=Math.ceil(O/we),k=1;k<=te;k++){de.writeUInt32BE(k,T.length);for(var q=oe.run(de,oe.ipad1),y=q,B=1;B<L;B++){y=oe.run(y,oe.ipad2);for(var $=0;$<we;$++)q[$]^=y[$]}q.copy(se,he),he+=we}return se}return syncBrowser=M,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var r=requireSafeBuffer$1().Buffer,f=requirePrecondition(),d=requireDefaultEncoding(),m=requireSyncBrowser(),v=requireToBuffer(),g,w=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,x={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"},S=[],_;function b(){return _||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?_=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?_=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?_=commonjsGlobal.setImmediate:_=commonjsGlobal.setTimeout,_)}function C(A,T,L,O,N){return w.importKey("raw",A,{name:"PBKDF2"},!1,["deriveBits"]).then(function(H){return w.deriveBits({name:"PBKDF2",salt:T,iterations:L,hash:{name:N}},H,O<<3)}).then(function(H){return r.from(H)})}function E(A){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!w||!w.importKey||!w.deriveBits)return Promise.resolve(!1);if(S[A]!==void 0)return S[A];g=g||r.alloc(8);var T=C(g,g,10,128,A).then(function(){return!0},function(){return!1});return S[A]=T,T}function M(A,T){A.then(function(L){b()(function(){T(null,L)})},function(L){b()(function(){T(L)})})}return async=function(A,T,L,O,N,H){typeof N=="function"&&(H=N,N=void 0),N=N||"sha1";var V=x[N.toLowerCase()];if(!V||typeof commonjsGlobal.Promise!="function"){b()(function(){var X;try{X=m(A,T,L,O,N)}catch(oe){H(oe);return}H(null,X)});return}if(f(L,O),A=v(A,d,"Password"),T=v(T,d,"Salt"),typeof H!="function")throw new Error("No callback provided to pbkdf2");M(E(V).then(function(X){return X?C(A,T,L,O,V):m(A,T,L,O,N)}),H)},async}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$3={},hasRequiredUtils$3;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,utils$3.readUInt32BE=function(v,g){var w=v[0+g]<<24|v[1+g]<<16|v[2+g]<<8|v[3+g];return w>>>0},utils$3.writeUInt32BE=function(v,g,w){v[0+w]=g>>>24,v[1+w]=g>>>16&255,v[2+w]=g>>>8&255,v[3+w]=g&255},utils$3.ip=function(v,g,w,x){for(var S=0,_=0,b=6;b>=0;b-=2){for(var C=0;C<=24;C+=8)S<<=1,S|=g>>>C+b&1;for(var C=0;C<=24;C+=8)S<<=1,S|=v>>>C+b&1}for(var b=6;b>=0;b-=2){for(var C=1;C<=25;C+=8)_<<=1,_|=g>>>C+b&1;for(var C=1;C<=25;C+=8)_<<=1,_|=v>>>C+b&1}w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.rip=function(v,g,w,x){for(var S=0,_=0,b=0;b<4;b++)for(var C=24;C>=0;C-=8)S<<=1,S|=g>>>C+b&1,S<<=1,S|=v>>>C+b&1;for(var b=4;b<8;b++)for(var C=24;C>=0;C-=8)_<<=1,_|=g>>>C+b&1,_<<=1,_|=v>>>C+b&1;w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.pc1=function(v,g,w,x){for(var S=0,_=0,b=7;b>=5;b--){for(var C=0;C<=24;C+=8)S<<=1,S|=g>>C+b&1;for(var C=0;C<=24;C+=8)S<<=1,S|=v>>C+b&1}for(var C=0;C<=24;C+=8)S<<=1,S|=g>>C+b&1;for(var b=1;b<=3;b++){for(var C=0;C<=24;C+=8)_<<=1,_|=g>>C+b&1;for(var C=0;C<=24;C+=8)_<<=1,_|=v>>C+b&1}for(var C=0;C<=24;C+=8)_<<=1,_|=v>>C+b&1;w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.r28shl=function(v,g){return v<<g&268435455|v>>>28-g};var r=[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];utils$3.pc2=function(v,g,w,x){for(var S=0,_=0,b=r.length>>>1,C=0;C<b;C++)S<<=1,S|=v>>>r[C]&1;for(var C=b;C<r.length;C++)_<<=1,_|=g>>>r[C]&1;w[x+0]=S>>>0,w[x+1]=_>>>0},utils$3.expand=function(v,g,w){var x=0,S=0;x=(v&1)<<5|v>>>27;for(var _=23;_>=15;_-=4)x<<=6,x|=v>>>_&63;for(var _=11;_>=3;_-=4)S|=v>>>_&63,S<<=6;S|=(v&31)<<1|v>>>31,g[w+0]=x>>>0,g[w+1]=S>>>0};var f=[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];utils$3.substitute=function(v,g){for(var w=0,x=0;x<4;x++){var S=v>>>18-x*6&63,_=f[x*64+S];w<<=4,w|=_}for(var x=0;x<4;x++){var S=g>>>18-x*6&63,_=f[256+x*64+S];w<<=4,w|=_}return w>>>0};var d=[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];return utils$3.permute=function(v){for(var g=0,w=0;w<d.length;w++)g<<=1,g|=v>>>d[w]&1;return g>>>0},utils$3.padSplit=function(v,g,w){for(var x=v.toString(2);x.length<g;)x="0"+x;for(var S=[],_=0;_<g;_+=w)S.push(x.slice(_,_+w));return S.join(" ")},utils$3}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=r;function r(f,d){if(!f)throw new Error(d||"Assertion failed")}return r.equal=function(d,m,v){if(d!=m)throw new Error(v||"Assertion failed: "+d+" != "+m)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var r=requireMinimalisticAssert();function f(d){this.options=d,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=d.padding!==!1}return cipher=f,f.prototype._init=function(){},f.prototype.update=function(m){return m.length===0?[]:this.type==="decrypt"?this._updateDecrypt(m):this._updateEncrypt(m)},f.prototype._buffer=function(m,v){for(var g=Math.min(this.buffer.length-this.bufferOff,m.length-v),w=0;w<g;w++)this.buffer[this.bufferOff+w]=m[v+w];return this.bufferOff+=g,g},f.prototype._flushBuffer=function(m,v){return this._update(this.buffer,0,m,v),this.bufferOff=0,this.blockSize},f.prototype._updateEncrypt=function(m){var v=0,g=0,w=(this.bufferOff+m.length)/this.blockSize|0,x=new Array(w*this.blockSize);this.bufferOff!==0&&(v+=this._buffer(m,v),this.bufferOff===this.buffer.length&&(g+=this._flushBuffer(x,g)));for(var S=m.length-(m.length-v)%this.blockSize;v<S;v+=this.blockSize)this._update(m,v,x,g),g+=this.blockSize;for(;v<m.length;v++,this.bufferOff++)this.buffer[this.bufferOff]=m[v];return x},f.prototype._updateDecrypt=function(m){for(var v=0,g=0,w=Math.ceil((this.bufferOff+m.length)/this.blockSize)-1,x=new Array(w*this.blockSize);w>0;w--)v+=this._buffer(m,v),g+=this._flushBuffer(x,g);return v+=this._buffer(m,v),x},f.prototype.final=function(m){var v;m&&(v=this.update(m));var g;return this.type==="encrypt"?g=this._finalEncrypt():g=this._finalDecrypt(),v?v.concat(g):g},f.prototype._pad=function(m,v){if(v===0)return!1;for(;v<m.length;)m[v++]=0;return!0},f.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var m=new Array(this.blockSize);return this._update(this.buffer,0,m,0),m},f.prototype._unpad=function(m){return m},f.prototype._finalDecrypt=function(){r.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var m=new Array(this.blockSize);return this._flushBuffer(m,0),this._unpad(m)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d=requireUtils$3(),m=requireCipher();function v(){this.tmp=new Array(2),this.keys=null}function g(x){m.call(this,x);var S=new v;this._desState=S,this.deriveKeys(S,x.key)}f(g,m),des=g,g.create=function(S){return new g(S)};var w=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return g.prototype.deriveKeys=function(S,_){S.keys=new Array(32),r.equal(_.length,this.blockSize,"Invalid key length");var b=d.readUInt32BE(_,0),C=d.readUInt32BE(_,4);d.pc1(b,C,S.tmp,0),b=S.tmp[0],C=S.tmp[1];for(var E=0;E<S.keys.length;E+=2){var M=w[E>>>1];b=d.r28shl(b,M),C=d.r28shl(C,M),d.pc2(b,C,S.keys,E)}},g.prototype._update=function(S,_,b,C){var E=this._desState,M=d.readUInt32BE(S,_),A=d.readUInt32BE(S,_+4);d.ip(M,A,E.tmp,0),M=E.tmp[0],A=E.tmp[1],this.type==="encrypt"?this._encrypt(E,M,A,E.tmp,0):this._decrypt(E,M,A,E.tmp,0),M=E.tmp[0],A=E.tmp[1],d.writeUInt32BE(b,M,C),d.writeUInt32BE(b,A,C+4)},g.prototype._pad=function(S,_){if(this.padding===!1)return!1;for(var b=S.length-_,C=_;C<S.length;C++)S[C]=b;return!0},g.prototype._unpad=function(S){if(this.padding===!1)return S;for(var _=S[S.length-1],b=S.length-_;b<S.length;b++)r.equal(S[b],_);return S.slice(0,S.length-_)},g.prototype._encrypt=function(S,_,b,C,E){for(var M=_,A=b,T=0;T<S.keys.length;T+=2){var L=S.keys[T],O=S.keys[T+1];d.expand(A,S.tmp,0),L^=S.tmp[0],O^=S.tmp[1];var N=d.substitute(L,O),H=d.permute(N),V=A;A=(M^H)>>>0,M=V}d.rip(A,M,C,E)},g.prototype._decrypt=function(S,_,b,C,E){for(var M=b,A=_,T=S.keys.length-2;T>=0;T-=2){var L=S.keys[T],O=S.keys[T+1];d.expand(M,S.tmp,0),L^=S.tmp[0],O^=S.tmp[1];var N=d.substitute(L,O),H=d.permute(N),V=M;M=(A^H)>>>0,A=V}d.rip(M,A,C,E)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d={};function m(g){r.equal(g.length,8,"Invalid IV length"),this.iv=new Array(8);for(var w=0;w<this.iv.length;w++)this.iv[w]=g[w]}function v(g){function w(b){g.call(this,b),this._cbcInit()}f(w,g);for(var x=Object.keys(d),S=0;S<x.length;S++){var _=x[S];w.prototype[_]=d[_]}return w.create=function(C){return new w(C)},w}return cbc$1.instantiate=v,d._cbcInit=function(){var w=new m(this.options.iv);this._cbcState=w},d._update=function(w,x,S,_){var b=this._cbcState,C=this.constructor.super_.prototype,E=b.iv;if(this.type==="encrypt"){for(var M=0;M<this.blockSize;M++)E[M]^=w[x+M];C._update.call(this,E,0,S,_);for(var M=0;M<this.blockSize;M++)E[M]=S[_+M]}else{C._update.call(this,w,x,S,_);for(var M=0;M<this.blockSize;M++)S[_+M]^=E[M];for(var M=0;M<this.blockSize;M++)E[M]=w[x+M]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var r=requireMinimalisticAssert(),f=requireInherits_browser(),d=requireCipher(),m=requireDes$1();function v(w,x){r.equal(x.length,24,"Invalid key length");var S=x.slice(0,8),_=x.slice(8,16),b=x.slice(16,24);w==="encrypt"?this.ciphers=[m.create({type:"encrypt",key:S}),m.create({type:"decrypt",key:_}),m.create({type:"encrypt",key:b})]:this.ciphers=[m.create({type:"decrypt",key:b}),m.create({type:"encrypt",key:_}),m.create({type:"decrypt",key:S})]}function g(w){d.call(this,w);var x=new v(this.type,this.options.key);this._edeState=x}return f(g,d),ede=g,g.create=function(x){return new g(x)},g.prototype._update=function(x,S,_,b){var C=this._edeState;C.ciphers[0]._update(x,S,_,b),C.ciphers[1]._update(_,b,_,b),C.ciphers[2]._update(_,b,_,b)},g.prototype._pad=m.prototype._pad,g.prototype._unpad=m.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$3(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var r=requireCipherBase(),f=requireDes(),d=requireInherits_browser(),m=requireSafeBuffer$1().Buffer,v={"des-ede3-cbc":f.CBC.instantiate(f.EDE),"des-ede3":f.EDE,"des-ede-cbc":f.CBC.instantiate(f.EDE),"des-ede":f.EDE,"des-cbc":f.CBC.instantiate(f.DES),"des-ecb":f.DES};v.des=v["des-cbc"],v.des3=v["des-ede3-cbc"],browserifyDes=g,d(g,r);function g(w){r.call(this);var x=w.mode.toLowerCase(),S=v[x],_;w.decrypt?_="decrypt":_="encrypt";var b=w.key;m.isBuffer(b)||(b=m.from(b)),(x==="des-ede"||x==="des-ede-cbc")&&(b=m.concat([b,b.slice(0,8)]));var C=w.iv;m.isBuffer(C)||(C=m.from(C)),this._des=S.create({key:b,iv:C,type:_})}return g.prototype._update=function(w){return m.from(this._des.update(w))},g.prototype._final=function(){return m.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(r,f){return r._cipher.encryptBlock(f)},ecb.decrypt=function(r,f){return r._cipher.decryptBlock(f)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(f,d){for(var m=Math.min(f.length,d.length),v=new Buffer(m),g=0;g<m;++g)v[g]=f[g]^d[g];return v}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var r=requireBufferXor();return cbc.encrypt=function(f,d){var m=r(d,f._prev);return f._prev=f._cipher.encryptBlock(m),f._prev},cbc.decrypt=function(f,d){var m=f._prev;f._prev=d;var v=f._cipher.decryptBlock(d);return r(v,m)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var r=requireSafeBuffer$1().Buffer,f=requireBufferXor();function d(m,v,g){var w=v.length,x=f(v,m._cache);return m._cache=m._cache.slice(w),m._prev=r.concat([m._prev,g?v:x]),x}return cfb.encrypt=function(m,v,g){for(var w=r.allocUnsafe(0),x;v.length;)if(m._cache.length===0&&(m._cache=m._cipher.encryptBlock(m._prev),m._prev=r.allocUnsafe(0)),m._cache.length<=v.length)x=m._cache.length,w=r.concat([w,d(m,v.slice(0,x),g)]),v=v.slice(x);else{w=r.concat([w,d(m,v,g)]);break}return w},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var r=requireSafeBuffer$1().Buffer;function f(d,m,v){var g=d._cipher.encryptBlock(d._prev),w=g[0]^m;return d._prev=r.concat([d._prev.slice(1),r.from([v?m:w])]),w}return cfb8.encrypt=function(d,m,v){for(var g=m.length,w=r.allocUnsafe(g),x=-1;++x<g;)w[x]=f(d,m[x],v);return w},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var r=requireSafeBuffer$1().Buffer;function f(m,v,g){for(var w,x=-1,S=8,_=0,b,C;++x<S;)w=m._cipher.encryptBlock(m._prev),b=v&1<<7-x?128:0,C=w[0]^b,_+=(C&128)>>x%8,m._prev=d(m._prev,g?b:C);return _}function d(m,v){var g=m.length,w=-1,x=r.allocUnsafe(m.length);for(m=r.concat([m,r.from([v])]);++w<g;)x[w]=m[w]<<1|m[w+1]>>7;return x}return cfb1.encrypt=function(m,v,g){for(var w=v.length,x=r.allocUnsafe(w),S=-1;++S<w;)x[S]=f(m,v[S],g);return x},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var r=requireBufferXor();function f(d){return d._prev=d._cipher.encryptBlock(d._prev),d._prev}return ofb.encrypt=function(d,m){for(;d._cache.length<m.length;)d._cache=Buffer.concat([d._cache,f(d)]);var v=d._cache.slice(0,m.length);return d._cache=d._cache.slice(m.length),r(m,v)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function r(f){for(var d=f.length,m;d--;)if(m=f.readUInt8(d),m===255)f.writeUInt8(0,d);else{m++,f.writeUInt8(m,d);break}}return incr32_1=r,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var r=requireBufferXor(),f=requireSafeBuffer$1().Buffer,d=requireIncr32();function m(g){var w=g._cipher.encryptBlockRaw(g._prev);return d(g._prev),w}var v=16;return ctr.encrypt=function(g,w){var x=Math.ceil(w.length/v),S=g._cache.length;g._cache=f.concat([g._cache,f.allocUnsafe(x*v)]);for(var _=0;_<x;_++){var b=m(g),C=S+_*v;g._cache.writeUInt32BE(b[0],C+0),g._cache.writeUInt32BE(b[1],C+4),g._cache.writeUInt32BE(b[2],C+8),g._cache.writeUInt32BE(b[3],C+12)}var E=g._cache.slice(0,w.length);return g._cache=g._cache.slice(w.length),r(w,E)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128,aes192,aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var r={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},f=require$$2;for(var d in f)f[d].module=r[f[d].mode];return modes_1=f,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var r=requireSafeBuffer$1().Buffer;function f(x){r.isBuffer(x)||(x=r.from(x));for(var S=x.length/4|0,_=new Array(S),b=0;b<S;b++)_[b]=x.readUInt32BE(b*4);return _}function d(x){for(var S=0;S<x.length;x++)x[S]=0}function m(x,S,_,b,C){for(var E=_[0],M=_[1],A=_[2],T=_[3],L=x[0]^S[0],O=x[1]^S[1],N=x[2]^S[2],H=x[3]^S[3],V,X,oe,se,de=4,he=1;he<C;he++)V=E[L>>>24]^M[O>>>16&255]^A[N>>>8&255]^T[H&255]^S[de++],X=E[O>>>24]^M[N>>>16&255]^A[H>>>8&255]^T[L&255]^S[de++],oe=E[N>>>24]^M[H>>>16&255]^A[L>>>8&255]^T[O&255]^S[de++],se=E[H>>>24]^M[L>>>16&255]^A[O>>>8&255]^T[N&255]^S[de++],L=V,O=X,N=oe,H=se;return V=(b[L>>>24]<<24|b[O>>>16&255]<<16|b[N>>>8&255]<<8|b[H&255])^S[de++],X=(b[O>>>24]<<24|b[N>>>16&255]<<16|b[H>>>8&255]<<8|b[L&255])^S[de++],oe=(b[N>>>24]<<24|b[H>>>16&255]<<16|b[L>>>8&255]<<8|b[O&255])^S[de++],se=(b[H>>>24]<<24|b[L>>>16&255]<<16|b[O>>>8&255]<<8|b[N&255])^S[de++],V=V>>>0,X=X>>>0,oe=oe>>>0,se=se>>>0,[V,X,oe,se]}var v=[0,1,2,4,8,16,32,64,128,27,54],g=(function(){for(var x=new Array(256),S=0;S<256;S++)S<128?x[S]=S<<1:x[S]=S<<1^283;for(var _=[],b=[],C=[[],[],[],[]],E=[[],[],[],[]],M=0,A=0,T=0;T<256;++T){var L=A^A<<1^A<<2^A<<3^A<<4;L=L>>>8^L&255^99,_[M]=L,b[L]=M;var O=x[M],N=x[O],H=x[N],V=x[L]*257^L*16843008;C[0][M]=V<<24|V>>>8,C[1][M]=V<<16|V>>>16,C[2][M]=V<<8|V>>>24,C[3][M]=V,V=H*16843009^N*65537^O*257^M*16843008,E[0][L]=V<<24|V>>>8,E[1][L]=V<<16|V>>>16,E[2][L]=V<<8|V>>>24,E[3][L]=V,M===0?M=A=1:(M=O^x[x[x[H^O]]],A^=x[x[A]])}return{SBOX:_,INV_SBOX:b,SUB_MIX:C,INV_SUB_MIX:E}})();function w(x){this._key=f(x),this._reset()}return w.blockSize=16,w.keySize=256/8,w.prototype.blockSize=w.blockSize,w.prototype.keySize=w.keySize,w.prototype._reset=function(){for(var x=this._key,S=x.length,_=S+6,b=(_+1)*4,C=[],E=0;E<S;E++)C[E]=x[E];for(E=S;E<b;E++){var M=C[E-1];E%S===0?(M=M<<8|M>>>24,M=g.SBOX[M>>>24]<<24|g.SBOX[M>>>16&255]<<16|g.SBOX[M>>>8&255]<<8|g.SBOX[M&255],M^=v[E/S|0]<<24):S>6&&E%S===4&&(M=g.SBOX[M>>>24]<<24|g.SBOX[M>>>16&255]<<16|g.SBOX[M>>>8&255]<<8|g.SBOX[M&255]),C[E]=C[E-S]^M}for(var A=[],T=0;T<b;T++){var L=b-T,O=C[L-(T%4?0:4)];T<4||L<=4?A[T]=O:A[T]=g.INV_SUB_MIX[0][g.SBOX[O>>>24]]^g.INV_SUB_MIX[1][g.SBOX[O>>>16&255]]^g.INV_SUB_MIX[2][g.SBOX[O>>>8&255]]^g.INV_SUB_MIX[3][g.SBOX[O&255]]}this._nRounds=_,this._keySchedule=C,this._invKeySchedule=A},w.prototype.encryptBlockRaw=function(x){return x=f(x),m(x,this._keySchedule,g.SUB_MIX,g.SBOX,this._nRounds)},w.prototype.encryptBlock=function(x){var S=this.encryptBlockRaw(x),_=r.allocUnsafe(16);return _.writeUInt32BE(S[0],0),_.writeUInt32BE(S[1],4),_.writeUInt32BE(S[2],8),_.writeUInt32BE(S[3],12),_},w.prototype.decryptBlock=function(x){x=f(x);var S=x[1];x[1]=x[3],x[3]=S;var _=m(x,this._invKeySchedule,g.INV_SUB_MIX,g.INV_SBOX,this._nRounds),b=r.allocUnsafe(16);return b.writeUInt32BE(_[0],0),b.writeUInt32BE(_[3],4),b.writeUInt32BE(_[2],8),b.writeUInt32BE(_[1],12),b},w.prototype.scrub=function(){d(this._keySchedule),d(this._invKeySchedule),d(this._key)},aes.AES=w,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var r=requireSafeBuffer$1().Buffer,f=r.alloc(16,0);function d(g){return[g.readUInt32BE(0),g.readUInt32BE(4),g.readUInt32BE(8),g.readUInt32BE(12)]}function m(g){var w=r.allocUnsafe(16);return w.writeUInt32BE(g[0]>>>0,0),w.writeUInt32BE(g[1]>>>0,4),w.writeUInt32BE(g[2]>>>0,8),w.writeUInt32BE(g[3]>>>0,12),w}function v(g){this.h=g,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}return v.prototype.ghash=function(g){for(var w=-1;++w<g.length;)this.state[w]^=g[w];this._multiply()},v.prototype._multiply=function(){for(var g=d(this.h),w=[0,0,0,0],x,S,_,b=-1;++b<128;){for(S=(this.state[~~(b/8)]&1<<7-b%8)!==0,S&&(w[0]^=g[0],w[1]^=g[1],w[2]^=g[2],w[3]^=g[3]),_=(g[3]&1)!==0,x=3;x>0;x--)g[x]=g[x]>>>1|(g[x-1]&1)<<31;g[0]=g[0]>>>1,_&&(g[0]=g[0]^225<<24)}this.state=m(w)},v.prototype.update=function(g){this.cache=r.concat([this.cache,g]);for(var w;this.cache.length>=16;)w=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(w)},v.prototype.final=function(g,w){return this.cache.length&&this.ghash(r.concat([this.cache,f],16)),this.ghash(m([0,g,0,w])),this.state},ghash=v,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var r=requireAes(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),m=requireInherits_browser(),v=requireGhash(),g=requireBufferXor(),w=requireIncr32();function x(b,C){var E=0;b.length!==C.length&&E++;for(var M=Math.min(b.length,C.length),A=0;A<M;++A)E+=b[A]^C[A];return E}function S(b,C,E){if(C.length===12)return b._finID=f.concat([C,f.from([0,0,0,1])]),f.concat([C,f.from([0,0,0,2])]);var M=new v(E),A=C.length,T=A%16;M.update(C),T&&(T=16-T,M.update(f.alloc(T,0))),M.update(f.alloc(8,0));var L=A*8,O=f.alloc(8);O.writeUIntBE(L,0,8),M.update(O),b._finID=M.state;var N=f.from(b._finID);return w(N),N}function _(b,C,E,M){d.call(this);var A=f.alloc(4,0);this._cipher=new r.AES(C);var T=this._cipher.encryptBlock(A);this._ghash=new v(T),E=S(this,E,T),this._prev=f.from(E),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=M,this._alen=0,this._len=0,this._mode=b,this._authTag=null,this._called=!1}return m(_,d),_.prototype._update=function(b){if(!this._called&&this._alen){var C=16-this._alen%16;C<16&&(C=f.alloc(C,0),this._ghash.update(C))}this._called=!0;var E=this._mode.encrypt(this,b);return this._decrypt?this._ghash.update(b):this._ghash.update(E),this._len+=b.length,E},_.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var b=g(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&x(b,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=b,this._cipher.scrub()},_.prototype.getAuthTag=function(){if(this._decrypt||!f.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},_.prototype.setAuthTag=function(C){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=C},_.prototype.setAAD=function(C){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(C),this._alen+=C.length},authCipher=_,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var r=requireAes(),f=requireSafeBuffer$1().Buffer,d=requireCipherBase(),m=requireInherits_browser();function v(g,w,x,S){d.call(this),this._cipher=new r.AES(w),this._prev=f.from(x),this._cache=f.allocUnsafe(0),this._secCache=f.allocUnsafe(0),this._decrypt=S,this._mode=g}return m(v,d),v.prototype._update=function(g){return this._mode.encrypt(this,g,this._decrypt)},v.prototype._final=function(){this._cipher.scrub()},streamCipher=v,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var r=requireSafeBuffer$1().Buffer,f=requireMd5_js();function d(m,v,g,w){if(r.isBuffer(m)||(m=r.from(m,"binary")),v&&(r.isBuffer(v)||(v=r.from(v,"binary")),v.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var x=g/8,S=r.alloc(x),_=r.alloc(w||0),b=r.alloc(0);x>0||w>0;){var C=new f;C.update(b),C.update(m),v&&C.update(v),b=C.digest();var E=0;if(x>0){var M=S.length-x;E=Math.min(x,b.length),b.copy(S,M,0,E),x-=E}if(E<b.length&&w>0){var A=_.length-w,T=Math.min(w,b.length-E);b.copy(_,A,E,E+T),w-=T}}return b.fill(0),{key:S,iv:_}}return evp_bytestokey=d,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var r=requireModes$1(),f=requireAuthCipher(),d=requireSafeBuffer$1().Buffer,m=requireStreamCipher(),v=requireCipherBase(),g=requireAes(),w=requireEvp_bytestokey(),x=requireInherits_browser();function S(M,A,T){v.call(this),this._cache=new b,this._cipher=new g.AES(A),this._prev=d.from(T),this._mode=M,this._autopadding=!0}x(S,v),S.prototype._update=function(M){this._cache.add(M);for(var A,T,L=[];A=this._cache.get();)T=this._mode.encrypt(this,A),L.push(T);return d.concat(L)};var _=d.alloc(16,16);S.prototype._final=function(){var M=this._cache.flush();if(this._autopadding)return M=this._mode.encrypt(this,M),this._cipher.scrub(),M;if(!M.equals(_))throw this._cipher.scrub(),new Error("data not multiple of block length")},S.prototype.setAutoPadding=function(M){return this._autopadding=!!M,this};function b(){this.cache=d.allocUnsafe(0)}b.prototype.add=function(M){this.cache=d.concat([this.cache,M])},b.prototype.get=function(){if(this.cache.length>15){var M=this.cache.slice(0,16);return this.cache=this.cache.slice(16),M}return null},b.prototype.flush=function(){for(var M=16-this.cache.length,A=d.allocUnsafe(M),T=-1;++T<M;)A.writeUInt8(M,T);return d.concat([this.cache,A])};function C(M,A,T){var L=r[M.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if(typeof A=="string"&&(A=d.from(A)),A.length!==L.key/8)throw new TypeError("invalid key length "+A.length);if(typeof T=="string"&&(T=d.from(T)),L.mode!=="GCM"&&T.length!==L.iv)throw new TypeError("invalid iv length "+T.length);return L.type==="stream"?new m(L.module,A,T):L.type==="auth"?new f(L.module,A,T):new S(L.module,A,T)}function E(M,A){var T=r[M.toLowerCase()];if(!T)throw new TypeError("invalid suite type");var L=w(A,!1,T.key,T.iv);return C(M,L.key,L.iv)}return encrypter.createCipheriv=C,encrypter.createCipher=E,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var r=requireAuthCipher(),f=requireSafeBuffer$1().Buffer,d=requireModes$1(),m=requireStreamCipher(),v=requireCipherBase(),g=requireAes(),w=requireEvp_bytestokey(),x=requireInherits_browser();function S(M,A,T){v.call(this),this._cache=new _,this._last=void 0,this._cipher=new g.AES(A),this._prev=f.from(T),this._mode=M,this._autopadding=!0}x(S,v),S.prototype._update=function(M){this._cache.add(M);for(var A,T,L=[];A=this._cache.get(this._autopadding);)T=this._mode.decrypt(this,A),L.push(T);return f.concat(L)},S.prototype._final=function(){var M=this._cache.flush();if(this._autopadding)return b(this._mode.decrypt(this,M));if(M)throw new Error("data not multiple of block length")},S.prototype.setAutoPadding=function(M){return this._autopadding=!!M,this};function _(){this.cache=f.allocUnsafe(0)}_.prototype.add=function(M){this.cache=f.concat([this.cache,M])},_.prototype.get=function(M){var A;if(M){if(this.cache.length>16)return A=this.cache.slice(0,16),this.cache=this.cache.slice(16),A}else if(this.cache.length>=16)return A=this.cache.slice(0,16),this.cache=this.cache.slice(16),A;return null},_.prototype.flush=function(){if(this.cache.length)return this.cache};function b(M){var A=M[15];if(A<1||A>16)throw new Error("unable to decrypt data");for(var T=-1;++T<A;)if(M[T+(16-A)]!==A)throw new Error("unable to decrypt data");if(A!==16)return M.slice(0,16-A)}function C(M,A,T){var L=d[M.toLowerCase()];if(!L)throw new TypeError("invalid suite type");if(typeof T=="string"&&(T=f.from(T)),L.mode!=="GCM"&&T.length!==L.iv)throw new TypeError("invalid iv length "+T.length);if(typeof A=="string"&&(A=f.from(A)),A.length!==L.key/8)throw new TypeError("invalid key length "+A.length);return L.type==="stream"?new m(L.module,A,T,!0):L.type==="auth"?new r(L.module,A,T,!0):new S(L.module,A,T)}function E(M,A){var T=d[M.toLowerCase()];if(!T)throw new TypeError("invalid suite type");var L=w(A,!1,T.key,T.iv);return C(M,L.key,L.iv)}return decrypter.createDecipher=E,decrypter.createDecipheriv=C,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var r=requireEncrypter(),f=requireDecrypter(),d=require$$2;function m(){return Object.keys(d)}return browser$5.createCipher=browser$5.Cipher=r.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=r.createCipheriv,browser$5.createDecipher=browser$5.Decipher=f.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=f.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=m,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(function(r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}})(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var r=requireBrowserifyDes(),f=requireBrowser$6(),d=requireModes$1(),m=requireModes(),v=requireEvp_bytestokey();function g(b,C){b=b.toLowerCase();var E,M;if(d[b])E=d[b].key,M=d[b].iv;else if(m[b])E=m[b].key*8,M=m[b].iv;else throw new TypeError("invalid suite type");var A=v(C,!1,E,M);return x(b,A.key,A.iv)}function w(b,C){b=b.toLowerCase();var E,M;if(d[b])E=d[b].key,M=d[b].iv;else if(m[b])E=m[b].key*8,M=m[b].iv;else throw new TypeError("invalid suite type");var A=v(C,!1,E,M);return S(b,A.key,A.iv)}function x(b,C,E){if(b=b.toLowerCase(),d[b])return f.createCipheriv(b,C,E);if(m[b])return new r({key:C,iv:E,mode:b});throw new TypeError("invalid suite type")}function S(b,C,E){if(b=b.toLowerCase(),d[b])return f.createDecipheriv(b,C,E);if(m[b])return new r({key:C,iv:E,mode:b,decrypt:!0});throw new TypeError("invalid suite type")}function _(){return Object.keys(m).concat(f.getCiphers())}return browser$6.createCipher=browser$6.Cipher=g,browser$6.createCipheriv=browser$6.Cipheriv=x,browser$6.createDecipher=browser$6.Decipher=w,browser$6.createDecipheriv=browser$6.Decipheriv=S,browser$6.listCiphers=browser$6.getCiphers=_,browser$6}var browser$4={},bn$5={exports:{}},bn$4=bn$5.exports,hasRequiredBn$2;function requireBn$2(){return hasRequiredBn$2||(hasRequiredBn$2=1,(function(r){(function(f,d){function m(te,k){if(!te)throw new Error(k||"Assertion failed")}function v(te,k){te.super_=k;var q=function(){};q.prototype=k.prototype,te.prototype=new q,te.prototype.constructor=te}function g(te,k,q){if(g.isBN(te))return te;this.negative=0,this.words=null,this.length=0,this.red=null,te!==null&&((k==="le"||k==="be")&&(q=k,k=10),this._init(te||0,k||10,q||"be"))}typeof f=="object"?f.exports=g:d.BN=g,g.BN=g,g.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}g.isBN=function(k){return k instanceof g?!0:k!==null&&typeof k=="object"&&k.constructor.wordSize===g.wordSize&&Array.isArray(k.words)},g.max=function(k,q){return k.cmp(q)>0?k:q},g.min=function(k,q){return k.cmp(q)<0?k:q},g.prototype._init=function(k,q,y){if(typeof k=="number")return this._initNumber(k,q,y);if(typeof k=="object")return this._initArray(k,q,y);q==="hex"&&(q=16),m(q===(q|0)&&q>=2&&q<=36),k=k.toString().replace(/\s+/g,"");var B=0;k[0]==="-"&&(B++,this.negative=1),B<k.length&&(q===16?this._parseHex(k,B,y):(this._parseBase(k,q,B),y==="le"&&this._initArray(this.toArray(),q,y)))},g.prototype._initNumber=function(k,q,y){k<0&&(this.negative=1,k=-k),k<67108864?(this.words=[k&67108863],this.length=1):k<4503599627370496?(this.words=[k&67108863,k/67108864&67108863],this.length=2):(m(k<9007199254740992),this.words=[k&67108863,k/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),q,y)},g.prototype._initArray=function(k,q,y){if(m(typeof k.length=="number"),k.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(k.length/3),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var $,I,U=0;if(y==="be")for(B=k.length-1,$=0;B>=0;B-=3)I=k[B]|k[B-1]<<8|k[B-2]<<16,this.words[$]|=I<<U&67108863,this.words[$+1]=I>>>26-U&67108863,U+=24,U>=26&&(U-=26,$++);else if(y==="le")for(B=0,$=0;B<k.length;B+=3)I=k[B]|k[B+1]<<8|k[B+2]<<16,this.words[$]|=I<<U&67108863,this.words[$+1]=I>>>26-U&67108863,U+=24,U>=26&&(U-=26,$++);return this.strip()};function x(te,k){var q=te.charCodeAt(k);return q>=65&&q<=70?q-55:q>=97&&q<=102?q-87:q-48&15}function S(te,k,q){var y=x(te,q);return q-1>=k&&(y|=x(te,q-1)<<4),y}g.prototype._parseHex=function(k,q,y){this.length=Math.ceil((k.length-q)/6),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var $=0,I=0,U;if(y==="be")for(B=k.length-1;B>=q;B-=2)U=S(k,q,B)<<$,this.words[I]|=U&67108863,$>=18?($-=18,I+=1,this.words[I]|=U>>>26):$+=8;else{var j=k.length-q;for(B=j%2===0?q+1:q;B<k.length;B+=2)U=S(k,q,B)<<$,this.words[I]|=U&67108863,$>=18?($-=18,I+=1,this.words[I]|=U>>>26):$+=8}this.strip()};function _(te,k,q,y){for(var B=0,$=Math.min(te.length,q),I=k;I<$;I++){var U=te.charCodeAt(I)-48;B*=y,U>=49?B+=U-49+10:U>=17?B+=U-17+10:B+=U}return B}g.prototype._parseBase=function(k,q,y){this.words=[0],this.length=1;for(var B=0,$=1;$<=67108863;$*=q)B++;B--,$=$/q|0;for(var I=k.length-y,U=I%B,j=Math.min(I,I-U)+y,D=0,W=y;W<j;W+=B)D=_(k,W,W+B,q),this.imuln($),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D);if(U!==0){var R=1;for(D=_(k,W,k.length,q),W=0;W<U;W++)R*=q;this.imuln(R),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D)}this.strip()},g.prototype.copy=function(k){k.words=new Array(this.length);for(var q=0;q<this.length;q++)k.words[q]=this.words[q];k.length=this.length,k.negative=this.negative,k.red=this.red},g.prototype.clone=function(){var k=new g(null);return this.copy(k),k},g.prototype._expand=function(k){for(;this.length<k;)this.words[this.length++]=0;return this},g.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},g.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},g.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];g.prototype.toString=function(k,q){k=k||10,q=q|0||1;var y;if(k===16||k==="hex"){y="";for(var B=0,$=0,I=0;I<this.length;I++){var U=this.words[I],j=((U<<B|$)&16777215).toString(16);$=U>>>24-B&16777215,B+=2,B>=26&&(B-=26,I--),$!==0||I!==this.length-1?y=b[6-j.length]+j+y:y=j+y}for($!==0&&(y=$.toString(16)+y);y.length%q!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(k===(k|0)&&k>=2&&k<=36){var D=C[k],W=E[k];y="";var R=this.clone();for(R.negative=0;!R.isZero();){var z=R.modn(W).toString(k);R=R.idivn(W),R.isZero()?y=z+y:y=b[D-z.length]+z+y}for(this.isZero()&&(y="0"+y);y.length%q!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}m(!1,"Base should be between 2 and 36")},g.prototype.toNumber=function(){var k=this.words[0];return this.length===2?k+=this.words[1]*67108864:this.length===3&&this.words[2]===1?k+=4503599627370496+this.words[1]*67108864:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-k:k},g.prototype.toJSON=function(){return this.toString(16)},g.prototype.toBuffer=function(k,q){return m(typeof w<"u"),this.toArrayLike(w,k,q)},g.prototype.toArray=function(k,q){return this.toArrayLike(Array,k,q)},g.prototype.toArrayLike=function(k,q,y){var B=this.byteLength(),$=y||Math.max(1,B);m(B<=$,"byte array longer than desired length"),m($>0,"Requested array length <= 0"),this.strip();var I=q==="le",U=new k($),j,D,W=this.clone();if(I){for(D=0;!W.isZero();D++)j=W.andln(255),W.iushrn(8),U[D]=j;for(;D<$;D++)U[D]=0}else{for(D=0;D<$-B;D++)U[D]=0;for(D=0;!W.isZero();D++)j=W.andln(255),W.iushrn(8),U[$-D-1]=j}return U},Math.clz32?g.prototype._countBits=function(k){return 32-Math.clz32(k)}:g.prototype._countBits=function(k){var q=k,y=0;return q>=4096&&(y+=13,q>>>=13),q>=64&&(y+=7,q>>>=7),q>=8&&(y+=4,q>>>=4),q>=2&&(y+=2,q>>>=2),y+q},g.prototype._zeroBits=function(k){if(k===0)return 26;var q=k,y=0;return(q&8191)===0&&(y+=13,q>>>=13),(q&127)===0&&(y+=7,q>>>=7),(q&15)===0&&(y+=4,q>>>=4),(q&3)===0&&(y+=2,q>>>=2),(q&1)===0&&y++,y},g.prototype.bitLength=function(){var k=this.words[this.length-1],q=this._countBits(k);return(this.length-1)*26+q};function M(te){for(var k=new Array(te.bitLength()),q=0;q<k.length;q++){var y=q/26|0,B=q%26;k[q]=(te.words[y]&1<<B)>>>B}return k}g.prototype.zeroBits=function(){if(this.isZero())return 0;for(var k=0,q=0;q<this.length;q++){var y=this._zeroBits(this.words[q]);if(k+=y,y!==26)break}return k},g.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},g.prototype.toTwos=function(k){return this.negative!==0?this.abs().inotn(k).iaddn(1):this.clone()},g.prototype.fromTwos=function(k){return this.testn(k-1)?this.notn(k).iaddn(1).ineg():this.clone()},g.prototype.isNeg=function(){return this.negative!==0},g.prototype.neg=function(){return this.clone().ineg()},g.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},g.prototype.iuor=function(k){for(;this.length<k.length;)this.words[this.length++]=0;for(var q=0;q<k.length;q++)this.words[q]=this.words[q]|k.words[q];return this.strip()},g.prototype.ior=function(k){return m((this.negative|k.negative)===0),this.iuor(k)},g.prototype.or=function(k){return this.length>k.length?this.clone().ior(k):k.clone().ior(this)},g.prototype.uor=function(k){return this.length>k.length?this.clone().iuor(k):k.clone().iuor(this)},g.prototype.iuand=function(k){var q;this.length>k.length?q=k:q=this;for(var y=0;y<q.length;y++)this.words[y]=this.words[y]&k.words[y];return this.length=q.length,this.strip()},g.prototype.iand=function(k){return m((this.negative|k.negative)===0),this.iuand(k)},g.prototype.and=function(k){return this.length>k.length?this.clone().iand(k):k.clone().iand(this)},g.prototype.uand=function(k){return this.length>k.length?this.clone().iuand(k):k.clone().iuand(this)},g.prototype.iuxor=function(k){var q,y;this.length>k.length?(q=this,y=k):(q=k,y=this);for(var B=0;B<y.length;B++)this.words[B]=q.words[B]^y.words[B];if(this!==q)for(;B<q.length;B++)this.words[B]=q.words[B];return this.length=q.length,this.strip()},g.prototype.ixor=function(k){return m((this.negative|k.negative)===0),this.iuxor(k)},g.prototype.xor=function(k){return this.length>k.length?this.clone().ixor(k):k.clone().ixor(this)},g.prototype.uxor=function(k){return this.length>k.length?this.clone().iuxor(k):k.clone().iuxor(this)},g.prototype.inotn=function(k){m(typeof k=="number"&&k>=0);var q=Math.ceil(k/26)|0,y=k%26;this._expand(q),y>0&&q--;for(var B=0;B<q;B++)this.words[B]=~this.words[B]&67108863;return y>0&&(this.words[B]=~this.words[B]&67108863>>26-y),this.strip()},g.prototype.notn=function(k){return this.clone().inotn(k)},g.prototype.setn=function(k,q){m(typeof k=="number"&&k>=0);var y=k/26|0,B=k%26;return this._expand(y+1),q?this.words[y]=this.words[y]|1<<B:this.words[y]=this.words[y]&~(1<<B),this.strip()},g.prototype.iadd=function(k){var q;if(this.negative!==0&&k.negative===0)return this.negative=0,q=this.isub(k),this.negative^=1,this._normSign();if(this.negative===0&&k.negative!==0)return k.negative=0,q=this.isub(k),k.negative=1,q._normSign();var y,B;this.length>k.length?(y=this,B=k):(y=k,B=this);for(var $=0,I=0;I<B.length;I++)q=(y.words[I]|0)+(B.words[I]|0)+$,this.words[I]=q&67108863,$=q>>>26;for(;$!==0&&I<y.length;I++)q=(y.words[I]|0)+$,this.words[I]=q&67108863,$=q>>>26;if(this.length=y.length,$!==0)this.words[this.length]=$,this.length++;else if(y!==this)for(;I<y.length;I++)this.words[I]=y.words[I];return this},g.prototype.add=function(k){var q;return k.negative!==0&&this.negative===0?(k.negative=0,q=this.sub(k),k.negative^=1,q):k.negative===0&&this.negative!==0?(this.negative=0,q=k.sub(this),this.negative=1,q):this.length>k.length?this.clone().iadd(k):k.clone().iadd(this)},g.prototype.isub=function(k){if(k.negative!==0){k.negative=0;var q=this.iadd(k);return k.negative=1,q._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(k),this.negative=1,this._normSign();var y=this.cmp(k);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,$;y>0?(B=this,$=k):(B=k,$=this);for(var I=0,U=0;U<$.length;U++)q=(B.words[U]|0)-($.words[U]|0)+I,I=q>>26,this.words[U]=q&67108863;for(;I!==0&&U<B.length;U++)q=(B.words[U]|0)+I,I=q>>26,this.words[U]=q&67108863;if(I===0&&U<B.length&&B!==this)for(;U<B.length;U++)this.words[U]=B.words[U];return this.length=Math.max(this.length,U),B!==this&&(this.negative=1),this.strip()},g.prototype.sub=function(k){return this.clone().isub(k)};function A(te,k,q){q.negative=k.negative^te.negative;var y=te.length+k.length|0;q.length=y,y=y-1|0;var B=te.words[0]|0,$=k.words[0]|0,I=B*$,U=I&67108863,j=I/67108864|0;q.words[0]=U;for(var D=1;D<y;D++){for(var W=j>>>26,R=j&67108863,z=Math.min(D,k.length-1),ye=Math.max(0,D-te.length+1);ye<=z;ye++){var Ce=D-ye|0;B=te.words[Ce]|0,$=k.words[ye]|0,I=B*$+R,W+=I/67108864|0,R=I&67108863}q.words[D]=R|0,j=W|0}return j!==0?q.words[D]=j|0:q.length--,q.strip()}var T=function(k,q,y){var B=k.words,$=q.words,I=y.words,U=0,j,D,W,R=B[0]|0,z=R&8191,ye=R>>>13,Ce=B[1]|0,me=Ce&8191,ie=Ce>>>13,ee=B[2]|0,pe=ee&8191,be=ee>>>13,ae=B[3]|0,ne=ae&8191,Se=ae>>>13,qe=B[4]|0,Ie=qe&8191,Oe=qe>>>13,Fe=B[5]|0,De=Fe&8191,$e=Fe>>>13,je=B[6]|0,Ye=je&8191,st=je>>>13,Je=B[7]|0,Ge=Je&8191,ut=Je>>>13,gt=B[8]|0,rt=gt&8191,wt=gt>>>13,bt=B[9]|0,le=bt&8191,Z=bt>>>13,J=$[0]|0,ge=J&8191,Ee=J>>>13,Re=$[1]|0,ke=Re&8191,Xe=Re>>>13,He=$[2]|0,Ze=He&8191,xt=He>>>13,tt=$[3]|0,mt=tt&8191,Tt=tt>>>13,St=$[4]|0,lt=St&8191,Mt=St>>>13,Ct=$[5]|0,ce=Ct&8191,Y=Ct>>>13,Q=$[6]|0,ve=Q&8191,fe=Q>>>13,F=$[7]|0,G=F&8191,re=F>>>13,K=$[8]|0,ue=K&8191,Ae=K>>>13,xe=$[9]|0,Te=xe&8191,Pe=xe>>>13;y.negative=k.negative^q.negative,y.length=19,j=Math.imul(z,ge),D=Math.imul(z,Ee),D=D+Math.imul(ye,ge)|0,W=Math.imul(ye,Ee);var Ue=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,j=Math.imul(me,ge),D=Math.imul(me,Ee),D=D+Math.imul(ie,ge)|0,W=Math.imul(ie,Ee),j=j+Math.imul(z,ke)|0,D=D+Math.imul(z,Xe)|0,D=D+Math.imul(ye,ke)|0,W=W+Math.imul(ye,Xe)|0;var Ne=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,j=Math.imul(pe,ge),D=Math.imul(pe,Ee),D=D+Math.imul(be,ge)|0,W=Math.imul(be,Ee),j=j+Math.imul(me,ke)|0,D=D+Math.imul(me,Xe)|0,D=D+Math.imul(ie,ke)|0,W=W+Math.imul(ie,Xe)|0,j=j+Math.imul(z,Ze)|0,D=D+Math.imul(z,xt)|0,D=D+Math.imul(ye,Ze)|0,W=W+Math.imul(ye,xt)|0;var At=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(At>>>26)|0,At&=67108863,j=Math.imul(ne,ge),D=Math.imul(ne,Ee),D=D+Math.imul(Se,ge)|0,W=Math.imul(Se,Ee),j=j+Math.imul(pe,ke)|0,D=D+Math.imul(pe,Xe)|0,D=D+Math.imul(be,ke)|0,W=W+Math.imul(be,Xe)|0,j=j+Math.imul(me,Ze)|0,D=D+Math.imul(me,xt)|0,D=D+Math.imul(ie,Ze)|0,W=W+Math.imul(ie,xt)|0,j=j+Math.imul(z,mt)|0,D=D+Math.imul(z,Tt)|0,D=D+Math.imul(ye,mt)|0,W=W+Math.imul(ye,Tt)|0;var ot=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(ot>>>26)|0,ot&=67108863,j=Math.imul(Ie,ge),D=Math.imul(Ie,Ee),D=D+Math.imul(Oe,ge)|0,W=Math.imul(Oe,Ee),j=j+Math.imul(ne,ke)|0,D=D+Math.imul(ne,Xe)|0,D=D+Math.imul(Se,ke)|0,W=W+Math.imul(Se,Xe)|0,j=j+Math.imul(pe,Ze)|0,D=D+Math.imul(pe,xt)|0,D=D+Math.imul(be,Ze)|0,W=W+Math.imul(be,xt)|0,j=j+Math.imul(me,mt)|0,D=D+Math.imul(me,Tt)|0,D=D+Math.imul(ie,mt)|0,W=W+Math.imul(ie,Tt)|0,j=j+Math.imul(z,lt)|0,D=D+Math.imul(z,Mt)|0,D=D+Math.imul(ye,lt)|0,W=W+Math.imul(ye,Mt)|0;var yt=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(yt>>>26)|0,yt&=67108863,j=Math.imul(De,ge),D=Math.imul(De,Ee),D=D+Math.imul($e,ge)|0,W=Math.imul($e,Ee),j=j+Math.imul(Ie,ke)|0,D=D+Math.imul(Ie,Xe)|0,D=D+Math.imul(Oe,ke)|0,W=W+Math.imul(Oe,Xe)|0,j=j+Math.imul(ne,Ze)|0,D=D+Math.imul(ne,xt)|0,D=D+Math.imul(Se,Ze)|0,W=W+Math.imul(Se,xt)|0,j=j+Math.imul(pe,mt)|0,D=D+Math.imul(pe,Tt)|0,D=D+Math.imul(be,mt)|0,W=W+Math.imul(be,Tt)|0,j=j+Math.imul(me,lt)|0,D=D+Math.imul(me,Mt)|0,D=D+Math.imul(ie,lt)|0,W=W+Math.imul(ie,Mt)|0,j=j+Math.imul(z,ce)|0,D=D+Math.imul(z,Y)|0,D=D+Math.imul(ye,ce)|0,W=W+Math.imul(ye,Y)|0;var vt=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(vt>>>26)|0,vt&=67108863,j=Math.imul(Ye,ge),D=Math.imul(Ye,Ee),D=D+Math.imul(st,ge)|0,W=Math.imul(st,Ee),j=j+Math.imul(De,ke)|0,D=D+Math.imul(De,Xe)|0,D=D+Math.imul($e,ke)|0,W=W+Math.imul($e,Xe)|0,j=j+Math.imul(Ie,Ze)|0,D=D+Math.imul(Ie,xt)|0,D=D+Math.imul(Oe,Ze)|0,W=W+Math.imul(Oe,xt)|0,j=j+Math.imul(ne,mt)|0,D=D+Math.imul(ne,Tt)|0,D=D+Math.imul(Se,mt)|0,W=W+Math.imul(Se,Tt)|0,j=j+Math.imul(pe,lt)|0,D=D+Math.imul(pe,Mt)|0,D=D+Math.imul(be,lt)|0,W=W+Math.imul(be,Mt)|0,j=j+Math.imul(me,ce)|0,D=D+Math.imul(me,Y)|0,D=D+Math.imul(ie,ce)|0,W=W+Math.imul(ie,Y)|0,j=j+Math.imul(z,ve)|0,D=D+Math.imul(z,fe)|0,D=D+Math.imul(ye,ve)|0,W=W+Math.imul(ye,fe)|0;var _t=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(_t>>>26)|0,_t&=67108863,j=Math.imul(Ge,ge),D=Math.imul(Ge,Ee),D=D+Math.imul(ut,ge)|0,W=Math.imul(ut,Ee),j=j+Math.imul(Ye,ke)|0,D=D+Math.imul(Ye,Xe)|0,D=D+Math.imul(st,ke)|0,W=W+Math.imul(st,Xe)|0,j=j+Math.imul(De,Ze)|0,D=D+Math.imul(De,xt)|0,D=D+Math.imul($e,Ze)|0,W=W+Math.imul($e,xt)|0,j=j+Math.imul(Ie,mt)|0,D=D+Math.imul(Ie,Tt)|0,D=D+Math.imul(Oe,mt)|0,W=W+Math.imul(Oe,Tt)|0,j=j+Math.imul(ne,lt)|0,D=D+Math.imul(ne,Mt)|0,D=D+Math.imul(Se,lt)|0,W=W+Math.imul(Se,Mt)|0,j=j+Math.imul(pe,ce)|0,D=D+Math.imul(pe,Y)|0,D=D+Math.imul(be,ce)|0,W=W+Math.imul(be,Y)|0,j=j+Math.imul(me,ve)|0,D=D+Math.imul(me,fe)|0,D=D+Math.imul(ie,ve)|0,W=W+Math.imul(ie,fe)|0,j=j+Math.imul(z,G)|0,D=D+Math.imul(z,re)|0,D=D+Math.imul(ye,G)|0,W=W+Math.imul(ye,re)|0;var Ve=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,j=Math.imul(rt,ge),D=Math.imul(rt,Ee),D=D+Math.imul(wt,ge)|0,W=Math.imul(wt,Ee),j=j+Math.imul(Ge,ke)|0,D=D+Math.imul(Ge,Xe)|0,D=D+Math.imul(ut,ke)|0,W=W+Math.imul(ut,Xe)|0,j=j+Math.imul(Ye,Ze)|0,D=D+Math.imul(Ye,xt)|0,D=D+Math.imul(st,Ze)|0,W=W+Math.imul(st,xt)|0,j=j+Math.imul(De,mt)|0,D=D+Math.imul(De,Tt)|0,D=D+Math.imul($e,mt)|0,W=W+Math.imul($e,Tt)|0,j=j+Math.imul(Ie,lt)|0,D=D+Math.imul(Ie,Mt)|0,D=D+Math.imul(Oe,lt)|0,W=W+Math.imul(Oe,Mt)|0,j=j+Math.imul(ne,ce)|0,D=D+Math.imul(ne,Y)|0,D=D+Math.imul(Se,ce)|0,W=W+Math.imul(Se,Y)|0,j=j+Math.imul(pe,ve)|0,D=D+Math.imul(pe,fe)|0,D=D+Math.imul(be,ve)|0,W=W+Math.imul(be,fe)|0,j=j+Math.imul(me,G)|0,D=D+Math.imul(me,re)|0,D=D+Math.imul(ie,G)|0,W=W+Math.imul(ie,re)|0,j=j+Math.imul(z,ue)|0,D=D+Math.imul(z,Ae)|0,D=D+Math.imul(ye,ue)|0,W=W+Math.imul(ye,Ae)|0;var ft=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(ft>>>26)|0,ft&=67108863,j=Math.imul(le,ge),D=Math.imul(le,Ee),D=D+Math.imul(Z,ge)|0,W=Math.imul(Z,Ee),j=j+Math.imul(rt,ke)|0,D=D+Math.imul(rt,Xe)|0,D=D+Math.imul(wt,ke)|0,W=W+Math.imul(wt,Xe)|0,j=j+Math.imul(Ge,Ze)|0,D=D+Math.imul(Ge,xt)|0,D=D+Math.imul(ut,Ze)|0,W=W+Math.imul(ut,xt)|0,j=j+Math.imul(Ye,mt)|0,D=D+Math.imul(Ye,Tt)|0,D=D+Math.imul(st,mt)|0,W=W+Math.imul(st,Tt)|0,j=j+Math.imul(De,lt)|0,D=D+Math.imul(De,Mt)|0,D=D+Math.imul($e,lt)|0,W=W+Math.imul($e,Mt)|0,j=j+Math.imul(Ie,ce)|0,D=D+Math.imul(Ie,Y)|0,D=D+Math.imul(Oe,ce)|0,W=W+Math.imul(Oe,Y)|0,j=j+Math.imul(ne,ve)|0,D=D+Math.imul(ne,fe)|0,D=D+Math.imul(Se,ve)|0,W=W+Math.imul(Se,fe)|0,j=j+Math.imul(pe,G)|0,D=D+Math.imul(pe,re)|0,D=D+Math.imul(be,G)|0,W=W+Math.imul(be,re)|0,j=j+Math.imul(me,ue)|0,D=D+Math.imul(me,Ae)|0,D=D+Math.imul(ie,ue)|0,W=W+Math.imul(ie,Ae)|0,j=j+Math.imul(z,Te)|0,D=D+Math.imul(z,Pe)|0,D=D+Math.imul(ye,Te)|0,W=W+Math.imul(ye,Pe)|0;var et=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(et>>>26)|0,et&=67108863,j=Math.imul(le,ke),D=Math.imul(le,Xe),D=D+Math.imul(Z,ke)|0,W=Math.imul(Z,Xe),j=j+Math.imul(rt,Ze)|0,D=D+Math.imul(rt,xt)|0,D=D+Math.imul(wt,Ze)|0,W=W+Math.imul(wt,xt)|0,j=j+Math.imul(Ge,mt)|0,D=D+Math.imul(Ge,Tt)|0,D=D+Math.imul(ut,mt)|0,W=W+Math.imul(ut,Tt)|0,j=j+Math.imul(Ye,lt)|0,D=D+Math.imul(Ye,Mt)|0,D=D+Math.imul(st,lt)|0,W=W+Math.imul(st,Mt)|0,j=j+Math.imul(De,ce)|0,D=D+Math.imul(De,Y)|0,D=D+Math.imul($e,ce)|0,W=W+Math.imul($e,Y)|0,j=j+Math.imul(Ie,ve)|0,D=D+Math.imul(Ie,fe)|0,D=D+Math.imul(Oe,ve)|0,W=W+Math.imul(Oe,fe)|0,j=j+Math.imul(ne,G)|0,D=D+Math.imul(ne,re)|0,D=D+Math.imul(Se,G)|0,W=W+Math.imul(Se,re)|0,j=j+Math.imul(pe,ue)|0,D=D+Math.imul(pe,Ae)|0,D=D+Math.imul(be,ue)|0,W=W+Math.imul(be,Ae)|0,j=j+Math.imul(me,Te)|0,D=D+Math.imul(me,Pe)|0,D=D+Math.imul(ie,Te)|0,W=W+Math.imul(ie,Pe)|0;var ht=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(ht>>>26)|0,ht&=67108863,j=Math.imul(le,Ze),D=Math.imul(le,xt),D=D+Math.imul(Z,Ze)|0,W=Math.imul(Z,xt),j=j+Math.imul(rt,mt)|0,D=D+Math.imul(rt,Tt)|0,D=D+Math.imul(wt,mt)|0,W=W+Math.imul(wt,Tt)|0,j=j+Math.imul(Ge,lt)|0,D=D+Math.imul(Ge,Mt)|0,D=D+Math.imul(ut,lt)|0,W=W+Math.imul(ut,Mt)|0,j=j+Math.imul(Ye,ce)|0,D=D+Math.imul(Ye,Y)|0,D=D+Math.imul(st,ce)|0,W=W+Math.imul(st,Y)|0,j=j+Math.imul(De,ve)|0,D=D+Math.imul(De,fe)|0,D=D+Math.imul($e,ve)|0,W=W+Math.imul($e,fe)|0,j=j+Math.imul(Ie,G)|0,D=D+Math.imul(Ie,re)|0,D=D+Math.imul(Oe,G)|0,W=W+Math.imul(Oe,re)|0,j=j+Math.imul(ne,ue)|0,D=D+Math.imul(ne,Ae)|0,D=D+Math.imul(Se,ue)|0,W=W+Math.imul(Se,Ae)|0,j=j+Math.imul(pe,Te)|0,D=D+Math.imul(pe,Pe)|0,D=D+Math.imul(be,Te)|0,W=W+Math.imul(be,Pe)|0;var it=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(it>>>26)|0,it&=67108863,j=Math.imul(le,mt),D=Math.imul(le,Tt),D=D+Math.imul(Z,mt)|0,W=Math.imul(Z,Tt),j=j+Math.imul(rt,lt)|0,D=D+Math.imul(rt,Mt)|0,D=D+Math.imul(wt,lt)|0,W=W+Math.imul(wt,Mt)|0,j=j+Math.imul(Ge,ce)|0,D=D+Math.imul(Ge,Y)|0,D=D+Math.imul(ut,ce)|0,W=W+Math.imul(ut,Y)|0,j=j+Math.imul(Ye,ve)|0,D=D+Math.imul(Ye,fe)|0,D=D+Math.imul(st,ve)|0,W=W+Math.imul(st,fe)|0,j=j+Math.imul(De,G)|0,D=D+Math.imul(De,re)|0,D=D+Math.imul($e,G)|0,W=W+Math.imul($e,re)|0,j=j+Math.imul(Ie,ue)|0,D=D+Math.imul(Ie,Ae)|0,D=D+Math.imul(Oe,ue)|0,W=W+Math.imul(Oe,Ae)|0,j=j+Math.imul(ne,Te)|0,D=D+Math.imul(ne,Pe)|0,D=D+Math.imul(Se,Te)|0,W=W+Math.imul(Se,Pe)|0;var pt=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(pt>>>26)|0,pt&=67108863,j=Math.imul(le,lt),D=Math.imul(le,Mt),D=D+Math.imul(Z,lt)|0,W=Math.imul(Z,Mt),j=j+Math.imul(rt,ce)|0,D=D+Math.imul(rt,Y)|0,D=D+Math.imul(wt,ce)|0,W=W+Math.imul(wt,Y)|0,j=j+Math.imul(Ge,ve)|0,D=D+Math.imul(Ge,fe)|0,D=D+Math.imul(ut,ve)|0,W=W+Math.imul(ut,fe)|0,j=j+Math.imul(Ye,G)|0,D=D+Math.imul(Ye,re)|0,D=D+Math.imul(st,G)|0,W=W+Math.imul(st,re)|0,j=j+Math.imul(De,ue)|0,D=D+Math.imul(De,Ae)|0,D=D+Math.imul($e,ue)|0,W=W+Math.imul($e,Ae)|0,j=j+Math.imul(Ie,Te)|0,D=D+Math.imul(Ie,Pe)|0,D=D+Math.imul(Oe,Te)|0,W=W+Math.imul(Oe,Pe)|0;var at=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(at>>>26)|0,at&=67108863,j=Math.imul(le,ce),D=Math.imul(le,Y),D=D+Math.imul(Z,ce)|0,W=Math.imul(Z,Y),j=j+Math.imul(rt,ve)|0,D=D+Math.imul(rt,fe)|0,D=D+Math.imul(wt,ve)|0,W=W+Math.imul(wt,fe)|0,j=j+Math.imul(Ge,G)|0,D=D+Math.imul(Ge,re)|0,D=D+Math.imul(ut,G)|0,W=W+Math.imul(ut,re)|0,j=j+Math.imul(Ye,ue)|0,D=D+Math.imul(Ye,Ae)|0,D=D+Math.imul(st,ue)|0,W=W+Math.imul(st,Ae)|0,j=j+Math.imul(De,Te)|0,D=D+Math.imul(De,Pe)|0,D=D+Math.imul($e,Te)|0,W=W+Math.imul($e,Pe)|0;var ct=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(ct>>>26)|0,ct&=67108863,j=Math.imul(le,ve),D=Math.imul(le,fe),D=D+Math.imul(Z,ve)|0,W=Math.imul(Z,fe),j=j+Math.imul(rt,G)|0,D=D+Math.imul(rt,re)|0,D=D+Math.imul(wt,G)|0,W=W+Math.imul(wt,re)|0,j=j+Math.imul(Ge,ue)|0,D=D+Math.imul(Ge,Ae)|0,D=D+Math.imul(ut,ue)|0,W=W+Math.imul(ut,Ae)|0,j=j+Math.imul(Ye,Te)|0,D=D+Math.imul(Ye,Pe)|0,D=D+Math.imul(st,Te)|0,W=W+Math.imul(st,Pe)|0;var dt=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(dt>>>26)|0,dt&=67108863,j=Math.imul(le,G),D=Math.imul(le,re),D=D+Math.imul(Z,G)|0,W=Math.imul(Z,re),j=j+Math.imul(rt,ue)|0,D=D+Math.imul(rt,Ae)|0,D=D+Math.imul(wt,ue)|0,W=W+Math.imul(wt,Ae)|0,j=j+Math.imul(Ge,Te)|0,D=D+Math.imul(Ge,Pe)|0,D=D+Math.imul(ut,Te)|0,W=W+Math.imul(ut,Pe)|0;var nt=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(nt>>>26)|0,nt&=67108863,j=Math.imul(le,ue),D=Math.imul(le,Ae),D=D+Math.imul(Z,ue)|0,W=Math.imul(Z,Ae),j=j+Math.imul(rt,Te)|0,D=D+Math.imul(rt,Pe)|0,D=D+Math.imul(wt,Te)|0,W=W+Math.imul(wt,Pe)|0;var Le=(U+j|0)+((D&8191)<<13)|0;U=(W+(D>>>13)|0)+(Le>>>26)|0,Le&=67108863,j=Math.imul(le,Te),D=Math.imul(le,Pe),D=D+Math.imul(Z,Te)|0,W=Math.imul(Z,Pe);var Be=(U+j|0)+((D&8191)<<13)|0;return U=(W+(D>>>13)|0)+(Be>>>26)|0,Be&=67108863,I[0]=Ue,I[1]=Ne,I[2]=At,I[3]=ot,I[4]=yt,I[5]=vt,I[6]=_t,I[7]=Ve,I[8]=ft,I[9]=et,I[10]=ht,I[11]=it,I[12]=pt,I[13]=at,I[14]=ct,I[15]=dt,I[16]=nt,I[17]=Le,I[18]=Be,U!==0&&(I[19]=U,y.length++),y};Math.imul||(T=A);function L(te,k,q){q.negative=k.negative^te.negative,q.length=te.length+k.length;for(var y=0,B=0,$=0;$<q.length-1;$++){var I=B;B=0;for(var U=y&67108863,j=Math.min($,k.length-1),D=Math.max(0,$-te.length+1);D<=j;D++){var W=$-D,R=te.words[W]|0,z=k.words[D]|0,ye=R*z,Ce=ye&67108863;I=I+(ye/67108864|0)|0,Ce=Ce+U|0,U=Ce&67108863,I=I+(Ce>>>26)|0,B+=I>>>26,I&=67108863}q.words[$]=U,y=I,I=B}return y!==0?q.words[$]=y:q.length--,q.strip()}function O(te,k,q){var y=new N;return y.mulp(te,k,q)}g.prototype.mulTo=function(k,q){var y,B=this.length+k.length;return this.length===10&&k.length===10?y=T(this,k,q):B<63?y=A(this,k,q):B<1024?y=L(this,k,q):y=O(this,k,q),y};function N(te,k){this.x=te,this.y=k}N.prototype.makeRBT=function(k){for(var q=new Array(k),y=g.prototype._countBits(k)-1,B=0;B<k;B++)q[B]=this.revBin(B,y,k);return q},N.prototype.revBin=function(k,q,y){if(k===0||k===y-1)return k;for(var B=0,$=0;$<q;$++)B|=(k&1)<<q-$-1,k>>=1;return B},N.prototype.permute=function(k,q,y,B,$,I){for(var U=0;U<I;U++)B[U]=q[k[U]],$[U]=y[k[U]]},N.prototype.transform=function(k,q,y,B,$,I){this.permute(I,k,q,y,B,$);for(var U=1;U<$;U<<=1)for(var j=U<<1,D=Math.cos(2*Math.PI/j),W=Math.sin(2*Math.PI/j),R=0;R<$;R+=j)for(var z=D,ye=W,Ce=0;Ce<U;Ce++){var me=y[R+Ce],ie=B[R+Ce],ee=y[R+Ce+U],pe=B[R+Ce+U],be=z*ee-ye*pe;pe=z*pe+ye*ee,ee=be,y[R+Ce]=me+ee,B[R+Ce]=ie+pe,y[R+Ce+U]=me-ee,B[R+Ce+U]=ie-pe,Ce!==j&&(be=D*z-W*ye,ye=D*ye+W*z,z=be)}},N.prototype.guessLen13b=function(k,q){var y=Math.max(q,k)|1,B=y&1,$=0;for(y=y/2|0;y;y=y>>>1)$++;return 1<<$+1+B},N.prototype.conjugate=function(k,q,y){if(!(y<=1))for(var B=0;B<y/2;B++){var $=k[B];k[B]=k[y-B-1],k[y-B-1]=$,$=q[B],q[B]=-q[y-B-1],q[y-B-1]=-$}},N.prototype.normalize13b=function(k,q){for(var y=0,B=0;B<q/2;B++){var $=Math.round(k[2*B+1]/q)*8192+Math.round(k[2*B]/q)+y;k[B]=$&67108863,$<67108864?y=0:y=$/67108864|0}return k},N.prototype.convert13b=function(k,q,y,B){for(var $=0,I=0;I<q;I++)$=$+(k[I]|0),y[2*I]=$&8191,$=$>>>13,y[2*I+1]=$&8191,$=$>>>13;for(I=2*q;I<B;++I)y[I]=0;m($===0),m(($&-8192)===0)},N.prototype.stub=function(k){for(var q=new Array(k),y=0;y<k;y++)q[y]=0;return q},N.prototype.mulp=function(k,q,y){var B=2*this.guessLen13b(k.length,q.length),$=this.makeRBT(B),I=this.stub(B),U=new Array(B),j=new Array(B),D=new Array(B),W=new Array(B),R=new Array(B),z=new Array(B),ye=y.words;ye.length=B,this.convert13b(k.words,k.length,U,B),this.convert13b(q.words,q.length,W,B),this.transform(U,I,j,D,B,$),this.transform(W,I,R,z,B,$);for(var Ce=0;Ce<B;Ce++){var me=j[Ce]*R[Ce]-D[Ce]*z[Ce];D[Ce]=j[Ce]*z[Ce]+D[Ce]*R[Ce],j[Ce]=me}return this.conjugate(j,D,B),this.transform(j,D,ye,I,B,$),this.conjugate(ye,I,B),this.normalize13b(ye,B),y.negative=k.negative^q.negative,y.length=k.length+q.length,y.strip()},g.prototype.mul=function(k){var q=new g(null);return q.words=new Array(this.length+k.length),this.mulTo(k,q)},g.prototype.mulf=function(k){var q=new g(null);return q.words=new Array(this.length+k.length),O(this,k,q)},g.prototype.imul=function(k){return this.clone().mulTo(k,this)},g.prototype.imuln=function(k){m(typeof k=="number"),m(k<67108864);for(var q=0,y=0;y<this.length;y++){var B=(this.words[y]|0)*k,$=(B&67108863)+(q&67108863);q>>=26,q+=B/67108864|0,q+=$>>>26,this.words[y]=$&67108863}return q!==0&&(this.words[y]=q,this.length++),this.length=k===0?1:this.length,this},g.prototype.muln=function(k){return this.clone().imuln(k)},g.prototype.sqr=function(){return this.mul(this)},g.prototype.isqr=function(){return this.imul(this.clone())},g.prototype.pow=function(k){var q=M(k);if(q.length===0)return new g(1);for(var y=this,B=0;B<q.length&&q[B]===0;B++,y=y.sqr());if(++B<q.length)for(var $=y.sqr();B<q.length;B++,$=$.sqr())q[B]!==0&&(y=y.mul($));return y},g.prototype.iushln=function(k){m(typeof k=="number"&&k>=0);var q=k%26,y=(k-q)/26,B=67108863>>>26-q<<26-q,$;if(q!==0){var I=0;for($=0;$<this.length;$++){var U=this.words[$]&B,j=(this.words[$]|0)-U<<q;this.words[$]=j|I,I=U>>>26-q}I&&(this.words[$]=I,this.length++)}if(y!==0){for($=this.length-1;$>=0;$--)this.words[$+y]=this.words[$];for($=0;$<y;$++)this.words[$]=0;this.length+=y}return this.strip()},g.prototype.ishln=function(k){return m(this.negative===0),this.iushln(k)},g.prototype.iushrn=function(k,q,y){m(typeof k=="number"&&k>=0);var B;q?B=(q-q%26)/26:B=0;var $=k%26,I=Math.min((k-$)/26,this.length),U=67108863^67108863>>>$<<$,j=y;if(B-=I,B=Math.max(0,B),j){for(var D=0;D<I;D++)j.words[D]=this.words[D];j.length=I}if(I!==0)if(this.length>I)for(this.length-=I,D=0;D<this.length;D++)this.words[D]=this.words[D+I];else this.words[0]=0,this.length=1;var W=0;for(D=this.length-1;D>=0&&(W!==0||D>=B);D--){var R=this.words[D]|0;this.words[D]=W<<26-$|R>>>$,W=R&U}return j&&W!==0&&(j.words[j.length++]=W),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},g.prototype.ishrn=function(k,q,y){return m(this.negative===0),this.iushrn(k,q,y)},g.prototype.shln=function(k){return this.clone().ishln(k)},g.prototype.ushln=function(k){return this.clone().iushln(k)},g.prototype.shrn=function(k){return this.clone().ishrn(k)},g.prototype.ushrn=function(k){return this.clone().iushrn(k)},g.prototype.testn=function(k){m(typeof k=="number"&&k>=0);var q=k%26,y=(k-q)/26,B=1<<q;if(this.length<=y)return!1;var $=this.words[y];return!!($&B)},g.prototype.imaskn=function(k){m(typeof k=="number"&&k>=0);var q=k%26,y=(k-q)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(q!==0&&y++,this.length=Math.min(y,this.length),q!==0){var B=67108863^67108863>>>q<<q;this.words[this.length-1]&=B}return this.strip()},g.prototype.maskn=function(k){return this.clone().imaskn(k)},g.prototype.iaddn=function(k){return m(typeof k=="number"),m(k<67108864),k<0?this.isubn(-k):this.negative!==0?this.length===1&&(this.words[0]|0)<k?(this.words[0]=k-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(k),this.negative=1,this):this._iaddn(k)},g.prototype._iaddn=function(k){this.words[0]+=k;for(var q=0;q<this.length&&this.words[q]>=67108864;q++)this.words[q]-=67108864,q===this.length-1?this.words[q+1]=1:this.words[q+1]++;return this.length=Math.max(this.length,q+1),this},g.prototype.isubn=function(k){if(m(typeof k=="number"),m(k<67108864),k<0)return this.iaddn(-k);if(this.negative!==0)return this.negative=0,this.iaddn(k),this.negative=1,this;if(this.words[0]-=k,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var q=0;q<this.length&&this.words[q]<0;q++)this.words[q]+=67108864,this.words[q+1]-=1;return this.strip()},g.prototype.addn=function(k){return this.clone().iaddn(k)},g.prototype.subn=function(k){return this.clone().isubn(k)},g.prototype.iabs=function(){return this.negative=0,this},g.prototype.abs=function(){return this.clone().iabs()},g.prototype._ishlnsubmul=function(k,q,y){var B=k.length+y,$;this._expand(B);var I,U=0;for($=0;$<k.length;$++){I=(this.words[$+y]|0)+U;var j=(k.words[$]|0)*q;I-=j&67108863,U=(I>>26)-(j/67108864|0),this.words[$+y]=I&67108863}for(;$<this.length-y;$++)I=(this.words[$+y]|0)+U,U=I>>26,this.words[$+y]=I&67108863;if(U===0)return this.strip();for(m(U===-1),U=0,$=0;$<this.length;$++)I=-(this.words[$]|0)+U,U=I>>26,this.words[$]=I&67108863;return this.negative=1,this.strip()},g.prototype._wordDiv=function(k,q){var y=this.length-k.length,B=this.clone(),$=k,I=$.words[$.length-1]|0,U=this._countBits(I);y=26-U,y!==0&&($=$.ushln(y),B.iushln(y),I=$.words[$.length-1]|0);var j=B.length-$.length,D;if(q!=="mod"){D=new g(null),D.length=j+1,D.words=new Array(D.length);for(var W=0;W<D.length;W++)D.words[W]=0}var R=B.clone()._ishlnsubmul($,1,j);R.negative===0&&(B=R,D&&(D.words[j]=1));for(var z=j-1;z>=0;z--){var ye=(B.words[$.length+z]|0)*67108864+(B.words[$.length+z-1]|0);for(ye=Math.min(ye/I|0,67108863),B._ishlnsubmul($,ye,z);B.negative!==0;)ye--,B.negative=0,B._ishlnsubmul($,1,z),B.isZero()||(B.negative^=1);D&&(D.words[z]=ye)}return D&&D.strip(),B.strip(),q!=="div"&&y!==0&&B.iushrn(y),{div:D||null,mod:B}},g.prototype.divmod=function(k,q,y){if(m(!k.isZero()),this.isZero())return{div:new g(0),mod:new g(0)};var B,$,I;return this.negative!==0&&k.negative===0?(I=this.neg().divmod(k,q),q!=="mod"&&(B=I.div.neg()),q!=="div"&&($=I.mod.neg(),y&&$.negative!==0&&$.iadd(k)),{div:B,mod:$}):this.negative===0&&k.negative!==0?(I=this.divmod(k.neg(),q),q!=="mod"&&(B=I.div.neg()),{div:B,mod:I.mod}):(this.negative&k.negative)!==0?(I=this.neg().divmod(k.neg(),q),q!=="div"&&($=I.mod.neg(),y&&$.negative!==0&&$.isub(k)),{div:I.div,mod:$}):k.length>this.length||this.cmp(k)<0?{div:new g(0),mod:this}:k.length===1?q==="div"?{div:this.divn(k.words[0]),mod:null}:q==="mod"?{div:null,mod:new g(this.modn(k.words[0]))}:{div:this.divn(k.words[0]),mod:new g(this.modn(k.words[0]))}:this._wordDiv(k,q)},g.prototype.div=function(k){return this.divmod(k,"div",!1).div},g.prototype.mod=function(k){return this.divmod(k,"mod",!1).mod},g.prototype.umod=function(k){return this.divmod(k,"mod",!0).mod},g.prototype.divRound=function(k){var q=this.divmod(k);if(q.mod.isZero())return q.div;var y=q.div.negative!==0?q.mod.isub(k):q.mod,B=k.ushrn(1),$=k.andln(1),I=y.cmp(B);return I<0||$===1&&I===0?q.div:q.div.negative!==0?q.div.isubn(1):q.div.iaddn(1)},g.prototype.modn=function(k){m(k<=67108863);for(var q=(1<<26)%k,y=0,B=this.length-1;B>=0;B--)y=(q*y+(this.words[B]|0))%k;return y},g.prototype.idivn=function(k){m(k<=67108863);for(var q=0,y=this.length-1;y>=0;y--){var B=(this.words[y]|0)+q*67108864;this.words[y]=B/k|0,q=B%k}return this.strip()},g.prototype.divn=function(k){return this.clone().idivn(k)},g.prototype.egcd=function(k){m(k.negative===0),m(!k.isZero());var q=this,y=k.clone();q.negative!==0?q=q.umod(k):q=q.clone();for(var B=new g(1),$=new g(0),I=new g(0),U=new g(1),j=0;q.isEven()&&y.isEven();)q.iushrn(1),y.iushrn(1),++j;for(var D=y.clone(),W=q.clone();!q.isZero();){for(var R=0,z=1;(q.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for(q.iushrn(R);R-- >0;)(B.isOdd()||$.isOdd())&&(B.iadd(D),$.isub(W)),B.iushrn(1),$.iushrn(1);for(var ye=0,Ce=1;(y.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(y.iushrn(ye);ye-- >0;)(I.isOdd()||U.isOdd())&&(I.iadd(D),U.isub(W)),I.iushrn(1),U.iushrn(1);q.cmp(y)>=0?(q.isub(y),B.isub(I),$.isub(U)):(y.isub(q),I.isub(B),U.isub($))}return{a:I,b:U,gcd:y.iushln(j)}},g.prototype._invmp=function(k){m(k.negative===0),m(!k.isZero());var q=this,y=k.clone();q.negative!==0?q=q.umod(k):q=q.clone();for(var B=new g(1),$=new g(0),I=y.clone();q.cmpn(1)>0&&y.cmpn(1)>0;){for(var U=0,j=1;(q.words[0]&j)===0&&U<26;++U,j<<=1);if(U>0)for(q.iushrn(U);U-- >0;)B.isOdd()&&B.iadd(I),B.iushrn(1);for(var D=0,W=1;(y.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(y.iushrn(D);D-- >0;)$.isOdd()&&$.iadd(I),$.iushrn(1);q.cmp(y)>=0?(q.isub(y),B.isub($)):(y.isub(q),$.isub(B))}var R;return q.cmpn(1)===0?R=B:R=$,R.cmpn(0)<0&&R.iadd(k),R},g.prototype.gcd=function(k){if(this.isZero())return k.abs();if(k.isZero())return this.abs();var q=this.clone(),y=k.clone();q.negative=0,y.negative=0;for(var B=0;q.isEven()&&y.isEven();B++)q.iushrn(1),y.iushrn(1);do{for(;q.isEven();)q.iushrn(1);for(;y.isEven();)y.iushrn(1);var $=q.cmp(y);if($<0){var I=q;q=y,y=I}else if($===0||y.cmpn(1)===0)break;q.isub(y)}while(!0);return y.iushln(B)},g.prototype.invm=function(k){return this.egcd(k).a.umod(k)},g.prototype.isEven=function(){return(this.words[0]&1)===0},g.prototype.isOdd=function(){return(this.words[0]&1)===1},g.prototype.andln=function(k){return this.words[0]&k},g.prototype.bincn=function(k){m(typeof k=="number");var q=k%26,y=(k-q)/26,B=1<<q;if(this.length<=y)return this._expand(y+1),this.words[y]|=B,this;for(var $=B,I=y;$!==0&&I<this.length;I++){var U=this.words[I]|0;U+=$,$=U>>>26,U&=67108863,this.words[I]=U}return $!==0&&(this.words[I]=$,this.length++),this},g.prototype.isZero=function(){return this.length===1&&this.words[0]===0},g.prototype.cmpn=function(k){var q=k<0;if(this.negative!==0&&!q)return-1;if(this.negative===0&&q)return 1;this.strip();var y;if(this.length>1)y=1;else{q&&(k=-k),m(k<=67108863,"Number is too big");var B=this.words[0]|0;y=B===k?0:B<k?-1:1}return this.negative!==0?-y|0:y},g.prototype.cmp=function(k){if(this.negative!==0&&k.negative===0)return-1;if(this.negative===0&&k.negative!==0)return 1;var q=this.ucmp(k);return this.negative!==0?-q|0:q},g.prototype.ucmp=function(k){if(this.length>k.length)return 1;if(this.length<k.length)return-1;for(var q=0,y=this.length-1;y>=0;y--){var B=this.words[y]|0,$=k.words[y]|0;if(B!==$){B<$?q=-1:B>$&&(q=1);break}}return q},g.prototype.gtn=function(k){return this.cmpn(k)===1},g.prototype.gt=function(k){return this.cmp(k)===1},g.prototype.gten=function(k){return this.cmpn(k)>=0},g.prototype.gte=function(k){return this.cmp(k)>=0},g.prototype.ltn=function(k){return this.cmpn(k)===-1},g.prototype.lt=function(k){return this.cmp(k)===-1},g.prototype.lten=function(k){return this.cmpn(k)<=0},g.prototype.lte=function(k){return this.cmp(k)<=0},g.prototype.eqn=function(k){return this.cmpn(k)===0},g.prototype.eq=function(k){return this.cmp(k)===0},g.red=function(k){return new he(k)},g.prototype.toRed=function(k){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),k.convertTo(this)._forceRed(k)},g.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},g.prototype._forceRed=function(k){return this.red=k,this},g.prototype.forceRed=function(k){return m(!this.red,"Already a number in reduction context"),this._forceRed(k)},g.prototype.redAdd=function(k){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,k)},g.prototype.redIAdd=function(k){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,k)},g.prototype.redSub=function(k){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,k)},g.prototype.redISub=function(k){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,k)},g.prototype.redShl=function(k){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,k)},g.prototype.redMul=function(k){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.mul(this,k)},g.prototype.redIMul=function(k){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,k),this.red.imul(this,k)},g.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},g.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},g.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},g.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},g.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},g.prototype.redPow=function(k){return m(this.red&&!k.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,k)};var H={k256:null,p224:null,p192:null,p25519:null};function V(te,k){this.name=te,this.p=new g(k,16),this.n=this.p.bitLength(),this.k=new g(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}V.prototype._tmp=function(){var k=new g(null);return k.words=new Array(Math.ceil(this.n/13)),k},V.prototype.ireduce=function(k){var q=k,y;do this.split(q,this.tmp),q=this.imulK(q),q=q.iadd(this.tmp),y=q.bitLength();while(y>this.n);var B=y<this.n?-1:q.ucmp(this.p);return B===0?(q.words[0]=0,q.length=1):B>0?q.isub(this.p):q.strip!==void 0?q.strip():q._strip(),q},V.prototype.split=function(k,q){k.iushrn(this.n,0,q)},V.prototype.imulK=function(k){return k.imul(this.k)};function X(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(X,V),X.prototype.split=function(k,q){for(var y=4194303,B=Math.min(k.length,9),$=0;$<B;$++)q.words[$]=k.words[$];if(q.length=B,k.length<=9){k.words[0]=0,k.length=1;return}var I=k.words[9];for(q.words[q.length++]=I&y,$=10;$<k.length;$++){var U=k.words[$]|0;k.words[$-10]=(U&y)<<4|I>>>22,I=U}I>>>=22,k.words[$-10]=I,I===0&&k.length>10?k.length-=10:k.length-=9},X.prototype.imulK=function(k){k.words[k.length]=0,k.words[k.length+1]=0,k.length+=2;for(var q=0,y=0;y<k.length;y++){var B=k.words[y]|0;q+=B*977,k.words[y]=q&67108863,q=B*64+(q/67108864|0)}return k.words[k.length-1]===0&&(k.length--,k.words[k.length-1]===0&&k.length--),k};function oe(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(oe,V);function se(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(se,V);function de(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(de,V),de.prototype.imulK=function(k){for(var q=0,y=0;y<k.length;y++){var B=(k.words[y]|0)*19+q,$=B&67108863;B>>>=26,k.words[y]=$,q=B}return q!==0&&(k.words[k.length++]=q),k},g._prime=function(k){if(H[k])return H[k];var q;if(k==="k256")q=new X;else if(k==="p224")q=new oe;else if(k==="p192")q=new se;else if(k==="p25519")q=new de;else throw new Error("Unknown prime "+k);return H[k]=q,q};function he(te){if(typeof te=="string"){var k=g._prime(te);this.m=k.p,this.prime=k}else m(te.gtn(1),"modulus must be greater than 1"),this.m=te,this.prime=null}he.prototype._verify1=function(k){m(k.negative===0,"red works only with positives"),m(k.red,"red works only with red numbers")},he.prototype._verify2=function(k,q){m((k.negative|q.negative)===0,"red works only with positives"),m(k.red&&k.red===q.red,"red works only with red numbers")},he.prototype.imod=function(k){return this.prime?this.prime.ireduce(k)._forceRed(this):k.umod(this.m)._forceRed(this)},he.prototype.neg=function(k){return k.isZero()?k.clone():this.m.sub(k)._forceRed(this)},he.prototype.add=function(k,q){this._verify2(k,q);var y=k.add(q);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},he.prototype.iadd=function(k,q){this._verify2(k,q);var y=k.iadd(q);return y.cmp(this.m)>=0&&y.isub(this.m),y},he.prototype.sub=function(k,q){this._verify2(k,q);var y=k.sub(q);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},he.prototype.isub=function(k,q){this._verify2(k,q);var y=k.isub(q);return y.cmpn(0)<0&&y.iadd(this.m),y},he.prototype.shl=function(k,q){return this._verify1(k),this.imod(k.ushln(q))},he.prototype.imul=function(k,q){return this._verify2(k,q),this.imod(k.imul(q))},he.prototype.mul=function(k,q){return this._verify2(k,q),this.imod(k.mul(q))},he.prototype.isqr=function(k){return this.imul(k,k.clone())},he.prototype.sqr=function(k){return this.mul(k,k)},he.prototype.sqrt=function(k){if(k.isZero())return k.clone();var q=this.m.andln(3);if(m(q%2===1),q===3){var y=this.m.add(new g(1)).iushrn(2);return this.pow(k,y)}for(var B=this.m.subn(1),$=0;!B.isZero()&&B.andln(1)===0;)$++,B.iushrn(1);m(!B.isZero());var I=new g(1).toRed(this),U=I.redNeg(),j=this.m.subn(1).iushrn(1),D=this.m.bitLength();for(D=new g(2*D*D).toRed(this);this.pow(D,j).cmp(U)!==0;)D.redIAdd(U);for(var W=this.pow(D,B),R=this.pow(k,B.addn(1).iushrn(1)),z=this.pow(k,B),ye=$;z.cmp(I)!==0;){for(var Ce=z,me=0;Ce.cmp(I)!==0;me++)Ce=Ce.redSqr();m(me<ye);var ie=this.pow(W,new g(1).iushln(ye-me-1));R=R.redMul(ie),W=ie.redSqr(),z=z.redMul(W),ye=me}return R},he.prototype.invm=function(k){var q=k._invmp(this.m);return q.negative!==0?(q.negative=0,this.imod(q).redNeg()):this.imod(q)},he.prototype.pow=function(k,q){if(q.isZero())return new g(1).toRed(this);if(q.cmpn(1)===0)return k.clone();var y=4,B=new Array(1<<y);B[0]=new g(1).toRed(this),B[1]=k;for(var $=2;$<B.length;$++)B[$]=this.mul(B[$-1],k);var I=B[0],U=0,j=0,D=q.bitLength()%26;for(D===0&&(D=26),$=q.length-1;$>=0;$--){for(var W=q.words[$],R=D-1;R>=0;R--){var z=W>>R&1;if(I!==B[0]&&(I=this.sqr(I)),z===0&&U===0){j=0;continue}U<<=1,U|=z,j++,!(j!==y&&($!==0||R!==0))&&(I=this.mul(I,B[U]),j=0,U=0)}D=26}return I},he.prototype.convertTo=function(k){var q=k.umod(this.m);return q===k?q.clone():q},he.prototype.convertFrom=function(k){var q=k.clone();return q.red=null,q},g.mont=function(k){return new we(k)};function we(te){he.call(this,te),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(we,he),we.prototype.convertTo=function(k){return this.imod(k.ushln(this.shift))},we.prototype.convertFrom=function(k){var q=this.imod(k.mul(this.rinv));return q.red=null,q},we.prototype.imul=function(k,q){if(k.isZero()||q.isZero())return k.words[0]=0,k.length=1,k;var y=k.imul(q),B=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=y.isub(B).iushrn(this.shift),I=$;return $.cmp(this.m)>=0?I=$.isub(this.m):$.cmpn(0)<0&&(I=$.iadd(this.m)),I._forceRed(this)},we.prototype.mul=function(k,q){if(k.isZero()||q.isZero())return new g(0)._forceRed(this);var y=k.mul(q),B=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=y.isub(B).iushrn(this.shift),I=$;return $.cmp(this.m)>=0?I=$.isub(this.m):$.cmpn(0)<0&&(I=$.iadd(this.m)),I._forceRed(this)},we.prototype.invm=function(k){var q=this.imod(k._invmp(this.m).mul(this.r2));return q._forceRed(this)}})(r,bn$4)})(bn$5)),bn$5.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var r;brorand.exports=function(v){return r||(r=new f(null)),r.generate(v)};function f(m){this.rand=m}if(brorand.exports.Rand=f,f.prototype.generate=function(v){return this._rand(v)},f.prototype._rand=function(v){if(this.rand.getBytes)return this.rand.getBytes(v);for(var g=new Uint8Array(v),w=0;w<g.length;w++)g[w]=this.rand.getByte();return g},typeof self=="object")self.crypto&&self.crypto.getRandomValues?f.prototype._rand=function(v){var g=new Uint8Array(v);return self.crypto.getRandomValues(g),g}:self.msCrypto&&self.msCrypto.getRandomValues?f.prototype._rand=function(v){var g=new Uint8Array(v);return self.msCrypto.getRandomValues(g),g}:typeof window=="object"&&(f.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var d=requireCryptoBrowserify();if(typeof d.randomBytes!="function")throw new Error("Not supported");f.prototype._rand=function(v){return d.randomBytes(v)}}catch{}return brorand.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var r=requireBn$2(),f=requireBrorand();function d(m){this.rand=m||new f.Rand}return mr=d,d.create=function(v){return new d(v)},d.prototype._randbelow=function(v){var g=v.bitLength(),w=Math.ceil(g/8);do var x=new r(this.rand.generate(w));while(x.cmp(v)>=0);return x},d.prototype._randrange=function(v,g){var w=g.sub(v);return v.add(this._randbelow(w))},d.prototype.test=function(v,g,w){var x=v.bitLength(),S=r.mont(v),_=new r(1).toRed(S);g||(g=Math.max(1,x/48|0));for(var b=v.subn(1),C=0;!b.testn(C);C++);for(var E=v.shrn(C),M=b.toRed(S),A=!0;g>0;g--){var T=this._randrange(new r(2),b);w&&w(T);var L=T.toRed(S).redPow(E);if(!(L.cmp(_)===0||L.cmp(M)===0)){for(var O=1;O<C;O++){if(L=L.redSqr(),L.cmp(_)===0)return!1;if(L.cmp(M)===0)break}if(O===C)return!1}}return A},d.prototype.getDivisor=function(v,g){var w=v.bitLength(),x=r.mont(v),S=new r(1).toRed(x);g||(g=Math.max(1,w/48|0));for(var _=v.subn(1),b=0;!_.testn(b);b++);for(var C=v.shrn(b),E=_.toRed(x);g>0;g--){var M=this._randrange(new r(2),_),A=v.gcd(M);if(A.cmpn(1)!==0)return A;var T=M.toRed(x).redPow(C);if(!(T.cmp(S)===0||T.cmp(E)===0)){for(var L=1;L<b;L++){if(T=T.redSqr(),T.cmp(S)===0)return T.fromRed().subn(1).gcd(v);if(T.cmp(E)===0)break}if(L===b)return T=T.redSqr(),T.fromRed().subn(1).gcd(v)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var r=requireBrowser$b();generatePrime=L,L.simpleSieve=A,L.fermatTest=T;var f=requireBn$2(),d=new f(24),m=requireMr(),v=new m,g=new f(1),w=new f(2),x=new f(5);new f(16),new f(8);var S=new f(10),_=new f(3);new f(7);var b=new f(11),C=new f(4);new f(12);var E=null;function M(){if(E!==null)return E;var O=1048576,N=[];N[0]=2;for(var H=1,V=3;V<O;V+=2){for(var X=Math.ceil(Math.sqrt(V)),oe=0;oe<H&&N[oe]<=X&&V%N[oe]!==0;oe++);H!==oe&&N[oe]<=X||(N[H++]=V)}return E=N,N}function A(O){for(var N=M(),H=0;H<N.length;H++)if(O.modn(N[H])===0)return O.cmpn(N[H])===0;return!0}function T(O){var N=f.mont(O);return w.toRed(N).redPow(O.subn(1)).fromRed().cmpn(1)===0}function L(O,N){if(O<16)return N===2||N===5?new f([140,123]):new f([140,39]);N=new f(N);for(var H,V;;){for(H=new f(r(Math.ceil(O/8)));H.bitLength()>O;)H.ishrn(1);if(H.isEven()&&H.iadd(g),H.testn(1)||H.iadd(w),N.cmp(w)){if(!N.cmp(x))for(;H.mod(S).cmp(_);)H.iadd(C)}else for(;H.mod(d).cmp(b);)H.iadd(C);if(V=H.shrn(1),A(V)&&A(H)&&T(V)&&T(H)&&v.test(V)&&v.test(H))return H}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var r=requireBn$2(),f=requireMr(),d=new f,m=new r(24),v=new r(11),g=new r(10),w=new r(3),x=new r(7),S=requireGeneratePrime(),_=requireBrowser$b();dh=A;function b(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this._pub=new r(L),this}function C(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this._priv=new r(L),this}var E={};function M(L,O){var N=O.toString("hex"),H=[N,L.toString(16)].join("_");if(H in E)return E[H];var V=0;if(L.isEven()||!S.simpleSieve||!S.fermatTest(L)||!d.test(L))return V+=1,N==="02"||N==="05"?V+=8:V+=4,E[H]=V,V;d.test(L.shrn(1))||(V+=2);var X;switch(N){case"02":L.mod(m).cmp(v)&&(V+=8);break;case"05":X=L.mod(g),X.cmp(w)&&X.cmp(x)&&(V+=8);break;default:V+=4}return E[H]=V,V}function A(L,O,N){this.setGenerator(O),this.__prime=new r(L),this._prime=r.mont(this.__prime),this._primeLen=L.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,N?(this.setPublicKey=b,this.setPrivateKey=C):this._primeCode=8}Object.defineProperty(A.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=M(this.__prime,this.__gen)),this._primeCode}}),A.prototype.generateKeys=function(){return this._priv||(this._priv=new r(_(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},A.prototype.computeSecret=function(L){L=new r(L),L=L.toRed(this._prime);var O=L.redPow(this._priv).fromRed(),N=new Buffer(O.toArray()),H=this.getPrime();if(N.length<H.length){var V=new Buffer(H.length-N.length);V.fill(0),N=Buffer.concat([V,N])}return N},A.prototype.getPublicKey=function(O){return T(this._pub,O)},A.prototype.getPrivateKey=function(O){return T(this._priv,O)},A.prototype.getPrime=function(L){return T(this.__prime,L)},A.prototype.getGenerator=function(L){return T(this._gen,L)},A.prototype.setGenerator=function(L,O){return O=O||"utf8",Buffer.isBuffer(L)||(L=new Buffer(L,O)),this.__gen=L,this._gen=new r(L),this};function T(L,O){var N=new Buffer(L.toArray());return O?N.toString(O):N}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var r=requireGeneratePrime(),f=require$$1$1,d=requireDh();function m(w){var x=new Buffer(f[w].prime,"hex"),S=new Buffer(f[w].gen,"hex");return new d(x,S)}var v={binary:!0,hex:!0,base64:!0};function g(w,x,S,_){return Buffer.isBuffer(x)||v[x]===void 0?g(w,"binary",x,S):(x=x||"binary",_=_||"binary",S=S||new Buffer([2]),Buffer.isBuffer(S)||(S=new Buffer(S,_)),typeof w=="number"?new d(r(w,S),S,!0):(Buffer.isBuffer(w)||(w=new Buffer(w,x)),new d(w,S,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=m,browser$4.createDiffieHellman=browser$4.DiffieHellman=g,browser$4}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1>"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:r}:processNextickArgs.exports=process$1;function r(f,d,m,v){if(typeof f!="function")throw new TypeError('"callback" argument must be a function');var g=arguments.length,w,x;switch(g){case 0:case 1:return process$1.nextTick(f);case 2:return process$1.nextTick(function(){f.call(null,d)});case 3:return process$1.nextTick(function(){f.call(null,d,m)});case 4:return process$1.nextTick(function(){f.call(null,d,m,v)});default:for(w=new Array(g-1),x=0;x<w.length;)w[x++]=arguments[x];return process$1.nextTick(function(){f.apply(null,w)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var r={}.toString;return isarray=Array.isArray||function(f){return r.call(f)=="[object Array]"},isarray}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,(function(r,f){var d=requireDist(),m=d.Buffer;function v(w,x){for(var S in w)x[S]=w[S]}m.from&&m.alloc&&m.allocUnsafe&&m.allocUnsafeSlow?r.exports=d:(v(d,f),f.Buffer=g);function g(w,x,S){return m(w,x,S)}v(m,g),g.from=function(w,x,S){if(typeof w=="number")throw new TypeError("Argument must not be a number");return m(w,x,S)},g.alloc=function(w,x,S){if(typeof w!="number")throw new TypeError("Argument must be a number");var _=m(w);return x!==void 0?typeof S=="string"?_.fill(x,S):_.fill(x):_.fill(0),_},g.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return m(w)},g.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(w)}})(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function r(T){return Array.isArray?Array.isArray(T):A(T)==="[object Array]"}util.isArray=r;function f(T){return typeof T=="boolean"}util.isBoolean=f;function d(T){return T===null}util.isNull=d;function m(T){return T==null}util.isNullOrUndefined=m;function v(T){return typeof T=="number"}util.isNumber=v;function g(T){return typeof T=="string"}util.isString=g;function w(T){return typeof T=="symbol"}util.isSymbol=w;function x(T){return T===void 0}util.isUndefined=x;function S(T){return A(T)==="[object RegExp]"}util.isRegExp=S;function _(T){return typeof T=="object"&&T!==null}util.isObject=_;function b(T){return A(T)==="[object Date]"}util.isDate=b;function C(T){return A(T)==="[object Error]"||T instanceof Error}util.isError=C;function E(T){return typeof T=="function"}util.isFunction=E;function M(T){return T===null||typeof T=="boolean"||typeof T=="number"||typeof T=="string"||typeof T=="symbol"||typeof T>"u"}util.isPrimitive=M,util.isBuffer=requireDist().Buffer.isBuffer;function A(T){return Object.prototype.toString.call(T)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,(function(r){function f(g,w){if(!(g instanceof w))throw new TypeError("Cannot call a class as a function")}var d=requireSafeBuffer().Buffer,m=requireUtil$1();function v(g,w,x){g.copy(w,x)}r.exports=(function(){function g(){f(this,g),this.head=null,this.tail=null,this.length=0}return g.prototype.push=function(x){var S={data:x,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length},g.prototype.unshift=function(x){var S={data:x,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length},g.prototype.shift=function(){if(this.length!==0){var x=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,x}},g.prototype.clear=function(){this.head=this.tail=null,this.length=0},g.prototype.join=function(x){if(this.length===0)return"";for(var S=this.head,_=""+S.data;S=S.next;)_+=x+S.data;return _},g.prototype.concat=function(x){if(this.length===0)return d.alloc(0);for(var S=d.allocUnsafe(x>>>0),_=this.head,b=0;_;)v(_.data,S,b),b+=_.data.length,_=_.next;return S},g})(),m&&m.inspect&&m.inspect.custom&&(r.exports.prototype[m.inspect.custom]=function(){var g=m.inspect({length:this.length});return this.constructor.name+" "+g})})(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var r=requireProcessNextickArgs();function f(v,g){var w=this,x=this._readableState&&this._readableState.destroyed,S=this._writableState&&this._writableState.destroyed;return x||S?(g?g(v):v&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(m,this,v)):r.nextTick(m,this,v)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(v||null,function(_){!g&&_?w._writableState?w._writableState.errorEmitted||(w._writableState.errorEmitted=!0,r.nextTick(m,w,_)):r.nextTick(m,w,_):g&&g(_)}),this)}function d(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function m(v,g){v.emit("error",g)}return destroy_1={destroy:f,undestroy:d},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var r=requireProcessNextickArgs();_stream_writable=T;function f(I){var U=this;this.next=null,this.entry=null,this.finish=function(){$(U,I)}}var d=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:r.nextTick,m;T.WritableState=M;var v=Object.create(requireUtil());v.inherits=requireInherits_browser();var g={deprecate:requireBrowser$a()},w=requireStreamBrowser(),x=requireSafeBuffer().Buffer,S=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _(I){return x.from(I)}function b(I){return x.isBuffer(I)||I instanceof S}var C=requireDestroy();v.inherits(T,w);function E(){}function M(I,U){m=m||require_stream_duplex(),I=I||{};var j=U instanceof m;this.objectMode=!!I.objectMode,j&&(this.objectMode=this.objectMode||!!I.writableObjectMode);var D=I.highWaterMark,W=I.writableHighWaterMark,R=this.objectMode?16:16*1024;D||D===0?this.highWaterMark=D:j&&(W||W===0)?this.highWaterMark=W:this.highWaterMark=R,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=I.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ye){se(U,ye)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new f(this)}M.prototype.getBuffer=function(){for(var U=this.bufferedRequest,j=[];U;)j.push(U),U=U.next;return j},(function(){try{Object.defineProperty(M.prototype,"buffer",{get:g.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var A;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(A=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(I){return A.call(this,I)?!0:this!==T?!1:I&&I._writableState instanceof M}})):A=function(I){return I instanceof this};function T(I){if(m=m||require_stream_duplex(),!A.call(T,this)&&!(this instanceof m))return new T(I);this._writableState=new M(I,this),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),w.call(this)}T.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function L(I,U){var j=new Error("write after end");I.emit("error",j),r.nextTick(U,j)}function O(I,U,j,D){var W=!0,R=!1;return j===null?R=new TypeError("May not write null values to stream"):typeof j!="string"&&j!==void 0&&!U.objectMode&&(R=new TypeError("Invalid non-string/buffer chunk")),R&&(I.emit("error",R),r.nextTick(D,R),W=!1),W}T.prototype.write=function(I,U,j){var D=this._writableState,W=!1,R=!D.objectMode&&b(I);return R&&!x.isBuffer(I)&&(I=_(I)),typeof U=="function"&&(j=U,U=null),R?U="buffer":U||(U=D.defaultEncoding),typeof j!="function"&&(j=E),D.ended?L(this,j):(R||O(this,D,I,j))&&(D.pendingcb++,W=H(this,D,R,I,U,j)),W},T.prototype.cork=function(){var I=this._writableState;I.corked++},T.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&we(this,I))},T.prototype.setDefaultEncoding=function(U){if(typeof U=="string"&&(U=U.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((U+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+U);return this._writableState.defaultEncoding=U,this};function N(I,U,j){return!I.objectMode&&I.decodeStrings!==!1&&typeof U=="string"&&(U=x.from(U,j)),U}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function H(I,U,j,D,W,R){if(!j){var z=N(U,D,W);D!==z&&(j=!0,W="buffer",D=z)}var ye=U.objectMode?1:D.length;U.length+=ye;var Ce=U.length<U.highWaterMark;if(Ce||(U.needDrain=!0),U.writing||U.corked){var me=U.lastBufferedRequest;U.lastBufferedRequest={chunk:D,encoding:W,isBuf:j,callback:R,next:null},me?me.next=U.lastBufferedRequest:U.bufferedRequest=U.lastBufferedRequest,U.bufferedRequestCount+=1}else V(I,U,!1,ye,D,W,R);return Ce}function V(I,U,j,D,W,R,z){U.writelen=D,U.writecb=z,U.writing=!0,U.sync=!0,j?I._writev(W,U.onwrite):I._write(W,R,U.onwrite),U.sync=!1}function X(I,U,j,D,W){--U.pendingcb,j?(r.nextTick(W,D),r.nextTick(y,I,U),I._writableState.errorEmitted=!0,I.emit("error",D)):(W(D),I._writableState.errorEmitted=!0,I.emit("error",D),y(I,U))}function oe(I){I.writing=!1,I.writecb=null,I.length-=I.writelen,I.writelen=0}function se(I,U){var j=I._writableState,D=j.sync,W=j.writecb;if(oe(j),U)X(I,j,D,U,W);else{var R=te(j);!R&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&we(I,j),D?d(de,I,j,R,W):de(I,j,R,W)}}function de(I,U,j,D){j||he(I,U),U.pendingcb--,D(),y(I,U)}function he(I,U){U.length===0&&U.needDrain&&(U.needDrain=!1,I.emit("drain"))}function we(I,U){U.bufferProcessing=!0;var j=U.bufferedRequest;if(I._writev&&j&&j.next){var D=U.bufferedRequestCount,W=new Array(D),R=U.corkedRequestsFree;R.entry=j;for(var z=0,ye=!0;j;)W[z]=j,j.isBuf||(ye=!1),j=j.next,z+=1;W.allBuffers=ye,V(I,U,!0,U.length,W,"",R.finish),U.pendingcb++,U.lastBufferedRequest=null,R.next?(U.corkedRequestsFree=R.next,R.next=null):U.corkedRequestsFree=new f(U),U.bufferedRequestCount=0}else{for(;j;){var Ce=j.chunk,me=j.encoding,ie=j.callback,ee=U.objectMode?1:Ce.length;if(V(I,U,!1,ee,Ce,me,ie),j=j.next,U.bufferedRequestCount--,U.writing)break}j===null&&(U.lastBufferedRequest=null)}U.bufferedRequest=j,U.bufferProcessing=!1}T.prototype._write=function(I,U,j){j(new Error("_write() is not implemented"))},T.prototype._writev=null,T.prototype.end=function(I,U,j){var D=this._writableState;typeof I=="function"?(j=I,I=null,U=null):typeof U=="function"&&(j=U,U=null),I!=null&&this.write(I,U),D.corked&&(D.corked=1,this.uncork()),D.ending||B(this,D,j)};function te(I){return I.ending&&I.length===0&&I.bufferedRequest===null&&!I.finished&&!I.writing}function k(I,U){I._final(function(j){U.pendingcb--,j&&I.emit("error",j),U.prefinished=!0,I.emit("prefinish"),y(I,U)})}function q(I,U){!U.prefinished&&!U.finalCalled&&(typeof I._final=="function"?(U.pendingcb++,U.finalCalled=!0,r.nextTick(k,I,U)):(U.prefinished=!0,I.emit("prefinish")))}function y(I,U){var j=te(U);return j&&(q(I,U),U.pendingcb===0&&(U.finished=!0,I.emit("finish"))),j}function B(I,U,j){U.ending=!0,y(I,U),j&&(U.finished?r.nextTick(j):I.once("finish",j)),U.ended=!0,I.writable=!1}function $(I,U,j){var D=I.entry;for(I.entry=null;D;){var W=D.callback;U.pendingcb--,W(j),D=D.next}U.corkedRequestsFree.next=I}return Object.defineProperty(T.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(I){this._writableState&&(this._writableState.destroyed=I)}}),T.prototype.destroy=C.destroy,T.prototype._undestroy=C.undestroy,T.prototype._destroy=function(I,U){this.end(),U(I)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var r=requireProcessNextickArgs(),f=Object.keys||function(C){var E=[];for(var M in C)E.push(M);return E};_stream_duplex=S;var d=Object.create(requireUtil());d.inherits=requireInherits_browser();var m=require_stream_readable(),v=require_stream_writable();d.inherits(S,m);for(var g=f(v.prototype),w=0;w<g.length;w++){var x=g[w];S.prototype[x]||(S.prototype[x]=v.prototype[x])}function S(C){if(!(this instanceof S))return new S(C);m.call(this,C),v.call(this,C),C&&C.readable===!1&&(this.readable=!1),C&&C.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,C&&C.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",_)}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function _(){this.allowHalfOpen||this._writableState.ended||r.nextTick(b,this)}function b(C){C.end()}return Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(C){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=C,this._writableState.destroyed=C)}}),S.prototype._destroy=function(C,E){this.push(null),this.end(),r.nextTick(E,C)},_stream_duplex}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var r=requireProcessNextickArgs();_stream_readable=N;var f=requireIsarray(),d;N.ReadableState=O,requireEvents().EventEmitter;var m=function(ie,ee){return ie.listeners(ee).length},v=requireStreamBrowser(),g=requireSafeBuffer().Buffer,w=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function x(ie){return g.from(ie)}function S(ie){return g.isBuffer(ie)||ie instanceof w}var _=Object.create(requireUtil());_.inherits=requireInherits_browser();var b=requireUtil$1(),C=void 0;b&&b.debuglog?C=b.debuglog("stream"):C=function(){};var E=requireBufferList(),M=requireDestroy(),A;_.inherits(N,v);var T=["error","close","destroy","pause","resume"];function L(ie,ee,pe){if(typeof ie.prependListener=="function")return ie.prependListener(ee,pe);!ie._events||!ie._events[ee]?ie.on(ee,pe):f(ie._events[ee])?ie._events[ee].unshift(pe):ie._events[ee]=[pe,ie._events[ee]]}function O(ie,ee){d=d||require_stream_duplex(),ie=ie||{};var pe=ee instanceof d;this.objectMode=!!ie.objectMode,pe&&(this.objectMode=this.objectMode||!!ie.readableObjectMode);var be=ie.highWaterMark,ae=ie.readableHighWaterMark,ne=this.objectMode?16:16*1024;be||be===0?this.highWaterMark=be:pe&&(ae||ae===0)?this.highWaterMark=ae:this.highWaterMark=ne,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new E,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ie.encoding&&(A||(A=requireString_decoder().StringDecoder),this.decoder=new A(ie.encoding),this.encoding=ie.encoding)}function N(ie){if(d=d||require_stream_duplex(),!(this instanceof N))return new N(ie);this._readableState=new O(ie,this),this.readable=!0,ie&&(typeof ie.read=="function"&&(this._read=ie.read),typeof ie.destroy=="function"&&(this._destroy=ie.destroy)),v.call(this)}Object.defineProperty(N.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ie){this._readableState&&(this._readableState.destroyed=ie)}}),N.prototype.destroy=M.destroy,N.prototype._undestroy=M.undestroy,N.prototype._destroy=function(ie,ee){this.push(null),ee(ie)},N.prototype.push=function(ie,ee){var pe=this._readableState,be;return pe.objectMode?be=!0:typeof ie=="string"&&(ee=ee||pe.defaultEncoding,ee!==pe.encoding&&(ie=g.from(ie,ee),ee=""),be=!0),H(this,ie,ee,!1,be)},N.prototype.unshift=function(ie){return H(this,ie,null,!0,!1)};function H(ie,ee,pe,be,ae){var ne=ie._readableState;if(ee===null)ne.reading=!1,we(ie,ne);else{var Se;ae||(Se=X(ne,ee)),Se?ie.emit("error",Se):ne.objectMode||ee&&ee.length>0?(typeof ee!="string"&&!ne.objectMode&&Object.getPrototypeOf(ee)!==g.prototype&&(ee=x(ee)),be?ne.endEmitted?ie.emit("error",new Error("stream.unshift() after end event")):V(ie,ne,ee,!0):ne.ended?ie.emit("error",new Error("stream.push() after EOF")):(ne.reading=!1,ne.decoder&&!pe?(ee=ne.decoder.write(ee),ne.objectMode||ee.length!==0?V(ie,ne,ee,!1):q(ie,ne)):V(ie,ne,ee,!1))):be||(ne.reading=!1)}return oe(ne)}function V(ie,ee,pe,be){ee.flowing&&ee.length===0&&!ee.sync?(ie.emit("data",pe),ie.read(0)):(ee.length+=ee.objectMode?1:pe.length,be?ee.buffer.unshift(pe):ee.buffer.push(pe),ee.needReadable&&te(ie)),q(ie,ee)}function X(ie,ee){var pe;return!S(ee)&&typeof ee!="string"&&ee!==void 0&&!ie.objectMode&&(pe=new TypeError("Invalid non-string/buffer chunk")),pe}function oe(ie){return!ie.ended&&(ie.needReadable||ie.length<ie.highWaterMark||ie.length===0)}N.prototype.isPaused=function(){return this._readableState.flowing===!1},N.prototype.setEncoding=function(ie){return A||(A=requireString_decoder().StringDecoder),this._readableState.decoder=new A(ie),this._readableState.encoding=ie,this};var se=8388608;function de(ie){return ie>=se?ie=se:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function he(ie,ee){return ie<=0||ee.length===0&&ee.ended?0:ee.objectMode?1:ie!==ie?ee.flowing&&ee.length?ee.buffer.head.data.length:ee.length:(ie>ee.highWaterMark&&(ee.highWaterMark=de(ie)),ie<=ee.length?ie:ee.ended?ee.length:(ee.needReadable=!0,0))}N.prototype.read=function(ie){C("read",ie),ie=parseInt(ie,10);var ee=this._readableState,pe=ie;if(ie!==0&&(ee.emittedReadable=!1),ie===0&&ee.needReadable&&(ee.length>=ee.highWaterMark||ee.ended))return C("read: emitReadable",ee.length,ee.ended),ee.length===0&&ee.ended?ye(this):te(this),null;if(ie=he(ie,ee),ie===0&&ee.ended)return ee.length===0&&ye(this),null;var be=ee.needReadable;C("need readable",be),(ee.length===0||ee.length-ie<ee.highWaterMark)&&(be=!0,C("length less than watermark",be)),ee.ended||ee.reading?(be=!1,C("reading or ended",be)):be&&(C("do read"),ee.reading=!0,ee.sync=!0,ee.length===0&&(ee.needReadable=!0),this._read(ee.highWaterMark),ee.sync=!1,ee.reading||(ie=he(pe,ee)));var ae;return ie>0?ae=D(ie,ee):ae=null,ae===null?(ee.needReadable=!0,ie=0):ee.length-=ie,ee.length===0&&(ee.ended||(ee.needReadable=!0),pe!==ie&&ee.ended&&ye(this)),ae!==null&&this.emit("data",ae),ae};function we(ie,ee){if(!ee.ended){if(ee.decoder){var pe=ee.decoder.end();pe&&pe.length&&(ee.buffer.push(pe),ee.length+=ee.objectMode?1:pe.length)}ee.ended=!0,te(ie)}}function te(ie){var ee=ie._readableState;ee.needReadable=!1,ee.emittedReadable||(C("emitReadable",ee.flowing),ee.emittedReadable=!0,ee.sync?r.nextTick(k,ie):k(ie))}function k(ie){C("emit readable"),ie.emit("readable"),j(ie)}function q(ie,ee){ee.readingMore||(ee.readingMore=!0,r.nextTick(y,ie,ee))}function y(ie,ee){for(var pe=ee.length;!ee.reading&&!ee.flowing&&!ee.ended&&ee.length<ee.highWaterMark&&(C("maybeReadMore read 0"),ie.read(0),pe!==ee.length);)pe=ee.length;ee.readingMore=!1}N.prototype._read=function(ie){this.emit("error",new Error("_read() is not implemented"))},N.prototype.pipe=function(ie,ee){var pe=this,be=this._readableState;switch(be.pipesCount){case 0:be.pipes=ie;break;case 1:be.pipes=[be.pipes,ie];break;default:be.pipes.push(ie);break}be.pipesCount+=1,C("pipe count=%d opts=%j",be.pipesCount,ee);var ae=(!ee||ee.end!==!1)&&ie!==process$1.stdout&&ie!==process$1.stderr,ne=ae?qe:Je;be.endEmitted?r.nextTick(ne):pe.once("end",ne),ie.on("unpipe",Se);function Se(Ge,ut){C("onunpipe"),Ge===pe&&ut&&ut.hasUnpiped===!1&&(ut.hasUnpiped=!0,Fe())}function qe(){C("onend"),ie.end()}var Ie=B(pe);ie.on("drain",Ie);var Oe=!1;function Fe(){C("cleanup"),ie.removeListener("close",Ye),ie.removeListener("finish",st),ie.removeListener("drain",Ie),ie.removeListener("error",je),ie.removeListener("unpipe",Se),pe.removeListener("end",qe),pe.removeListener("end",Je),pe.removeListener("data",$e),Oe=!0,be.awaitDrain&&(!ie._writableState||ie._writableState.needDrain)&&Ie()}var De=!1;pe.on("data",$e);function $e(Ge){C("ondata"),De=!1;var ut=ie.write(Ge);ut===!1&&!De&&((be.pipesCount===1&&be.pipes===ie||be.pipesCount>1&&me(be.pipes,ie)!==-1)&&!Oe&&(C("false write response, pause",be.awaitDrain),be.awaitDrain++,De=!0),pe.pause())}function je(Ge){C("onerror",Ge),Je(),ie.removeListener("error",je),m(ie,"error")===0&&ie.emit("error",Ge)}L(ie,"error",je);function Ye(){ie.removeListener("finish",st),Je()}ie.once("close",Ye);function st(){C("onfinish"),ie.removeListener("close",Ye),Je()}ie.once("finish",st);function Je(){C("unpipe"),pe.unpipe(ie)}return ie.emit("pipe",pe),be.flowing||(C("pipe resume"),pe.resume()),ie};function B(ie){return function(){var ee=ie._readableState;C("pipeOnDrain",ee.awaitDrain),ee.awaitDrain&&ee.awaitDrain--,ee.awaitDrain===0&&m(ie,"data")&&(ee.flowing=!0,j(ie))}}N.prototype.unpipe=function(ie){var ee=this._readableState,pe={hasUnpiped:!1};if(ee.pipesCount===0)return this;if(ee.pipesCount===1)return ie&&ie!==ee.pipes?this:(ie||(ie=ee.pipes),ee.pipes=null,ee.pipesCount=0,ee.flowing=!1,ie&&ie.emit("unpipe",this,pe),this);if(!ie){var be=ee.pipes,ae=ee.pipesCount;ee.pipes=null,ee.pipesCount=0,ee.flowing=!1;for(var ne=0;ne<ae;ne++)be[ne].emit("unpipe",this,{hasUnpiped:!1});return this}var Se=me(ee.pipes,ie);return Se===-1?this:(ee.pipes.splice(Se,1),ee.pipesCount-=1,ee.pipesCount===1&&(ee.pipes=ee.pipes[0]),ie.emit("unpipe",this,pe),this)},N.prototype.on=function(ie,ee){var pe=v.prototype.on.call(this,ie,ee);if(ie==="data")this._readableState.flowing!==!1&&this.resume();else if(ie==="readable"){var be=this._readableState;!be.endEmitted&&!be.readableListening&&(be.readableListening=be.needReadable=!0,be.emittedReadable=!1,be.reading?be.length&&te(this):r.nextTick($,this))}return pe},N.prototype.addListener=N.prototype.on;function $(ie){C("readable nexttick read 0"),ie.read(0)}N.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(C("resume"),ie.flowing=!0,I(this,ie)),this};function I(ie,ee){ee.resumeScheduled||(ee.resumeScheduled=!0,r.nextTick(U,ie,ee))}function U(ie,ee){ee.reading||(C("resume read 0"),ie.read(0)),ee.resumeScheduled=!1,ee.awaitDrain=0,ie.emit("resume"),j(ie),ee.flowing&&!ee.reading&&ie.read(0)}N.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function j(ie){var ee=ie._readableState;for(C("flow",ee.flowing);ee.flowing&&ie.read()!==null;);}N.prototype.wrap=function(ie){var ee=this,pe=this._readableState,be=!1;ie.on("end",function(){if(C("wrapped end"),pe.decoder&&!pe.ended){var Se=pe.decoder.end();Se&&Se.length&&ee.push(Se)}ee.push(null)}),ie.on("data",function(Se){if(C("wrapped data"),pe.decoder&&(Se=pe.decoder.write(Se)),!(pe.objectMode&&Se==null)&&!(!pe.objectMode&&(!Se||!Se.length))){var qe=ee.push(Se);qe||(be=!0,ie.pause())}});for(var ae in ie)this[ae]===void 0&&typeof ie[ae]=="function"&&(this[ae]=(function(Se){return function(){return ie[Se].apply(ie,arguments)}})(ae));for(var ne=0;ne<T.length;ne++)ie.on(T[ne],this.emit.bind(this,T[ne]));return this._read=function(Se){C("wrapped _read",Se),be&&(be=!1,ie.resume())},this},Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),N._fromList=D;function D(ie,ee){if(ee.length===0)return null;var pe;return ee.objectMode?pe=ee.buffer.shift():!ie||ie>=ee.length?(ee.decoder?pe=ee.buffer.join(""):ee.buffer.length===1?pe=ee.buffer.head.data:pe=ee.buffer.concat(ee.length),ee.buffer.clear()):pe=W(ie,ee.buffer,ee.decoder),pe}function W(ie,ee,pe){var be;return ie<ee.head.data.length?(be=ee.head.data.slice(0,ie),ee.head.data=ee.head.data.slice(ie)):ie===ee.head.data.length?be=ee.shift():be=pe?R(ie,ee):z(ie,ee),be}function R(ie,ee){var pe=ee.head,be=1,ae=pe.data;for(ie-=ae.length;pe=pe.next;){var ne=pe.data,Se=ie>ne.length?ne.length:ie;if(Se===ne.length?ae+=ne:ae+=ne.slice(0,ie),ie-=Se,ie===0){Se===ne.length?(++be,pe.next?ee.head=pe.next:ee.head=ee.tail=null):(ee.head=pe,pe.data=ne.slice(Se));break}++be}return ee.length-=be,ae}function z(ie,ee){var pe=g.allocUnsafe(ie),be=ee.head,ae=1;for(be.data.copy(pe),ie-=be.data.length;be=be.next;){var ne=be.data,Se=ie>ne.length?ne.length:ie;if(ne.copy(pe,pe.length-ie,0,Se),ie-=Se,ie===0){Se===ne.length?(++ae,be.next?ee.head=be.next:ee.head=ee.tail=null):(ee.head=be,be.data=ne.slice(Se));break}++ae}return ee.length-=ae,pe}function ye(ie){var ee=ie._readableState;if(ee.length>0)throw new Error('"endReadable()" called on non-empty stream');ee.endEmitted||(ee.ended=!0,r.nextTick(Ce,ee,ie))}function Ce(ie,ee){!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,ee.readable=!1,ee.emit("end"))}function me(ie,ee){for(var pe=0,be=ie.length;pe<be;pe++)if(ie[pe]===ee)return pe;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=m;var r=require_stream_duplex(),f=Object.create(requireUtil());f.inherits=requireInherits_browser(),f.inherits(m,r);function d(w,x){var S=this._transformState;S.transforming=!1;var _=S.writecb;if(!_)return this.emit("error",new Error("write callback called multiple times"));S.writechunk=null,S.writecb=null,x!=null&&this.push(x),_(w);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function m(w){if(!(this instanceof m))return new m(w);r.call(this,w),this._transformState={afterTransform:d.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,w&&(typeof w.transform=="function"&&(this._transform=w.transform),typeof w.flush=="function"&&(this._flush=w.flush)),this.on("prefinish",v)}function v(){var w=this;typeof this._flush=="function"?this._flush(function(x,S){g(w,x,S)}):g(this,null,null)}m.prototype.push=function(w,x){return this._transformState.needTransform=!1,r.prototype.push.call(this,w,x)},m.prototype._transform=function(w,x,S){throw new Error("_transform() is not implemented")},m.prototype._write=function(w,x,S){var _=this._transformState;if(_.writecb=S,_.writechunk=w,_.writeencoding=x,!_.transforming){var b=this._readableState;(_.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},m.prototype._read=function(w){var x=this._transformState;x.writechunk!==null&&x.writecb&&!x.transforming?(x.transforming=!0,this._transform(x.writechunk,x.writeencoding,x.afterTransform)):x.needTransform=!0},m.prototype._destroy=function(w,x){var S=this;r.prototype._destroy.call(this,w,function(_){x(_),S.emit("close")})};function g(w,x,S){if(x)return w.emit("error",x);if(S!=null&&w.push(S),w._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(w._transformState.transforming)throw new Error("Calling transform done when still transforming");return w.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=d;var r=require_stream_transform(),f=Object.create(requireUtil());f.inherits=requireInherits_browser(),f.inherits(d,r);function d(m){if(!(this instanceof d))return new d(m);r.call(this,m)}return d.prototype._transform=function(m,v,g){g(null,m)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,(function(r,f){f=r.exports=require_stream_readable(),f.Stream=f,f.Readable=f,f.Writable=require_stream_writable(),f.Duplex=require_stream_duplex(),f.Transform=require_stream_transform(),f.PassThrough=require_stream_passthrough()})(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var sign={exports:{}},bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,(function(r){(function(f,d){function m(q,y){if(!q)throw new Error(y||"Assertion failed")}function v(q,y){q.super_=y;var B=function(){};B.prototype=y.prototype,q.prototype=new B,q.prototype.constructor=q}function g(q,y,B){if(g.isBN(q))return q;this.negative=0,this.words=null,this.length=0,this.red=null,q!==null&&((y==="le"||y==="be")&&(B=y,y=10),this._init(q||0,y||10,B||"be"))}typeof f=="object"?f.exports=g:d.BN=g,g.BN=g,g.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}g.isBN=function(y){return y instanceof g?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===g.wordSize&&Array.isArray(y.words)},g.max=function(y,B){return y.cmp(B)>0?y:B},g.min=function(y,B){return y.cmp(B)<0?y:B},g.prototype._init=function(y,B,$){if(typeof y=="number")return this._initNumber(y,B,$);if(typeof y=="object")return this._initArray(y,B,$);B==="hex"&&(B=16),m(B===(B|0)&&B>=2&&B<=36),y=y.toString().replace(/\s+/g,"");var I=0;y[0]==="-"&&(I++,this.negative=1),I<y.length&&(B===16?this._parseHex(y,I,$):(this._parseBase(y,B,I),$==="le"&&this._initArray(this.toArray(),B,$)))},g.prototype._initNumber=function(y,B,$){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(m(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),B,$)},g.prototype._initArray=function(y,B,$){if(m(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var U,j,D=0;if($==="be")for(I=y.length-1,U=0;I>=0;I-=3)j=y[I]|y[I-1]<<8|y[I-2]<<16,this.words[U]|=j<<D&67108863,this.words[U+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,U++);else if($==="le")for(I=0,U=0;I<y.length;I+=3)j=y[I]|y[I+1]<<8|y[I+2]<<16,this.words[U]|=j<<D&67108863,this.words[U+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,U++);return this._strip()};function x(q,y){var B=q.charCodeAt(y);if(B>=48&&B<=57)return B-48;if(B>=65&&B<=70)return B-55;if(B>=97&&B<=102)return B-87;m(!1,"Invalid character in "+q)}function S(q,y,B){var $=x(q,B);return B-1>=y&&($|=x(q,B-1)<<4),$}g.prototype._parseHex=function(y,B,$){this.length=Math.ceil((y.length-B)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var U=0,j=0,D;if($==="be")for(I=y.length-1;I>=B;I-=2)D=S(y,B,I)<<U,this.words[j]|=D&67108863,U>=18?(U-=18,j+=1,this.words[j]|=D>>>26):U+=8;else{var W=y.length-B;for(I=W%2===0?B+1:B;I<y.length;I+=2)D=S(y,B,I)<<U,this.words[j]|=D&67108863,U>=18?(U-=18,j+=1,this.words[j]|=D>>>26):U+=8}this._strip()};function _(q,y,B,$){for(var I=0,U=0,j=Math.min(q.length,B),D=y;D<j;D++){var W=q.charCodeAt(D)-48;I*=$,W>=49?U=W-49+10:W>=17?U=W-17+10:U=W,m(W>=0&&U<$,"Invalid character"),I+=U}return I}g.prototype._parseBase=function(y,B,$){this.words=[0],this.length=1;for(var I=0,U=1;U<=67108863;U*=B)I++;I--,U=U/B|0;for(var j=y.length-$,D=j%I,W=Math.min(j,j-D)+$,R=0,z=$;z<W;z+=I)R=_(y,z,z+I,B),this.imuln(U),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(D!==0){var ye=1;for(R=_(y,z,y.length,B),z=0;z<D;z++)ye*=B;this.imuln(ye),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},g.prototype.copy=function(y){y.words=new Array(this.length);for(var B=0;B<this.length;B++)y.words[B]=this.words[B];y.length=this.length,y.negative=this.negative,y.red=this.red};function b(q,y){q.words=y.words,q.length=y.length,q.negative=y.negative,q.red=y.red}if(g.prototype._move=function(y){b(y,this)},g.prototype.clone=function(){var y=new g(null);return this.copy(y),y},g.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},g.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},g.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{g.prototype[Symbol.for("nodejs.util.inspect.custom")]=C}catch{g.prototype.inspect=C}else g.prototype.inspect=C;function C(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];g.prototype.toString=function(y,B){y=y||10,B=B|0||1;var $;if(y===16||y==="hex"){$="";for(var I=0,U=0,j=0;j<this.length;j++){var D=this.words[j],W=((D<<I|U)&16777215).toString(16);U=D>>>24-I&16777215,I+=2,I>=26&&(I-=26,j--),U!==0||j!==this.length-1?$=E[6-W.length]+W+$:$=W+$}for(U!==0&&($=U.toString(16)+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(y===(y|0)&&y>=2&&y<=36){var R=M[y],z=A[y];$="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var Ce=ye.modrn(z).toString(y);ye=ye.idivn(z),ye.isZero()?$=Ce+$:$=E[R-Ce.length]+Ce+$}for(this.isZero()&&($="0"+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}m(!1,"Base should be between 2 and 36")},g.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},g.prototype.toJSON=function(){return this.toString(16,2)},w&&(g.prototype.toBuffer=function(y,B){return this.toArrayLike(w,y,B)}),g.prototype.toArray=function(y,B){return this.toArrayLike(Array,y,B)};var T=function(y,B){return y.allocUnsafe?y.allocUnsafe(B):new y(B)};g.prototype.toArrayLike=function(y,B,$){this._strip();var I=this.byteLength(),U=$||Math.max(1,I);m(I<=U,"byte array longer than desired length"),m(U>0,"Requested array length <= 0");var j=T(y,U),D=B==="le"?"LE":"BE";return this["_toArrayLike"+D](j,I),j},g.prototype._toArrayLikeLE=function(y,B){for(var $=0,I=0,U=0,j=0;U<this.length;U++){var D=this.words[U]<<j|I;y[$++]=D&255,$<y.length&&(y[$++]=D>>8&255),$<y.length&&(y[$++]=D>>16&255),j===6?($<y.length&&(y[$++]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($<y.length)for(y[$++]=I;$<y.length;)y[$++]=0},g.prototype._toArrayLikeBE=function(y,B){for(var $=y.length-1,I=0,U=0,j=0;U<this.length;U++){var D=this.words[U]<<j|I;y[$--]=D&255,$>=0&&(y[$--]=D>>8&255),$>=0&&(y[$--]=D>>16&255),j===6?($>=0&&(y[$--]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($>=0)for(y[$--]=I;$>=0;)y[$--]=0},Math.clz32?g.prototype._countBits=function(y){return 32-Math.clz32(y)}:g.prototype._countBits=function(y){var B=y,$=0;return B>=4096&&($+=13,B>>>=13),B>=64&&($+=7,B>>>=7),B>=8&&($+=4,B>>>=4),B>=2&&($+=2,B>>>=2),$+B},g.prototype._zeroBits=function(y){if(y===0)return 26;var B=y,$=0;return(B&8191)===0&&($+=13,B>>>=13),(B&127)===0&&($+=7,B>>>=7),(B&15)===0&&($+=4,B>>>=4),(B&3)===0&&($+=2,B>>>=2),(B&1)===0&&$++,$},g.prototype.bitLength=function(){var y=this.words[this.length-1],B=this._countBits(y);return(this.length-1)*26+B};function L(q){for(var y=new Array(q.bitLength()),B=0;B<y.length;B++){var $=B/26|0,I=B%26;y[B]=q.words[$]>>>I&1}return y}g.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,B=0;B<this.length;B++){var $=this._zeroBits(this.words[B]);if(y+=$,$!==26)break}return y},g.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},g.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},g.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},g.prototype.isNeg=function(){return this.negative!==0},g.prototype.neg=function(){return this.clone().ineg()},g.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},g.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var B=0;B<y.length;B++)this.words[B]=this.words[B]|y.words[B];return this._strip()},g.prototype.ior=function(y){return m((this.negative|y.negative)===0),this.iuor(y)},g.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},g.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},g.prototype.iuand=function(y){var B;this.length>y.length?B=y:B=this;for(var $=0;$<B.length;$++)this.words[$]=this.words[$]&y.words[$];return this.length=B.length,this._strip()},g.prototype.iand=function(y){return m((this.negative|y.negative)===0),this.iuand(y)},g.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},g.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},g.prototype.iuxor=function(y){var B,$;this.length>y.length?(B=this,$=y):(B=y,$=this);for(var I=0;I<$.length;I++)this.words[I]=B.words[I]^$.words[I];if(this!==B)for(;I<B.length;I++)this.words[I]=B.words[I];return this.length=B.length,this._strip()},g.prototype.ixor=function(y){return m((this.negative|y.negative)===0),this.iuxor(y)},g.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},g.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},g.prototype.inotn=function(y){m(typeof y=="number"&&y>=0);var B=Math.ceil(y/26)|0,$=y%26;this._expand(B),$>0&&B--;for(var I=0;I<B;I++)this.words[I]=~this.words[I]&67108863;return $>0&&(this.words[I]=~this.words[I]&67108863>>26-$),this._strip()},g.prototype.notn=function(y){return this.clone().inotn(y)},g.prototype.setn=function(y,B){m(typeof y=="number"&&y>=0);var $=y/26|0,I=y%26;return this._expand($+1),B?this.words[$]=this.words[$]|1<<I:this.words[$]=this.words[$]&~(1<<I),this._strip()},g.prototype.iadd=function(y){var B;if(this.negative!==0&&y.negative===0)return this.negative=0,B=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,B=this.isub(y),y.negative=1,B._normSign();var $,I;this.length>y.length?($=this,I=y):($=y,I=this);for(var U=0,j=0;j<I.length;j++)B=($.words[j]|0)+(I.words[j]|0)+U,this.words[j]=B&67108863,U=B>>>26;for(;U!==0&&j<$.length;j++)B=($.words[j]|0)+U,this.words[j]=B&67108863,U=B>>>26;if(this.length=$.length,U!==0)this.words[this.length]=U,this.length++;else if($!==this)for(;j<$.length;j++)this.words[j]=$.words[j];return this},g.prototype.add=function(y){var B;return y.negative!==0&&this.negative===0?(y.negative=0,B=this.sub(y),y.negative^=1,B):y.negative===0&&this.negative!==0?(this.negative=0,B=y.sub(this),this.negative=1,B):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},g.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var B=this.iadd(y);return y.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var $=this.cmp(y);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,U;$>0?(I=this,U=y):(I=y,U=this);for(var j=0,D=0;D<U.length;D++)B=(I.words[D]|0)-(U.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;for(;j!==0&&D<I.length;D++)B=(I.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;if(j===0&&D<I.length&&I!==this)for(;D<I.length;D++)this.words[D]=I.words[D];return this.length=Math.max(this.length,D),I!==this&&(this.negative=1),this._strip()},g.prototype.sub=function(y){return this.clone().isub(y)};function O(q,y,B){B.negative=y.negative^q.negative;var $=q.length+y.length|0;B.length=$,$=$-1|0;var I=q.words[0]|0,U=y.words[0]|0,j=I*U,D=j&67108863,W=j/67108864|0;B.words[0]=D;for(var R=1;R<$;R++){for(var z=W>>>26,ye=W&67108863,Ce=Math.min(R,y.length-1),me=Math.max(0,R-q.length+1);me<=Ce;me++){var ie=R-me|0;I=q.words[ie]|0,U=y.words[me]|0,j=I*U+ye,z+=j/67108864|0,ye=j&67108863}B.words[R]=ye|0,W=z|0}return W!==0?B.words[R]=W|0:B.length--,B._strip()}var N=function(y,B,$){var I=y.words,U=B.words,j=$.words,D=0,W,R,z,ye=I[0]|0,Ce=ye&8191,me=ye>>>13,ie=I[1]|0,ee=ie&8191,pe=ie>>>13,be=I[2]|0,ae=be&8191,ne=be>>>13,Se=I[3]|0,qe=Se&8191,Ie=Se>>>13,Oe=I[4]|0,Fe=Oe&8191,De=Oe>>>13,$e=I[5]|0,je=$e&8191,Ye=$e>>>13,st=I[6]|0,Je=st&8191,Ge=st>>>13,ut=I[7]|0,gt=ut&8191,rt=ut>>>13,wt=I[8]|0,bt=wt&8191,le=wt>>>13,Z=I[9]|0,J=Z&8191,ge=Z>>>13,Ee=U[0]|0,Re=Ee&8191,ke=Ee>>>13,Xe=U[1]|0,He=Xe&8191,Ze=Xe>>>13,xt=U[2]|0,tt=xt&8191,mt=xt>>>13,Tt=U[3]|0,St=Tt&8191,lt=Tt>>>13,Mt=U[4]|0,Ct=Mt&8191,ce=Mt>>>13,Y=U[5]|0,Q=Y&8191,ve=Y>>>13,fe=U[6]|0,F=fe&8191,G=fe>>>13,re=U[7]|0,K=re&8191,ue=re>>>13,Ae=U[8]|0,xe=Ae&8191,Te=Ae>>>13,Pe=U[9]|0,Ue=Pe&8191,Ne=Pe>>>13;$.negative=y.negative^B.negative,$.length=19,W=Math.imul(Ce,Re),R=Math.imul(Ce,ke),R=R+Math.imul(me,Re)|0,z=Math.imul(me,ke);var At=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(At>>>26)|0,At&=67108863,W=Math.imul(ee,Re),R=Math.imul(ee,ke),R=R+Math.imul(pe,Re)|0,z=Math.imul(pe,ke),W=W+Math.imul(Ce,He)|0,R=R+Math.imul(Ce,Ze)|0,R=R+Math.imul(me,He)|0,z=z+Math.imul(me,Ze)|0;var ot=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ot>>>26)|0,ot&=67108863,W=Math.imul(ae,Re),R=Math.imul(ae,ke),R=R+Math.imul(ne,Re)|0,z=Math.imul(ne,ke),W=W+Math.imul(ee,He)|0,R=R+Math.imul(ee,Ze)|0,R=R+Math.imul(pe,He)|0,z=z+Math.imul(pe,Ze)|0,W=W+Math.imul(Ce,tt)|0,R=R+Math.imul(Ce,mt)|0,R=R+Math.imul(me,tt)|0,z=z+Math.imul(me,mt)|0;var yt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(yt>>>26)|0,yt&=67108863,W=Math.imul(qe,Re),R=Math.imul(qe,ke),R=R+Math.imul(Ie,Re)|0,z=Math.imul(Ie,ke),W=W+Math.imul(ae,He)|0,R=R+Math.imul(ae,Ze)|0,R=R+Math.imul(ne,He)|0,z=z+Math.imul(ne,Ze)|0,W=W+Math.imul(ee,tt)|0,R=R+Math.imul(ee,mt)|0,R=R+Math.imul(pe,tt)|0,z=z+Math.imul(pe,mt)|0,W=W+Math.imul(Ce,St)|0,R=R+Math.imul(Ce,lt)|0,R=R+Math.imul(me,St)|0,z=z+Math.imul(me,lt)|0;var vt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(vt>>>26)|0,vt&=67108863,W=Math.imul(Fe,Re),R=Math.imul(Fe,ke),R=R+Math.imul(De,Re)|0,z=Math.imul(De,ke),W=W+Math.imul(qe,He)|0,R=R+Math.imul(qe,Ze)|0,R=R+Math.imul(Ie,He)|0,z=z+Math.imul(Ie,Ze)|0,W=W+Math.imul(ae,tt)|0,R=R+Math.imul(ae,mt)|0,R=R+Math.imul(ne,tt)|0,z=z+Math.imul(ne,mt)|0,W=W+Math.imul(ee,St)|0,R=R+Math.imul(ee,lt)|0,R=R+Math.imul(pe,St)|0,z=z+Math.imul(pe,lt)|0,W=W+Math.imul(Ce,Ct)|0,R=R+Math.imul(Ce,ce)|0,R=R+Math.imul(me,Ct)|0,z=z+Math.imul(me,ce)|0;var _t=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(_t>>>26)|0,_t&=67108863,W=Math.imul(je,Re),R=Math.imul(je,ke),R=R+Math.imul(Ye,Re)|0,z=Math.imul(Ye,ke),W=W+Math.imul(Fe,He)|0,R=R+Math.imul(Fe,Ze)|0,R=R+Math.imul(De,He)|0,z=z+Math.imul(De,Ze)|0,W=W+Math.imul(qe,tt)|0,R=R+Math.imul(qe,mt)|0,R=R+Math.imul(Ie,tt)|0,z=z+Math.imul(Ie,mt)|0,W=W+Math.imul(ae,St)|0,R=R+Math.imul(ae,lt)|0,R=R+Math.imul(ne,St)|0,z=z+Math.imul(ne,lt)|0,W=W+Math.imul(ee,Ct)|0,R=R+Math.imul(ee,ce)|0,R=R+Math.imul(pe,Ct)|0,z=z+Math.imul(pe,ce)|0,W=W+Math.imul(Ce,Q)|0,R=R+Math.imul(Ce,ve)|0,R=R+Math.imul(me,Q)|0,z=z+Math.imul(me,ve)|0;var Ve=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,W=Math.imul(Je,Re),R=Math.imul(Je,ke),R=R+Math.imul(Ge,Re)|0,z=Math.imul(Ge,ke),W=W+Math.imul(je,He)|0,R=R+Math.imul(je,Ze)|0,R=R+Math.imul(Ye,He)|0,z=z+Math.imul(Ye,Ze)|0,W=W+Math.imul(Fe,tt)|0,R=R+Math.imul(Fe,mt)|0,R=R+Math.imul(De,tt)|0,z=z+Math.imul(De,mt)|0,W=W+Math.imul(qe,St)|0,R=R+Math.imul(qe,lt)|0,R=R+Math.imul(Ie,St)|0,z=z+Math.imul(Ie,lt)|0,W=W+Math.imul(ae,Ct)|0,R=R+Math.imul(ae,ce)|0,R=R+Math.imul(ne,Ct)|0,z=z+Math.imul(ne,ce)|0,W=W+Math.imul(ee,Q)|0,R=R+Math.imul(ee,ve)|0,R=R+Math.imul(pe,Q)|0,z=z+Math.imul(pe,ve)|0,W=W+Math.imul(Ce,F)|0,R=R+Math.imul(Ce,G)|0,R=R+Math.imul(me,F)|0,z=z+Math.imul(me,G)|0;var ft=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ft>>>26)|0,ft&=67108863,W=Math.imul(gt,Re),R=Math.imul(gt,ke),R=R+Math.imul(rt,Re)|0,z=Math.imul(rt,ke),W=W+Math.imul(Je,He)|0,R=R+Math.imul(Je,Ze)|0,R=R+Math.imul(Ge,He)|0,z=z+Math.imul(Ge,Ze)|0,W=W+Math.imul(je,tt)|0,R=R+Math.imul(je,mt)|0,R=R+Math.imul(Ye,tt)|0,z=z+Math.imul(Ye,mt)|0,W=W+Math.imul(Fe,St)|0,R=R+Math.imul(Fe,lt)|0,R=R+Math.imul(De,St)|0,z=z+Math.imul(De,lt)|0,W=W+Math.imul(qe,Ct)|0,R=R+Math.imul(qe,ce)|0,R=R+Math.imul(Ie,Ct)|0,z=z+Math.imul(Ie,ce)|0,W=W+Math.imul(ae,Q)|0,R=R+Math.imul(ae,ve)|0,R=R+Math.imul(ne,Q)|0,z=z+Math.imul(ne,ve)|0,W=W+Math.imul(ee,F)|0,R=R+Math.imul(ee,G)|0,R=R+Math.imul(pe,F)|0,z=z+Math.imul(pe,G)|0,W=W+Math.imul(Ce,K)|0,R=R+Math.imul(Ce,ue)|0,R=R+Math.imul(me,K)|0,z=z+Math.imul(me,ue)|0;var et=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(et>>>26)|0,et&=67108863,W=Math.imul(bt,Re),R=Math.imul(bt,ke),R=R+Math.imul(le,Re)|0,z=Math.imul(le,ke),W=W+Math.imul(gt,He)|0,R=R+Math.imul(gt,Ze)|0,R=R+Math.imul(rt,He)|0,z=z+Math.imul(rt,Ze)|0,W=W+Math.imul(Je,tt)|0,R=R+Math.imul(Je,mt)|0,R=R+Math.imul(Ge,tt)|0,z=z+Math.imul(Ge,mt)|0,W=W+Math.imul(je,St)|0,R=R+Math.imul(je,lt)|0,R=R+Math.imul(Ye,St)|0,z=z+Math.imul(Ye,lt)|0,W=W+Math.imul(Fe,Ct)|0,R=R+Math.imul(Fe,ce)|0,R=R+Math.imul(De,Ct)|0,z=z+Math.imul(De,ce)|0,W=W+Math.imul(qe,Q)|0,R=R+Math.imul(qe,ve)|0,R=R+Math.imul(Ie,Q)|0,z=z+Math.imul(Ie,ve)|0,W=W+Math.imul(ae,F)|0,R=R+Math.imul(ae,G)|0,R=R+Math.imul(ne,F)|0,z=z+Math.imul(ne,G)|0,W=W+Math.imul(ee,K)|0,R=R+Math.imul(ee,ue)|0,R=R+Math.imul(pe,K)|0,z=z+Math.imul(pe,ue)|0,W=W+Math.imul(Ce,xe)|0,R=R+Math.imul(Ce,Te)|0,R=R+Math.imul(me,xe)|0,z=z+Math.imul(me,Te)|0;var ht=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ht>>>26)|0,ht&=67108863,W=Math.imul(J,Re),R=Math.imul(J,ke),R=R+Math.imul(ge,Re)|0,z=Math.imul(ge,ke),W=W+Math.imul(bt,He)|0,R=R+Math.imul(bt,Ze)|0,R=R+Math.imul(le,He)|0,z=z+Math.imul(le,Ze)|0,W=W+Math.imul(gt,tt)|0,R=R+Math.imul(gt,mt)|0,R=R+Math.imul(rt,tt)|0,z=z+Math.imul(rt,mt)|0,W=W+Math.imul(Je,St)|0,R=R+Math.imul(Je,lt)|0,R=R+Math.imul(Ge,St)|0,z=z+Math.imul(Ge,lt)|0,W=W+Math.imul(je,Ct)|0,R=R+Math.imul(je,ce)|0,R=R+Math.imul(Ye,Ct)|0,z=z+Math.imul(Ye,ce)|0,W=W+Math.imul(Fe,Q)|0,R=R+Math.imul(Fe,ve)|0,R=R+Math.imul(De,Q)|0,z=z+Math.imul(De,ve)|0,W=W+Math.imul(qe,F)|0,R=R+Math.imul(qe,G)|0,R=R+Math.imul(Ie,F)|0,z=z+Math.imul(Ie,G)|0,W=W+Math.imul(ae,K)|0,R=R+Math.imul(ae,ue)|0,R=R+Math.imul(ne,K)|0,z=z+Math.imul(ne,ue)|0,W=W+Math.imul(ee,xe)|0,R=R+Math.imul(ee,Te)|0,R=R+Math.imul(pe,xe)|0,z=z+Math.imul(pe,Te)|0,W=W+Math.imul(Ce,Ue)|0,R=R+Math.imul(Ce,Ne)|0,R=R+Math.imul(me,Ue)|0,z=z+Math.imul(me,Ne)|0;var it=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(it>>>26)|0,it&=67108863,W=Math.imul(J,He),R=Math.imul(J,Ze),R=R+Math.imul(ge,He)|0,z=Math.imul(ge,Ze),W=W+Math.imul(bt,tt)|0,R=R+Math.imul(bt,mt)|0,R=R+Math.imul(le,tt)|0,z=z+Math.imul(le,mt)|0,W=W+Math.imul(gt,St)|0,R=R+Math.imul(gt,lt)|0,R=R+Math.imul(rt,St)|0,z=z+Math.imul(rt,lt)|0,W=W+Math.imul(Je,Ct)|0,R=R+Math.imul(Je,ce)|0,R=R+Math.imul(Ge,Ct)|0,z=z+Math.imul(Ge,ce)|0,W=W+Math.imul(je,Q)|0,R=R+Math.imul(je,ve)|0,R=R+Math.imul(Ye,Q)|0,z=z+Math.imul(Ye,ve)|0,W=W+Math.imul(Fe,F)|0,R=R+Math.imul(Fe,G)|0,R=R+Math.imul(De,F)|0,z=z+Math.imul(De,G)|0,W=W+Math.imul(qe,K)|0,R=R+Math.imul(qe,ue)|0,R=R+Math.imul(Ie,K)|0,z=z+Math.imul(Ie,ue)|0,W=W+Math.imul(ae,xe)|0,R=R+Math.imul(ae,Te)|0,R=R+Math.imul(ne,xe)|0,z=z+Math.imul(ne,Te)|0,W=W+Math.imul(ee,Ue)|0,R=R+Math.imul(ee,Ne)|0,R=R+Math.imul(pe,Ue)|0,z=z+Math.imul(pe,Ne)|0;var pt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(pt>>>26)|0,pt&=67108863,W=Math.imul(J,tt),R=Math.imul(J,mt),R=R+Math.imul(ge,tt)|0,z=Math.imul(ge,mt),W=W+Math.imul(bt,St)|0,R=R+Math.imul(bt,lt)|0,R=R+Math.imul(le,St)|0,z=z+Math.imul(le,lt)|0,W=W+Math.imul(gt,Ct)|0,R=R+Math.imul(gt,ce)|0,R=R+Math.imul(rt,Ct)|0,z=z+Math.imul(rt,ce)|0,W=W+Math.imul(Je,Q)|0,R=R+Math.imul(Je,ve)|0,R=R+Math.imul(Ge,Q)|0,z=z+Math.imul(Ge,ve)|0,W=W+Math.imul(je,F)|0,R=R+Math.imul(je,G)|0,R=R+Math.imul(Ye,F)|0,z=z+Math.imul(Ye,G)|0,W=W+Math.imul(Fe,K)|0,R=R+Math.imul(Fe,ue)|0,R=R+Math.imul(De,K)|0,z=z+Math.imul(De,ue)|0,W=W+Math.imul(qe,xe)|0,R=R+Math.imul(qe,Te)|0,R=R+Math.imul(Ie,xe)|0,z=z+Math.imul(Ie,Te)|0,W=W+Math.imul(ae,Ue)|0,R=R+Math.imul(ae,Ne)|0,R=R+Math.imul(ne,Ue)|0,z=z+Math.imul(ne,Ne)|0;var at=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(at>>>26)|0,at&=67108863,W=Math.imul(J,St),R=Math.imul(J,lt),R=R+Math.imul(ge,St)|0,z=Math.imul(ge,lt),W=W+Math.imul(bt,Ct)|0,R=R+Math.imul(bt,ce)|0,R=R+Math.imul(le,Ct)|0,z=z+Math.imul(le,ce)|0,W=W+Math.imul(gt,Q)|0,R=R+Math.imul(gt,ve)|0,R=R+Math.imul(rt,Q)|0,z=z+Math.imul(rt,ve)|0,W=W+Math.imul(Je,F)|0,R=R+Math.imul(Je,G)|0,R=R+Math.imul(Ge,F)|0,z=z+Math.imul(Ge,G)|0,W=W+Math.imul(je,K)|0,R=R+Math.imul(je,ue)|0,R=R+Math.imul(Ye,K)|0,z=z+Math.imul(Ye,ue)|0,W=W+Math.imul(Fe,xe)|0,R=R+Math.imul(Fe,Te)|0,R=R+Math.imul(De,xe)|0,z=z+Math.imul(De,Te)|0,W=W+Math.imul(qe,Ue)|0,R=R+Math.imul(qe,Ne)|0,R=R+Math.imul(Ie,Ue)|0,z=z+Math.imul(Ie,Ne)|0;var ct=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ct>>>26)|0,ct&=67108863,W=Math.imul(J,Ct),R=Math.imul(J,ce),R=R+Math.imul(ge,Ct)|0,z=Math.imul(ge,ce),W=W+Math.imul(bt,Q)|0,R=R+Math.imul(bt,ve)|0,R=R+Math.imul(le,Q)|0,z=z+Math.imul(le,ve)|0,W=W+Math.imul(gt,F)|0,R=R+Math.imul(gt,G)|0,R=R+Math.imul(rt,F)|0,z=z+Math.imul(rt,G)|0,W=W+Math.imul(Je,K)|0,R=R+Math.imul(Je,ue)|0,R=R+Math.imul(Ge,K)|0,z=z+Math.imul(Ge,ue)|0,W=W+Math.imul(je,xe)|0,R=R+Math.imul(je,Te)|0,R=R+Math.imul(Ye,xe)|0,z=z+Math.imul(Ye,Te)|0,W=W+Math.imul(Fe,Ue)|0,R=R+Math.imul(Fe,Ne)|0,R=R+Math.imul(De,Ue)|0,z=z+Math.imul(De,Ne)|0;var dt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(dt>>>26)|0,dt&=67108863,W=Math.imul(J,Q),R=Math.imul(J,ve),R=R+Math.imul(ge,Q)|0,z=Math.imul(ge,ve),W=W+Math.imul(bt,F)|0,R=R+Math.imul(bt,G)|0,R=R+Math.imul(le,F)|0,z=z+Math.imul(le,G)|0,W=W+Math.imul(gt,K)|0,R=R+Math.imul(gt,ue)|0,R=R+Math.imul(rt,K)|0,z=z+Math.imul(rt,ue)|0,W=W+Math.imul(Je,xe)|0,R=R+Math.imul(Je,Te)|0,R=R+Math.imul(Ge,xe)|0,z=z+Math.imul(Ge,Te)|0,W=W+Math.imul(je,Ue)|0,R=R+Math.imul(je,Ne)|0,R=R+Math.imul(Ye,Ue)|0,z=z+Math.imul(Ye,Ne)|0;var nt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(nt>>>26)|0,nt&=67108863,W=Math.imul(J,F),R=Math.imul(J,G),R=R+Math.imul(ge,F)|0,z=Math.imul(ge,G),W=W+Math.imul(bt,K)|0,R=R+Math.imul(bt,ue)|0,R=R+Math.imul(le,K)|0,z=z+Math.imul(le,ue)|0,W=W+Math.imul(gt,xe)|0,R=R+Math.imul(gt,Te)|0,R=R+Math.imul(rt,xe)|0,z=z+Math.imul(rt,Te)|0,W=W+Math.imul(Je,Ue)|0,R=R+Math.imul(Je,Ne)|0,R=R+Math.imul(Ge,Ue)|0,z=z+Math.imul(Ge,Ne)|0;var Le=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Le>>>26)|0,Le&=67108863,W=Math.imul(J,K),R=Math.imul(J,ue),R=R+Math.imul(ge,K)|0,z=Math.imul(ge,ue),W=W+Math.imul(bt,xe)|0,R=R+Math.imul(bt,Te)|0,R=R+Math.imul(le,xe)|0,z=z+Math.imul(le,Te)|0,W=W+Math.imul(gt,Ue)|0,R=R+Math.imul(gt,Ne)|0,R=R+Math.imul(rt,Ue)|0,z=z+Math.imul(rt,Ne)|0;var Be=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Be>>>26)|0,Be&=67108863,W=Math.imul(J,xe),R=Math.imul(J,Te),R=R+Math.imul(ge,xe)|0,z=Math.imul(ge,Te),W=W+Math.imul(bt,Ue)|0,R=R+Math.imul(bt,Ne)|0,R=R+Math.imul(le,Ue)|0,z=z+Math.imul(le,Ne)|0;var Ke=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,W=Math.imul(J,Ue),R=Math.imul(J,Ne),R=R+Math.imul(ge,Ue)|0,z=Math.imul(ge,Ne);var We=(D+W|0)+((R&8191)<<13)|0;return D=(z+(R>>>13)|0)+(We>>>26)|0,We&=67108863,j[0]=At,j[1]=ot,j[2]=yt,j[3]=vt,j[4]=_t,j[5]=Ve,j[6]=ft,j[7]=et,j[8]=ht,j[9]=it,j[10]=pt,j[11]=at,j[12]=ct,j[13]=dt,j[14]=nt,j[15]=Le,j[16]=Be,j[17]=Ke,j[18]=We,D!==0&&(j[19]=D,$.length++),$};Math.imul||(N=O);function H(q,y,B){B.negative=y.negative^q.negative,B.length=q.length+y.length;for(var $=0,I=0,U=0;U<B.length-1;U++){var j=I;I=0;for(var D=$&67108863,W=Math.min(U,y.length-1),R=Math.max(0,U-q.length+1);R<=W;R++){var z=U-R,ye=q.words[z]|0,Ce=y.words[R]|0,me=ye*Ce,ie=me&67108863;j=j+(me/67108864|0)|0,ie=ie+D|0,D=ie&67108863,j=j+(ie>>>26)|0,I+=j>>>26,j&=67108863}B.words[U]=D,$=j,j=I}return $!==0?B.words[U]=$:B.length--,B._strip()}function V(q,y,B){return H(q,y,B)}g.prototype.mulTo=function(y,B){var $,I=this.length+y.length;return this.length===10&&y.length===10?$=N(this,y,B):I<63?$=O(this,y,B):I<1024?$=H(this,y,B):$=V(this,y,B),$},g.prototype.mul=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),this.mulTo(y,B)},g.prototype.mulf=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),V(this,y,B)},g.prototype.imul=function(y){return this.clone().mulTo(y,this)},g.prototype.imuln=function(y){var B=y<0;B&&(y=-y),m(typeof y=="number"),m(y<67108864);for(var $=0,I=0;I<this.length;I++){var U=(this.words[I]|0)*y,j=(U&67108863)+($&67108863);$>>=26,$+=U/67108864|0,$+=j>>>26,this.words[I]=j&67108863}return $!==0&&(this.words[I]=$,this.length++),this.length=y===0?1:this.length,B?this.ineg():this},g.prototype.muln=function(y){return this.clone().imuln(y)},g.prototype.sqr=function(){return this.mul(this)},g.prototype.isqr=function(){return this.imul(this.clone())},g.prototype.pow=function(y){var B=L(y);if(B.length===0)return new g(1);for(var $=this,I=0;I<B.length&&B[I]===0;I++,$=$.sqr());if(++I<B.length)for(var U=$.sqr();I<B.length;I++,U=U.sqr())B[I]!==0&&($=$.mul(U));return $},g.prototype.iushln=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=67108863>>>26-B<<26-B,U;if(B!==0){var j=0;for(U=0;U<this.length;U++){var D=this.words[U]&I,W=(this.words[U]|0)-D<<B;this.words[U]=W|j,j=D>>>26-B}j&&(this.words[U]=j,this.length++)}if($!==0){for(U=this.length-1;U>=0;U--)this.words[U+$]=this.words[U];for(U=0;U<$;U++)this.words[U]=0;this.length+=$}return this._strip()},g.prototype.ishln=function(y){return m(this.negative===0),this.iushln(y)},g.prototype.iushrn=function(y,B,$){m(typeof y=="number"&&y>=0);var I;B?I=(B-B%26)/26:I=0;var U=y%26,j=Math.min((y-U)/26,this.length),D=67108863^67108863>>>U<<U,W=$;if(I-=j,I=Math.max(0,I),W){for(var R=0;R<j;R++)W.words[R]=this.words[R];W.length=j}if(j!==0)if(this.length>j)for(this.length-=j,R=0;R<this.length;R++)this.words[R]=this.words[R+j];else this.words[0]=0,this.length=1;var z=0;for(R=this.length-1;R>=0&&(z!==0||R>=I);R--){var ye=this.words[R]|0;this.words[R]=z<<26-U|ye>>>U,z=ye&D}return W&&z!==0&&(W.words[W.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},g.prototype.ishrn=function(y,B,$){return m(this.negative===0),this.iushrn(y,B,$)},g.prototype.shln=function(y){return this.clone().ishln(y)},g.prototype.ushln=function(y){return this.clone().iushln(y)},g.prototype.shrn=function(y){return this.clone().ishrn(y)},g.prototype.ushrn=function(y){return this.clone().iushrn(y)},g.prototype.testn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return!1;var U=this.words[$];return!!(U&I)},g.prototype.imaskn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(B!==0&&$++,this.length=Math.min($,this.length),B!==0){var I=67108863^67108863>>>B<<B;this.words[this.length-1]&=I}return this._strip()},g.prototype.maskn=function(y){return this.clone().imaskn(y)},g.prototype.iaddn=function(y){return m(typeof y=="number"),m(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},g.prototype._iaddn=function(y){this.words[0]+=y;for(var B=0;B<this.length&&this.words[B]>=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},g.prototype.isubn=function(y){if(m(typeof y=="number"),m(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B<this.length&&this.words[B]<0;B++)this.words[B]+=67108864,this.words[B+1]-=1;return this._strip()},g.prototype.addn=function(y){return this.clone().iaddn(y)},g.prototype.subn=function(y){return this.clone().isubn(y)},g.prototype.iabs=function(){return this.negative=0,this},g.prototype.abs=function(){return this.clone().iabs()},g.prototype._ishlnsubmul=function(y,B,$){var I=y.length+$,U;this._expand(I);var j,D=0;for(U=0;U<y.length;U++){j=(this.words[U+$]|0)+D;var W=(y.words[U]|0)*B;j-=W&67108863,D=(j>>26)-(W/67108864|0),this.words[U+$]=j&67108863}for(;U<this.length-$;U++)j=(this.words[U+$]|0)+D,D=j>>26,this.words[U+$]=j&67108863;if(D===0)return this._strip();for(m(D===-1),D=0,U=0;U<this.length;U++)j=-(this.words[U]|0)+D,D=j>>26,this.words[U]=j&67108863;return this.negative=1,this._strip()},g.prototype._wordDiv=function(y,B){var $=this.length-y.length,I=this.clone(),U=y,j=U.words[U.length-1]|0,D=this._countBits(j);$=26-D,$!==0&&(U=U.ushln($),I.iushln($),j=U.words[U.length-1]|0);var W=I.length-U.length,R;if(B!=="mod"){R=new g(null),R.length=W+1,R.words=new Array(R.length);for(var z=0;z<R.length;z++)R.words[z]=0}var ye=I.clone()._ishlnsubmul(U,1,W);ye.negative===0&&(I=ye,R&&(R.words[W]=1));for(var Ce=W-1;Ce>=0;Ce--){var me=(I.words[U.length+Ce]|0)*67108864+(I.words[U.length+Ce-1]|0);for(me=Math.min(me/j|0,67108863),I._ishlnsubmul(U,me,Ce);I.negative!==0;)me--,I.negative=0,I._ishlnsubmul(U,1,Ce),I.isZero()||(I.negative^=1);R&&(R.words[Ce]=me)}return R&&R._strip(),I._strip(),B!=="div"&&$!==0&&I.iushrn($),{div:R||null,mod:I}},g.prototype.divmod=function(y,B,$){if(m(!y.isZero()),this.isZero())return{div:new g(0),mod:new g(0)};var I,U,j;return this.negative!==0&&y.negative===0?(j=this.neg().divmod(y,B),B!=="mod"&&(I=j.div.neg()),B!=="div"&&(U=j.mod.neg(),$&&U.negative!==0&&U.iadd(y)),{div:I,mod:U}):this.negative===0&&y.negative!==0?(j=this.divmod(y.neg(),B),B!=="mod"&&(I=j.div.neg()),{div:I,mod:j.mod}):(this.negative&y.negative)!==0?(j=this.neg().divmod(y.neg(),B),B!=="div"&&(U=j.mod.neg(),$&&U.negative!==0&&U.isub(y)),{div:j.div,mod:U}):y.length>this.length||this.cmp(y)<0?{div:new g(0),mod:this}:y.length===1?B==="div"?{div:this.divn(y.words[0]),mod:null}:B==="mod"?{div:null,mod:new g(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new g(this.modrn(y.words[0]))}:this._wordDiv(y,B)},g.prototype.div=function(y){return this.divmod(y,"div",!1).div},g.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},g.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},g.prototype.divRound=function(y){var B=this.divmod(y);if(B.mod.isZero())return B.div;var $=B.div.negative!==0?B.mod.isub(y):B.mod,I=y.ushrn(1),U=y.andln(1),j=$.cmp(I);return j<0||U===1&&j===0?B.div:B.div.negative!==0?B.div.isubn(1):B.div.iaddn(1)},g.prototype.modrn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=(1<<26)%y,I=0,U=this.length-1;U>=0;U--)I=($*I+(this.words[U]|0))%y;return B?-I:I},g.prototype.modn=function(y){return this.modrn(y)},g.prototype.idivn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=0,I=this.length-1;I>=0;I--){var U=(this.words[I]|0)+$*67108864;this.words[I]=U/y|0,$=U%y}return this._strip(),B?this.ineg():this},g.prototype.divn=function(y){return this.clone().idivn(y)},g.prototype.egcd=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),U=new g(0),j=new g(0),D=new g(1),W=0;B.isEven()&&$.isEven();)B.iushrn(1),$.iushrn(1),++W;for(var R=$.clone(),z=B.clone();!B.isZero();){for(var ye=0,Ce=1;(B.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(B.iushrn(ye);ye-- >0;)(I.isOdd()||U.isOdd())&&(I.iadd(R),U.isub(z)),I.iushrn(1),U.iushrn(1);for(var me=0,ie=1;($.words[0]&ie)===0&&me<26;++me,ie<<=1);if(me>0)for($.iushrn(me);me-- >0;)(j.isOdd()||D.isOdd())&&(j.iadd(R),D.isub(z)),j.iushrn(1),D.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(j),U.isub(D)):($.isub(B),j.isub(I),D.isub(U))}return{a:j,b:D,gcd:$.iushln(W)}},g.prototype._invmp=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),U=new g(0),j=$.clone();B.cmpn(1)>0&&$.cmpn(1)>0;){for(var D=0,W=1;(B.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(B.iushrn(D);D-- >0;)I.isOdd()&&I.iadd(j),I.iushrn(1);for(var R=0,z=1;($.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for($.iushrn(R);R-- >0;)U.isOdd()&&U.iadd(j),U.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(U)):($.isub(B),U.isub(I))}var ye;return B.cmpn(1)===0?ye=I:ye=U,ye.cmpn(0)<0&&ye.iadd(y),ye},g.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var B=this.clone(),$=y.clone();B.negative=0,$.negative=0;for(var I=0;B.isEven()&&$.isEven();I++)B.iushrn(1),$.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;$.isEven();)$.iushrn(1);var U=B.cmp($);if(U<0){var j=B;B=$,$=j}else if(U===0||$.cmpn(1)===0)break;B.isub($)}while(!0);return $.iushln(I)},g.prototype.invm=function(y){return this.egcd(y).a.umod(y)},g.prototype.isEven=function(){return(this.words[0]&1)===0},g.prototype.isOdd=function(){return(this.words[0]&1)===1},g.prototype.andln=function(y){return this.words[0]&y},g.prototype.bincn=function(y){m(typeof y=="number");var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return this._expand($+1),this.words[$]|=I,this;for(var U=I,j=$;U!==0&&j<this.length;j++){var D=this.words[j]|0;D+=U,U=D>>>26,D&=67108863,this.words[j]=D}return U!==0&&(this.words[j]=U,this.length++),this},g.prototype.isZero=function(){return this.length===1&&this.words[0]===0},g.prototype.cmpn=function(y){var B=y<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this._strip();var $;if(this.length>1)$=1;else{B&&(y=-y),m(y<=67108863,"Number is too big");var I=this.words[0]|0;$=I===y?0:I<y?-1:1}return this.negative!==0?-$|0:$},g.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var B=this.ucmp(y);return this.negative!==0?-B|0:B},g.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var B=0,$=this.length-1;$>=0;$--){var I=this.words[$]|0,U=y.words[$]|0;if(I!==U){I<U?B=-1:I>U&&(B=1);break}}return B},g.prototype.gtn=function(y){return this.cmpn(y)===1},g.prototype.gt=function(y){return this.cmp(y)===1},g.prototype.gten=function(y){return this.cmpn(y)>=0},g.prototype.gte=function(y){return this.cmp(y)>=0},g.prototype.ltn=function(y){return this.cmpn(y)===-1},g.prototype.lt=function(y){return this.cmp(y)===-1},g.prototype.lten=function(y){return this.cmpn(y)<=0},g.prototype.lte=function(y){return this.cmp(y)<=0},g.prototype.eqn=function(y){return this.cmpn(y)===0},g.prototype.eq=function(y){return this.cmp(y)===0},g.red=function(y){return new te(y)},g.prototype.toRed=function(y){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},g.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},g.prototype._forceRed=function(y){return this.red=y,this},g.prototype.forceRed=function(y){return m(!this.red,"Already a number in reduction context"),this._forceRed(y)},g.prototype.redAdd=function(y){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},g.prototype.redIAdd=function(y){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},g.prototype.redSub=function(y){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},g.prototype.redISub=function(y){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},g.prototype.redShl=function(y){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},g.prototype.redMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},g.prototype.redIMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},g.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},g.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},g.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},g.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},g.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},g.prototype.redPow=function(y){return m(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var X={k256:null,p224:null,p192:null,p25519:null};function oe(q,y){this.name=q,this.p=new g(y,16),this.n=this.p.bitLength(),this.k=new g(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}oe.prototype._tmp=function(){var y=new g(null);return y.words=new Array(Math.ceil(this.n/13)),y},oe.prototype.ireduce=function(y){var B=y,$;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),$=B.bitLength();while($>this.n);var I=$<this.n?-1:B.ucmp(this.p);return I===0?(B.words[0]=0,B.length=1):I>0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},oe.prototype.split=function(y,B){y.iushrn(this.n,0,B)},oe.prototype.imulK=function(y){return y.imul(this.k)};function se(){oe.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(se,oe),se.prototype.split=function(y,B){for(var $=4194303,I=Math.min(y.length,9),U=0;U<I;U++)B.words[U]=y.words[U];if(B.length=I,y.length<=9){y.words[0]=0,y.length=1;return}var j=y.words[9];for(B.words[B.length++]=j&$,U=10;U<y.length;U++){var D=y.words[U]|0;y.words[U-10]=(D&$)<<4|j>>>22,j=D}j>>>=22,y.words[U-10]=j,j===0&&y.length>10?y.length-=10:y.length-=9},se.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var B=0,$=0;$<y.length;$++){var I=y.words[$]|0;B+=I*977,y.words[$]=B&67108863,B=I*64+(B/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function de(){oe.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(de,oe);function he(){oe.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(he,oe);function we(){oe.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(we,oe),we.prototype.imulK=function(y){for(var B=0,$=0;$<y.length;$++){var I=(y.words[$]|0)*19+B,U=I&67108863;I>>>=26,y.words[$]=U,B=I}return B!==0&&(y.words[y.length++]=B),y},g._prime=function(y){if(X[y])return X[y];var B;if(y==="k256")B=new se;else if(y==="p224")B=new de;else if(y==="p192")B=new he;else if(y==="p25519")B=new we;else throw new Error("Unknown prime "+y);return X[y]=B,B};function te(q){if(typeof q=="string"){var y=g._prime(q);this.m=y.p,this.prime=y}else m(q.gtn(1),"modulus must be greater than 1"),this.m=q,this.prime=null}te.prototype._verify1=function(y){m(y.negative===0,"red works only with positives"),m(y.red,"red works only with red numbers")},te.prototype._verify2=function(y,B){m((y.negative|B.negative)===0,"red works only with positives"),m(y.red&&y.red===B.red,"red works only with red numbers")},te.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(b(y,y.umod(this.m)._forceRed(this)),y)},te.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},te.prototype.add=function(y,B){this._verify2(y,B);var $=y.add(B);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},te.prototype.iadd=function(y,B){this._verify2(y,B);var $=y.iadd(B);return $.cmp(this.m)>=0&&$.isub(this.m),$},te.prototype.sub=function(y,B){this._verify2(y,B);var $=y.sub(B);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},te.prototype.isub=function(y,B){this._verify2(y,B);var $=y.isub(B);return $.cmpn(0)<0&&$.iadd(this.m),$},te.prototype.shl=function(y,B){return this._verify1(y),this.imod(y.ushln(B))},te.prototype.imul=function(y,B){return this._verify2(y,B),this.imod(y.imul(B))},te.prototype.mul=function(y,B){return this._verify2(y,B),this.imod(y.mul(B))},te.prototype.isqr=function(y){return this.imul(y,y.clone())},te.prototype.sqr=function(y){return this.mul(y,y)},te.prototype.sqrt=function(y){if(y.isZero())return y.clone();var B=this.m.andln(3);if(m(B%2===1),B===3){var $=this.m.add(new g(1)).iushrn(2);return this.pow(y,$)}for(var I=this.m.subn(1),U=0;!I.isZero()&&I.andln(1)===0;)U++,I.iushrn(1);m(!I.isZero());var j=new g(1).toRed(this),D=j.redNeg(),W=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new g(2*R*R).toRed(this);this.pow(R,W).cmp(D)!==0;)R.redIAdd(D);for(var z=this.pow(R,I),ye=this.pow(y,I.addn(1).iushrn(1)),Ce=this.pow(y,I),me=U;Ce.cmp(j)!==0;){for(var ie=Ce,ee=0;ie.cmp(j)!==0;ee++)ie=ie.redSqr();m(ee<me);var pe=this.pow(z,new g(1).iushln(me-ee-1));ye=ye.redMul(pe),z=pe.redSqr(),Ce=Ce.redMul(z),me=ee}return ye},te.prototype.invm=function(y){var B=y._invmp(this.m);return B.negative!==0?(B.negative=0,this.imod(B).redNeg()):this.imod(B)},te.prototype.pow=function(y,B){if(B.isZero())return new g(1).toRed(this);if(B.cmpn(1)===0)return y.clone();var $=4,I=new Array(1<<$);I[0]=new g(1).toRed(this),I[1]=y;for(var U=2;U<I.length;U++)I[U]=this.mul(I[U-1],y);var j=I[0],D=0,W=0,R=B.bitLength()%26;for(R===0&&(R=26),U=B.length-1;U>=0;U--){for(var z=B.words[U],ye=R-1;ye>=0;ye--){var Ce=z>>ye&1;if(j!==I[0]&&(j=this.sqr(j)),Ce===0&&D===0){W=0;continue}D<<=1,D|=Ce,W++,!(W!==$&&(U!==0||ye!==0))&&(j=this.mul(j,I[D]),W=0,D=0)}R=26}return j},te.prototype.convertTo=function(y){var B=y.umod(this.m);return B===y?B.clone():B},te.prototype.convertFrom=function(y){var B=y.clone();return B.red=null,B},g.mont=function(y){return new k(y)};function k(q){te.call(this,q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(k,te),k.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},k.prototype.convertFrom=function(y){var B=this.imod(y.mul(this.rinv));return B.red=null,B},k.prototype.imul=function(y,B){if(y.isZero()||B.isZero())return y.words[0]=0,y.length=1,y;var $=y.imul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),U=$.isub(I).iushrn(this.shift),j=U;return U.cmp(this.m)>=0?j=U.isub(this.m):U.cmpn(0)<0&&(j=U.iadd(this.m)),j._forceRed(this)},k.prototype.mul=function(y,B){if(y.isZero()||B.isZero())return new g(0)._forceRed(this);var $=y.mul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),U=$.isub(I).iushrn(this.shift),j=U;return U.cmp(this.m)>=0?j=U.isub(this.m):U.cmpn(0)<0&&(j=U.iadd(this.m)),j._forceRed(this)},k.prototype.invm=function(y){var B=this.imod(y._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(r,bn$2)})(bn$3)),bn$3.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var r=requireBn$1(),f=requireBrowser$b(),d=requireSafeBuffer$1().Buffer;function m(w){var x=w.modulus.byteLength(),S;do S=new r(f(x));while(S.cmp(w.modulus)>=0||!S.umod(w.prime1)||!S.umod(w.prime2));return S}function v(w){var x=m(w),S=x.toRed(r.mont(w.modulus)).redPow(new r(w.publicExponent)).fromRed();return{blinder:S,unblinder:x.invm(w.modulus)}}function g(w,x){var S=v(x),_=x.modulus.byteLength(),b=new r(w).mul(S.blinder).umod(x.modulus),C=b.toRed(r.mont(x.prime1)),E=b.toRed(r.mont(x.prime2)),M=x.coefficient,A=x.prime1,T=x.prime2,L=C.redPow(x.exponent1).fromRed(),O=E.redPow(x.exponent2).fromRed(),N=L.isub(O).imul(M).umod(A).imul(T);return O.iadd(N).imul(S.unblinder).umod(x.modulus).toArrayLike(d,"be",_)}return g.getr=m,browserifyRsa=g,browserifyRsa}var elliptic={};const version="6.6.1",require$$0={version};var utils$2={},utils$1={},hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,(function(r){var f=r;function d(g,w){if(Array.isArray(g))return g.slice();if(!g)return[];var x=[];if(typeof g!="string"){for(var S=0;S<g.length;S++)x[S]=g[S]|0;return x}if(w==="hex"){g=g.replace(/[^a-z0-9]+/ig,""),g.length%2!==0&&(g="0"+g);for(var S=0;S<g.length;S+=2)x.push(parseInt(g[S]+g[S+1],16))}else for(var S=0;S<g.length;S++){var _=g.charCodeAt(S),b=_>>8,C=_&255;b?x.push(b,C):x.push(C)}return x}f.toArray=d;function m(g){return g.length===1?"0"+g:g}f.zero2=m;function v(g){for(var w="",x=0;x<g.length;x++)w+=m(g[x].toString(16));return w}f.toHex=v,f.encode=function(w,x){return x==="hex"?v(w):w}})(utils$1)),utils$1}var hasRequiredUtils$1;function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,(function(r){var f=r,d=requireBn$2(),m=requireMinimalisticAssert(),v=requireUtils$2();f.assert=m,f.toArray=v.toArray,f.zero2=v.zero2,f.toHex=v.toHex,f.encode=v.encode;function g(b,C,E){var M=new Array(Math.max(b.bitLength(),E)+1),A;for(A=0;A<M.length;A+=1)M[A]=0;var T=1<<C+1,L=b.clone();for(A=0;A<M.length;A++){var O,N=L.andln(T-1);L.isOdd()?(N>(T>>1)-1?O=(T>>1)-N:O=N,L.isubn(O)):O=0,M[A]=O,L.iushrn(1)}return M}f.getNAF=g;function w(b,C){var E=[[],[]];b=b.clone(),C=C.clone();for(var M=0,A=0,T;b.cmpn(-M)>0||C.cmpn(-A)>0;){var L=b.andln(3)+M&3,O=C.andln(3)+A&3;L===3&&(L=-1),O===3&&(O=-1);var N;(L&1)===0?N=0:(T=b.andln(7)+M&7,(T===3||T===5)&&O===2?N=-L:N=L),E[0].push(N);var H;(O&1)===0?H=0:(T=C.andln(7)+A&7,(T===3||T===5)&&L===2?H=-O:H=O),E[1].push(H),2*M===N+1&&(M=1-M),2*A===H+1&&(A=1-A),b.iushrn(1),C.iushrn(1)}return E}f.getJSF=w;function x(b,C,E){var M="_"+C;b.prototype[C]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}f.cachedProperty=x;function S(b){return typeof b=="string"?f.toArray(b,"hex"):b}f.parseBytes=S;function _(b){return new d(b,"hex","le")}f.intFromLE=_})(utils$2)),utils$2}var curve={},base$1,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.getNAF,m=f.getJSF,v=f.assert;function g(x,S){this.type=x,this.p=new r(S.p,16),this.red=S.prime?r.red(S.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=S.n&&new r(S.n,16),this.g=S.g&&this.pointFromJSON(S.g,S.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var _=this.n&&this.p.div(this.n);!_||_.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$1=g,g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(S,_){v(S.precomputed);var b=S._getDoubles(),C=d(_,1,this._bitLength),E=(1<<b.step+1)-(b.step%2===0?2:1);E/=3;var M=[],A,T;for(A=0;A<C.length;A+=b.step){T=0;for(var L=A+b.step-1;L>=A;L--)T=(T<<1)+C[L];M.push(T)}for(var O=this.jpoint(null,null,null),N=this.jpoint(null,null,null),H=E;H>0;H--){for(A=0;A<M.length;A++)T=M[A],T===H?N=N.mixedAdd(b.points[A]):T===-H&&(N=N.mixedAdd(b.points[A].neg()));O=O.add(N)}return O.toP()},g.prototype._wnafMul=function(S,_){var b=4,C=S._getNAFPoints(b);b=C.wnd;for(var E=C.points,M=d(_,b,this._bitLength),A=this.jpoint(null,null,null),T=M.length-1;T>=0;T--){for(var L=0;T>=0&&M[T]===0;T--)L++;if(T>=0&&L++,A=A.dblp(L),T<0)break;var O=M[T];v(O!==0),S.type==="affine"?O>0?A=A.mixedAdd(E[O-1>>1]):A=A.mixedAdd(E[-O-1>>1].neg()):O>0?A=A.add(E[O-1>>1]):A=A.add(E[-O-1>>1].neg())}return S.type==="affine"?A.toP():A},g.prototype._wnafMulAdd=function(S,_,b,C,E){var M=this._wnafT1,A=this._wnafT2,T=this._wnafT3,L=0,O,N,H;for(O=0;O<C;O++){H=_[O];var V=H._getNAFPoints(S);M[O]=V.wnd,A[O]=V.points}for(O=C-1;O>=1;O-=2){var X=O-1,oe=O;if(M[X]!==1||M[oe]!==1){T[X]=d(b[X],M[X],this._bitLength),T[oe]=d(b[oe],M[oe],this._bitLength),L=Math.max(T[X].length,L),L=Math.max(T[oe].length,L);continue}var se=[_[X],null,null,_[oe]];_[X].y.cmp(_[oe].y)===0?(se[1]=_[X].add(_[oe]),se[2]=_[X].toJ().mixedAdd(_[oe].neg())):_[X].y.cmp(_[oe].y.redNeg())===0?(se[1]=_[X].toJ().mixedAdd(_[oe]),se[2]=_[X].add(_[oe].neg())):(se[1]=_[X].toJ().mixedAdd(_[oe]),se[2]=_[X].toJ().mixedAdd(_[oe].neg()));var de=[-3,-1,-5,-7,0,7,5,1,3],he=m(b[X],b[oe]);for(L=Math.max(he[0].length,L),T[X]=new Array(L),T[oe]=new Array(L),N=0;N<L;N++){var we=he[0][N]|0,te=he[1][N]|0;T[X][N]=de[(we+1)*3+(te+1)],T[oe][N]=0,A[X]=se}}var k=this.jpoint(null,null,null),q=this._wnafT4;for(O=L;O>=0;O--){for(var y=0;O>=0;){var B=!0;for(N=0;N<C;N++)q[N]=T[N][O]|0,q[N]!==0&&(B=!1);if(!B)break;y++,O--}if(O>=0&&y++,k=k.dblp(y),O<0)break;for(N=0;N<C;N++){var $=q[N];$!==0&&($>0?H=A[N][$-1>>1]:$<0&&(H=A[N][-$-1>>1].neg()),H.type==="affine"?k=k.mixedAdd(H):k=k.add(H))}}for(O=0;O<C;O++)A[O]=null;return E?k:k.toP()};function w(x,S){this.curve=x,this.type=S,this.precomputed=null}return g.BasePoint=w,w.prototype.eq=function(){throw new Error("Not implemented")},w.prototype.validate=function(){return this.curve.validate(this)},g.prototype.decodePoint=function(S,_){S=f.toArray(S,_);var b=this.p.byteLength();if((S[0]===4||S[0]===6||S[0]===7)&&S.length-1===2*b){S[0]===6?v(S[S.length-1]%2===0):S[0]===7&&v(S[S.length-1]%2===1);var C=this.point(S.slice(1,1+b),S.slice(1+b,1+2*b));return C}else if((S[0]===2||S[0]===3)&&S.length-1===b)return this.pointFromX(S.slice(1,1+b),S[0]===3);throw new Error("Unknown point format")},w.prototype.encodeCompressed=function(S){return this.encode(S,!0)},w.prototype._encode=function(S){var _=this.curve.p.byteLength(),b=this.getX().toArray("be",_);return S?[this.getY().isEven()?2:3].concat(b):[4].concat(b,this.getY().toArray("be",_))},w.prototype.encode=function(S,_){return f.encode(this._encode(_),S)},w.prototype.precompute=function(S){if(this.precomputed)return this;var _={doubles:null,naf:null,beta:null};return _.naf=this._getNAFPoints(8),_.doubles=this._getDoubles(4,S),_.beta=this._getBeta(),this.precomputed=_,this},w.prototype._hasDoubles=function(S){if(!this.precomputed)return!1;var _=this.precomputed.doubles;return _?_.points.length>=Math.ceil((S.bitLength()+1)/_.step):!1},w.prototype._getDoubles=function(S,_){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var b=[this],C=this,E=0;E<_;E+=S){for(var M=0;M<S;M++)C=C.dbl();b.push(C)}return{step:S,points:b}},w.prototype._getNAFPoints=function(S){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var _=[this],b=(1<<S)-1,C=b===1?null:this.dbl(),E=1;E<b;E++)_[E]=_[E-1].add(C);return{wnd:S,points:_}},w.prototype._getBeta=function(){return null},w.prototype.dblp=function(S){for(var _=this,b=0;b<S;b++)_=_.dbl();return _},base$1}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var r=requireUtils$1(),f=requireBn$2(),d=requireInherits_browser(),m=requireBase$1(),v=r.assert;function g(S){m.call(this,"short",S),this.a=new f(S.a,16).toRed(this.red),this.b=new f(S.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(S),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}d(g,m),short=g,g.prototype._getEndomorphism=function(_){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var b,C;if(_.beta)b=new f(_.beta,16).toRed(this.red);else{var E=this._getEndoRoots(this.p);b=E[0].cmp(E[1])<0?E[0]:E[1],b=b.toRed(this.red)}if(_.lambda)C=new f(_.lambda,16);else{var M=this._getEndoRoots(this.n);this.g.mul(M[0]).x.cmp(this.g.x.redMul(b))===0?C=M[0]:(C=M[1],v(this.g.mul(C).x.cmp(this.g.x.redMul(b))===0))}var A;return _.basis?A=_.basis.map(function(T){return{a:new f(T.a,16),b:new f(T.b,16)}}):A=this._getEndoBasis(C),{beta:b,lambda:C,basis:A}}},g.prototype._getEndoRoots=function(_){var b=_===this.p?this.red:f.mont(_),C=new f(2).toRed(b).redInvm(),E=C.redNeg(),M=new f(3).toRed(b).redNeg().redSqrt().redMul(C),A=E.redAdd(M).fromRed(),T=E.redSub(M).fromRed();return[A,T]},g.prototype._getEndoBasis=function(_){for(var b=this.n.ushrn(Math.floor(this.n.bitLength()/2)),C=_,E=this.n.clone(),M=new f(1),A=new f(0),T=new f(0),L=new f(1),O,N,H,V,X,oe,se,de=0,he,we;C.cmpn(0)!==0;){var te=E.div(C);he=E.sub(te.mul(C)),we=T.sub(te.mul(M));var k=L.sub(te.mul(A));if(!H&&he.cmp(b)<0)O=se.neg(),N=M,H=he.neg(),V=we;else if(H&&++de===2)break;se=he,E=C,C=he,T=M,M=we,L=A,A=k}X=he.neg(),oe=we;var q=H.sqr().add(V.sqr()),y=X.sqr().add(oe.sqr());return y.cmp(q)>=0&&(X=O,oe=N),H.negative&&(H=H.neg(),V=V.neg()),X.negative&&(X=X.neg(),oe=oe.neg()),[{a:H,b:V},{a:X,b:oe}]},g.prototype._endoSplit=function(_){var b=this.endo.basis,C=b[0],E=b[1],M=E.b.mul(_).divRound(this.n),A=C.b.neg().mul(_).divRound(this.n),T=M.mul(C.a),L=A.mul(E.a),O=M.mul(C.b),N=A.mul(E.b),H=_.sub(T).sub(L),V=O.add(N).neg();return{k1:H,k2:V}},g.prototype.pointFromX=function(_,b){_=new f(_,16),_.red||(_=_.toRed(this.red));var C=_.redSqr().redMul(_).redIAdd(_.redMul(this.a)).redIAdd(this.b),E=C.redSqrt();if(E.redSqr().redSub(C).cmp(this.zero)!==0)throw new Error("invalid point");var M=E.fromRed().isOdd();return(b&&!M||!b&&M)&&(E=E.redNeg()),this.point(_,E)},g.prototype.validate=function(_){if(_.inf)return!0;var b=_.x,C=_.y,E=this.a.redMul(b),M=b.redSqr().redMul(b).redIAdd(E).redIAdd(this.b);return C.redSqr().redISub(M).cmpn(0)===0},g.prototype._endoWnafMulAdd=function(_,b,C){for(var E=this._endoWnafT1,M=this._endoWnafT2,A=0;A<_.length;A++){var T=this._endoSplit(b[A]),L=_[A],O=L._getBeta();T.k1.negative&&(T.k1.ineg(),L=L.neg(!0)),T.k2.negative&&(T.k2.ineg(),O=O.neg(!0)),E[A*2]=L,E[A*2+1]=O,M[A*2]=T.k1,M[A*2+1]=T.k2}for(var N=this._wnafMulAdd(1,E,M,A*2,C),H=0;H<A*2;H++)E[H]=null,M[H]=null;return N};function w(S,_,b,C){m.BasePoint.call(this,S,"affine"),_===null&&b===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new f(_,16),this.y=new f(b,16),C&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}d(w,m.BasePoint),g.prototype.point=function(_,b,C){return new w(this,_,b,C)},g.prototype.pointFromJSON=function(_,b){return w.fromJSON(this,_,b)},w.prototype._getBeta=function(){if(this.curve.endo){var _=this.precomputed;if(_&&_.beta)return _.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(_){var C=this.curve,E=function(M){return C.point(M.x.redMul(C.endo.beta),M.y)};_.beta=b,b.precomputed={beta:null,naf:_.naf&&{wnd:_.naf.wnd,points:_.naf.points.map(E)},doubles:_.doubles&&{step:_.doubles.step,points:_.doubles.points.map(E)}}}return b}},w.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},w.fromJSON=function(_,b,C){typeof b=="string"&&(b=JSON.parse(b));var E=_.point(b[0],b[1],C);if(!b[2])return E;function M(T){return _.point(T[0],T[1],C)}var A=b[2];return E.precomputed={beta:null,doubles:A.doubles&&{step:A.doubles.step,points:[E].concat(A.doubles.points.map(M))},naf:A.naf&&{wnd:A.naf.wnd,points:[E].concat(A.naf.points.map(M))}},E},w.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},w.prototype.isInfinity=function(){return this.inf},w.prototype.add=function(_){if(this.inf)return _;if(_.inf)return this;if(this.eq(_))return this.dbl();if(this.neg().eq(_))return this.curve.point(null,null);if(this.x.cmp(_.x)===0)return this.curve.point(null,null);var b=this.y.redSub(_.y);b.cmpn(0)!==0&&(b=b.redMul(this.x.redSub(_.x).redInvm()));var C=b.redSqr().redISub(this.x).redISub(_.x),E=b.redMul(this.x.redSub(C)).redISub(this.y);return this.curve.point(C,E)},w.prototype.dbl=function(){if(this.inf)return this;var _=this.y.redAdd(this.y);if(_.cmpn(0)===0)return this.curve.point(null,null);var b=this.curve.a,C=this.x.redSqr(),E=_.redInvm(),M=C.redAdd(C).redIAdd(C).redIAdd(b).redMul(E),A=M.redSqr().redISub(this.x.redAdd(this.x)),T=M.redMul(this.x.redSub(A)).redISub(this.y);return this.curve.point(A,T)},w.prototype.getX=function(){return this.x.fromRed()},w.prototype.getY=function(){return this.y.fromRed()},w.prototype.mul=function(_){return _=new f(_,16),this.isInfinity()?this:this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve.endo?this.curve._endoWnafMulAdd([this],[_]):this.curve._wnafMul(this,_)},w.prototype.mulAdd=function(_,b,C){var E=[this,b],M=[_,C];return this.curve.endo?this.curve._endoWnafMulAdd(E,M):this.curve._wnafMulAdd(1,E,M,2)},w.prototype.jmulAdd=function(_,b,C){var E=[this,b],M=[_,C];return this.curve.endo?this.curve._endoWnafMulAdd(E,M,!0):this.curve._wnafMulAdd(1,E,M,2,!0)},w.prototype.eq=function(_){return this===_||this.inf===_.inf&&(this.inf||this.x.cmp(_.x)===0&&this.y.cmp(_.y)===0)},w.prototype.neg=function(_){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(_&&this.precomputed){var C=this.precomputed,E=function(M){return M.neg()};b.precomputed={naf:C.naf&&{wnd:C.naf.wnd,points:C.naf.points.map(E)},doubles:C.doubles&&{step:C.doubles.step,points:C.doubles.points.map(E)}}}return b},w.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var _=this.curve.jpoint(this.x,this.y,this.curve.one);return _};function x(S,_,b,C){m.BasePoint.call(this,S,"jacobian"),_===null&&b===null&&C===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new f(0)):(this.x=new f(_,16),this.y=new f(b,16),this.z=new f(C,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return d(x,m.BasePoint),g.prototype.jpoint=function(_,b,C){return new x(this,_,b,C)},x.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var _=this.z.redInvm(),b=_.redSqr(),C=this.x.redMul(b),E=this.y.redMul(b).redMul(_);return this.curve.point(C,E)},x.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},x.prototype.add=function(_){if(this.isInfinity())return _;if(_.isInfinity())return this;var b=_.z.redSqr(),C=this.z.redSqr(),E=this.x.redMul(b),M=_.x.redMul(C),A=this.y.redMul(b.redMul(_.z)),T=_.y.redMul(C.redMul(this.z)),L=E.redSub(M),O=A.redSub(T);if(L.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var N=L.redSqr(),H=N.redMul(L),V=E.redMul(N),X=O.redSqr().redIAdd(H).redISub(V).redISub(V),oe=O.redMul(V.redISub(X)).redISub(A.redMul(H)),se=this.z.redMul(_.z).redMul(L);return this.curve.jpoint(X,oe,se)},x.prototype.mixedAdd=function(_){if(this.isInfinity())return _.toJ();if(_.isInfinity())return this;var b=this.z.redSqr(),C=this.x,E=_.x.redMul(b),M=this.y,A=_.y.redMul(b).redMul(this.z),T=C.redSub(E),L=M.redSub(A);if(T.cmpn(0)===0)return L.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=T.redSqr(),N=O.redMul(T),H=C.redMul(O),V=L.redSqr().redIAdd(N).redISub(H).redISub(H),X=L.redMul(H.redISub(V)).redISub(M.redMul(N)),oe=this.z.redMul(T);return this.curve.jpoint(V,X,oe)},x.prototype.dblp=function(_){if(_===0)return this;if(this.isInfinity())return this;if(!_)return this.dbl();var b;if(this.curve.zeroA||this.curve.threeA){var C=this;for(b=0;b<_;b++)C=C.dbl();return C}var E=this.curve.a,M=this.curve.tinv,A=this.x,T=this.y,L=this.z,O=L.redSqr().redSqr(),N=T.redAdd(T);for(b=0;b<_;b++){var H=A.redSqr(),V=N.redSqr(),X=V.redSqr(),oe=H.redAdd(H).redIAdd(H).redIAdd(E.redMul(O)),se=A.redMul(V),de=oe.redSqr().redISub(se.redAdd(se)),he=se.redISub(de),we=oe.redMul(he);we=we.redIAdd(we).redISub(X);var te=N.redMul(L);b+1<_&&(O=O.redMul(X)),A=de,L=te,N=we}return this.curve.jpoint(A,N.redMul(M),L)},x.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},x.prototype._zeroDbl=function(){var _,b,C;if(this.zOne){var E=this.x.redSqr(),M=this.y.redSqr(),A=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(E).redISub(A);T=T.redIAdd(T);var L=E.redAdd(E).redIAdd(E),O=L.redSqr().redISub(T).redISub(T),N=A.redIAdd(A);N=N.redIAdd(N),N=N.redIAdd(N),_=O,b=L.redMul(T.redISub(O)).redISub(N),C=this.y.redAdd(this.y)}else{var H=this.x.redSqr(),V=this.y.redSqr(),X=V.redSqr(),oe=this.x.redAdd(V).redSqr().redISub(H).redISub(X);oe=oe.redIAdd(oe);var se=H.redAdd(H).redIAdd(H),de=se.redSqr(),he=X.redIAdd(X);he=he.redIAdd(he),he=he.redIAdd(he),_=de.redISub(oe).redISub(oe),b=se.redMul(oe.redISub(_)).redISub(he),C=this.y.redMul(this.z),C=C.redIAdd(C)}return this.curve.jpoint(_,b,C)},x.prototype._threeDbl=function(){var _,b,C;if(this.zOne){var E=this.x.redSqr(),M=this.y.redSqr(),A=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(E).redISub(A);T=T.redIAdd(T);var L=E.redAdd(E).redIAdd(E).redIAdd(this.curve.a),O=L.redSqr().redISub(T).redISub(T);_=O;var N=A.redIAdd(A);N=N.redIAdd(N),N=N.redIAdd(N),b=L.redMul(T.redISub(O)).redISub(N),C=this.y.redAdd(this.y)}else{var H=this.z.redSqr(),V=this.y.redSqr(),X=this.x.redMul(V),oe=this.x.redSub(H).redMul(this.x.redAdd(H));oe=oe.redAdd(oe).redIAdd(oe);var se=X.redIAdd(X);se=se.redIAdd(se);var de=se.redAdd(se);_=oe.redSqr().redISub(de),C=this.y.redAdd(this.z).redSqr().redISub(V).redISub(H);var he=V.redSqr();he=he.redIAdd(he),he=he.redIAdd(he),he=he.redIAdd(he),b=oe.redMul(se.redISub(_)).redISub(he)}return this.curve.jpoint(_,b,C)},x.prototype._dbl=function(){var _=this.curve.a,b=this.x,C=this.y,E=this.z,M=E.redSqr().redSqr(),A=b.redSqr(),T=C.redSqr(),L=A.redAdd(A).redIAdd(A).redIAdd(_.redMul(M)),O=b.redAdd(b);O=O.redIAdd(O);var N=O.redMul(T),H=L.redSqr().redISub(N.redAdd(N)),V=N.redISub(H),X=T.redSqr();X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X);var oe=L.redMul(V).redISub(X),se=C.redAdd(C).redMul(E);return this.curve.jpoint(H,oe,se)},x.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var _=this.x.redSqr(),b=this.y.redSqr(),C=this.z.redSqr(),E=b.redSqr(),M=_.redAdd(_).redIAdd(_),A=M.redSqr(),T=this.x.redAdd(b).redSqr().redISub(_).redISub(E);T=T.redIAdd(T),T=T.redAdd(T).redIAdd(T),T=T.redISub(A);var L=T.redSqr(),O=E.redIAdd(E);O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var N=M.redIAdd(T).redSqr().redISub(A).redISub(L).redISub(O),H=b.redMul(N);H=H.redIAdd(H),H=H.redIAdd(H);var V=this.x.redMul(L).redISub(H);V=V.redIAdd(V),V=V.redIAdd(V);var X=this.y.redMul(N.redMul(O.redISub(N)).redISub(T.redMul(L)));X=X.redIAdd(X),X=X.redIAdd(X),X=X.redIAdd(X);var oe=this.z.redAdd(T).redSqr().redISub(C).redISub(L);return this.curve.jpoint(V,X,oe)},x.prototype.mul=function(_,b){return _=new f(_,b),this.curve._wnafMul(this,_)},x.prototype.eq=function(_){if(_.type==="affine")return this.eq(_.toJ());if(this===_)return!0;var b=this.z.redSqr(),C=_.z.redSqr();if(this.x.redMul(C).redISub(_.x.redMul(b)).cmpn(0)!==0)return!1;var E=b.redMul(this.z),M=C.redMul(_.z);return this.y.redMul(M).redISub(_.y.redMul(E)).cmpn(0)===0},x.prototype.eqXToP=function(_){var b=this.z.redSqr(),C=_.toRed(this.curve.red).redMul(b);if(this.x.cmp(C)===0)return!0;for(var E=_.clone(),M=this.curve.redN.redMul(b);;){if(E.iadd(this.curve.n),E.cmp(this.curve.p)>=0)return!1;if(C.redIAdd(M),this.x.cmp(C)===0)return!0}},x.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},x.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var r=requireBn$2(),f=requireInherits_browser(),d=requireBase$1(),m=requireUtils$1();function v(w){d.call(this,"mont",w),this.a=new r(w.a,16).toRed(this.red),this.b=new r(w.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}f(v,d),mont=v,v.prototype.validate=function(x){var S=x.normalize().x,_=S.redSqr(),b=_.redMul(S).redAdd(_.redMul(this.a)).redAdd(S),C=b.redSqrt();return C.redSqr().cmp(b)===0};function g(w,x,S){d.BasePoint.call(this,w,"projective"),x===null&&S===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(x,16),this.z=new r(S,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return f(g,d.BasePoint),v.prototype.decodePoint=function(x,S){return this.point(m.toArray(x,S),1)},v.prototype.point=function(x,S){return new g(this,x,S)},v.prototype.pointFromJSON=function(x){return g.fromJSON(this,x)},g.prototype.precompute=function(){},g.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},g.fromJSON=function(x,S){return new g(x,S[0],S[1]||x.one)},g.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},g.prototype.isInfinity=function(){return this.z.cmpn(0)===0},g.prototype.dbl=function(){var x=this.x.redAdd(this.z),S=x.redSqr(),_=this.x.redSub(this.z),b=_.redSqr(),C=S.redSub(b),E=S.redMul(b),M=C.redMul(b.redAdd(this.curve.a24.redMul(C)));return this.curve.point(E,M)},g.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},g.prototype.diffAdd=function(x,S){var _=this.x.redAdd(this.z),b=this.x.redSub(this.z),C=x.x.redAdd(x.z),E=x.x.redSub(x.z),M=E.redMul(_),A=C.redMul(b),T=S.z.redMul(M.redAdd(A).redSqr()),L=S.x.redMul(M.redISub(A).redSqr());return this.curve.point(T,L)},g.prototype.mul=function(x){for(var S=x.clone(),_=this,b=this.curve.point(null,null),C=this,E=[];S.cmpn(0)!==0;S.iushrn(1))E.push(S.andln(1));for(var M=E.length-1;M>=0;M--)E[M]===0?(_=_.diffAdd(b,C),b=b.dbl()):(b=_.diffAdd(b,C),_=_.dbl());return b},g.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},g.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},g.prototype.eq=function(x){return this.getX().cmp(x.getX())===0},g.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},g.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var r=requireUtils$1(),f=requireBn$2(),d=requireInherits_browser(),m=requireBase$1(),v=r.assert;function g(x){this.twisted=(x.a|0)!==1,this.mOneA=this.twisted&&(x.a|0)===-1,this.extended=this.mOneA,m.call(this,"edwards",x),this.a=new f(x.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new f(x.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new f(x.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),v(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(x.c|0)===1}d(g,m),edwards=g,g.prototype._mulA=function(S){return this.mOneA?S.redNeg():this.a.redMul(S)},g.prototype._mulC=function(S){return this.oneC?S:this.c.redMul(S)},g.prototype.jpoint=function(S,_,b,C){return this.point(S,_,b,C)},g.prototype.pointFromX=function(S,_){S=new f(S,16),S.red||(S=S.toRed(this.red));var b=S.redSqr(),C=this.c2.redSub(this.a.redMul(b)),E=this.one.redSub(this.c2.redMul(this.d).redMul(b)),M=C.redMul(E.redInvm()),A=M.redSqrt();if(A.redSqr().redSub(M).cmp(this.zero)!==0)throw new Error("invalid point");var T=A.fromRed().isOdd();return(_&&!T||!_&&T)&&(A=A.redNeg()),this.point(S,A)},g.prototype.pointFromY=function(S,_){S=new f(S,16),S.red||(S=S.toRed(this.red));var b=S.redSqr(),C=b.redSub(this.c2),E=b.redMul(this.d).redMul(this.c2).redSub(this.a),M=C.redMul(E.redInvm());if(M.cmp(this.zero)===0){if(_)throw new Error("invalid point");return this.point(this.zero,S)}var A=M.redSqrt();if(A.redSqr().redSub(M).cmp(this.zero)!==0)throw new Error("invalid point");return A.fromRed().isOdd()!==_&&(A=A.redNeg()),this.point(A,S)},g.prototype.validate=function(S){if(S.isInfinity())return!0;S.normalize();var _=S.x.redSqr(),b=S.y.redSqr(),C=_.redMul(this.a).redAdd(b),E=this.c2.redMul(this.one.redAdd(this.d.redMul(_).redMul(b)));return C.cmp(E)===0};function w(x,S,_,b,C){m.BasePoint.call(this,x,"projective"),S===null&&_===null&&b===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new f(S,16),this.y=new f(_,16),this.z=b?new f(b,16):this.curve.one,this.t=C&&new f(C,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return d(w,m.BasePoint),g.prototype.pointFromJSON=function(S){return w.fromJSON(this,S)},g.prototype.point=function(S,_,b,C){return new w(this,S,_,b,C)},w.fromJSON=function(S,_){return new w(S,_[0],_[1],_[2])},w.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},w.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},w.prototype._extDbl=function(){var S=this.x.redSqr(),_=this.y.redSqr(),b=this.z.redSqr();b=b.redIAdd(b);var C=this.curve._mulA(S),E=this.x.redAdd(this.y).redSqr().redISub(S).redISub(_),M=C.redAdd(_),A=M.redSub(b),T=C.redSub(_),L=E.redMul(A),O=M.redMul(T),N=E.redMul(T),H=A.redMul(M);return this.curve.point(L,O,H,N)},w.prototype._projDbl=function(){var S=this.x.redAdd(this.y).redSqr(),_=this.x.redSqr(),b=this.y.redSqr(),C,E,M,A,T,L;if(this.curve.twisted){A=this.curve._mulA(_);var O=A.redAdd(b);this.zOne?(C=S.redSub(_).redSub(b).redMul(O.redSub(this.curve.two)),E=O.redMul(A.redSub(b)),M=O.redSqr().redSub(O).redSub(O)):(T=this.z.redSqr(),L=O.redSub(T).redISub(T),C=S.redSub(_).redISub(b).redMul(L),E=O.redMul(A.redSub(b)),M=O.redMul(L))}else A=_.redAdd(b),T=this.curve._mulC(this.z).redSqr(),L=A.redSub(T).redSub(T),C=this.curve._mulC(S.redISub(A)).redMul(L),E=this.curve._mulC(A).redMul(_.redISub(b)),M=A.redMul(L);return this.curve.point(C,E,M)},w.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},w.prototype._extAdd=function(S){var _=this.y.redSub(this.x).redMul(S.y.redSub(S.x)),b=this.y.redAdd(this.x).redMul(S.y.redAdd(S.x)),C=this.t.redMul(this.curve.dd).redMul(S.t),E=this.z.redMul(S.z.redAdd(S.z)),M=b.redSub(_),A=E.redSub(C),T=E.redAdd(C),L=b.redAdd(_),O=M.redMul(A),N=T.redMul(L),H=M.redMul(L),V=A.redMul(T);return this.curve.point(O,N,V,H)},w.prototype._projAdd=function(S){var _=this.z.redMul(S.z),b=_.redSqr(),C=this.x.redMul(S.x),E=this.y.redMul(S.y),M=this.curve.d.redMul(C).redMul(E),A=b.redSub(M),T=b.redAdd(M),L=this.x.redAdd(this.y).redMul(S.x.redAdd(S.y)).redISub(C).redISub(E),O=_.redMul(A).redMul(L),N,H;return this.curve.twisted?(N=_.redMul(T).redMul(E.redSub(this.curve._mulA(C))),H=A.redMul(T)):(N=_.redMul(T).redMul(E.redSub(C)),H=this.curve._mulC(A).redMul(T)),this.curve.point(O,N,H)},w.prototype.add=function(S){return this.isInfinity()?S:S.isInfinity()?this:this.curve.extended?this._extAdd(S):this._projAdd(S)},w.prototype.mul=function(S){return this._hasDoubles(S)?this.curve._fixedNafMul(this,S):this.curve._wnafMul(this,S)},w.prototype.mulAdd=function(S,_,b){return this.curve._wnafMulAdd(1,[this,_],[S,b],2,!1)},w.prototype.jmulAdd=function(S,_,b){return this.curve._wnafMulAdd(1,[this,_],[S,b],2,!0)},w.prototype.normalize=function(){if(this.zOne)return this;var S=this.z.redInvm();return this.x=this.x.redMul(S),this.y=this.y.redMul(S),this.t&&(this.t=this.t.redMul(S)),this.z=this.curve.one,this.zOne=!0,this},w.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},w.prototype.getX=function(){return this.normalize(),this.x.fromRed()},w.prototype.getY=function(){return this.normalize(),this.y.fromRed()},w.prototype.eq=function(S){return this===S||this.getX().cmp(S.getX())===0&&this.getY().cmp(S.getY())===0},w.prototype.eqXToP=function(S){var _=S.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(_)===0)return!0;for(var b=S.clone(),C=this.curve.redN.redMul(this.z);;){if(b.iadd(this.curve.n),b.cmp(this.curve.p)>=0)return!1;if(_.redIAdd(C),this.x.cmp(_)===0)return!0}},w.prototype.toP=w.prototype.normalize,w.prototype.mixedAdd=w.prototype.add,edwards}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(function(r){var f=r;f.base=requireBase$1(),f.short=requireShort(),f.mont=requireMont(),f.edwards=requireEdwards()})(curve)),curve}var curves={},hash={},utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var r=requireMinimalisticAssert(),f=requireInherits_browser();utils.inherits=f;function d(k,q){return(k.charCodeAt(q)&64512)!==55296||q<0||q+1>=k.length?!1:(k.charCodeAt(q+1)&64512)===56320}function m(k,q){if(Array.isArray(k))return k.slice();if(!k)return[];var y=[];if(typeof k=="string")if(q){if(q==="hex")for(k=k.replace(/[^a-z0-9]+/ig,""),k.length%2!==0&&(k="0"+k),$=0;$<k.length;$+=2)y.push(parseInt(k[$]+k[$+1],16))}else for(var B=0,$=0;$<k.length;$++){var I=k.charCodeAt($);I<128?y[B++]=I:I<2048?(y[B++]=I>>6|192,y[B++]=I&63|128):d(k,$)?(I=65536+((I&1023)<<10)+(k.charCodeAt(++$)&1023),y[B++]=I>>18|240,y[B++]=I>>12&63|128,y[B++]=I>>6&63|128,y[B++]=I&63|128):(y[B++]=I>>12|224,y[B++]=I>>6&63|128,y[B++]=I&63|128)}else for($=0;$<k.length;$++)y[$]=k[$]|0;return y}utils.toArray=m;function v(k){for(var q="",y=0;y<k.length;y++)q+=x(k[y].toString(16));return q}utils.toHex=v;function g(k){var q=k>>>24|k>>>8&65280|k<<8&16711680|(k&255)<<24;return q>>>0}utils.htonl=g;function w(k,q){for(var y="",B=0;B<k.length;B++){var $=k[B];q==="little"&&($=g($)),y+=S($.toString(16))}return y}utils.toHex32=w;function x(k){return k.length===1?"0"+k:k}utils.zero2=x;function S(k){return k.length===7?"0"+k:k.length===6?"00"+k:k.length===5?"000"+k:k.length===4?"0000"+k:k.length===3?"00000"+k:k.length===2?"000000"+k:k.length===1?"0000000"+k:k}utils.zero8=S;function _(k,q,y,B){var $=y-q;r($%4===0);for(var I=new Array($/4),U=0,j=q;U<I.length;U++,j+=4){var D;B==="big"?D=k[j]<<24|k[j+1]<<16|k[j+2]<<8|k[j+3]:D=k[j+3]<<24|k[j+2]<<16|k[j+1]<<8|k[j],I[U]=D>>>0}return I}utils.join32=_;function b(k,q){for(var y=new Array(k.length*4),B=0,$=0;B<k.length;B++,$+=4){var I=k[B];q==="big"?(y[$]=I>>>24,y[$+1]=I>>>16&255,y[$+2]=I>>>8&255,y[$+3]=I&255):(y[$+3]=I>>>24,y[$+2]=I>>>16&255,y[$+1]=I>>>8&255,y[$]=I&255)}return y}utils.split32=b;function C(k,q){return k>>>q|k<<32-q}utils.rotr32=C;function E(k,q){return k<<q|k>>>32-q}utils.rotl32=E;function M(k,q){return k+q>>>0}utils.sum32=M;function A(k,q,y){return k+q+y>>>0}utils.sum32_3=A;function T(k,q,y,B){return k+q+y+B>>>0}utils.sum32_4=T;function L(k,q,y,B,$){return k+q+y+B+$>>>0}utils.sum32_5=L;function O(k,q,y,B){var $=k[q],I=k[q+1],U=B+I>>>0,j=(U<B?1:0)+y+$;k[q]=j>>>0,k[q+1]=U}utils.sum64=O;function N(k,q,y,B){var $=q+B>>>0,I=($<q?1:0)+k+y;return I>>>0}utils.sum64_hi=N;function H(k,q,y,B){var $=q+B;return $>>>0}utils.sum64_lo=H;function V(k,q,y,B,$,I,U,j){var D=0,W=q;W=W+B>>>0,D+=W<q?1:0,W=W+I>>>0,D+=W<I?1:0,W=W+j>>>0,D+=W<j?1:0;var R=k+y+$+U+D;return R>>>0}utils.sum64_4_hi=V;function X(k,q,y,B,$,I,U,j){var D=q+B+I+j;return D>>>0}utils.sum64_4_lo=X;function oe(k,q,y,B,$,I,U,j,D,W){var R=0,z=q;z=z+B>>>0,R+=z<q?1:0,z=z+I>>>0,R+=z<I?1:0,z=z+j>>>0,R+=z<j?1:0,z=z+W>>>0,R+=z<W?1:0;var ye=k+y+$+U+D+R;return ye>>>0}utils.sum64_5_hi=oe;function se(k,q,y,B,$,I,U,j,D,W){var R=q+B+I+j+W;return R>>>0}utils.sum64_5_lo=se;function de(k,q,y){var B=q<<32-y|k>>>y;return B>>>0}utils.rotr64_hi=de;function he(k,q,y){var B=k<<32-y|q>>>y;return B>>>0}utils.rotr64_lo=he;function we(k,q,y){return k>>>y}utils.shr64_hi=we;function te(k,q,y){var B=k<<32-y|q>>>y;return B>>>0}return utils.shr64_lo=te,utils}var common$3={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$3;hasRequiredCommon$1=1;var r=requireUtils(),f=requireMinimalisticAssert();function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$3.BlockHash=d,d.prototype.update=function(v,g){if(v=r.toArray(v,g),this.pending?this.pending=this.pending.concat(v):this.pending=v,this.pendingTotal+=v.length,this.pending.length>=this._delta8){v=this.pending;var w=v.length%this._delta8;this.pending=v.slice(v.length-w,v.length),this.pending.length===0&&(this.pending=null),v=r.join32(v,0,v.length-w,this.endian);for(var x=0;x<v.length;x+=this._delta32)this._update(v,x,x+this._delta32)}return this},d.prototype.digest=function(v){return this.update(this._pad()),f(this.pending===null),this._digest(v)},d.prototype._pad=function(){var v=this.pendingTotal,g=this._delta8,w=g-(v+this.padLength)%g,x=new Array(w+this.padLength);x[0]=128;for(var S=1;S<w;S++)x[S]=0;if(v<<=3,this.endian==="big"){for(var _=8;_<this.padLength;_++)x[S++]=0;x[S++]=0,x[S++]=0,x[S++]=0,x[S++]=0,x[S++]=v>>>24&255,x[S++]=v>>>16&255,x[S++]=v>>>8&255,x[S++]=v&255}else for(x[S++]=v&255,x[S++]=v>>>8&255,x[S++]=v>>>16&255,x[S++]=v>>>24&255,x[S++]=0,x[S++]=0,x[S++]=0,x[S++]=0,_=8;_<this.padLength;_++)x[S++]=0;return x},common$3}var sha={},common$2={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common$2;hasRequiredCommon=1;var r=requireUtils(),f=r.rotr32;function d(b,C,E,M){if(b===0)return m(C,E,M);if(b===1||b===3)return g(C,E,M);if(b===2)return v(C,E,M)}common$2.ft_1=d;function m(b,C,E){return b&C^~b&E}common$2.ch32=m;function v(b,C,E){return b&C^b&E^C&E}common$2.maj32=v;function g(b,C,E){return b^C^E}common$2.p32=g;function w(b){return f(b,2)^f(b,13)^f(b,22)}common$2.s0_256=w;function x(b){return f(b,6)^f(b,11)^f(b,25)}common$2.s1_256=x;function S(b){return f(b,7)^f(b,18)^b>>>3}common$2.g0_256=S;function _(b){return f(b,17)^f(b,19)^b>>>10}return common$2.g1_256=_,common$2}var _1,hasRequired_1;function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var r=requireUtils(),f=requireCommon$1(),d=requireCommon(),m=r.rotl32,v=r.sum32,g=r.sum32_5,w=d.ft_1,x=f.BlockHash,S=[1518500249,1859775393,2400959708,3395469782];function _(){if(!(this instanceof _))return new _;x.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return r.inherits(_,x),_1=_,_.blockSize=512,_.outSize=160,_.hmacStrength=80,_.padLength=64,_.prototype._update=function(C,E){for(var M=this.W,A=0;A<16;A++)M[A]=C[E+A];for(;A<M.length;A++)M[A]=m(M[A-3]^M[A-8]^M[A-14]^M[A-16],1);var T=this.h[0],L=this.h[1],O=this.h[2],N=this.h[3],H=this.h[4];for(A=0;A<M.length;A++){var V=~~(A/20),X=g(m(T,5),w(V,L,O,N),H,M[A],S[V]);H=N,N=O,O=m(L,30),L=T,T=X}this.h[0]=v(this.h[0],T),this.h[1]=v(this.h[1],L),this.h[2]=v(this.h[2],O),this.h[3]=v(this.h[3],N),this.h[4]=v(this.h[4],H)},_.prototype._digest=function(C){return C==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},_1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var r=requireUtils(),f=requireCommon$1(),d=requireCommon(),m=requireMinimalisticAssert(),v=r.sum32,g=r.sum32_4,w=r.sum32_5,x=d.ch32,S=d.maj32,_=d.s0_256,b=d.s1_256,C=d.g0_256,E=d.g1_256,M=f.BlockHash,A=[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];function T(){if(!(this instanceof T))return new T;M.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=A,this.W=new Array(64)}return r.inherits(T,M),_256=T,T.blockSize=512,T.outSize=256,T.hmacStrength=192,T.padLength=64,T.prototype._update=function(O,N){for(var H=this.W,V=0;V<16;V++)H[V]=O[N+V];for(;V<H.length;V++)H[V]=g(E(H[V-2]),H[V-7],C(H[V-15]),H[V-16]);var X=this.h[0],oe=this.h[1],se=this.h[2],de=this.h[3],he=this.h[4],we=this.h[5],te=this.h[6],k=this.h[7];for(m(this.k.length===H.length),V=0;V<H.length;V++){var q=w(k,b(he),x(he,we,te),this.k[V],H[V]),y=v(_(X),S(X,oe,se));k=te,te=we,we=he,he=v(de,q),de=se,se=oe,oe=X,X=v(q,y)}this.h[0]=v(this.h[0],X),this.h[1]=v(this.h[1],oe),this.h[2]=v(this.h[2],se),this.h[3]=v(this.h[3],de),this.h[4]=v(this.h[4],he),this.h[5]=v(this.h[5],we),this.h[6]=v(this.h[6],te),this.h[7]=v(this.h[7],k)},T.prototype._digest=function(O){return O==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var r=requireUtils(),f=require_256();function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return r.inherits(d,f),_224=d,d.blockSize=512,d.outSize=224,d.hmacStrength=192,d.padLength=64,d.prototype._digest=function(v){return v==="hex"?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var r=requireUtils(),f=requireCommon$1(),d=requireMinimalisticAssert(),m=r.rotr64_hi,v=r.rotr64_lo,g=r.shr64_hi,w=r.shr64_lo,x=r.sum64,S=r.sum64_hi,_=r.sum64_lo,b=r.sum64_4_hi,C=r.sum64_4_lo,E=r.sum64_5_hi,M=r.sum64_5_lo,A=f.BlockHash,T=[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];function L(){if(!(this instanceof L))return new L;A.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=T,this.W=new Array(160)}r.inherits(L,A),_512=L,L.blockSize=1024,L.outSize=512,L.hmacStrength=192,L.padLength=128,L.prototype._prepareBlock=function(y,B){for(var $=this.W,I=0;I<32;I++)$[I]=y[B+I];for(;I<$.length;I+=2){var U=te($[I-4],$[I-3]),j=k($[I-4],$[I-3]),D=$[I-14],W=$[I-13],R=he($[I-30],$[I-29]),z=we($[I-30],$[I-29]),ye=$[I-32],Ce=$[I-31];$[I]=b(U,j,D,W,R,z,ye,Ce),$[I+1]=C(U,j,D,W,R,z,ye,Ce)}},L.prototype._update=function(y,B){this._prepareBlock(y,B);var $=this.W,I=this.h[0],U=this.h[1],j=this.h[2],D=this.h[3],W=this.h[4],R=this.h[5],z=this.h[6],ye=this.h[7],Ce=this.h[8],me=this.h[9],ie=this.h[10],ee=this.h[11],pe=this.h[12],be=this.h[13],ae=this.h[14],ne=this.h[15];d(this.k.length===$.length);for(var Se=0;Se<$.length;Se+=2){var qe=ae,Ie=ne,Oe=se(Ce,me),Fe=de(Ce,me),De=O(Ce,me,ie,ee,pe),$e=N(Ce,me,ie,ee,pe,be),je=this.k[Se],Ye=this.k[Se+1],st=$[Se],Je=$[Se+1],Ge=E(qe,Ie,Oe,Fe,De,$e,je,Ye,st,Je),ut=M(qe,Ie,Oe,Fe,De,$e,je,Ye,st,Je);qe=X(I,U),Ie=oe(I,U),Oe=H(I,U,j,D,W),Fe=V(I,U,j,D,W,R);var gt=S(qe,Ie,Oe,Fe),rt=_(qe,Ie,Oe,Fe);ae=pe,ne=be,pe=ie,be=ee,ie=Ce,ee=me,Ce=S(z,ye,Ge,ut),me=_(ye,ye,Ge,ut),z=W,ye=R,W=j,R=D,j=I,D=U,I=S(Ge,ut,gt,rt),U=_(Ge,ut,gt,rt)}x(this.h,0,I,U),x(this.h,2,j,D),x(this.h,4,W,R),x(this.h,6,z,ye),x(this.h,8,Ce,me),x(this.h,10,ie,ee),x(this.h,12,pe,be),x(this.h,14,ae,ne)},L.prototype._digest=function(y){return y==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")};function O(q,y,B,$,I){var U=q&B^~q&I;return U<0&&(U+=4294967296),U}function N(q,y,B,$,I,U){var j=y&$^~y&U;return j<0&&(j+=4294967296),j}function H(q,y,B,$,I){var U=q&B^q&I^B&I;return U<0&&(U+=4294967296),U}function V(q,y,B,$,I,U){var j=y&$^y&U^$&U;return j<0&&(j+=4294967296),j}function X(q,y){var B=m(q,y,28),$=m(y,q,2),I=m(y,q,7),U=B^$^I;return U<0&&(U+=4294967296),U}function oe(q,y){var B=v(q,y,28),$=v(y,q,2),I=v(y,q,7),U=B^$^I;return U<0&&(U+=4294967296),U}function se(q,y){var B=m(q,y,14),$=m(q,y,18),I=m(y,q,9),U=B^$^I;return U<0&&(U+=4294967296),U}function de(q,y){var B=v(q,y,14),$=v(q,y,18),I=v(y,q,9),U=B^$^I;return U<0&&(U+=4294967296),U}function he(q,y){var B=m(q,y,1),$=m(q,y,8),I=g(q,y,7),U=B^$^I;return U<0&&(U+=4294967296),U}function we(q,y){var B=v(q,y,1),$=v(q,y,8),I=w(q,y,7),U=B^$^I;return U<0&&(U+=4294967296),U}function te(q,y){var B=m(q,y,19),$=m(y,q,29),I=g(q,y,6),U=B^$^I;return U<0&&(U+=4294967296),U}function k(q,y){var B=v(q,y,19),$=v(y,q,29),I=w(q,y,6),U=B^$^I;return U<0&&(U+=4294967296),U}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var r=requireUtils(),f=require_512();function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return r.inherits(d,f),_384=d,d.blockSize=1024,d.outSize=384,d.hmacStrength=192,d.padLength=128,d.prototype._digest=function(v){return v==="hex"?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var r=requireUtils(),f=requireCommon$1(),d=r.rotl32,m=r.sum32,v=r.sum32_3,g=r.sum32_4,w=f.BlockHash;function x(){if(!(this instanceof x))return new x;w.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}r.inherits(x,w),ripemd.ripemd160=x,x.blockSize=512,x.outSize=160,x.hmacStrength=192,x.padLength=64,x.prototype._update=function(L,O){for(var N=this.h[0],H=this.h[1],V=this.h[2],X=this.h[3],oe=this.h[4],se=N,de=H,he=V,we=X,te=oe,k=0;k<80;k++){var q=m(d(g(N,S(k,H,V,X),L[C[k]+O],_(k)),M[k]),oe);N=oe,oe=X,X=d(V,10),V=H,H=q,q=m(d(g(se,S(79-k,de,he,we),L[E[k]+O],b(k)),A[k]),te),se=te,te=we,we=d(he,10),he=de,de=q}q=v(this.h[1],V,we),this.h[1]=v(this.h[2],X,te),this.h[2]=v(this.h[3],oe,se),this.h[3]=v(this.h[4],N,de),this.h[4]=v(this.h[0],H,he),this.h[0]=q},x.prototype._digest=function(L){return L==="hex"?r.toHex32(this.h,"little"):r.split32(this.h,"little")};function S(T,L,O,N){return T<=15?L^O^N:T<=31?L&O|~L&N:T<=47?(L|~O)^N:T<=63?L&N|O&~N:L^(O|~N)}function _(T){return T<=15?0:T<=31?1518500249:T<=47?1859775393:T<=63?2400959708:2840853838}function b(T){return T<=15?1352829926:T<=31?1548603684:T<=47?1836072691:T<=63?2053994217:0}var C=[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],E=[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],M=[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],A=[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];return ripemd}var hmac,hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;var r=requireUtils(),f=requireMinimalisticAssert();function d(m,v,g){if(!(this instanceof d))return new d(m,v,g);this.Hash=m,this.blockSize=m.blockSize/8,this.outSize=m.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(v,g))}return hmac=d,d.prototype._init=function(v){v.length>this.blockSize&&(v=new this.Hash().update(v).digest()),f(v.length<=this.blockSize);for(var g=v.length;g<this.blockSize;g++)v.push(0);for(g=0;g<v.length;g++)v[g]^=54;for(this.inner=new this.Hash().update(v),g=0;g<v.length;g++)v[g]^=106;this.outer=new this.Hash().update(v)},d.prototype.update=function(v,g){return this.inner.update(v,g),this},d.prototype.digest=function(v){return this.outer.update(this.inner.digest()),this.outer.digest(v)},hmac}var hasRequiredHash;function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(function(r){var f=r;f.utils=requireUtils(),f.common=requireCommon$1(),f.sha=requireSha(),f.ripemd=requireRipemd(),f.hmac=requireHmac(),f.sha1=f.sha.sha1,f.sha256=f.sha.sha256,f.sha224=f.sha.sha224,f.sha384=f.sha.sha384,f.sha512=f.sha.sha512,f.ripemd160=f.ripemd.ripemd160})(hash)),hash}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,(function(r){var f=r,d=requireHash(),m=requireCurve(),v=requireUtils$1(),g=v.assert;function w(_){_.type==="short"?this.curve=new m.short(_):_.type==="edwards"?this.curve=new m.edwards(_):this.curve=new m.mont(_),this.g=this.curve.g,this.n=this.curve.n,this.hash=_.hash,g(this.g.validate(),"Invalid curve"),g(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}f.PresetCurve=w;function x(_,b){Object.defineProperty(f,_,{configurable:!0,enumerable:!0,get:function(){var C=new w(b);return Object.defineProperty(f,_,{configurable:!0,enumerable:!0,value:C}),C}})}x("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:d.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),x("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:d.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),x("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:d.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),x("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:d.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),x("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:d.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),x("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["9"]}),x("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:d.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var S;try{S=requireSecp256k1()}catch{S=void 0}x("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:d.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",S]})})(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var r=requireHash(),f=requireUtils$2(),d=requireMinimalisticAssert();function m(v){if(!(this instanceof m))return new m(v);this.hash=v.hash,this.predResist=!!v.predResist,this.outLen=this.hash.outSize,this.minEntropy=v.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var g=f.toArray(v.entropy,v.entropyEnc||"hex"),w=f.toArray(v.nonce,v.nonceEnc||"hex"),x=f.toArray(v.pers,v.persEnc||"hex");d(g.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(g,w,x)}return hmacDrbg=m,m.prototype._init=function(g,w,x){var S=g.concat(w).concat(x);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var _=0;_<this.V.length;_++)this.K[_]=0,this.V[_]=1;this._update(S),this._reseed=1,this.reseedInterval=281474976710656},m.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},m.prototype._update=function(g){var w=this._hmac().update(this.V).update([0]);g&&(w=w.update(g)),this.K=w.digest(),this.V=this._hmac().update(this.V).digest(),g&&(this.K=this._hmac().update(this.V).update([1]).update(g).digest(),this.V=this._hmac().update(this.V).digest())},m.prototype.reseed=function(g,w,x,S){typeof w!="string"&&(S=x,x=w,w=null),g=f.toArray(g,w),x=f.toArray(x,S),d(g.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(g.concat(x||[])),this._reseed=1},m.prototype.generate=function(g,w,x,S){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof w!="string"&&(S=x,x=w,w=null),x&&(x=f.toArray(x,S||"hex"),this._update(x));for(var _=[];_.length<g;)this.V=this._hmac().update(this.V).digest(),_=_.concat(this.V);var b=_.slice(0,g);return this._update(x),this._reseed++,f.encode(b,w)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert;function m(v,g){this.ec=v,this.priv=null,this.pub=null,g.priv&&this._importPrivate(g.priv,g.privEnc),g.pub&&this._importPublic(g.pub,g.pubEnc)}return key$1=m,m.fromPublic=function(g,w,x){return w instanceof m?w:new m(g,{pub:w,pubEnc:x})},m.fromPrivate=function(g,w,x){return w instanceof m?w:new m(g,{priv:w,privEnc:x})},m.prototype.validate=function(){var g=this.getPublic();return g.isInfinity()?{result:!1,reason:"Invalid public key"}:g.validate()?g.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},m.prototype.getPublic=function(g,w){return typeof g=="string"&&(w=g,g=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),w?this.pub.encode(w,g):this.pub},m.prototype.getPrivate=function(g){return g==="hex"?this.priv.toString(16,2):this.priv},m.prototype._importPrivate=function(g,w){this.priv=new r(g,w||16),this.priv=this.priv.umod(this.ec.curve.n)},m.prototype._importPublic=function(g,w){if(g.x||g.y){this.ec.curve.type==="mont"?d(g.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&d(g.x&&g.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(g.x,g.y);return}this.pub=this.ec.curve.decodePoint(g,w)},m.prototype.derive=function(g){return g.validate()||d(g.validate(),"public point not validated"),g.mul(this.priv).getX()},m.prototype.sign=function(g,w,x){return this.ec.sign(g,this,w,x)},m.prototype.verify=function(g,w,x){return this.ec.verify(g,w,this,void 0,x)},m.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert;function m(S,_){if(S instanceof m)return S;this._importDER(S,_)||(d(S.r&&S.s,"Signature without r or s"),this.r=new r(S.r,16),this.s=new r(S.s,16),S.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=S.recoveryParam)}signature$1=m;function v(){this.place=0}function g(S,_){var b=S[_.place++];if(!(b&128))return b;var C=b&15;if(C===0||C>4||S[_.place]===0)return!1;for(var E=0,M=0,A=_.place;M<C;M++,A++)E<<=8,E|=S[A],E>>>=0;return E<=127?!1:(_.place=A,E)}function w(S){for(var _=0,b=S.length-1;!S[_]&&!(S[_+1]&128)&&_<b;)_++;return _===0?S:S.slice(_)}m.prototype._importDER=function(_,b){_=f.toArray(_,b);var C=new v;if(_[C.place++]!==48)return!1;var E=g(_,C);if(E===!1||E+C.place!==_.length||_[C.place++]!==2)return!1;var M=g(_,C);if(M===!1||(_[C.place]&128)!==0)return!1;var A=_.slice(C.place,M+C.place);if(C.place+=M,_[C.place++]!==2)return!1;var T=g(_,C);if(T===!1||_.length!==T+C.place||(_[C.place]&128)!==0)return!1;var L=_.slice(C.place,T+C.place);if(A[0]===0)if(A[1]&128)A=A.slice(1);else return!1;if(L[0]===0)if(L[1]&128)L=L.slice(1);else return!1;return this.r=new r(A),this.s=new r(L),this.recoveryParam=null,!0};function x(S,_){if(_<128){S.push(_);return}var b=1+(Math.log(_)/Math.LN2>>>3);for(S.push(b|128);--b;)S.push(_>>>(b<<3)&255);S.push(_)}return m.prototype.toDER=function(_){var b=this.r.toArray(),C=this.s.toArray();for(b[0]&128&&(b=[0].concat(b)),C[0]&128&&(C=[0].concat(C)),b=w(b),C=w(C);!C[0]&&!(C[1]&128);)C=C.slice(1);var E=[2];x(E,b.length),E=E.concat(b),E.push(2),x(E,C.length);var M=E.concat(C),A=[48];return x(A,M.length),A=A.concat(M),f.encode(A,_)},signature$1}var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var r=requireBn$2(),f=requireHmacDrbg(),d=requireUtils$1(),m=requireCurves(),v=requireBrorand(),g=d.assert,w=requireKey$1(),x=requireSignature$1();function S(_){if(!(this instanceof S))return new S(_);typeof _=="string"&&(g(Object.prototype.hasOwnProperty.call(m,_),"Unknown curve "+_),_=m[_]),_ instanceof m.PresetCurve&&(_={curve:_}),this.curve=_.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=_.curve.g,this.g.precompute(_.curve.n.bitLength()+1),this.hash=_.hash||_.curve.hash}return ec=S,S.prototype.keyPair=function(b){return new w(this,b)},S.prototype.keyFromPrivate=function(b,C){return w.fromPrivate(this,b,C)},S.prototype.keyFromPublic=function(b,C){return w.fromPublic(this,b,C)},S.prototype.genKeyPair=function(b){b||(b={});for(var C=new f({hash:this.hash,pers:b.pers,persEnc:b.persEnc||"utf8",entropy:b.entropy||v(this.hash.hmacStrength),entropyEnc:b.entropy&&b.entropyEnc||"utf8",nonce:this.n.toArray()}),E=this.n.byteLength(),M=this.n.sub(new r(2));;){var A=new r(C.generate(E));if(!(A.cmp(M)>0))return A.iaddn(1),this.keyFromPrivate(A)}},S.prototype._truncateToN=function(b,C,E){var M;if(r.isBN(b)||typeof b=="number")b=new r(b,16),M=b.byteLength();else if(typeof b=="object")M=b.length,b=new r(b,16);else{var A=b.toString();M=A.length+1>>>1,b=new r(A,16)}typeof E!="number"&&(E=M*8);var T=E-this.n.bitLength();return T>0&&(b=b.ushrn(T)),!C&&b.cmp(this.n)>=0?b.sub(this.n):b},S.prototype.sign=function(b,C,E,M){if(typeof E=="object"&&(M=E,E=null),M||(M={}),typeof b!="string"&&typeof b!="number"&&!r.isBN(b)){g(typeof b=="object"&&b&&typeof b.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),g(b.length>>>0===b.length);for(var A=0;A<b.length;A++)g((b[A]&255)===b[A])}C=this.keyFromPrivate(C,E),b=this._truncateToN(b,!1,M.msgBitLength),g(!b.isNeg(),"Can not sign a negative message");var T=this.n.byteLength(),L=C.getPrivate().toArray("be",T),O=b.toArray("be",T);g(new r(O).eq(b),"Can not sign message");for(var N=new f({hash:this.hash,entropy:L,nonce:O,pers:M.pers,persEnc:M.persEnc||"utf8"}),H=this.n.sub(new r(1)),V=0;;V++){var X=M.k?M.k(V):new r(N.generate(this.n.byteLength()));if(X=this._truncateToN(X,!0),!(X.cmpn(1)<=0||X.cmp(H)>=0)){var oe=this.g.mul(X);if(!oe.isInfinity()){var se=oe.getX(),de=se.umod(this.n);if(de.cmpn(0)!==0){var he=X.invm(this.n).mul(de.mul(C.getPrivate()).iadd(b));if(he=he.umod(this.n),he.cmpn(0)!==0){var we=(oe.getY().isOdd()?1:0)|(se.cmp(de)!==0?2:0);return M.canonical&&he.cmp(this.nh)>0&&(he=this.n.sub(he),we^=1),new x({r:de,s:he,recoveryParam:we})}}}}}},S.prototype.verify=function(b,C,E,M,A){A||(A={}),b=this._truncateToN(b,!1,A.msgBitLength),E=this.keyFromPublic(E,M),C=new x(C,"hex");var T=C.r,L=C.s;if(T.cmpn(1)<0||T.cmp(this.n)>=0||L.cmpn(1)<0||L.cmp(this.n)>=0)return!1;var O=L.invm(this.n),N=O.mul(b).umod(this.n),H=O.mul(T).umod(this.n),V;return this.curve._maxwellTrick?(V=this.g.jmulAdd(N,E.getPublic(),H),V.isInfinity()?!1:V.eqXToP(T)):(V=this.g.mulAdd(N,E.getPublic(),H),V.isInfinity()?!1:V.getX().umod(this.n).cmp(T)===0)},S.prototype.recoverPubKey=function(_,b,C,E){g((3&C)===C,"The recovery param is more than two bits"),b=new x(b,E);var M=this.n,A=new r(_),T=b.r,L=b.s,O=C&1,N=C>>1;if(T.cmp(this.curve.p.umod(this.curve.n))>=0&&N)throw new Error("Unable to find sencond key candinate");N?T=this.curve.pointFromX(T.add(this.curve.n),O):T=this.curve.pointFromX(T,O);var H=b.r.invm(M),V=M.sub(A).mul(H).umod(M),X=L.mul(H).umod(M);return this.g.mulAdd(V,T,X)},S.prototype.getKeyRecoveryParam=function(_,b,C,E){if(b=new x(b,E),b.recoveryParam!==null)return b.recoveryParam;for(var M=0;M<4;M++){var A;try{A=this.recoverPubKey(_,b,M)}catch{continue}if(A.eq(C))return M}throw new Error("Unable to find valid recovery factor")},ec}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var r=requireUtils$1(),f=r.assert,d=r.parseBytes,m=r.cachedProperty;function v(g,w){this.eddsa=g,this._secret=d(w.secret),g.isPoint(w.pub)?this._pub=w.pub:this._pubBytes=d(w.pub)}return v.fromPublic=function(w,x){return x instanceof v?x:new v(w,{pub:x})},v.fromSecret=function(w,x){return x instanceof v?x:new v(w,{secret:x})},v.prototype.secret=function(){return this._secret},m(v,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),m(v,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),m(v,"privBytes",function(){var w=this.eddsa,x=this.hash(),S=w.encodingLength-1,_=x.slice(0,w.encodingLength);return _[0]&=248,_[S]&=127,_[S]|=64,_}),m(v,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),m(v,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),m(v,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),v.prototype.sign=function(w){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(w,this)},v.prototype.verify=function(w,x){return this.eddsa.verify(w,x,this)},v.prototype.getSecret=function(w){return f(this._secret,"KeyPair is public only"),r.encode(this.secret(),w)},v.prototype.getPublic=function(w){return r.encode(this.pubBytes(),w)},key=v,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var r=requireBn$2(),f=requireUtils$1(),d=f.assert,m=f.cachedProperty,v=f.parseBytes;function g(w,x){this.eddsa=w,typeof x!="object"&&(x=v(x)),Array.isArray(x)&&(d(x.length===w.encodingLength*2,"Signature has invalid size"),x={R:x.slice(0,w.encodingLength),S:x.slice(w.encodingLength)}),d(x.R&&x.S,"Signature without R or S"),w.isPoint(x.R)&&(this._R=x.R),x.S instanceof r&&(this._S=x.S),this._Rencoded=Array.isArray(x.R)?x.R:x.Rencoded,this._Sencoded=Array.isArray(x.S)?x.S:x.Sencoded}return m(g,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),m(g,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),m(g,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),m(g,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),g.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},g.prototype.toHex=function(){return f.encode(this.toBytes(),"hex").toUpperCase()},signature=g,signature}var eddsa,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var r=requireHash(),f=requireCurves(),d=requireUtils$1(),m=d.assert,v=d.parseBytes,g=requireKey(),w=requireSignature();function x(S){if(m(S==="ed25519","only tested with ed25519 so far"),!(this instanceof x))return new x(S);S=f[S].curve,this.curve=S,this.g=S.g,this.g.precompute(S.n.bitLength()+1),this.pointClass=S.point().constructor,this.encodingLength=Math.ceil(S.n.bitLength()/8),this.hash=r.sha512}return eddsa=x,x.prototype.sign=function(_,b){_=v(_);var C=this.keyFromSecret(b),E=this.hashInt(C.messagePrefix(),_),M=this.g.mul(E),A=this.encodePoint(M),T=this.hashInt(A,C.pubBytes(),_).mul(C.priv()),L=E.add(T).umod(this.curve.n);return this.makeSignature({R:M,S:L,Rencoded:A})},x.prototype.verify=function(_,b,C){if(_=v(_),b=this.makeSignature(b),b.S().gte(b.eddsa.curve.n)||b.S().isNeg())return!1;var E=this.keyFromPublic(C),M=this.hashInt(b.Rencoded(),E.pubBytes(),_),A=this.g.mul(b.S()),T=b.R().add(E.pub().mul(M));return T.eq(A)},x.prototype.hashInt=function(){for(var _=this.hash(),b=0;b<arguments.length;b++)_.update(arguments[b]);return d.intFromLE(_.digest()).umod(this.curve.n)},x.prototype.keyFromPublic=function(_){return g.fromPublic(this,_)},x.prototype.keyFromSecret=function(_){return g.fromSecret(this,_)},x.prototype.makeSignature=function(_){return _ instanceof w?_:new w(this,_)},x.prototype.encodePoint=function(_){var b=_.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=_.getX().isOdd()?128:0,b},x.prototype.decodePoint=function(_){_=d.parseBytes(_);var b=_.length-1,C=_.slice(0,b).concat(_[b]&-129),E=(_[b]&128)!==0,M=d.intFromLE(C);return this.curve.pointFromY(M,E)},x.prototype.encodeInt=function(_){return _.toArray("le",this.encodingLength)},x.prototype.decodeInt=function(_){return d.intFromLE(_)},x.prototype.isPoint=function(_){return _ instanceof this.pointClass},eddsa}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(function(r){var f=r;f.version=require$$0.version,f.utils=requireUtils$1(),f.rand=requireBrorand(),f.curve=requireCurve(),f.curves=requireCurves(),f.ec=requireEc(),f.eddsa=requireEddsa()})(elliptic)),elliptic}var bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,(function(r){(function(f,d){function m(q,y){if(!q)throw new Error(y||"Assertion failed")}function v(q,y){q.super_=y;var B=function(){};B.prototype=y.prototype,q.prototype=new B,q.prototype.constructor=q}function g(q,y,B){if(g.isBN(q))return q;this.negative=0,this.words=null,this.length=0,this.red=null,q!==null&&((y==="le"||y==="be")&&(B=y,y=10),this._init(q||0,y||10,B||"be"))}typeof f=="object"?f.exports=g:d.BN=g,g.BN=g,g.wordSize=26;var w;try{typeof window<"u"&&typeof window.Buffer<"u"?w=window.Buffer:w=requireDist().Buffer}catch{}g.isBN=function(y){return y instanceof g?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===g.wordSize&&Array.isArray(y.words)},g.max=function(y,B){return y.cmp(B)>0?y:B},g.min=function(y,B){return y.cmp(B)<0?y:B},g.prototype._init=function(y,B,$){if(typeof y=="number")return this._initNumber(y,B,$);if(typeof y=="object")return this._initArray(y,B,$);B==="hex"&&(B=16),m(B===(B|0)&&B>=2&&B<=36),y=y.toString().replace(/\s+/g,"");var I=0;y[0]==="-"&&(I++,this.negative=1),I<y.length&&(B===16?this._parseHex(y,I,$):(this._parseBase(y,B,I),$==="le"&&this._initArray(this.toArray(),B,$)))},g.prototype._initNumber=function(y,B,$){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(m(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),$==="le"&&this._initArray(this.toArray(),B,$)},g.prototype._initArray=function(y,B,$){if(m(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var U,j,D=0;if($==="be")for(I=y.length-1,U=0;I>=0;I-=3)j=y[I]|y[I-1]<<8|y[I-2]<<16,this.words[U]|=j<<D&67108863,this.words[U+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,U++);else if($==="le")for(I=0,U=0;I<y.length;I+=3)j=y[I]|y[I+1]<<8|y[I+2]<<16,this.words[U]|=j<<D&67108863,this.words[U+1]=j>>>26-D&67108863,D+=24,D>=26&&(D-=26,U++);return this._strip()};function x(q,y){var B=q.charCodeAt(y);if(B>=48&&B<=57)return B-48;if(B>=65&&B<=70)return B-55;if(B>=97&&B<=102)return B-87;m(!1,"Invalid character in "+q)}function S(q,y,B){var $=x(q,B);return B-1>=y&&($|=x(q,B-1)<<4),$}g.prototype._parseHex=function(y,B,$){this.length=Math.ceil((y.length-B)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var U=0,j=0,D;if($==="be")for(I=y.length-1;I>=B;I-=2)D=S(y,B,I)<<U,this.words[j]|=D&67108863,U>=18?(U-=18,j+=1,this.words[j]|=D>>>26):U+=8;else{var W=y.length-B;for(I=W%2===0?B+1:B;I<y.length;I+=2)D=S(y,B,I)<<U,this.words[j]|=D&67108863,U>=18?(U-=18,j+=1,this.words[j]|=D>>>26):U+=8}this._strip()};function _(q,y,B,$){for(var I=0,U=0,j=Math.min(q.length,B),D=y;D<j;D++){var W=q.charCodeAt(D)-48;I*=$,W>=49?U=W-49+10:W>=17?U=W-17+10:U=W,m(W>=0&&U<$,"Invalid character"),I+=U}return I}g.prototype._parseBase=function(y,B,$){this.words=[0],this.length=1;for(var I=0,U=1;U<=67108863;U*=B)I++;I--,U=U/B|0;for(var j=y.length-$,D=j%I,W=Math.min(j,j-D)+$,R=0,z=$;z<W;z+=I)R=_(y,z,z+I,B),this.imuln(U),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(D!==0){var ye=1;for(R=_(y,z,y.length,B),z=0;z<D;z++)ye*=B;this.imuln(ye),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},g.prototype.copy=function(y){y.words=new Array(this.length);for(var B=0;B<this.length;B++)y.words[B]=this.words[B];y.length=this.length,y.negative=this.negative,y.red=this.red};function b(q,y){q.words=y.words,q.length=y.length,q.negative=y.negative,q.red=y.red}if(g.prototype._move=function(y){b(y,this)},g.prototype.clone=function(){var y=new g(null);return this.copy(y),y},g.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},g.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},g.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{g.prototype[Symbol.for("nodejs.util.inspect.custom")]=C}catch{g.prototype.inspect=C}else g.prototype.inspect=C;function C(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];g.prototype.toString=function(y,B){y=y||10,B=B|0||1;var $;if(y===16||y==="hex"){$="";for(var I=0,U=0,j=0;j<this.length;j++){var D=this.words[j],W=((D<<I|U)&16777215).toString(16);U=D>>>24-I&16777215,I+=2,I>=26&&(I-=26,j--),U!==0||j!==this.length-1?$=E[6-W.length]+W+$:$=W+$}for(U!==0&&($=U.toString(16)+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(y===(y|0)&&y>=2&&y<=36){var R=M[y],z=A[y];$="";var ye=this.clone();for(ye.negative=0;!ye.isZero();){var Ce=ye.modrn(z).toString(y);ye=ye.idivn(z),ye.isZero()?$=Ce+$:$=E[R-Ce.length]+Ce+$}for(this.isZero()&&($="0"+$);$.length%B!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}m(!1,"Base should be between 2 and 36")},g.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&m(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},g.prototype.toJSON=function(){return this.toString(16,2)},w&&(g.prototype.toBuffer=function(y,B){return this.toArrayLike(w,y,B)}),g.prototype.toArray=function(y,B){return this.toArrayLike(Array,y,B)};var T=function(y,B){return y.allocUnsafe?y.allocUnsafe(B):new y(B)};g.prototype.toArrayLike=function(y,B,$){this._strip();var I=this.byteLength(),U=$||Math.max(1,I);m(I<=U,"byte array longer than desired length"),m(U>0,"Requested array length <= 0");var j=T(y,U),D=B==="le"?"LE":"BE";return this["_toArrayLike"+D](j,I),j},g.prototype._toArrayLikeLE=function(y,B){for(var $=0,I=0,U=0,j=0;U<this.length;U++){var D=this.words[U]<<j|I;y[$++]=D&255,$<y.length&&(y[$++]=D>>8&255),$<y.length&&(y[$++]=D>>16&255),j===6?($<y.length&&(y[$++]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($<y.length)for(y[$++]=I;$<y.length;)y[$++]=0},g.prototype._toArrayLikeBE=function(y,B){for(var $=y.length-1,I=0,U=0,j=0;U<this.length;U++){var D=this.words[U]<<j|I;y[$--]=D&255,$>=0&&(y[$--]=D>>8&255),$>=0&&(y[$--]=D>>16&255),j===6?($>=0&&(y[$--]=D>>24&255),I=0,j=0):(I=D>>>24,j+=2)}if($>=0)for(y[$--]=I;$>=0;)y[$--]=0},Math.clz32?g.prototype._countBits=function(y){return 32-Math.clz32(y)}:g.prototype._countBits=function(y){var B=y,$=0;return B>=4096&&($+=13,B>>>=13),B>=64&&($+=7,B>>>=7),B>=8&&($+=4,B>>>=4),B>=2&&($+=2,B>>>=2),$+B},g.prototype._zeroBits=function(y){if(y===0)return 26;var B=y,$=0;return(B&8191)===0&&($+=13,B>>>=13),(B&127)===0&&($+=7,B>>>=7),(B&15)===0&&($+=4,B>>>=4),(B&3)===0&&($+=2,B>>>=2),(B&1)===0&&$++,$},g.prototype.bitLength=function(){var y=this.words[this.length-1],B=this._countBits(y);return(this.length-1)*26+B};function L(q){for(var y=new Array(q.bitLength()),B=0;B<y.length;B++){var $=B/26|0,I=B%26;y[B]=q.words[$]>>>I&1}return y}g.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,B=0;B<this.length;B++){var $=this._zeroBits(this.words[B]);if(y+=$,$!==26)break}return y},g.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},g.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},g.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},g.prototype.isNeg=function(){return this.negative!==0},g.prototype.neg=function(){return this.clone().ineg()},g.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},g.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var B=0;B<y.length;B++)this.words[B]=this.words[B]|y.words[B];return this._strip()},g.prototype.ior=function(y){return m((this.negative|y.negative)===0),this.iuor(y)},g.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},g.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},g.prototype.iuand=function(y){var B;this.length>y.length?B=y:B=this;for(var $=0;$<B.length;$++)this.words[$]=this.words[$]&y.words[$];return this.length=B.length,this._strip()},g.prototype.iand=function(y){return m((this.negative|y.negative)===0),this.iuand(y)},g.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},g.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},g.prototype.iuxor=function(y){var B,$;this.length>y.length?(B=this,$=y):(B=y,$=this);for(var I=0;I<$.length;I++)this.words[I]=B.words[I]^$.words[I];if(this!==B)for(;I<B.length;I++)this.words[I]=B.words[I];return this.length=B.length,this._strip()},g.prototype.ixor=function(y){return m((this.negative|y.negative)===0),this.iuxor(y)},g.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},g.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},g.prototype.inotn=function(y){m(typeof y=="number"&&y>=0);var B=Math.ceil(y/26)|0,$=y%26;this._expand(B),$>0&&B--;for(var I=0;I<B;I++)this.words[I]=~this.words[I]&67108863;return $>0&&(this.words[I]=~this.words[I]&67108863>>26-$),this._strip()},g.prototype.notn=function(y){return this.clone().inotn(y)},g.prototype.setn=function(y,B){m(typeof y=="number"&&y>=0);var $=y/26|0,I=y%26;return this._expand($+1),B?this.words[$]=this.words[$]|1<<I:this.words[$]=this.words[$]&~(1<<I),this._strip()},g.prototype.iadd=function(y){var B;if(this.negative!==0&&y.negative===0)return this.negative=0,B=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,B=this.isub(y),y.negative=1,B._normSign();var $,I;this.length>y.length?($=this,I=y):($=y,I=this);for(var U=0,j=0;j<I.length;j++)B=($.words[j]|0)+(I.words[j]|0)+U,this.words[j]=B&67108863,U=B>>>26;for(;U!==0&&j<$.length;j++)B=($.words[j]|0)+U,this.words[j]=B&67108863,U=B>>>26;if(this.length=$.length,U!==0)this.words[this.length]=U,this.length++;else if($!==this)for(;j<$.length;j++)this.words[j]=$.words[j];return this},g.prototype.add=function(y){var B;return y.negative!==0&&this.negative===0?(y.negative=0,B=this.sub(y),y.negative^=1,B):y.negative===0&&this.negative!==0?(this.negative=0,B=y.sub(this),this.negative=1,B):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},g.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var B=this.iadd(y);return y.negative=1,B._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var $=this.cmp(y);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,U;$>0?(I=this,U=y):(I=y,U=this);for(var j=0,D=0;D<U.length;D++)B=(I.words[D]|0)-(U.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;for(;j!==0&&D<I.length;D++)B=(I.words[D]|0)+j,j=B>>26,this.words[D]=B&67108863;if(j===0&&D<I.length&&I!==this)for(;D<I.length;D++)this.words[D]=I.words[D];return this.length=Math.max(this.length,D),I!==this&&(this.negative=1),this._strip()},g.prototype.sub=function(y){return this.clone().isub(y)};function O(q,y,B){B.negative=y.negative^q.negative;var $=q.length+y.length|0;B.length=$,$=$-1|0;var I=q.words[0]|0,U=y.words[0]|0,j=I*U,D=j&67108863,W=j/67108864|0;B.words[0]=D;for(var R=1;R<$;R++){for(var z=W>>>26,ye=W&67108863,Ce=Math.min(R,y.length-1),me=Math.max(0,R-q.length+1);me<=Ce;me++){var ie=R-me|0;I=q.words[ie]|0,U=y.words[me]|0,j=I*U+ye,z+=j/67108864|0,ye=j&67108863}B.words[R]=ye|0,W=z|0}return W!==0?B.words[R]=W|0:B.length--,B._strip()}var N=function(y,B,$){var I=y.words,U=B.words,j=$.words,D=0,W,R,z,ye=I[0]|0,Ce=ye&8191,me=ye>>>13,ie=I[1]|0,ee=ie&8191,pe=ie>>>13,be=I[2]|0,ae=be&8191,ne=be>>>13,Se=I[3]|0,qe=Se&8191,Ie=Se>>>13,Oe=I[4]|0,Fe=Oe&8191,De=Oe>>>13,$e=I[5]|0,je=$e&8191,Ye=$e>>>13,st=I[6]|0,Je=st&8191,Ge=st>>>13,ut=I[7]|0,gt=ut&8191,rt=ut>>>13,wt=I[8]|0,bt=wt&8191,le=wt>>>13,Z=I[9]|0,J=Z&8191,ge=Z>>>13,Ee=U[0]|0,Re=Ee&8191,ke=Ee>>>13,Xe=U[1]|0,He=Xe&8191,Ze=Xe>>>13,xt=U[2]|0,tt=xt&8191,mt=xt>>>13,Tt=U[3]|0,St=Tt&8191,lt=Tt>>>13,Mt=U[4]|0,Ct=Mt&8191,ce=Mt>>>13,Y=U[5]|0,Q=Y&8191,ve=Y>>>13,fe=U[6]|0,F=fe&8191,G=fe>>>13,re=U[7]|0,K=re&8191,ue=re>>>13,Ae=U[8]|0,xe=Ae&8191,Te=Ae>>>13,Pe=U[9]|0,Ue=Pe&8191,Ne=Pe>>>13;$.negative=y.negative^B.negative,$.length=19,W=Math.imul(Ce,Re),R=Math.imul(Ce,ke),R=R+Math.imul(me,Re)|0,z=Math.imul(me,ke);var At=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(At>>>26)|0,At&=67108863,W=Math.imul(ee,Re),R=Math.imul(ee,ke),R=R+Math.imul(pe,Re)|0,z=Math.imul(pe,ke),W=W+Math.imul(Ce,He)|0,R=R+Math.imul(Ce,Ze)|0,R=R+Math.imul(me,He)|0,z=z+Math.imul(me,Ze)|0;var ot=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ot>>>26)|0,ot&=67108863,W=Math.imul(ae,Re),R=Math.imul(ae,ke),R=R+Math.imul(ne,Re)|0,z=Math.imul(ne,ke),W=W+Math.imul(ee,He)|0,R=R+Math.imul(ee,Ze)|0,R=R+Math.imul(pe,He)|0,z=z+Math.imul(pe,Ze)|0,W=W+Math.imul(Ce,tt)|0,R=R+Math.imul(Ce,mt)|0,R=R+Math.imul(me,tt)|0,z=z+Math.imul(me,mt)|0;var yt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(yt>>>26)|0,yt&=67108863,W=Math.imul(qe,Re),R=Math.imul(qe,ke),R=R+Math.imul(Ie,Re)|0,z=Math.imul(Ie,ke),W=W+Math.imul(ae,He)|0,R=R+Math.imul(ae,Ze)|0,R=R+Math.imul(ne,He)|0,z=z+Math.imul(ne,Ze)|0,W=W+Math.imul(ee,tt)|0,R=R+Math.imul(ee,mt)|0,R=R+Math.imul(pe,tt)|0,z=z+Math.imul(pe,mt)|0,W=W+Math.imul(Ce,St)|0,R=R+Math.imul(Ce,lt)|0,R=R+Math.imul(me,St)|0,z=z+Math.imul(me,lt)|0;var vt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(vt>>>26)|0,vt&=67108863,W=Math.imul(Fe,Re),R=Math.imul(Fe,ke),R=R+Math.imul(De,Re)|0,z=Math.imul(De,ke),W=W+Math.imul(qe,He)|0,R=R+Math.imul(qe,Ze)|0,R=R+Math.imul(Ie,He)|0,z=z+Math.imul(Ie,Ze)|0,W=W+Math.imul(ae,tt)|0,R=R+Math.imul(ae,mt)|0,R=R+Math.imul(ne,tt)|0,z=z+Math.imul(ne,mt)|0,W=W+Math.imul(ee,St)|0,R=R+Math.imul(ee,lt)|0,R=R+Math.imul(pe,St)|0,z=z+Math.imul(pe,lt)|0,W=W+Math.imul(Ce,Ct)|0,R=R+Math.imul(Ce,ce)|0,R=R+Math.imul(me,Ct)|0,z=z+Math.imul(me,ce)|0;var _t=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(_t>>>26)|0,_t&=67108863,W=Math.imul(je,Re),R=Math.imul(je,ke),R=R+Math.imul(Ye,Re)|0,z=Math.imul(Ye,ke),W=W+Math.imul(Fe,He)|0,R=R+Math.imul(Fe,Ze)|0,R=R+Math.imul(De,He)|0,z=z+Math.imul(De,Ze)|0,W=W+Math.imul(qe,tt)|0,R=R+Math.imul(qe,mt)|0,R=R+Math.imul(Ie,tt)|0,z=z+Math.imul(Ie,mt)|0,W=W+Math.imul(ae,St)|0,R=R+Math.imul(ae,lt)|0,R=R+Math.imul(ne,St)|0,z=z+Math.imul(ne,lt)|0,W=W+Math.imul(ee,Ct)|0,R=R+Math.imul(ee,ce)|0,R=R+Math.imul(pe,Ct)|0,z=z+Math.imul(pe,ce)|0,W=W+Math.imul(Ce,Q)|0,R=R+Math.imul(Ce,ve)|0,R=R+Math.imul(me,Q)|0,z=z+Math.imul(me,ve)|0;var Ve=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,W=Math.imul(Je,Re),R=Math.imul(Je,ke),R=R+Math.imul(Ge,Re)|0,z=Math.imul(Ge,ke),W=W+Math.imul(je,He)|0,R=R+Math.imul(je,Ze)|0,R=R+Math.imul(Ye,He)|0,z=z+Math.imul(Ye,Ze)|0,W=W+Math.imul(Fe,tt)|0,R=R+Math.imul(Fe,mt)|0,R=R+Math.imul(De,tt)|0,z=z+Math.imul(De,mt)|0,W=W+Math.imul(qe,St)|0,R=R+Math.imul(qe,lt)|0,R=R+Math.imul(Ie,St)|0,z=z+Math.imul(Ie,lt)|0,W=W+Math.imul(ae,Ct)|0,R=R+Math.imul(ae,ce)|0,R=R+Math.imul(ne,Ct)|0,z=z+Math.imul(ne,ce)|0,W=W+Math.imul(ee,Q)|0,R=R+Math.imul(ee,ve)|0,R=R+Math.imul(pe,Q)|0,z=z+Math.imul(pe,ve)|0,W=W+Math.imul(Ce,F)|0,R=R+Math.imul(Ce,G)|0,R=R+Math.imul(me,F)|0,z=z+Math.imul(me,G)|0;var ft=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ft>>>26)|0,ft&=67108863,W=Math.imul(gt,Re),R=Math.imul(gt,ke),R=R+Math.imul(rt,Re)|0,z=Math.imul(rt,ke),W=W+Math.imul(Je,He)|0,R=R+Math.imul(Je,Ze)|0,R=R+Math.imul(Ge,He)|0,z=z+Math.imul(Ge,Ze)|0,W=W+Math.imul(je,tt)|0,R=R+Math.imul(je,mt)|0,R=R+Math.imul(Ye,tt)|0,z=z+Math.imul(Ye,mt)|0,W=W+Math.imul(Fe,St)|0,R=R+Math.imul(Fe,lt)|0,R=R+Math.imul(De,St)|0,z=z+Math.imul(De,lt)|0,W=W+Math.imul(qe,Ct)|0,R=R+Math.imul(qe,ce)|0,R=R+Math.imul(Ie,Ct)|0,z=z+Math.imul(Ie,ce)|0,W=W+Math.imul(ae,Q)|0,R=R+Math.imul(ae,ve)|0,R=R+Math.imul(ne,Q)|0,z=z+Math.imul(ne,ve)|0,W=W+Math.imul(ee,F)|0,R=R+Math.imul(ee,G)|0,R=R+Math.imul(pe,F)|0,z=z+Math.imul(pe,G)|0,W=W+Math.imul(Ce,K)|0,R=R+Math.imul(Ce,ue)|0,R=R+Math.imul(me,K)|0,z=z+Math.imul(me,ue)|0;var et=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(et>>>26)|0,et&=67108863,W=Math.imul(bt,Re),R=Math.imul(bt,ke),R=R+Math.imul(le,Re)|0,z=Math.imul(le,ke),W=W+Math.imul(gt,He)|0,R=R+Math.imul(gt,Ze)|0,R=R+Math.imul(rt,He)|0,z=z+Math.imul(rt,Ze)|0,W=W+Math.imul(Je,tt)|0,R=R+Math.imul(Je,mt)|0,R=R+Math.imul(Ge,tt)|0,z=z+Math.imul(Ge,mt)|0,W=W+Math.imul(je,St)|0,R=R+Math.imul(je,lt)|0,R=R+Math.imul(Ye,St)|0,z=z+Math.imul(Ye,lt)|0,W=W+Math.imul(Fe,Ct)|0,R=R+Math.imul(Fe,ce)|0,R=R+Math.imul(De,Ct)|0,z=z+Math.imul(De,ce)|0,W=W+Math.imul(qe,Q)|0,R=R+Math.imul(qe,ve)|0,R=R+Math.imul(Ie,Q)|0,z=z+Math.imul(Ie,ve)|0,W=W+Math.imul(ae,F)|0,R=R+Math.imul(ae,G)|0,R=R+Math.imul(ne,F)|0,z=z+Math.imul(ne,G)|0,W=W+Math.imul(ee,K)|0,R=R+Math.imul(ee,ue)|0,R=R+Math.imul(pe,K)|0,z=z+Math.imul(pe,ue)|0,W=W+Math.imul(Ce,xe)|0,R=R+Math.imul(Ce,Te)|0,R=R+Math.imul(me,xe)|0,z=z+Math.imul(me,Te)|0;var ht=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ht>>>26)|0,ht&=67108863,W=Math.imul(J,Re),R=Math.imul(J,ke),R=R+Math.imul(ge,Re)|0,z=Math.imul(ge,ke),W=W+Math.imul(bt,He)|0,R=R+Math.imul(bt,Ze)|0,R=R+Math.imul(le,He)|0,z=z+Math.imul(le,Ze)|0,W=W+Math.imul(gt,tt)|0,R=R+Math.imul(gt,mt)|0,R=R+Math.imul(rt,tt)|0,z=z+Math.imul(rt,mt)|0,W=W+Math.imul(Je,St)|0,R=R+Math.imul(Je,lt)|0,R=R+Math.imul(Ge,St)|0,z=z+Math.imul(Ge,lt)|0,W=W+Math.imul(je,Ct)|0,R=R+Math.imul(je,ce)|0,R=R+Math.imul(Ye,Ct)|0,z=z+Math.imul(Ye,ce)|0,W=W+Math.imul(Fe,Q)|0,R=R+Math.imul(Fe,ve)|0,R=R+Math.imul(De,Q)|0,z=z+Math.imul(De,ve)|0,W=W+Math.imul(qe,F)|0,R=R+Math.imul(qe,G)|0,R=R+Math.imul(Ie,F)|0,z=z+Math.imul(Ie,G)|0,W=W+Math.imul(ae,K)|0,R=R+Math.imul(ae,ue)|0,R=R+Math.imul(ne,K)|0,z=z+Math.imul(ne,ue)|0,W=W+Math.imul(ee,xe)|0,R=R+Math.imul(ee,Te)|0,R=R+Math.imul(pe,xe)|0,z=z+Math.imul(pe,Te)|0,W=W+Math.imul(Ce,Ue)|0,R=R+Math.imul(Ce,Ne)|0,R=R+Math.imul(me,Ue)|0,z=z+Math.imul(me,Ne)|0;var it=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(it>>>26)|0,it&=67108863,W=Math.imul(J,He),R=Math.imul(J,Ze),R=R+Math.imul(ge,He)|0,z=Math.imul(ge,Ze),W=W+Math.imul(bt,tt)|0,R=R+Math.imul(bt,mt)|0,R=R+Math.imul(le,tt)|0,z=z+Math.imul(le,mt)|0,W=W+Math.imul(gt,St)|0,R=R+Math.imul(gt,lt)|0,R=R+Math.imul(rt,St)|0,z=z+Math.imul(rt,lt)|0,W=W+Math.imul(Je,Ct)|0,R=R+Math.imul(Je,ce)|0,R=R+Math.imul(Ge,Ct)|0,z=z+Math.imul(Ge,ce)|0,W=W+Math.imul(je,Q)|0,R=R+Math.imul(je,ve)|0,R=R+Math.imul(Ye,Q)|0,z=z+Math.imul(Ye,ve)|0,W=W+Math.imul(Fe,F)|0,R=R+Math.imul(Fe,G)|0,R=R+Math.imul(De,F)|0,z=z+Math.imul(De,G)|0,W=W+Math.imul(qe,K)|0,R=R+Math.imul(qe,ue)|0,R=R+Math.imul(Ie,K)|0,z=z+Math.imul(Ie,ue)|0,W=W+Math.imul(ae,xe)|0,R=R+Math.imul(ae,Te)|0,R=R+Math.imul(ne,xe)|0,z=z+Math.imul(ne,Te)|0,W=W+Math.imul(ee,Ue)|0,R=R+Math.imul(ee,Ne)|0,R=R+Math.imul(pe,Ue)|0,z=z+Math.imul(pe,Ne)|0;var pt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(pt>>>26)|0,pt&=67108863,W=Math.imul(J,tt),R=Math.imul(J,mt),R=R+Math.imul(ge,tt)|0,z=Math.imul(ge,mt),W=W+Math.imul(bt,St)|0,R=R+Math.imul(bt,lt)|0,R=R+Math.imul(le,St)|0,z=z+Math.imul(le,lt)|0,W=W+Math.imul(gt,Ct)|0,R=R+Math.imul(gt,ce)|0,R=R+Math.imul(rt,Ct)|0,z=z+Math.imul(rt,ce)|0,W=W+Math.imul(Je,Q)|0,R=R+Math.imul(Je,ve)|0,R=R+Math.imul(Ge,Q)|0,z=z+Math.imul(Ge,ve)|0,W=W+Math.imul(je,F)|0,R=R+Math.imul(je,G)|0,R=R+Math.imul(Ye,F)|0,z=z+Math.imul(Ye,G)|0,W=W+Math.imul(Fe,K)|0,R=R+Math.imul(Fe,ue)|0,R=R+Math.imul(De,K)|0,z=z+Math.imul(De,ue)|0,W=W+Math.imul(qe,xe)|0,R=R+Math.imul(qe,Te)|0,R=R+Math.imul(Ie,xe)|0,z=z+Math.imul(Ie,Te)|0,W=W+Math.imul(ae,Ue)|0,R=R+Math.imul(ae,Ne)|0,R=R+Math.imul(ne,Ue)|0,z=z+Math.imul(ne,Ne)|0;var at=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(at>>>26)|0,at&=67108863,W=Math.imul(J,St),R=Math.imul(J,lt),R=R+Math.imul(ge,St)|0,z=Math.imul(ge,lt),W=W+Math.imul(bt,Ct)|0,R=R+Math.imul(bt,ce)|0,R=R+Math.imul(le,Ct)|0,z=z+Math.imul(le,ce)|0,W=W+Math.imul(gt,Q)|0,R=R+Math.imul(gt,ve)|0,R=R+Math.imul(rt,Q)|0,z=z+Math.imul(rt,ve)|0,W=W+Math.imul(Je,F)|0,R=R+Math.imul(Je,G)|0,R=R+Math.imul(Ge,F)|0,z=z+Math.imul(Ge,G)|0,W=W+Math.imul(je,K)|0,R=R+Math.imul(je,ue)|0,R=R+Math.imul(Ye,K)|0,z=z+Math.imul(Ye,ue)|0,W=W+Math.imul(Fe,xe)|0,R=R+Math.imul(Fe,Te)|0,R=R+Math.imul(De,xe)|0,z=z+Math.imul(De,Te)|0,W=W+Math.imul(qe,Ue)|0,R=R+Math.imul(qe,Ne)|0,R=R+Math.imul(Ie,Ue)|0,z=z+Math.imul(Ie,Ne)|0;var ct=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(ct>>>26)|0,ct&=67108863,W=Math.imul(J,Ct),R=Math.imul(J,ce),R=R+Math.imul(ge,Ct)|0,z=Math.imul(ge,ce),W=W+Math.imul(bt,Q)|0,R=R+Math.imul(bt,ve)|0,R=R+Math.imul(le,Q)|0,z=z+Math.imul(le,ve)|0,W=W+Math.imul(gt,F)|0,R=R+Math.imul(gt,G)|0,R=R+Math.imul(rt,F)|0,z=z+Math.imul(rt,G)|0,W=W+Math.imul(Je,K)|0,R=R+Math.imul(Je,ue)|0,R=R+Math.imul(Ge,K)|0,z=z+Math.imul(Ge,ue)|0,W=W+Math.imul(je,xe)|0,R=R+Math.imul(je,Te)|0,R=R+Math.imul(Ye,xe)|0,z=z+Math.imul(Ye,Te)|0,W=W+Math.imul(Fe,Ue)|0,R=R+Math.imul(Fe,Ne)|0,R=R+Math.imul(De,Ue)|0,z=z+Math.imul(De,Ne)|0;var dt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(dt>>>26)|0,dt&=67108863,W=Math.imul(J,Q),R=Math.imul(J,ve),R=R+Math.imul(ge,Q)|0,z=Math.imul(ge,ve),W=W+Math.imul(bt,F)|0,R=R+Math.imul(bt,G)|0,R=R+Math.imul(le,F)|0,z=z+Math.imul(le,G)|0,W=W+Math.imul(gt,K)|0,R=R+Math.imul(gt,ue)|0,R=R+Math.imul(rt,K)|0,z=z+Math.imul(rt,ue)|0,W=W+Math.imul(Je,xe)|0,R=R+Math.imul(Je,Te)|0,R=R+Math.imul(Ge,xe)|0,z=z+Math.imul(Ge,Te)|0,W=W+Math.imul(je,Ue)|0,R=R+Math.imul(je,Ne)|0,R=R+Math.imul(Ye,Ue)|0,z=z+Math.imul(Ye,Ne)|0;var nt=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(nt>>>26)|0,nt&=67108863,W=Math.imul(J,F),R=Math.imul(J,G),R=R+Math.imul(ge,F)|0,z=Math.imul(ge,G),W=W+Math.imul(bt,K)|0,R=R+Math.imul(bt,ue)|0,R=R+Math.imul(le,K)|0,z=z+Math.imul(le,ue)|0,W=W+Math.imul(gt,xe)|0,R=R+Math.imul(gt,Te)|0,R=R+Math.imul(rt,xe)|0,z=z+Math.imul(rt,Te)|0,W=W+Math.imul(Je,Ue)|0,R=R+Math.imul(Je,Ne)|0,R=R+Math.imul(Ge,Ue)|0,z=z+Math.imul(Ge,Ne)|0;var Le=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Le>>>26)|0,Le&=67108863,W=Math.imul(J,K),R=Math.imul(J,ue),R=R+Math.imul(ge,K)|0,z=Math.imul(ge,ue),W=W+Math.imul(bt,xe)|0,R=R+Math.imul(bt,Te)|0,R=R+Math.imul(le,xe)|0,z=z+Math.imul(le,Te)|0,W=W+Math.imul(gt,Ue)|0,R=R+Math.imul(gt,Ne)|0,R=R+Math.imul(rt,Ue)|0,z=z+Math.imul(rt,Ne)|0;var Be=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Be>>>26)|0,Be&=67108863,W=Math.imul(J,xe),R=Math.imul(J,Te),R=R+Math.imul(ge,xe)|0,z=Math.imul(ge,Te),W=W+Math.imul(bt,Ue)|0,R=R+Math.imul(bt,Ne)|0,R=R+Math.imul(le,Ue)|0,z=z+Math.imul(le,Ne)|0;var Ke=(D+W|0)+((R&8191)<<13)|0;D=(z+(R>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,W=Math.imul(J,Ue),R=Math.imul(J,Ne),R=R+Math.imul(ge,Ue)|0,z=Math.imul(ge,Ne);var We=(D+W|0)+((R&8191)<<13)|0;return D=(z+(R>>>13)|0)+(We>>>26)|0,We&=67108863,j[0]=At,j[1]=ot,j[2]=yt,j[3]=vt,j[4]=_t,j[5]=Ve,j[6]=ft,j[7]=et,j[8]=ht,j[9]=it,j[10]=pt,j[11]=at,j[12]=ct,j[13]=dt,j[14]=nt,j[15]=Le,j[16]=Be,j[17]=Ke,j[18]=We,D!==0&&(j[19]=D,$.length++),$};Math.imul||(N=O);function H(q,y,B){B.negative=y.negative^q.negative,B.length=q.length+y.length;for(var $=0,I=0,U=0;U<B.length-1;U++){var j=I;I=0;for(var D=$&67108863,W=Math.min(U,y.length-1),R=Math.max(0,U-q.length+1);R<=W;R++){var z=U-R,ye=q.words[z]|0,Ce=y.words[R]|0,me=ye*Ce,ie=me&67108863;j=j+(me/67108864|0)|0,ie=ie+D|0,D=ie&67108863,j=j+(ie>>>26)|0,I+=j>>>26,j&=67108863}B.words[U]=D,$=j,j=I}return $!==0?B.words[U]=$:B.length--,B._strip()}function V(q,y,B){return H(q,y,B)}g.prototype.mulTo=function(y,B){var $,I=this.length+y.length;return this.length===10&&y.length===10?$=N(this,y,B):I<63?$=O(this,y,B):I<1024?$=H(this,y,B):$=V(this,y,B),$},g.prototype.mul=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),this.mulTo(y,B)},g.prototype.mulf=function(y){var B=new g(null);return B.words=new Array(this.length+y.length),V(this,y,B)},g.prototype.imul=function(y){return this.clone().mulTo(y,this)},g.prototype.imuln=function(y){var B=y<0;B&&(y=-y),m(typeof y=="number"),m(y<67108864);for(var $=0,I=0;I<this.length;I++){var U=(this.words[I]|0)*y,j=(U&67108863)+($&67108863);$>>=26,$+=U/67108864|0,$+=j>>>26,this.words[I]=j&67108863}return $!==0&&(this.words[I]=$,this.length++),this.length=y===0?1:this.length,B?this.ineg():this},g.prototype.muln=function(y){return this.clone().imuln(y)},g.prototype.sqr=function(){return this.mul(this)},g.prototype.isqr=function(){return this.imul(this.clone())},g.prototype.pow=function(y){var B=L(y);if(B.length===0)return new g(1);for(var $=this,I=0;I<B.length&&B[I]===0;I++,$=$.sqr());if(++I<B.length)for(var U=$.sqr();I<B.length;I++,U=U.sqr())B[I]!==0&&($=$.mul(U));return $},g.prototype.iushln=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=67108863>>>26-B<<26-B,U;if(B!==0){var j=0;for(U=0;U<this.length;U++){var D=this.words[U]&I,W=(this.words[U]|0)-D<<B;this.words[U]=W|j,j=D>>>26-B}j&&(this.words[U]=j,this.length++)}if($!==0){for(U=this.length-1;U>=0;U--)this.words[U+$]=this.words[U];for(U=0;U<$;U++)this.words[U]=0;this.length+=$}return this._strip()},g.prototype.ishln=function(y){return m(this.negative===0),this.iushln(y)},g.prototype.iushrn=function(y,B,$){m(typeof y=="number"&&y>=0);var I;B?I=(B-B%26)/26:I=0;var U=y%26,j=Math.min((y-U)/26,this.length),D=67108863^67108863>>>U<<U,W=$;if(I-=j,I=Math.max(0,I),W){for(var R=0;R<j;R++)W.words[R]=this.words[R];W.length=j}if(j!==0)if(this.length>j)for(this.length-=j,R=0;R<this.length;R++)this.words[R]=this.words[R+j];else this.words[0]=0,this.length=1;var z=0;for(R=this.length-1;R>=0&&(z!==0||R>=I);R--){var ye=this.words[R]|0;this.words[R]=z<<26-U|ye>>>U,z=ye&D}return W&&z!==0&&(W.words[W.length++]=z),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},g.prototype.ishrn=function(y,B,$){return m(this.negative===0),this.iushrn(y,B,$)},g.prototype.shln=function(y){return this.clone().ishln(y)},g.prototype.ushln=function(y){return this.clone().iushln(y)},g.prototype.shrn=function(y){return this.clone().ishrn(y)},g.prototype.ushrn=function(y){return this.clone().iushrn(y)},g.prototype.testn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return!1;var U=this.words[$];return!!(U&I)},g.prototype.imaskn=function(y){m(typeof y=="number"&&y>=0);var B=y%26,$=(y-B)/26;if(m(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(B!==0&&$++,this.length=Math.min($,this.length),B!==0){var I=67108863^67108863>>>B<<B;this.words[this.length-1]&=I}return this._strip()},g.prototype.maskn=function(y){return this.clone().imaskn(y)},g.prototype.iaddn=function(y){return m(typeof y=="number"),m(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},g.prototype._iaddn=function(y){this.words[0]+=y;for(var B=0;B<this.length&&this.words[B]>=67108864;B++)this.words[B]-=67108864,B===this.length-1?this.words[B+1]=1:this.words[B+1]++;return this.length=Math.max(this.length,B+1),this},g.prototype.isubn=function(y){if(m(typeof y=="number"),m(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var B=0;B<this.length&&this.words[B]<0;B++)this.words[B]+=67108864,this.words[B+1]-=1;return this._strip()},g.prototype.addn=function(y){return this.clone().iaddn(y)},g.prototype.subn=function(y){return this.clone().isubn(y)},g.prototype.iabs=function(){return this.negative=0,this},g.prototype.abs=function(){return this.clone().iabs()},g.prototype._ishlnsubmul=function(y,B,$){var I=y.length+$,U;this._expand(I);var j,D=0;for(U=0;U<y.length;U++){j=(this.words[U+$]|0)+D;var W=(y.words[U]|0)*B;j-=W&67108863,D=(j>>26)-(W/67108864|0),this.words[U+$]=j&67108863}for(;U<this.length-$;U++)j=(this.words[U+$]|0)+D,D=j>>26,this.words[U+$]=j&67108863;if(D===0)return this._strip();for(m(D===-1),D=0,U=0;U<this.length;U++)j=-(this.words[U]|0)+D,D=j>>26,this.words[U]=j&67108863;return this.negative=1,this._strip()},g.prototype._wordDiv=function(y,B){var $=this.length-y.length,I=this.clone(),U=y,j=U.words[U.length-1]|0,D=this._countBits(j);$=26-D,$!==0&&(U=U.ushln($),I.iushln($),j=U.words[U.length-1]|0);var W=I.length-U.length,R;if(B!=="mod"){R=new g(null),R.length=W+1,R.words=new Array(R.length);for(var z=0;z<R.length;z++)R.words[z]=0}var ye=I.clone()._ishlnsubmul(U,1,W);ye.negative===0&&(I=ye,R&&(R.words[W]=1));for(var Ce=W-1;Ce>=0;Ce--){var me=(I.words[U.length+Ce]|0)*67108864+(I.words[U.length+Ce-1]|0);for(me=Math.min(me/j|0,67108863),I._ishlnsubmul(U,me,Ce);I.negative!==0;)me--,I.negative=0,I._ishlnsubmul(U,1,Ce),I.isZero()||(I.negative^=1);R&&(R.words[Ce]=me)}return R&&R._strip(),I._strip(),B!=="div"&&$!==0&&I.iushrn($),{div:R||null,mod:I}},g.prototype.divmod=function(y,B,$){if(m(!y.isZero()),this.isZero())return{div:new g(0),mod:new g(0)};var I,U,j;return this.negative!==0&&y.negative===0?(j=this.neg().divmod(y,B),B!=="mod"&&(I=j.div.neg()),B!=="div"&&(U=j.mod.neg(),$&&U.negative!==0&&U.iadd(y)),{div:I,mod:U}):this.negative===0&&y.negative!==0?(j=this.divmod(y.neg(),B),B!=="mod"&&(I=j.div.neg()),{div:I,mod:j.mod}):(this.negative&y.negative)!==0?(j=this.neg().divmod(y.neg(),B),B!=="div"&&(U=j.mod.neg(),$&&U.negative!==0&&U.isub(y)),{div:j.div,mod:U}):y.length>this.length||this.cmp(y)<0?{div:new g(0),mod:this}:y.length===1?B==="div"?{div:this.divn(y.words[0]),mod:null}:B==="mod"?{div:null,mod:new g(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new g(this.modrn(y.words[0]))}:this._wordDiv(y,B)},g.prototype.div=function(y){return this.divmod(y,"div",!1).div},g.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},g.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},g.prototype.divRound=function(y){var B=this.divmod(y);if(B.mod.isZero())return B.div;var $=B.div.negative!==0?B.mod.isub(y):B.mod,I=y.ushrn(1),U=y.andln(1),j=$.cmp(I);return j<0||U===1&&j===0?B.div:B.div.negative!==0?B.div.isubn(1):B.div.iaddn(1)},g.prototype.modrn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=(1<<26)%y,I=0,U=this.length-1;U>=0;U--)I=($*I+(this.words[U]|0))%y;return B?-I:I},g.prototype.modn=function(y){return this.modrn(y)},g.prototype.idivn=function(y){var B=y<0;B&&(y=-y),m(y<=67108863);for(var $=0,I=this.length-1;I>=0;I--){var U=(this.words[I]|0)+$*67108864;this.words[I]=U/y|0,$=U%y}return this._strip(),B?this.ineg():this},g.prototype.divn=function(y){return this.clone().idivn(y)},g.prototype.egcd=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),U=new g(0),j=new g(0),D=new g(1),W=0;B.isEven()&&$.isEven();)B.iushrn(1),$.iushrn(1),++W;for(var R=$.clone(),z=B.clone();!B.isZero();){for(var ye=0,Ce=1;(B.words[0]&Ce)===0&&ye<26;++ye,Ce<<=1);if(ye>0)for(B.iushrn(ye);ye-- >0;)(I.isOdd()||U.isOdd())&&(I.iadd(R),U.isub(z)),I.iushrn(1),U.iushrn(1);for(var me=0,ie=1;($.words[0]&ie)===0&&me<26;++me,ie<<=1);if(me>0)for($.iushrn(me);me-- >0;)(j.isOdd()||D.isOdd())&&(j.iadd(R),D.isub(z)),j.iushrn(1),D.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(j),U.isub(D)):($.isub(B),j.isub(I),D.isub(U))}return{a:j,b:D,gcd:$.iushln(W)}},g.prototype._invmp=function(y){m(y.negative===0),m(!y.isZero());var B=this,$=y.clone();B.negative!==0?B=B.umod(y):B=B.clone();for(var I=new g(1),U=new g(0),j=$.clone();B.cmpn(1)>0&&$.cmpn(1)>0;){for(var D=0,W=1;(B.words[0]&W)===0&&D<26;++D,W<<=1);if(D>0)for(B.iushrn(D);D-- >0;)I.isOdd()&&I.iadd(j),I.iushrn(1);for(var R=0,z=1;($.words[0]&z)===0&&R<26;++R,z<<=1);if(R>0)for($.iushrn(R);R-- >0;)U.isOdd()&&U.iadd(j),U.iushrn(1);B.cmp($)>=0?(B.isub($),I.isub(U)):($.isub(B),U.isub(I))}var ye;return B.cmpn(1)===0?ye=I:ye=U,ye.cmpn(0)<0&&ye.iadd(y),ye},g.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var B=this.clone(),$=y.clone();B.negative=0,$.negative=0;for(var I=0;B.isEven()&&$.isEven();I++)B.iushrn(1),$.iushrn(1);do{for(;B.isEven();)B.iushrn(1);for(;$.isEven();)$.iushrn(1);var U=B.cmp($);if(U<0){var j=B;B=$,$=j}else if(U===0||$.cmpn(1)===0)break;B.isub($)}while(!0);return $.iushln(I)},g.prototype.invm=function(y){return this.egcd(y).a.umod(y)},g.prototype.isEven=function(){return(this.words[0]&1)===0},g.prototype.isOdd=function(){return(this.words[0]&1)===1},g.prototype.andln=function(y){return this.words[0]&y},g.prototype.bincn=function(y){m(typeof y=="number");var B=y%26,$=(y-B)/26,I=1<<B;if(this.length<=$)return this._expand($+1),this.words[$]|=I,this;for(var U=I,j=$;U!==0&&j<this.length;j++){var D=this.words[j]|0;D+=U,U=D>>>26,D&=67108863,this.words[j]=D}return U!==0&&(this.words[j]=U,this.length++),this},g.prototype.isZero=function(){return this.length===1&&this.words[0]===0},g.prototype.cmpn=function(y){var B=y<0;if(this.negative!==0&&!B)return-1;if(this.negative===0&&B)return 1;this._strip();var $;if(this.length>1)$=1;else{B&&(y=-y),m(y<=67108863,"Number is too big");var I=this.words[0]|0;$=I===y?0:I<y?-1:1}return this.negative!==0?-$|0:$},g.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var B=this.ucmp(y);return this.negative!==0?-B|0:B},g.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var B=0,$=this.length-1;$>=0;$--){var I=this.words[$]|0,U=y.words[$]|0;if(I!==U){I<U?B=-1:I>U&&(B=1);break}}return B},g.prototype.gtn=function(y){return this.cmpn(y)===1},g.prototype.gt=function(y){return this.cmp(y)===1},g.prototype.gten=function(y){return this.cmpn(y)>=0},g.prototype.gte=function(y){return this.cmp(y)>=0},g.prototype.ltn=function(y){return this.cmpn(y)===-1},g.prototype.lt=function(y){return this.cmp(y)===-1},g.prototype.lten=function(y){return this.cmpn(y)<=0},g.prototype.lte=function(y){return this.cmp(y)<=0},g.prototype.eqn=function(y){return this.cmpn(y)===0},g.prototype.eq=function(y){return this.cmp(y)===0},g.red=function(y){return new te(y)},g.prototype.toRed=function(y){return m(!this.red,"Already a number in reduction context"),m(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},g.prototype.fromRed=function(){return m(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},g.prototype._forceRed=function(y){return this.red=y,this},g.prototype.forceRed=function(y){return m(!this.red,"Already a number in reduction context"),this._forceRed(y)},g.prototype.redAdd=function(y){return m(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},g.prototype.redIAdd=function(y){return m(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},g.prototype.redSub=function(y){return m(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},g.prototype.redISub=function(y){return m(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},g.prototype.redShl=function(y){return m(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},g.prototype.redMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},g.prototype.redIMul=function(y){return m(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},g.prototype.redSqr=function(){return m(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},g.prototype.redISqr=function(){return m(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},g.prototype.redSqrt=function(){return m(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},g.prototype.redInvm=function(){return m(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},g.prototype.redNeg=function(){return m(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},g.prototype.redPow=function(y){return m(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var X={k256:null,p224:null,p192:null,p25519:null};function oe(q,y){this.name=q,this.p=new g(y,16),this.n=this.p.bitLength(),this.k=new g(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}oe.prototype._tmp=function(){var y=new g(null);return y.words=new Array(Math.ceil(this.n/13)),y},oe.prototype.ireduce=function(y){var B=y,$;do this.split(B,this.tmp),B=this.imulK(B),B=B.iadd(this.tmp),$=B.bitLength();while($>this.n);var I=$<this.n?-1:B.ucmp(this.p);return I===0?(B.words[0]=0,B.length=1):I>0?B.isub(this.p):B.strip!==void 0?B.strip():B._strip(),B},oe.prototype.split=function(y,B){y.iushrn(this.n,0,B)},oe.prototype.imulK=function(y){return y.imul(this.k)};function se(){oe.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}v(se,oe),se.prototype.split=function(y,B){for(var $=4194303,I=Math.min(y.length,9),U=0;U<I;U++)B.words[U]=y.words[U];if(B.length=I,y.length<=9){y.words[0]=0,y.length=1;return}var j=y.words[9];for(B.words[B.length++]=j&$,U=10;U<y.length;U++){var D=y.words[U]|0;y.words[U-10]=(D&$)<<4|j>>>22,j=D}j>>>=22,y.words[U-10]=j,j===0&&y.length>10?y.length-=10:y.length-=9},se.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var B=0,$=0;$<y.length;$++){var I=y.words[$]|0;B+=I*977,y.words[$]=B&67108863,B=I*64+(B/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function de(){oe.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}v(de,oe);function he(){oe.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}v(he,oe);function we(){oe.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}v(we,oe),we.prototype.imulK=function(y){for(var B=0,$=0;$<y.length;$++){var I=(y.words[$]|0)*19+B,U=I&67108863;I>>>=26,y.words[$]=U,B=I}return B!==0&&(y.words[y.length++]=B),y},g._prime=function(y){if(X[y])return X[y];var B;if(y==="k256")B=new se;else if(y==="p224")B=new de;else if(y==="p192")B=new he;else if(y==="p25519")B=new we;else throw new Error("Unknown prime "+y);return X[y]=B,B};function te(q){if(typeof q=="string"){var y=g._prime(q);this.m=y.p,this.prime=y}else m(q.gtn(1),"modulus must be greater than 1"),this.m=q,this.prime=null}te.prototype._verify1=function(y){m(y.negative===0,"red works only with positives"),m(y.red,"red works only with red numbers")},te.prototype._verify2=function(y,B){m((y.negative|B.negative)===0,"red works only with positives"),m(y.red&&y.red===B.red,"red works only with red numbers")},te.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(b(y,y.umod(this.m)._forceRed(this)),y)},te.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},te.prototype.add=function(y,B){this._verify2(y,B);var $=y.add(B);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},te.prototype.iadd=function(y,B){this._verify2(y,B);var $=y.iadd(B);return $.cmp(this.m)>=0&&$.isub(this.m),$},te.prototype.sub=function(y,B){this._verify2(y,B);var $=y.sub(B);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},te.prototype.isub=function(y,B){this._verify2(y,B);var $=y.isub(B);return $.cmpn(0)<0&&$.iadd(this.m),$},te.prototype.shl=function(y,B){return this._verify1(y),this.imod(y.ushln(B))},te.prototype.imul=function(y,B){return this._verify2(y,B),this.imod(y.imul(B))},te.prototype.mul=function(y,B){return this._verify2(y,B),this.imod(y.mul(B))},te.prototype.isqr=function(y){return this.imul(y,y.clone())},te.prototype.sqr=function(y){return this.mul(y,y)},te.prototype.sqrt=function(y){if(y.isZero())return y.clone();var B=this.m.andln(3);if(m(B%2===1),B===3){var $=this.m.add(new g(1)).iushrn(2);return this.pow(y,$)}for(var I=this.m.subn(1),U=0;!I.isZero()&&I.andln(1)===0;)U++,I.iushrn(1);m(!I.isZero());var j=new g(1).toRed(this),D=j.redNeg(),W=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new g(2*R*R).toRed(this);this.pow(R,W).cmp(D)!==0;)R.redIAdd(D);for(var z=this.pow(R,I),ye=this.pow(y,I.addn(1).iushrn(1)),Ce=this.pow(y,I),me=U;Ce.cmp(j)!==0;){for(var ie=Ce,ee=0;ie.cmp(j)!==0;ee++)ie=ie.redSqr();m(ee<me);var pe=this.pow(z,new g(1).iushln(me-ee-1));ye=ye.redMul(pe),z=pe.redSqr(),Ce=Ce.redMul(z),me=ee}return ye},te.prototype.invm=function(y){var B=y._invmp(this.m);return B.negative!==0?(B.negative=0,this.imod(B).redNeg()):this.imod(B)},te.prototype.pow=function(y,B){if(B.isZero())return new g(1).toRed(this);if(B.cmpn(1)===0)return y.clone();var $=4,I=new Array(1<<$);I[0]=new g(1).toRed(this),I[1]=y;for(var U=2;U<I.length;U++)I[U]=this.mul(I[U-1],y);var j=I[0],D=0,W=0,R=B.bitLength()%26;for(R===0&&(R=26),U=B.length-1;U>=0;U--){for(var z=B.words[U],ye=R-1;ye>=0;ye--){var Ce=z>>ye&1;if(j!==I[0]&&(j=this.sqr(j)),Ce===0&&D===0){W=0;continue}D<<=1,D|=Ce,W++,!(W!==$&&(U!==0||ye!==0))&&(j=this.mul(j,I[D]),W=0,D=0)}R=26}return j},te.prototype.convertTo=function(y){var B=y.umod(this.m);return B===y?B.clone():B},te.prototype.convertFrom=function(y){var B=y.clone();return B.red=null,B},g.mont=function(y){return new k(y)};function k(q){te.call(this,q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v(k,te),k.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},k.prototype.convertFrom=function(y){var B=this.imod(y.mul(this.rinv));return B.red=null,B},k.prototype.imul=function(y,B){if(y.isZero()||B.isZero())return y.words[0]=0,y.length=1,y;var $=y.imul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),U=$.isub(I).iushrn(this.shift),j=U;return U.cmp(this.m)>=0?j=U.isub(this.m):U.cmpn(0)<0&&(j=U.iadd(this.m)),j._forceRed(this)},k.prototype.mul=function(y,B){if(y.isZero()||B.isZero())return new g(0)._forceRed(this);var $=y.mul(B),I=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),U=$.isub(I).iushrn(this.shift),j=U;return U.cmp(this.m)>=0?j=U.isub(this.m):U.cmpn(0)<0&&(j=U.iadd(this.m)),j._forceRed(this)},k.prototype.invm=function(y){var B=this.imod(y._invmp(this.m).mul(this.r2));return B._forceRed(this)}})(r,bn)})(bn$1)),bn$1.exports}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,(function(exports){var indexOf=function(r,f){if(r.indexOf)return r.indexOf(f);for(var d=0;d<r.length;d++)if(r[d]===f)return d;return-1},Object_keys=function(r){if(Object.keys)return Object.keys(r);var f=[];for(var d in r)f.push(d);return f},forEach=function(r,f){if(r.forEach)return r.forEach(f);for(var d=0;d<r.length;d++)f(r[d],d,r)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(r,f,d){Object.defineProperty(r,f,{writable:!0,enumerable:!1,configurable:!0,value:d})}}catch{return function(f,d,m){f[d]=m}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(f){if(!(this instanceof Script))return new Script(f);this.code=f};Script.prototype.runInContext=function(r){if(!(r instanceof Context))throw new TypeError("needs a 'context' argument.");var f=document.createElement("iframe");f.style||(f.style={}),f.style.display="none",document.body.appendChild(f);var d=f.contentWindow,m=d.eval,v=d.execScript;!m&&v&&(v.call(d,"null"),m=d.eval),forEach(Object_keys(r),function(x){d[x]=r[x]}),forEach(globals,function(x){r[x]&&(d[x]=r[x])});var g=Object_keys(d),w=m.call(d,this.code);return forEach(Object_keys(d),function(x){(x in r||indexOf(g,x)===-1)&&(r[x]=d[x])}),forEach(globals,function(x){x in r||defineProp(r,x,d[x])}),document.body.removeChild(f),w},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(r){var f=Script.createContext(r),d=this.runInContext(f);return r&&forEach(Object_keys(f),function(m){r[m]=f[m]}),d},forEach(Object_keys(Script.prototype),function(r){exports[r]=Script[r]=function(f){var d=Script(f);return d[r].apply(d,[].slice.call(arguments,1))}}),exports.isContext=function(r){return r instanceof Context},exports.createScript=function(r){return exports.Script(r)},exports.createContext=Script.createContext=function(r){var f=new Context;return typeof r=="object"&&forEach(Object_keys(r),function(d){f[d]=r[d]}),f}})(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,(function(r){var f=requireAsn1$1(),d=requireInherits_browser(),m=r;m.define=function(w,x){return new v(w,x)};function v(g,w){this.name=g,this.body=w,this.decoders={},this.encoders={}}v.prototype._createNamed=function(w){var x;try{x=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
27
27
  this._initNamed(entity);
28
28
  })`)}catch{x=function(_){this._initNamed(_)}}return d(x,w),x.prototype._initNamed=function(_){w.call(this,_)},new x(this)},v.prototype._getDecoder=function(w){return w=w||"der",this.decoders.hasOwnProperty(w)||(this.decoders[w]=this._createNamed(f.decoders[w])),this.decoders[w]},v.prototype.decode=function(w,x,S){return this._getDecoder(x).decode(w,S)},v.prototype._getEncoder=function(w){return w=w||"der",this.encoders.hasOwnProperty(w)||(this.encoders[w]=this._createNamed(f.encoders[w])),this.encoders[w]},v.prototype.encode=function(w,x,S){return this._getEncoder(x).encode(w,S)}})(api)),api}var base={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var r=requireInherits_browser();function f(m){this._reporterState={obj:null,path:[],options:m||{},errors:[]}}reporter.Reporter=f,f.prototype.isError=function(v){return v instanceof d},f.prototype.save=function(){var v=this._reporterState;return{obj:v.obj,pathLen:v.path.length}},f.prototype.restore=function(v){var g=this._reporterState;g.obj=v.obj,g.path=g.path.slice(0,v.pathLen)},f.prototype.enterKey=function(v){return this._reporterState.path.push(v)},f.prototype.exitKey=function(v){var g=this._reporterState;g.path=g.path.slice(0,v-1)},f.prototype.leaveKey=function(v,g,w){var x=this._reporterState;this.exitKey(v),x.obj!==null&&(x.obj[g]=w)},f.prototype.path=function(){return this._reporterState.path.join("/")},f.prototype.enterObject=function(){var v=this._reporterState,g=v.obj;return v.obj={},g},f.prototype.leaveObject=function(v){var g=this._reporterState,w=g.obj;return g.obj=v,w},f.prototype.error=function(v){var g,w=this._reporterState,x=v instanceof d;if(x?g=v:g=new d(w.path.map(function(S){return"["+JSON.stringify(S)+"]"}).join(""),v.message||v,v.stack),!w.options.partial)throw g;return x||w.errors.push(g),g},f.prototype.wrapResult=function(v){var g=this._reporterState;return g.options.partial?{result:this.isError(v)?null:v,errors:g.errors}:v};function d(m,v){this.path=m,this.rethrow(v)}return r(d,Error),d.prototype.rethrow=function(v){if(this.message=v+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,d),!this.stack)try{throw new Error(this.message)}catch(g){this.stack=g.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var r=requireInherits_browser(),f=requireBase().Reporter,d=requireDist().Buffer;function m(g,w){if(f.call(this,w),!d.isBuffer(g)){this.error("Input not Buffer");return}this.base=g,this.offset=0,this.length=g.length}r(m,f),buffer.DecoderBuffer=m,m.prototype.save=function(){return{offset:this.offset,reporter:f.prototype.save.call(this)}},m.prototype.restore=function(w){var x=new m(this.base);return x.offset=w.offset,x.length=this.offset,this.offset=w.offset,f.prototype.restore.call(this,w.reporter),x},m.prototype.isEmpty=function(){return this.offset===this.length},m.prototype.readUInt8=function(w){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(w||"DecoderBuffer overrun")},m.prototype.skip=function(w,x){if(!(this.offset+w<=this.length))return this.error(x||"DecoderBuffer overrun");var S=new m(this.base);return S._reporterState=this._reporterState,S.offset=this.offset,S.length=this.offset+w,this.offset+=w,S},m.prototype.raw=function(w){return this.base.slice(w?w.offset:this.offset,this.length)};function v(g,w){if(Array.isArray(g))this.length=0,this.value=g.map(function(x){return x instanceof v||(x=new v(x,w)),this.length+=x.length,x},this);else if(typeof g=="number"){if(!(0<=g&&g<=255))return w.error("non-byte EncoderBuffer value");this.value=g,this.length=1}else if(typeof g=="string")this.value=g,this.length=d.byteLength(g);else if(d.isBuffer(g))this.value=g,this.length=g.length;else return w.error("Unsupported type: "+typeof g)}return buffer.EncoderBuffer=v,v.prototype.join=function(w,x){return w||(w=new d(this.length)),x||(x=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(S){S.join(w,x),x+=S.length}):(typeof this.value=="number"?w[x]=this.value:typeof this.value=="string"?w.write(this.value,x):d.isBuffer(this.value)&&this.value.copy(w,x),x+=this.length)),w},buffer}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var r=requireBase().Reporter,f=requireBase().EncoderBuffer,d=requireBase().DecoderBuffer,m=requireMinimalisticAssert(),v=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],g=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(v),w=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function x(_,b){var C={};this._baseState=C,C.enc=_,C.parent=b||null,C.children=null,C.tag=null,C.args=null,C.reverseArgs=null,C.choice=null,C.optional=!1,C.any=!1,C.obj=!1,C.use=null,C.useDecoder=null,C.key=null,C.default=null,C.explicit=null,C.implicit=null,C.contains=null,C.parent||(C.children=[],this._wrap())}node=x;var S=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return x.prototype.clone=function(){var b=this._baseState,C={};S.forEach(function(M){C[M]=b[M]});var E=new this.constructor(C.parent);return E._baseState=C,E},x.prototype._wrap=function(){var b=this._baseState;g.forEach(function(C){this[C]=function(){var M=new this.constructor(this);return b.children.push(M),M[C].apply(M,arguments)}},this)},x.prototype._init=function(b){var C=this._baseState;m(C.parent===null),b.call(this),C.children=C.children.filter(function(E){return E._baseState.parent===this},this),m.equal(C.children.length,1,"Root node can have only one child")},x.prototype._useArgs=function(b){var C=this._baseState,E=b.filter(function(M){return M instanceof this.constructor},this);b=b.filter(function(M){return!(M instanceof this.constructor)},this),E.length!==0&&(m(C.children===null),C.children=E,E.forEach(function(M){M._baseState.parent=this},this)),b.length!==0&&(m(C.args===null),C.args=b,C.reverseArgs=b.map(function(M){if(typeof M!="object"||M.constructor!==Object)return M;var A={};return Object.keys(M).forEach(function(T){T==(T|0)&&(T|=0);var L=M[T];A[L]=T}),A}))},w.forEach(function(_){x.prototype[_]=function(){var C=this._baseState;throw new Error(_+" not implemented for encoding: "+C.enc)}}),v.forEach(function(_){x.prototype[_]=function(){var C=this._baseState,E=Array.prototype.slice.call(arguments);return m(C.tag===null),C.tag=_,this._useArgs(E),this}}),x.prototype.use=function(b){m(b);var C=this._baseState;return m(C.use===null),C.use=b,this},x.prototype.optional=function(){var b=this._baseState;return b.optional=!0,this},x.prototype.def=function(b){var C=this._baseState;return m(C.default===null),C.default=b,C.optional=!0,this},x.prototype.explicit=function(b){var C=this._baseState;return m(C.explicit===null&&C.implicit===null),C.explicit=b,this},x.prototype.implicit=function(b){var C=this._baseState;return m(C.explicit===null&&C.implicit===null),C.implicit=b,this},x.prototype.obj=function(){var b=this._baseState,C=Array.prototype.slice.call(arguments);return b.obj=!0,C.length!==0&&this._useArgs(C),this},x.prototype.key=function(b){var C=this._baseState;return m(C.key===null),C.key=b,this},x.prototype.any=function(){var b=this._baseState;return b.any=!0,this},x.prototype.choice=function(b){var C=this._baseState;return m(C.choice===null),C.choice=b,this._useArgs(Object.keys(b).map(function(E){return b[E]})),this},x.prototype.contains=function(b){var C=this._baseState;return m(C.use===null),C.contains=b,this},x.prototype._decode=function(b,C){var E=this._baseState;if(E.parent===null)return b.wrapResult(E.children[0]._decode(b,C));var M=E.default,A=!0,T=null;if(E.key!==null&&(T=b.enterKey(E.key)),E.optional){var L=null;if(E.explicit!==null?L=E.explicit:E.implicit!==null?L=E.implicit:E.tag!==null&&(L=E.tag),L===null&&!E.any){var O=b.save();try{E.choice===null?this._decodeGeneric(E.tag,b,C):this._decodeChoice(b,C),A=!0}catch{A=!1}b.restore(O)}else if(A=this._peekTag(b,L,E.any),b.isError(A))return A}var N;if(E.obj&&A&&(N=b.enterObject()),A){if(E.explicit!==null){var H=this._decodeTag(b,E.explicit);if(b.isError(H))return H;b=H}var V=b.offset;if(E.use===null&&E.choice===null){if(E.any)var O=b.save();var X=this._decodeTag(b,E.implicit!==null?E.implicit:E.tag,E.any);if(b.isError(X))return X;E.any?M=b.raw(O):b=X}if(C&&C.track&&E.tag!==null&&C.track(b.path(),V,b.length,"tagged"),C&&C.track&&E.tag!==null&&C.track(b.path(),b.offset,b.length,"content"),E.any?M=M:E.choice===null?M=this._decodeGeneric(E.tag,b,C):M=this._decodeChoice(b,C),b.isError(M))return M;if(!E.any&&E.choice===null&&E.children!==null&&E.children.forEach(function(de){de._decode(b,C)}),E.contains&&(E.tag==="octstr"||E.tag==="bitstr")){var oe=new d(M);M=this._getUse(E.contains,b._reporterState.obj)._decode(oe,C)}}return E.obj&&A&&(M=b.leaveObject(N)),E.key!==null&&(M!==null||A===!0)?b.leaveKey(T,E.key,M):T!==null&&b.exitKey(T),M},x.prototype._decodeGeneric=function(b,C,E){var M=this._baseState;return b==="seq"||b==="set"?null:b==="seqof"||b==="setof"?this._decodeList(C,b,M.args[0],E):/str$/.test(b)?this._decodeStr(C,b,E):b==="objid"&&M.args?this._decodeObjid(C,M.args[0],M.args[1],E):b==="objid"?this._decodeObjid(C,null,null,E):b==="gentime"||b==="utctime"?this._decodeTime(C,b,E):b==="null_"?this._decodeNull(C,E):b==="bool"?this._decodeBool(C,E):b==="objDesc"?this._decodeStr(C,b,E):b==="int"||b==="enum"?this._decodeInt(C,M.args&&M.args[0],E):M.use!==null?this._getUse(M.use,C._reporterState.obj)._decode(C,E):C.error("unknown tag: "+b)},x.prototype._getUse=function(b,C){var E=this._baseState;return E.useDecoder=this._use(b,C),m(E.useDecoder._baseState.parent===null),E.useDecoder=E.useDecoder._baseState.children[0],E.implicit!==E.useDecoder._baseState.implicit&&(E.useDecoder=E.useDecoder.clone(),E.useDecoder._baseState.implicit=E.implicit),E.useDecoder},x.prototype._decodeChoice=function(b,C){var E=this._baseState,M=null,A=!1;return Object.keys(E.choice).some(function(T){var L=b.save(),O=E.choice[T];try{var N=O._decode(b,C);if(b.isError(N))return!1;M={type:T,value:N},A=!0}catch{return b.restore(L),!1}return!0},this),A?M:b.error("Choice not matched")},x.prototype._createEncoderBuffer=function(b){return new f(b,this.reporter)},x.prototype._encode=function(b,C,E){var M=this._baseState;if(!(M.default!==null&&M.default===b)){var A=this._encodeValue(b,C,E);if(A!==void 0&&!this._skipDefault(A,C,E))return A}},x.prototype._encodeValue=function(b,C,E){var M=this._baseState;if(M.parent===null)return M.children[0]._encode(b,C||new r);var O=null;if(this.reporter=C,M.optional&&b===void 0)if(M.default!==null)b=M.default;else return;var A=null,T=!1;if(M.any)O=this._createEncoderBuffer(b);else if(M.choice)O=this._encodeChoice(b,C);else if(M.contains)A=this._getUse(M.contains,E)._encode(b,C),T=!0;else if(M.children)A=M.children.map(function(V){if(V._baseState.tag==="null_")return V._encode(null,C,b);if(V._baseState.key===null)return C.error("Child should have a key");var X=C.enterKey(V._baseState.key);if(typeof b!="object")return C.error("Child expected, but input is not object");var oe=V._encode(b[V._baseState.key],C,b);return C.leaveKey(X),oe},this).filter(function(V){return V}),A=this._createEncoderBuffer(A);else if(M.tag==="seqof"||M.tag==="setof"){if(!(M.args&&M.args.length===1))return C.error("Too many args for : "+M.tag);if(!Array.isArray(b))return C.error("seqof/setof, but data is not Array");var L=this.clone();L._baseState.implicit=null,A=this._createEncoderBuffer(b.map(function(V){var X=this._baseState;return this._getUse(X.args[0],b)._encode(V,C)},L))}else M.use!==null?O=this._getUse(M.use,E)._encode(b,C):(A=this._encodePrimitive(M.tag,b),T=!0);var O;if(!M.any&&M.choice===null){var N=M.implicit!==null?M.implicit:M.tag,H=M.implicit===null?"universal":"context";N===null?M.use===null&&C.error("Tag could be omitted only for .use()"):M.use===null&&(O=this._encodeComposite(N,T,H,A))}return M.explicit!==null&&(O=this._encodeComposite(M.explicit,!1,"context",O)),O},x.prototype._encodeChoice=function(b,C){var E=this._baseState,M=E.choice[b.type];return M||m(!1,b.type+" not found in "+JSON.stringify(Object.keys(E.choice))),M._encode(b.value,C)},x.prototype._encodePrimitive=function(b,C){var E=this._baseState;if(/str$/.test(b))return this._encodeStr(C,b);if(b==="objid"&&E.args)return this._encodeObjid(C,E.reverseArgs[0],E.args[1]);if(b==="objid")return this._encodeObjid(C,null,null);if(b==="gentime"||b==="utctime")return this._encodeTime(C,b);if(b==="null_")return this._encodeNull();if(b==="int"||b==="enum")return this._encodeInt(C,E.args&&E.reverseArgs[0]);if(b==="bool")return this._encodeBool(C);if(b==="objDesc")return this._encodeStr(C,b);throw new Error("Unsupported tag: "+b)},x.prototype._isNumstr=function(b){return/^[0-9 ]*$/.test(b)},x.prototype._isPrintstr=function(b){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(b)},node}var hasRequiredBase;function requireBase(){return hasRequiredBase||(hasRequiredBase=1,(function(r){var f=r;f.Reporter=requireReporter().Reporter,f.DecoderBuffer=requireBuffer().DecoderBuffer,f.EncoderBuffer=requireBuffer().EncoderBuffer,f.Node=requireNode()})(base)),base}var constants={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,(function(r){var f=requireConstants();r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=f._reverse(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=f._reverse(r.tag)})(der)),der}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,(function(r){var f=r;f._reverse=function(m){var v={};return Object.keys(m).forEach(function(g){(g|0)==g&&(g=g|0);var w=m[g];v[w]=g}),v},f.der=requireDer$2()})(constants)),constants}var decoders={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var r=requireInherits_browser(),f=requireAsn1$1(),d=f.base,m=f.bignum,v=f.constants.der;function g(_){this.enc="der",this.name=_.name,this.entity=_,this.tree=new w,this.tree._init(_.body)}der_1$1=g,g.prototype.decode=function(b,C){return b instanceof d.DecoderBuffer||(b=new d.DecoderBuffer(b,C)),this.tree._decode(b,C)};function w(_){d.Node.call(this,"der",_)}r(w,d.Node),w.prototype._peekTag=function(b,C,E){if(b.isEmpty())return!1;var M=b.save(),A=x(b,'Failed to peek tag: "'+C+'"');return b.isError(A)?A:(b.restore(M),A.tag===C||A.tagStr===C||A.tagStr+"of"===C||E)},w.prototype._decodeTag=function(b,C,E){var M=x(b,'Failed to decode tag of "'+C+'"');if(b.isError(M))return M;var A=S(b,M.primitive,'Failed to get length of "'+C+'"');if(b.isError(A))return A;if(!E&&M.tag!==C&&M.tagStr!==C&&M.tagStr+"of"!==C)return b.error('Failed to match tag: "'+C+'"');if(M.primitive||A!==null)return b.skip(A,'Failed to match body of: "'+C+'"');var T=b.save(),L=this._skipUntilEnd(b,'Failed to skip indefinite length body: "'+this.tag+'"');return b.isError(L)?L:(A=b.offset-T.offset,b.restore(T),b.skip(A,'Failed to match body of: "'+C+'"'))},w.prototype._skipUntilEnd=function(b,C){for(;;){var E=x(b,C);if(b.isError(E))return E;var M=S(b,E.primitive,C);if(b.isError(M))return M;var A;if(E.primitive||M!==null?A=b.skip(M):A=this._skipUntilEnd(b,C),b.isError(A))return A;if(E.tagStr==="end")break}},w.prototype._decodeList=function(b,C,E,M){for(var A=[];!b.isEmpty();){var T=this._peekTag(b,"end");if(b.isError(T))return T;var L=E.decode(b,"der",M);if(b.isError(L)&&T)break;A.push(L)}return A},w.prototype._decodeStr=function(b,C){if(C==="bitstr"){var E=b.readUInt8();return b.isError(E)?E:{unused:E,data:b.raw()}}else if(C==="bmpstr"){var M=b.raw();if(M.length%2===1)return b.error("Decoding of string type: bmpstr length mismatch");for(var A="",T=0;T<M.length/2;T++)A+=String.fromCharCode(M.readUInt16BE(T*2));return A}else if(C==="numstr"){var L=b.raw().toString("ascii");return this._isNumstr(L)?L:b.error("Decoding of string type: numstr unsupported characters")}else{if(C==="octstr")return b.raw();if(C==="objDesc")return b.raw();if(C==="printstr"){var O=b.raw().toString("ascii");return this._isPrintstr(O)?O:b.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(C)?b.raw().toString():b.error("Decoding of string type: "+C+" unsupported")}},w.prototype._decodeObjid=function(b,C,E){for(var M,A=[],T=0;!b.isEmpty();){var L=b.readUInt8();T<<=7,T|=L&127,(L&128)===0&&(A.push(T),T=0)}L&128&&A.push(T);var O=A[0]/40|0,N=A[0]%40;if(E?M=A:M=[O,N].concat(A.slice(1)),C){var H=C[M.join(" ")];H===void 0&&(H=C[M.join(".")]),H!==void 0&&(M=H)}return M},w.prototype._decodeTime=function(b,C){var E=b.raw().toString();if(C==="gentime")var M=E.slice(0,4)|0,A=E.slice(4,6)|0,T=E.slice(6,8)|0,L=E.slice(8,10)|0,O=E.slice(10,12)|0,N=E.slice(12,14)|0;else if(C==="utctime"){var M=E.slice(0,2)|0,A=E.slice(2,4)|0,T=E.slice(4,6)|0,L=E.slice(6,8)|0,O=E.slice(8,10)|0,N=E.slice(10,12)|0;M<70?M=2e3+M:M=1900+M}else return b.error("Decoding "+C+" time is not supported yet");return Date.UTC(M,A-1,T,L,O,N,0)},w.prototype._decodeNull=function(b){return null},w.prototype._decodeBool=function(b){var C=b.readUInt8();return b.isError(C)?C:C!==0},w.prototype._decodeInt=function(b,C){var E=b.raw(),M=new m(E);return C&&(M=C[M.toString(10)]||M),M},w.prototype._use=function(b,C){return typeof b=="function"&&(b=b(C)),b._getDecoder("der").tree};function x(_,b){var C=_.readUInt8(b);if(_.isError(C))return C;var E=v.tagClass[C>>6],M=(C&32)===0;if((C&31)===31){var A=C;for(C=0;(A&128)===128;){if(A=_.readUInt8(b),_.isError(A))return A;C<<=7,C|=A&127}}else C&=31;var T=v.tag[C];return{cls:E,primitive:M,tag:C,tagStr:T}}function S(_,b,C){var E=_.readUInt8(C);if(_.isError(E))return E;if(!b&&E===128)return null;if((E&128)===0)return E;var M=E&127;if(M>4)return _.error("length octect is too long");E=0;for(var A=0;A<M;A++){E<<=8;var T=_.readUInt8(C);if(_.isError(T))return T;E|=T}return E}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var r=requireInherits_browser(),f=requireDist().Buffer,d=requireDer$1();function m(v){d.call(this,v),this.enc="pem"}return r(m,d),pem$1=m,m.prototype.decode=function(g,w){for(var x=g.toString().split(/[\r\n]+/g),S=w.label.toUpperCase(),_=/^-----(BEGIN|END) ([^-]+)-----$/,b=-1,C=-1,E=0;E<x.length;E++){var M=x[E].match(_);if(M!==null&&M[2]===S)if(b===-1){if(M[1]!=="BEGIN")break;b=E}else{if(M[1]!=="END")break;C=E;break}}if(b===-1||C===-1)throw new Error("PEM section not found for: "+S);var A=x.slice(b+1,C).join("");A.replace(/[^a-z0-9\+\/=]+/gi,"");var T=new f(A,"base64");return d.prototype.decode.call(this,T,w)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,(function(r){var f=r;f.der=requireDer$1(),f.pem=requirePem$1()})(decoders)),decoders}var encoders={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var r=requireInherits_browser(),f=requireDist().Buffer,d=requireAsn1$1(),m=d.base,v=d.constants.der;function g(_){this.enc="der",this.name=_.name,this.entity=_,this.tree=new w,this.tree._init(_.body)}der_1=g,g.prototype.encode=function(b,C){return this.tree._encode(b,C).join()};function w(_){m.Node.call(this,"der",_)}r(w,m.Node),w.prototype._encodeComposite=function(b,C,E,M){var A=S(b,C,E,this.reporter);if(M.length<128){var O=new f(2);return O[0]=A,O[1]=M.length,this._createEncoderBuffer([O,M])}for(var T=1,L=M.length;L>=256;L>>=8)T++;var O=new f(2+T);O[0]=A,O[1]=128|T;for(var L=1+T,N=M.length;N>0;L--,N>>=8)O[L]=N&255;return this._createEncoderBuffer([O,M])},w.prototype._encodeStr=function(b,C){if(C==="bitstr")return this._createEncoderBuffer([b.unused|0,b.data]);if(C==="bmpstr"){for(var E=new f(b.length*2),M=0;M<b.length;M++)E.writeUInt16BE(b.charCodeAt(M),M*2);return this._createEncoderBuffer(E)}else return C==="numstr"?this._isNumstr(b)?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: numstr supports only digits and space"):C==="printstr"?this._isPrintstr(b)?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(C)?this._createEncoderBuffer(b):C==="objDesc"?this._createEncoderBuffer(b):this.reporter.error("Encoding of string type: "+C+" unsupported")},w.prototype._encodeObjid=function(b,C,E){if(typeof b=="string"){if(!C)return this.reporter.error("string objid given, but no values map found");if(!C.hasOwnProperty(b))return this.reporter.error("objid not found in values map");b=C[b].split(/[\s\.]+/g);for(var M=0;M<b.length;M++)b[M]|=0}else if(Array.isArray(b)){b=b.slice();for(var M=0;M<b.length;M++)b[M]|=0}if(!Array.isArray(b))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(b));if(!E){if(b[1]>=40)return this.reporter.error("Second objid identifier OOB");b.splice(0,2,b[0]*40+b[1])}for(var A=0,M=0;M<b.length;M++){var T=b[M];for(A++;T>=128;T>>=7)A++}for(var L=new f(A),O=L.length-1,M=b.length-1;M>=0;M--){var T=b[M];for(L[O--]=T&127;(T>>=7)>0;)L[O--]=128|T&127}return this._createEncoderBuffer(L)};function x(_){return _<10?"0"+_:_}w.prototype._encodeTime=function(b,C){var E,M=new Date(b);return C==="gentime"?E=[x(M.getFullYear()),x(M.getUTCMonth()+1),x(M.getUTCDate()),x(M.getUTCHours()),x(M.getUTCMinutes()),x(M.getUTCSeconds()),"Z"].join(""):C==="utctime"?E=[x(M.getFullYear()%100),x(M.getUTCMonth()+1),x(M.getUTCDate()),x(M.getUTCHours()),x(M.getUTCMinutes()),x(M.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+C+" time is not supported yet"),this._encodeStr(E,"octstr")},w.prototype._encodeNull=function(){return this._createEncoderBuffer("")},w.prototype._encodeInt=function(b,C){if(typeof b=="string"){if(!C)return this.reporter.error("String int or enum given, but no values map");if(!C.hasOwnProperty(b))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(b));b=C[b]}if(typeof b!="number"&&!f.isBuffer(b)){var E=b.toArray();!b.sign&&E[0]&128&&E.unshift(0),b=new f(E)}if(f.isBuffer(b)){var M=b.length;b.length===0&&M++;var T=new f(M);return b.copy(T),b.length===0&&(T[0]=0),this._createEncoderBuffer(T)}if(b<128)return this._createEncoderBuffer(b);if(b<256)return this._createEncoderBuffer([0,b]);for(var M=1,A=b;A>=256;A>>=8)M++;for(var T=new Array(M),A=T.length-1;A>=0;A--)T[A]=b&255,b>>=8;return T[0]&128&&T.unshift(0),this._createEncoderBuffer(new f(T))},w.prototype._encodeBool=function(b){return this._createEncoderBuffer(b?255:0)},w.prototype._use=function(b,C){return typeof b=="function"&&(b=b(C)),b._getEncoder("der").tree},w.prototype._skipDefault=function(b,C,E){var M=this._baseState,A;if(M.default===null)return!1;var T=b.join();if(M.defaultBuffer===void 0&&(M.defaultBuffer=this._encodeValue(M.default,C,E).join()),T.length!==M.defaultBuffer.length)return!1;for(A=0;A<T.length;A++)if(T[A]!==M.defaultBuffer[A])return!1;return!0};function S(_,b,C,E){var M;if(_==="seqof"?_="seq":_==="setof"&&(_="set"),v.tagByName.hasOwnProperty(_))M=v.tagByName[_];else if(typeof _=="number"&&(_|0)===_)M=_;else return E.error("Unknown tag: "+_);return M>=31?E.error("Multi-octet tag encoding unsupported"):(b||(M|=32),M|=v.tagClassByName[C||"universal"]<<6,M)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var r=requireInherits_browser(),f=requireDer();function d(m){f.call(this,m),this.enc="pem"}return r(d,f),pem=d,d.prototype.encode=function(v,g){for(var w=f.prototype.encode.call(this,v),x=w.toString("base64"),S=["-----BEGIN "+g.label+"-----"],_=0;_<x.length;_+=64)S.push(x.slice(_,_+64));return S.push("-----END "+g.label+"-----"),S.join(`
29
29
  `)},pem}var hasRequiredEncoders;function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,(function(r){var f=r;f.der=requireDer(),f.pem=requirePem()})(encoders)),encoders}var hasRequiredAsn1$1;function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,(function(r){var f=r;f.bignum=requireBn$2(),f.define=requireApi().define,f.base=requireBase(),f.constants=requireConstants(),f.decoders=requireDecoders(),f.encoders=requireEncoders()})(asn1)),asn1}var certificate,hasRequiredCertificate;function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var r=requireAsn1$1(),f=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),d=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),m=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),v=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(m),this.key("subjectPublicKey").bitstr())}),g=r.define("RelativeDistinguishedName",function(){this.setof(d)}),w=r.define("RDNSequence",function(){this.seqof(g)}),x=r.define("Name",function(){this.choice({rdnSequence:this.use(w)})}),S=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(f),this.key("notAfter").use(f))}),_=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),b=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(m),this.key("issuer").use(x),this.key("validity").use(S),this.key("subject").use(x),this.key("subjectPublicKeyInfo").use(v),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(_).optional())}),C=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(b),this.key("signatureAlgorithm").use(m),this.key("signatureValue").bitstr())});return certificate=C,certificate}var hasRequiredAsn1;function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var r=requireAsn1$1();asn1$1.certificate=requireCertificate();var f=r.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});asn1$1.RSAPrivateKey=f;var d=r.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$1.RSAPublicKey=d;var m=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),v=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(m),this.key("subjectPublicKey").bitstr())});asn1$1.PublicKey=v;var g=r.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(m),this.key("subjectPrivateKey").octstr())});asn1$1.PrivateKey=g;var w=r.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});asn1$1.EncryptedPrivateKey=w;var x=r.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});asn1$1.DSAPrivateKey=x,asn1$1.DSAparam=r.define("DSAparam",function(){this.int()});var S=r.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),_=r.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(S),this.key("publicKey").optional().explicit(1).bitstr())});return asn1$1.ECPrivateKey=_,asn1$1.signature=r.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),asn1$1}const require$$1={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var fixProc,hasRequiredFixProc;function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,d=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,m=requireEvp_bytestokey(),v=requireBrowser$6(),g=requireSafeBuffer$1().Buffer;return fixProc=function(w,x){var S=w.toString(),_=S.match(r),b;if(_){var E="aes"+_[1],M=g.from(_[2],"hex"),A=g.from(_[3].replace(/[\r\n]/g,""),"base64"),T=m(x,M.slice(0,8),parseInt(_[1],10)).key,L=[],O=v.createDecipheriv(E,T,M);L.push(O.update(A)),L.push(O.final()),b=g.concat(L)}else{var C=S.match(d);b=g.from(C[2].replace(/[\r\n]/g,""),"base64")}var N=S.match(f)[1];return{tag:N,data:b}},fixProc}var parseAsn1,hasRequiredParseAsn1;function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var r=requireAsn1(),f=require$$1,d=requireFixProc(),m=requireBrowser$6(),v=requireBrowser$7(),g=requireSafeBuffer$1().Buffer;function w(S,_){var b=S.algorithm.decrypt.kde.kdeparams.salt,C=parseInt(S.algorithm.decrypt.kde.kdeparams.iters.toString(),10),E=f[S.algorithm.decrypt.cipher.algo.join(".")],M=S.algorithm.decrypt.cipher.iv,A=S.subjectPrivateKey,T=parseInt(E.split("-")[1],10)/8,L=v.pbkdf2Sync(_,b,C,T,"sha1"),O=m.createDecipheriv(E,L,M),N=[];return N.push(O.update(A)),N.push(O.final()),g.concat(N)}function x(S){var _;typeof S=="object"&&!g.isBuffer(S)&&(_=S.passphrase,S=S.key),typeof S=="string"&&(S=g.from(S));var b=d(S,_),C=b.tag,E=b.data,M,A;switch(C){case"CERTIFICATE":A=r.certificate.decode(E,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(A||(A=r.PublicKey.decode(E,"der")),M=A.algorithm.algorithm.join("."),M){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(A.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return A.subjectPrivateKey=A.subjectPublicKey,{type:"ec",data:A};case"1.2.840.10040.4.1":return A.algorithm.params.pub_key=r.DSAparam.decode(A.subjectPublicKey.data,"der"),{type:"dsa",data:A.algorithm.params};default:throw new Error("unknown key id "+M)}case"ENCRYPTED PRIVATE KEY":E=r.EncryptedPrivateKey.decode(E,"der"),E=w(E,_);case"PRIVATE KEY":switch(A=r.PrivateKey.decode(E,"der"),M=A.algorithm.algorithm.join("."),M){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(A.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:A.algorithm.curve,privateKey:r.ECPrivateKey.decode(A.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return A.algorithm.params.priv_key=r.DSAparam.decode(A.subjectPrivateKey,"der"),{type:"dsa",params:A.algorithm.params};default:throw new Error("unknown key id "+M)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(E,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(E,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(E,"der")};case"EC PRIVATE KEY":return E=r.ECPrivateKey.decode(E,"der"),{curve:E.parameters.value,privateKey:E.privateKey};default:throw new Error("unknown key type "+C)}}return x.signature=r.signature,parseAsn1=x,parseAsn1}const require$$4={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign.exports;hasRequiredSign=1;var r=requireSafeBuffer$1().Buffer,f=requireBrowser$8(),d=requireBrowserifyRsa(),m=requireElliptic().ec,v=requireBn(),g=requireParseAsn1(),w=require$$4,x=1;function S(O,N,H,V,X){var oe=g(N);if(oe.curve){if(V!=="ecdsa"&&V!=="ecdsa/rsa")throw new Error("wrong private key type");return _(O,oe)}else if(oe.type==="dsa"){if(V!=="dsa")throw new Error("wrong private key type");return b(O,oe,H)}if(V!=="rsa"&&V!=="ecdsa/rsa")throw new Error("wrong private key type");if(N.padding!==void 0&&N.padding!==x)throw new Error("illegal or unsupported padding mode");O=r.concat([X,O]);for(var se=oe.modulus.byteLength(),de=[0,1];O.length+de.length+1<se;)de.push(255);de.push(0);for(var he=-1;++he<O.length;)de.push(O[he]);var we=d(de,oe);return we}function _(O,N){var H=w[N.curve.join(".")];if(!H)throw new Error("unknown curve "+N.curve.join("."));var V=new m(H),X=V.keyFromPrivate(N.privateKey),oe=X.sign(O);return r.from(oe.toDER())}function b(O,N,H){for(var V=N.params.priv_key,X=N.params.p,oe=N.params.q,se=N.params.g,de=new v(0),he,we=M(O,oe).mod(oe),te=!1,k=E(V,oe,O,H);te===!1;)he=T(oe,k,H),de=L(se,he,X,oe),te=he.invm(oe).imul(we.add(V.mul(de))).mod(oe),te.cmpn(0)===0&&(te=!1,de=new v(0));return C(de,te)}function C(O,N){O=O.toArray(),N=N.toArray(),O[0]&128&&(O=[0].concat(O)),N[0]&128&&(N=[0].concat(N));var H=O.length+N.length+4,V=[48,H,2,O.length];return V=V.concat(O,[2,N.length],N),r.from(V)}function E(O,N,H,V){if(O=r.from(O.toArray()),O.length<N.byteLength()){var X=r.alloc(N.byteLength()-O.length);O=r.concat([X,O])}var oe=H.length,se=A(H,N),de=r.alloc(oe);de.fill(1);var he=r.alloc(oe);return he=f(V,he).update(de).update(r.from([0])).update(O).update(se).digest(),de=f(V,he).update(de).digest(),he=f(V,he).update(de).update(r.from([1])).update(O).update(se).digest(),de=f(V,he).update(de).digest(),{k:he,v:de}}function M(O,N){var H=new v(O),V=(O.length<<3)-N.bitLength();return V>0&&H.ishrn(V),H}function A(O,N){O=M(O,N),O=O.mod(N);var H=r.from(O.toArray());if(H.length<N.byteLength()){var V=r.alloc(N.byteLength()-H.length);H=r.concat([V,H])}return H}function T(O,N,H){var V,X;do{for(V=r.alloc(0);V.length*8<O.bitLength();)N.v=f(H,N.k).update(N.v).digest(),V=r.concat([V,N.v]);X=M(V,O),N.k=f(H,N.k).update(N.v).update(r.from([0])).digest(),N.v=f(H,N.k).update(N.v).digest()}while(X.cmp(O)!==-1);return X}function L(O,N,H,V){return O.toRed(v.mont(H)).redPow(N).fromRed().mod(V)}return sign.exports=S,sign.exports.getKey=E,sign.exports.makeKey=T,sign.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var r=requireSafeBuffer$1().Buffer,f=requireBn(),d=requireElliptic().ec,m=requireParseAsn1(),v=require$$4;function g(_,b,C,E,M){var A=m(C);if(A.type==="ec"){if(E!=="ecdsa"&&E!=="ecdsa/rsa")throw new Error("wrong public key type");return w(_,b,A)}else if(A.type==="dsa"){if(E!=="dsa")throw new Error("wrong public key type");return x(_,b,A)}if(E!=="rsa"&&E!=="ecdsa/rsa")throw new Error("wrong public key type");b=r.concat([M,b]);for(var T=A.modulus.byteLength(),L=[1],O=0;b.length+L.length+2<T;)L.push(255),O+=1;L.push(0);for(var N=-1;++N<b.length;)L.push(b[N]);L=r.from(L);var H=f.mont(A.modulus);_=new f(_).toRed(H),_=_.redPow(new f(A.publicExponent)),_=r.from(_.fromRed().toArray());var V=O<8?1:0;for(T=Math.min(_.length,L.length),_.length!==L.length&&(V=1),N=-1;++N<T;)V|=_[N]^L[N];return V===0}function w(_,b,C){var E=v[C.data.algorithm.curve.join(".")];if(!E)throw new Error("unknown curve "+C.data.algorithm.curve.join("."));var M=new d(E),A=C.data.subjectPrivateKey.data;return M.verify(b,_,A)}function x(_,b,C){var E=C.data.p,M=C.data.q,A=C.data.g,T=C.data.pub_key,L=m.signature.decode(_,"der"),O=L.s,N=L.r;S(O,M),S(N,M);var H=f.mont(E),V=O.invm(M),X=A.toRed(H).redPow(new f(b).mul(V).mod(M)).fromRed().mul(T.toRed(H).redPow(N.mul(V).mod(M)).fromRed()).mod(E).mod(M);return X.cmp(N)===0}function S(_,b){if(_.cmpn(0)<=0)throw new Error("invalid sig");if(_.cmp(b)>=0)throw new Error("invalid sig")}return verify_1=g,verify_1}var browser$3,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$3;hasRequiredBrowser$3=1;var r=requireSafeBuffer$1().Buffer,f=requireBrowser$9(),d=requireReadableBrowser(),m=requireInherits_browser(),v=requireSign(),g=requireVerify(),w=require$$6;Object.keys(w).forEach(function(C){w[C].id=r.from(w[C].id,"hex"),w[C.toLowerCase()]=w[C]});function x(C){d.Writable.call(this);var E=w[C];if(!E)throw new Error("Unknown message digest");this._hashType=E.hash,this._hash=f(E.hash),this._tag=E.id,this._signType=E.sign}m(x,d.Writable),x.prototype._write=function(E,M,A){this._hash.update(E),A()},x.prototype.update=function(E,M){return this._hash.update(typeof E=="string"?r.from(E,M):E),this},x.prototype.sign=function(E,M){this.end();var A=this._hash.digest(),T=v(A,E,this._hashType,this._signType,this._tag);return M?T.toString(M):T};function S(C){d.Writable.call(this);var E=w[C];if(!E)throw new Error("Unknown message digest");this._hash=f(E.hash),this._tag=E.id,this._signType=E.sign}m(S,d.Writable),S.prototype._write=function(E,M,A){this._hash.update(E),A()},S.prototype.update=function(E,M){return this._hash.update(typeof E=="string"?r.from(E,M):E),this},S.prototype.verify=function(E,M,A){var T=typeof M=="string"?r.from(M,A):M;this.end();var L=this._hash.digest();return g(T,L,E,this._signType,this._tag)};function _(C){return new x(C)}function b(C){return new S(C)}return browser$3={Sign:_,Verify:b,createSign:_,createVerify:b},browser$3}var browser$2,hasRequiredBrowser$2;function requireBrowser$2(){if(hasRequiredBrowser$2)return browser$2;hasRequiredBrowser$2=1;var r=requireElliptic(),f=requireBn$2();browser$2=function(w){return new m(w)};var d={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};d.p224=d.secp224r1,d.p256=d.secp256r1=d.prime256v1,d.p192=d.secp192r1=d.prime192v1,d.p384=d.secp384r1,d.p521=d.secp521r1;function m(g){this.curveType=d[g],this.curveType||(this.curveType={name:g}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}m.prototype.generateKeys=function(g,w){return this.keys=this.curve.genKeyPair(),this.getPublicKey(g,w)},m.prototype.computeSecret=function(g,w,x){w=w||"utf8",Buffer.isBuffer(g)||(g=new Buffer(g,w));var S=this.curve.keyFromPublic(g).getPublic(),_=S.mul(this.keys.getPrivate()).getX();return v(_,x,this.curveType.byteLength)},m.prototype.getPublicKey=function(g,w){var x=this.keys.getPublic(w==="compressed",!0);return w==="hybrid"&&(x[x.length-1]%2?x[0]=7:x[0]=6),v(x,g)},m.prototype.getPrivateKey=function(g){return v(this.keys.getPrivate(),g)},m.prototype.setPublicKey=function(g,w){return w=w||"utf8",Buffer.isBuffer(g)||(g=new Buffer(g,w)),this.keys._importPublic(g),this},m.prototype.setPrivateKey=function(g,w){w=w||"utf8",Buffer.isBuffer(g)||(g=new Buffer(g,w));var x=new f(g);return x=x.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(x),this};function v(g,w,x){Array.isArray(g)||(g=g.toArray());var S=new Buffer(g);if(x&&S.length<x){var _=new Buffer(x-S.length);_.fill(0),S=Buffer.concat([_,S])}return w?S.toString(w):S}return browser$2}var browser$1={},mgf,hasRequiredMgf;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var r=requireBrowser$9(),f=requireSafeBuffer$1().Buffer;mgf=function(m,v){for(var g=f.alloc(0),w=0,x;g.length<v;)x=d(w++),g=f.concat([g,r("sha1").update(m).update(x).digest()]);return g.slice(0,v)};function d(m){var v=f.allocUnsafe(4);return v.writeUInt32BE(m,0),v}return mgf}var xor,hasRequiredXor;function requireXor(){return hasRequiredXor||(hasRequiredXor=1,xor=function(f,d){for(var m=f.length,v=-1;++v<m;)f[v]^=d[v];return f}),xor}var withPublic_1,hasRequiredWithPublic;function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var r=requireBn$2(),f=requireSafeBuffer$1().Buffer;function d(m,v){return f.from(m.toRed(r.mont(v.modulus)).redPow(new r(v.publicExponent)).fromRed().toArray())}return withPublic_1=d,withPublic_1}var publicEncrypt,hasRequiredPublicEncrypt;function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var r=requireParseAsn1(),f=requireBrowser$b(),d=requireBrowser$9(),m=requireMgf(),v=requireXor(),g=requireBn$2(),w=requireWithPublic(),x=requireBrowserifyRsa(),S=requireSafeBuffer$1().Buffer;publicEncrypt=function(M,A,T){var L;M.padding?L=M.padding:T?L=1:L=4;var O=r(M),N;if(L===4)N=_(O,A);else if(L===1)N=b(O,A,T);else if(L===3){if(N=new g(A),N.cmp(O.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return T?x(N,O):w(N,O)};function _(E,M){var A=E.modulus.byteLength(),T=M.length,L=d("sha1").update(S.alloc(0)).digest(),O=L.length,N=2*O;if(T>A-N-2)throw new Error("message too long");var H=S.alloc(A-T-N-2),V=A-O-1,X=f(O),oe=v(S.concat([L,H,S.alloc(1,1),M],V),m(X,V)),se=v(X,m(oe,O));return new g(S.concat([S.alloc(1),se,oe],A))}function b(E,M,A){var T=M.length,L=E.modulus.byteLength();if(T>L-11)throw new Error("message too long");var O;return A?O=S.alloc(L-T-3,255):O=C(L-T-3),new g(S.concat([S.from([0,A?1:2]),O,S.alloc(1),M],L))}function C(E){for(var M=S.allocUnsafe(E),A=0,T=f(E*2),L=0,O;A<E;)L===T.length&&(T=f(E*2),L=0),O=T[L++],O&&(M[A++]=O);return M}return publicEncrypt}var privateDecrypt,hasRequiredPrivateDecrypt;function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var r=requireParseAsn1(),f=requireMgf(),d=requireXor(),m=requireBn$2(),v=requireBrowserifyRsa(),g=requireBrowser$9(),w=requireWithPublic(),x=requireSafeBuffer$1().Buffer;privateDecrypt=function(E,M,A){var T;E.padding?T=E.padding:A?T=1:T=4;var L=r(E),O=L.modulus.byteLength();if(M.length>O||new m(M).cmp(L.modulus)>=0)throw new Error("decryption error");var N;A?N=w(new m(M),L):N=v(M,L);var H=x.alloc(O-N.length);if(N=x.concat([H,N],O),T===4)return S(L,N);if(T===1)return _(L,N,A);if(T===3)return N;throw new Error("unknown padding")};function S(C,E){var M=C.modulus.byteLength(),A=g("sha1").update(x.alloc(0)).digest(),T=A.length;if(E[0]!==0)throw new Error("decryption error");var L=E.slice(1,T+1),O=E.slice(T+1),N=d(L,f(O,T)),H=d(O,f(N,M-T-1));if(b(A,H.slice(0,T)))throw new Error("decryption error");for(var V=T;H[V]===0;)V++;if(H[V++]!==1)throw new Error("decryption error");return H.slice(V)}function _(C,E,M){for(var A=E.slice(0,2),T=2,L=0;E[T++]!==0;)if(T>=E.length){L++;break}var O=E.slice(2,T-1);if((A.toString("hex")!=="0002"&&!M||A.toString("hex")!=="0001"&&M)&&L++,O.length<8&&L++,L)throw new Error("decryption error");return E.slice(T)}function b(C,E){C=x.from(C),E=x.from(E);var M=0,A=C.length;C.length!==E.length&&(M++,A=Math.min(C.length,E.length));for(var T=-1;++T<A;)M+=C[T]^E[T];return M}return privateDecrypt}var hasRequiredBrowser$1;function requireBrowser$1(){return hasRequiredBrowser$1||(hasRequiredBrowser$1=1,(function(r){r.publicEncrypt=requirePublicEncrypt(),r.privateDecrypt=requirePrivateDecrypt(),r.privateEncrypt=function(d,m){return r.publicEncrypt(d,m,!0)},r.publicDecrypt=function(d,m){return r.privateDecrypt(d,m,!0)}})(browser$1)),browser$1}var browser={},hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser;hasRequiredBrowser=1;function r(){throw new Error(`secure random number generation not supported by this browser
30
30
  use chrome, FireFox or Internet Explorer 11`)}var f=requireSafeBuffer$1(),d=requireBrowser$b(),m=f.Buffer,v=f.kMaxLength,g=commonjsGlobal.crypto||commonjsGlobal.msCrypto,w=Math.pow(2,32)-1;function x(E,M){if(typeof E!="number"||E!==E)throw new TypeError("offset must be a number");if(E>w||E<0)throw new TypeError("offset must be a uint32");if(E>v||E>M)throw new RangeError("offset out of range")}function S(E,M,A){if(typeof E!="number"||E!==E)throw new TypeError("size must be a number");if(E>w||E<0)throw new TypeError("size must be a uint32");if(E+M>A||E>v)throw new RangeError("buffer too small")}g&&g.getRandomValues||!process$1.browser?(browser.randomFill=_,browser.randomFillSync=C):(browser.randomFill=r,browser.randomFillSync=r);function _(E,M,A,T){if(!m.isBuffer(E)&&!(E instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof M=="function")T=M,M=0,A=E.length;else if(typeof A=="function")T=A,A=E.length-M;else if(typeof T!="function")throw new TypeError('"cb" argument must be a function');return x(M,E.length),S(A,M,E.length),b(E,M,A,T)}function b(E,M,A,T){if(process$1.browser){var L=E.buffer,O=new Uint8Array(L,M,A);if(g.getRandomValues(O),T){process$1.nextTick(function(){T(null,E)});return}return E}if(T){d(A,function(H,V){if(H)return T(H);V.copy(E,M),T(null,E)});return}var N=d(A);return N.copy(E,M),E}function C(E,M,A){if(typeof M>"u"&&(M=0),!m.isBuffer(E)&&!(E instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return x(M,E.length),A===void 0&&(A=E.length-M),S(A,M,E.length),b(E,M,A)}return browser}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$b(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$9(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$8();var r=requireAlgos(),f=Object.keys(r),d=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(f);cryptoBrowserify.getHashes=function(){return d};var m=requireBrowser$7();cryptoBrowserify.pbkdf2=m.pbkdf2,cryptoBrowserify.pbkdf2Sync=m.pbkdf2Sync;var v=requireBrowser$5();cryptoBrowserify.Cipher=v.Cipher,cryptoBrowserify.createCipher=v.createCipher,cryptoBrowserify.Cipheriv=v.Cipheriv,cryptoBrowserify.createCipheriv=v.createCipheriv,cryptoBrowserify.Decipher=v.Decipher,cryptoBrowserify.createDecipher=v.createDecipher,cryptoBrowserify.Decipheriv=v.Decipheriv,cryptoBrowserify.createDecipheriv=v.createDecipheriv,cryptoBrowserify.getCiphers=v.getCiphers,cryptoBrowserify.listCiphers=v.listCiphers;var g=requireBrowser$4();cryptoBrowserify.DiffieHellmanGroup=g.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=g.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=g.getDiffieHellman,cryptoBrowserify.createDiffieHellman=g.createDiffieHellman,cryptoBrowserify.DiffieHellman=g.DiffieHellman;var w=requireBrowser$3();cryptoBrowserify.createSign=w.createSign,cryptoBrowserify.Sign=w.Sign,cryptoBrowserify.createVerify=w.createVerify,cryptoBrowserify.Verify=w.Verify,cryptoBrowserify.createECDH=requireBrowser$2();var x=requireBrowser$1();cryptoBrowserify.publicEncrypt=x.publicEncrypt,cryptoBrowserify.privateEncrypt=x.privateEncrypt,cryptoBrowserify.publicDecrypt=x.publicDecrypt,cryptoBrowserify.privateDecrypt=x.privateDecrypt;var S=requireBrowser();return cryptoBrowserify.randomFill=S.randomFill,cryptoBrowserify.randomFillSync=S.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
31
31
  we accept pull requests
32
- https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var hasRequiredNaclFast;function requireNaclFast(){return hasRequiredNaclFast||(hasRequiredNaclFast=1,(function(r){(function(f){var d=function(U){var G,re=new Float64Array(16);if(U)for(G=0;G<U.length;G++)re[G]=U[G];return re},m=function(){throw new Error("no PRNG")},v=new Uint8Array(16),g=new Uint8Array(32);g[0]=9;var w=d(),x=d([1]),S=d([56129,1]),_=d([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),b=d([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),C=d([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E=d([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),M=d([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(U,G,re,K){U[G]=re>>24&255,U[G+1]=re>>16&255,U[G+2]=re>>8&255,U[G+3]=re&255,U[G+4]=K>>24&255,U[G+5]=K>>16&255,U[G+6]=K>>8&255,U[G+7]=K&255}function T(U,G,re,K,ue){var Ae,xe=0;for(Ae=0;Ae<ue;Ae++)xe|=U[G+Ae]^re[K+Ae];return(1&xe-1>>>8)-1}function L(U,G,re,K){return T(U,G,re,K,16)}function O(U,G,re,K){return T(U,G,re,K,32)}function N(U,G,re,K){for(var ue=K[0]&255|(K[1]&255)<<8|(K[2]&255)<<16|(K[3]&255)<<24,Ae=re[0]&255|(re[1]&255)<<8|(re[2]&255)<<16|(re[3]&255)<<24,xe=re[4]&255|(re[5]&255)<<8|(re[6]&255)<<16|(re[7]&255)<<24,Te=re[8]&255|(re[9]&255)<<8|(re[10]&255)<<16|(re[11]&255)<<24,Pe=re[12]&255|(re[13]&255)<<8|(re[14]&255)<<16|(re[15]&255)<<24,Fe=K[4]&255|(K[5]&255)<<8|(K[6]&255)<<16|(K[7]&255)<<24,Ne=G[0]&255|(G[1]&255)<<8|(G[2]&255)<<16|(G[3]&255)<<24,At=G[4]&255|(G[5]&255)<<8|(G[6]&255)<<16|(G[7]&255)<<24,ot=G[8]&255|(G[9]&255)<<8|(G[10]&255)<<16|(G[11]&255)<<24,yt=G[12]&255|(G[13]&255)<<8|(G[14]&255)<<16|(G[15]&255)<<24,vt=K[8]&255|(K[9]&255)<<8|(K[10]&255)<<16|(K[11]&255)<<24,_t=re[16]&255|(re[17]&255)<<8|(re[18]&255)<<16|(re[19]&255)<<24,Ve=re[20]&255|(re[21]&255)<<8|(re[22]&255)<<16|(re[23]&255)<<24,ft=re[24]&255|(re[25]&255)<<8|(re[26]&255)<<16|(re[27]&255)<<24,et=re[28]&255|(re[29]&255)<<8|(re[30]&255)<<16|(re[31]&255)<<24,ht=K[12]&255|(K[13]&255)<<8|(K[14]&255)<<16|(K[15]&255)<<24,it=ue,pt=Ae,at=xe,ct=Te,dt=Pe,nt=Fe,Le=Ne,Be=At,Ke=ot,We=yt,ze=vt,Qe=_t,Et=Ve,Bt=ft,qt=et,Rt=ht,Me,$t=0;$t<20;$t+=2)Me=it+Et|0,dt^=Me<<7|Me>>>25,Me=dt+it|0,Ke^=Me<<9|Me>>>23,Me=Ke+dt|0,Et^=Me<<13|Me>>>19,Me=Et+Ke|0,it^=Me<<18|Me>>>14,Me=nt+pt|0,We^=Me<<7|Me>>>25,Me=We+nt|0,Bt^=Me<<9|Me>>>23,Me=Bt+We|0,pt^=Me<<13|Me>>>19,Me=pt+Bt|0,nt^=Me<<18|Me>>>14,Me=ze+Le|0,qt^=Me<<7|Me>>>25,Me=qt+ze|0,at^=Me<<9|Me>>>23,Me=at+qt|0,Le^=Me<<13|Me>>>19,Me=Le+at|0,ze^=Me<<18|Me>>>14,Me=Rt+Qe|0,ct^=Me<<7|Me>>>25,Me=ct+Rt|0,Be^=Me<<9|Me>>>23,Me=Be+ct|0,Qe^=Me<<13|Me>>>19,Me=Qe+Be|0,Rt^=Me<<18|Me>>>14,Me=it+ct|0,pt^=Me<<7|Me>>>25,Me=pt+it|0,at^=Me<<9|Me>>>23,Me=at+pt|0,ct^=Me<<13|Me>>>19,Me=ct+at|0,it^=Me<<18|Me>>>14,Me=nt+dt|0,Le^=Me<<7|Me>>>25,Me=Le+nt|0,Be^=Me<<9|Me>>>23,Me=Be+Le|0,dt^=Me<<13|Me>>>19,Me=dt+Be|0,nt^=Me<<18|Me>>>14,Me=ze+We|0,Qe^=Me<<7|Me>>>25,Me=Qe+ze|0,Ke^=Me<<9|Me>>>23,Me=Ke+Qe|0,We^=Me<<13|Me>>>19,Me=We+Ke|0,ze^=Me<<18|Me>>>14,Me=Rt+qt|0,Et^=Me<<7|Me>>>25,Me=Et+Rt|0,Bt^=Me<<9|Me>>>23,Me=Bt+Et|0,qt^=Me<<13|Me>>>19,Me=qt+Bt|0,Rt^=Me<<18|Me>>>14;it=it+ue|0,pt=pt+Ae|0,at=at+xe|0,ct=ct+Te|0,dt=dt+Pe|0,nt=nt+Fe|0,Le=Le+Ne|0,Be=Be+At|0,Ke=Ke+ot|0,We=We+yt|0,ze=ze+vt|0,Qe=Qe+_t|0,Et=Et+Ve|0,Bt=Bt+ft|0,qt=qt+et|0,Rt=Rt+ht|0,U[0]=it>>>0&255,U[1]=it>>>8&255,U[2]=it>>>16&255,U[3]=it>>>24&255,U[4]=pt>>>0&255,U[5]=pt>>>8&255,U[6]=pt>>>16&255,U[7]=pt>>>24&255,U[8]=at>>>0&255,U[9]=at>>>8&255,U[10]=at>>>16&255,U[11]=at>>>24&255,U[12]=ct>>>0&255,U[13]=ct>>>8&255,U[14]=ct>>>16&255,U[15]=ct>>>24&255,U[16]=dt>>>0&255,U[17]=dt>>>8&255,U[18]=dt>>>16&255,U[19]=dt>>>24&255,U[20]=nt>>>0&255,U[21]=nt>>>8&255,U[22]=nt>>>16&255,U[23]=nt>>>24&255,U[24]=Le>>>0&255,U[25]=Le>>>8&255,U[26]=Le>>>16&255,U[27]=Le>>>24&255,U[28]=Be>>>0&255,U[29]=Be>>>8&255,U[30]=Be>>>16&255,U[31]=Be>>>24&255,U[32]=Ke>>>0&255,U[33]=Ke>>>8&255,U[34]=Ke>>>16&255,U[35]=Ke>>>24&255,U[36]=We>>>0&255,U[37]=We>>>8&255,U[38]=We>>>16&255,U[39]=We>>>24&255,U[40]=ze>>>0&255,U[41]=ze>>>8&255,U[42]=ze>>>16&255,U[43]=ze>>>24&255,U[44]=Qe>>>0&255,U[45]=Qe>>>8&255,U[46]=Qe>>>16&255,U[47]=Qe>>>24&255,U[48]=Et>>>0&255,U[49]=Et>>>8&255,U[50]=Et>>>16&255,U[51]=Et>>>24&255,U[52]=Bt>>>0&255,U[53]=Bt>>>8&255,U[54]=Bt>>>16&255,U[55]=Bt>>>24&255,U[56]=qt>>>0&255,U[57]=qt>>>8&255,U[58]=qt>>>16&255,U[59]=qt>>>24&255,U[60]=Rt>>>0&255,U[61]=Rt>>>8&255,U[62]=Rt>>>16&255,U[63]=Rt>>>24&255}function H(U,G,re,K){for(var ue=K[0]&255|(K[1]&255)<<8|(K[2]&255)<<16|(K[3]&255)<<24,Ae=re[0]&255|(re[1]&255)<<8|(re[2]&255)<<16|(re[3]&255)<<24,xe=re[4]&255|(re[5]&255)<<8|(re[6]&255)<<16|(re[7]&255)<<24,Te=re[8]&255|(re[9]&255)<<8|(re[10]&255)<<16|(re[11]&255)<<24,Pe=re[12]&255|(re[13]&255)<<8|(re[14]&255)<<16|(re[15]&255)<<24,Fe=K[4]&255|(K[5]&255)<<8|(K[6]&255)<<16|(K[7]&255)<<24,Ne=G[0]&255|(G[1]&255)<<8|(G[2]&255)<<16|(G[3]&255)<<24,At=G[4]&255|(G[5]&255)<<8|(G[6]&255)<<16|(G[7]&255)<<24,ot=G[8]&255|(G[9]&255)<<8|(G[10]&255)<<16|(G[11]&255)<<24,yt=G[12]&255|(G[13]&255)<<8|(G[14]&255)<<16|(G[15]&255)<<24,vt=K[8]&255|(K[9]&255)<<8|(K[10]&255)<<16|(K[11]&255)<<24,_t=re[16]&255|(re[17]&255)<<8|(re[18]&255)<<16|(re[19]&255)<<24,Ve=re[20]&255|(re[21]&255)<<8|(re[22]&255)<<16|(re[23]&255)<<24,ft=re[24]&255|(re[25]&255)<<8|(re[26]&255)<<16|(re[27]&255)<<24,et=re[28]&255|(re[29]&255)<<8|(re[30]&255)<<16|(re[31]&255)<<24,ht=K[12]&255|(K[13]&255)<<8|(K[14]&255)<<16|(K[15]&255)<<24,it=ue,pt=Ae,at=xe,ct=Te,dt=Pe,nt=Fe,Le=Ne,Be=At,Ke=ot,We=yt,ze=vt,Qe=_t,Et=Ve,Bt=ft,qt=et,Rt=ht,Me,$t=0;$t<20;$t+=2)Me=it+Et|0,dt^=Me<<7|Me>>>25,Me=dt+it|0,Ke^=Me<<9|Me>>>23,Me=Ke+dt|0,Et^=Me<<13|Me>>>19,Me=Et+Ke|0,it^=Me<<18|Me>>>14,Me=nt+pt|0,We^=Me<<7|Me>>>25,Me=We+nt|0,Bt^=Me<<9|Me>>>23,Me=Bt+We|0,pt^=Me<<13|Me>>>19,Me=pt+Bt|0,nt^=Me<<18|Me>>>14,Me=ze+Le|0,qt^=Me<<7|Me>>>25,Me=qt+ze|0,at^=Me<<9|Me>>>23,Me=at+qt|0,Le^=Me<<13|Me>>>19,Me=Le+at|0,ze^=Me<<18|Me>>>14,Me=Rt+Qe|0,ct^=Me<<7|Me>>>25,Me=ct+Rt|0,Be^=Me<<9|Me>>>23,Me=Be+ct|0,Qe^=Me<<13|Me>>>19,Me=Qe+Be|0,Rt^=Me<<18|Me>>>14,Me=it+ct|0,pt^=Me<<7|Me>>>25,Me=pt+it|0,at^=Me<<9|Me>>>23,Me=at+pt|0,ct^=Me<<13|Me>>>19,Me=ct+at|0,it^=Me<<18|Me>>>14,Me=nt+dt|0,Le^=Me<<7|Me>>>25,Me=Le+nt|0,Be^=Me<<9|Me>>>23,Me=Be+Le|0,dt^=Me<<13|Me>>>19,Me=dt+Be|0,nt^=Me<<18|Me>>>14,Me=ze+We|0,Qe^=Me<<7|Me>>>25,Me=Qe+ze|0,Ke^=Me<<9|Me>>>23,Me=Ke+Qe|0,We^=Me<<13|Me>>>19,Me=We+Ke|0,ze^=Me<<18|Me>>>14,Me=Rt+qt|0,Et^=Me<<7|Me>>>25,Me=Et+Rt|0,Bt^=Me<<9|Me>>>23,Me=Bt+Et|0,qt^=Me<<13|Me>>>19,Me=qt+Bt|0,Rt^=Me<<18|Me>>>14;U[0]=it>>>0&255,U[1]=it>>>8&255,U[2]=it>>>16&255,U[3]=it>>>24&255,U[4]=nt>>>0&255,U[5]=nt>>>8&255,U[6]=nt>>>16&255,U[7]=nt>>>24&255,U[8]=ze>>>0&255,U[9]=ze>>>8&255,U[10]=ze>>>16&255,U[11]=ze>>>24&255,U[12]=Rt>>>0&255,U[13]=Rt>>>8&255,U[14]=Rt>>>16&255,U[15]=Rt>>>24&255,U[16]=Le>>>0&255,U[17]=Le>>>8&255,U[18]=Le>>>16&255,U[19]=Le>>>24&255,U[20]=Be>>>0&255,U[21]=Be>>>8&255,U[22]=Be>>>16&255,U[23]=Be>>>24&255,U[24]=Ke>>>0&255,U[25]=Ke>>>8&255,U[26]=Ke>>>16&255,U[27]=Ke>>>24&255,U[28]=We>>>0&255,U[29]=We>>>8&255,U[30]=We>>>16&255,U[31]=We>>>24&255}function V(U,G,re,K){N(U,G,re,K)}function X(U,G,re,K){H(U,G,re,K)}var oe=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function se(U,G,re,K,ue,Ae,xe){var Te=new Uint8Array(16),Pe=new Uint8Array(64),Fe,Ne;for(Ne=0;Ne<16;Ne++)Te[Ne]=0;for(Ne=0;Ne<8;Ne++)Te[Ne]=Ae[Ne];for(;ue>=64;){for(V(Pe,Te,xe,oe),Ne=0;Ne<64;Ne++)U[G+Ne]=re[K+Ne]^Pe[Ne];for(Fe=1,Ne=8;Ne<16;Ne++)Fe=Fe+(Te[Ne]&255)|0,Te[Ne]=Fe&255,Fe>>>=8;ue-=64,G+=64,K+=64}if(ue>0)for(V(Pe,Te,xe,oe),Ne=0;Ne<ue;Ne++)U[G+Ne]=re[K+Ne]^Pe[Ne];return 0}function de(U,G,re,K,ue){var Ae=new Uint8Array(16),xe=new Uint8Array(64),Te,Pe;for(Pe=0;Pe<16;Pe++)Ae[Pe]=0;for(Pe=0;Pe<8;Pe++)Ae[Pe]=K[Pe];for(;re>=64;){for(V(xe,Ae,ue,oe),Pe=0;Pe<64;Pe++)U[G+Pe]=xe[Pe];for(Te=1,Pe=8;Pe<16;Pe++)Te=Te+(Ae[Pe]&255)|0,Ae[Pe]=Te&255,Te>>>=8;re-=64,G+=64}if(re>0)for(V(xe,Ae,ue,oe),Pe=0;Pe<re;Pe++)U[G+Pe]=xe[Pe];return 0}function he(U,G,re,K,ue){var Ae=new Uint8Array(32);X(Ae,K,ue,oe);for(var xe=new Uint8Array(8),Te=0;Te<8;Te++)xe[Te]=K[Te+16];return de(U,G,re,xe,Ae)}function we(U,G,re,K,ue,Ae,xe){var Te=new Uint8Array(32);X(Te,Ae,xe,oe);for(var Pe=new Uint8Array(8),Fe=0;Fe<8;Fe++)Pe[Fe]=Ae[Fe+16];return se(U,G,re,K,ue,Pe,Te)}var te=function(U){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var G,re,K,ue,Ae,xe,Te,Pe;G=U[0]&255|(U[1]&255)<<8,this.r[0]=G&8191,re=U[2]&255|(U[3]&255)<<8,this.r[1]=(G>>>13|re<<3)&8191,K=U[4]&255|(U[5]&255)<<8,this.r[2]=(re>>>10|K<<6)&7939,ue=U[6]&255|(U[7]&255)<<8,this.r[3]=(K>>>7|ue<<9)&8191,Ae=U[8]&255|(U[9]&255)<<8,this.r[4]=(ue>>>4|Ae<<12)&255,this.r[5]=Ae>>>1&8190,xe=U[10]&255|(U[11]&255)<<8,this.r[6]=(Ae>>>14|xe<<2)&8191,Te=U[12]&255|(U[13]&255)<<8,this.r[7]=(xe>>>11|Te<<5)&8065,Pe=U[14]&255|(U[15]&255)<<8,this.r[8]=(Te>>>8|Pe<<8)&8191,this.r[9]=Pe>>>5&127,this.pad[0]=U[16]&255|(U[17]&255)<<8,this.pad[1]=U[18]&255|(U[19]&255)<<8,this.pad[2]=U[20]&255|(U[21]&255)<<8,this.pad[3]=U[22]&255|(U[23]&255)<<8,this.pad[4]=U[24]&255|(U[25]&255)<<8,this.pad[5]=U[26]&255|(U[27]&255)<<8,this.pad[6]=U[28]&255|(U[29]&255)<<8,this.pad[7]=U[30]&255|(U[31]&255)<<8};te.prototype.blocks=function(U,G,re){for(var K=this.fin?0:2048,ue,Ae,xe,Te,Pe,Fe,Ne,At,ot,yt,vt,_t,Ve,ft,et,ht,it,pt,at,ct=this.h[0],dt=this.h[1],nt=this.h[2],Le=this.h[3],Be=this.h[4],Ke=this.h[5],We=this.h[6],ze=this.h[7],Qe=this.h[8],Et=this.h[9],Bt=this.r[0],qt=this.r[1],Rt=this.r[2],Me=this.r[3],$t=this.r[4],Lt=this.r[5],Dt=this.r[6],kt=this.r[7],It=this.r[8],Pt=this.r[9];re>=16;)ue=U[G+0]&255|(U[G+1]&255)<<8,ct+=ue&8191,Ae=U[G+2]&255|(U[G+3]&255)<<8,dt+=(ue>>>13|Ae<<3)&8191,xe=U[G+4]&255|(U[G+5]&255)<<8,nt+=(Ae>>>10|xe<<6)&8191,Te=U[G+6]&255|(U[G+7]&255)<<8,Le+=(xe>>>7|Te<<9)&8191,Pe=U[G+8]&255|(U[G+9]&255)<<8,Be+=(Te>>>4|Pe<<12)&8191,Ke+=Pe>>>1&8191,Fe=U[G+10]&255|(U[G+11]&255)<<8,We+=(Pe>>>14|Fe<<2)&8191,Ne=U[G+12]&255|(U[G+13]&255)<<8,ze+=(Fe>>>11|Ne<<5)&8191,At=U[G+14]&255|(U[G+15]&255)<<8,Qe+=(Ne>>>8|At<<8)&8191,Et+=At>>>5|K,ot=0,yt=ot,yt+=ct*Bt,yt+=dt*(5*Pt),yt+=nt*(5*It),yt+=Le*(5*kt),yt+=Be*(5*Dt),ot=yt>>>13,yt&=8191,yt+=Ke*(5*Lt),yt+=We*(5*$t),yt+=ze*(5*Me),yt+=Qe*(5*Rt),yt+=Et*(5*qt),ot+=yt>>>13,yt&=8191,vt=ot,vt+=ct*qt,vt+=dt*Bt,vt+=nt*(5*Pt),vt+=Le*(5*It),vt+=Be*(5*kt),ot=vt>>>13,vt&=8191,vt+=Ke*(5*Dt),vt+=We*(5*Lt),vt+=ze*(5*$t),vt+=Qe*(5*Me),vt+=Et*(5*Rt),ot+=vt>>>13,vt&=8191,_t=ot,_t+=ct*Rt,_t+=dt*qt,_t+=nt*Bt,_t+=Le*(5*Pt),_t+=Be*(5*It),ot=_t>>>13,_t&=8191,_t+=Ke*(5*kt),_t+=We*(5*Dt),_t+=ze*(5*Lt),_t+=Qe*(5*$t),_t+=Et*(5*Me),ot+=_t>>>13,_t&=8191,Ve=ot,Ve+=ct*Me,Ve+=dt*Rt,Ve+=nt*qt,Ve+=Le*Bt,Ve+=Be*(5*Pt),ot=Ve>>>13,Ve&=8191,Ve+=Ke*(5*It),Ve+=We*(5*kt),Ve+=ze*(5*Dt),Ve+=Qe*(5*Lt),Ve+=Et*(5*$t),ot+=Ve>>>13,Ve&=8191,ft=ot,ft+=ct*$t,ft+=dt*Me,ft+=nt*Rt,ft+=Le*qt,ft+=Be*Bt,ot=ft>>>13,ft&=8191,ft+=Ke*(5*Pt),ft+=We*(5*It),ft+=ze*(5*kt),ft+=Qe*(5*Dt),ft+=Et*(5*Lt),ot+=ft>>>13,ft&=8191,et=ot,et+=ct*Lt,et+=dt*$t,et+=nt*Me,et+=Le*Rt,et+=Be*qt,ot=et>>>13,et&=8191,et+=Ke*Bt,et+=We*(5*Pt),et+=ze*(5*It),et+=Qe*(5*kt),et+=Et*(5*Dt),ot+=et>>>13,et&=8191,ht=ot,ht+=ct*Dt,ht+=dt*Lt,ht+=nt*$t,ht+=Le*Me,ht+=Be*Rt,ot=ht>>>13,ht&=8191,ht+=Ke*qt,ht+=We*Bt,ht+=ze*(5*Pt),ht+=Qe*(5*It),ht+=Et*(5*kt),ot+=ht>>>13,ht&=8191,it=ot,it+=ct*kt,it+=dt*Dt,it+=nt*Lt,it+=Le*$t,it+=Be*Me,ot=it>>>13,it&=8191,it+=Ke*Rt,it+=We*qt,it+=ze*Bt,it+=Qe*(5*Pt),it+=Et*(5*It),ot+=it>>>13,it&=8191,pt=ot,pt+=ct*It,pt+=dt*kt,pt+=nt*Dt,pt+=Le*Lt,pt+=Be*$t,ot=pt>>>13,pt&=8191,pt+=Ke*Me,pt+=We*Rt,pt+=ze*qt,pt+=Qe*Bt,pt+=Et*(5*Pt),ot+=pt>>>13,pt&=8191,at=ot,at+=ct*Pt,at+=dt*It,at+=nt*kt,at+=Le*Dt,at+=Be*Lt,ot=at>>>13,at&=8191,at+=Ke*$t,at+=We*Me,at+=ze*Rt,at+=Qe*qt,at+=Et*Bt,ot+=at>>>13,at&=8191,ot=(ot<<2)+ot|0,ot=ot+yt|0,yt=ot&8191,ot=ot>>>13,vt+=ot,ct=yt,dt=vt,nt=_t,Le=Ve,Be=ft,Ke=et,We=ht,ze=it,Qe=pt,Et=at,G+=16,re-=16;this.h[0]=ct,this.h[1]=dt,this.h[2]=nt,this.h[3]=Le,this.h[4]=Be,this.h[5]=Ke,this.h[6]=We,this.h[7]=ze,this.h[8]=Qe,this.h[9]=Et},te.prototype.finish=function(U,G){var re=new Uint16Array(10),K,ue,Ae,xe;if(this.leftover){for(xe=this.leftover,this.buffer[xe++]=1;xe<16;xe++)this.buffer[xe]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(K=this.h[1]>>>13,this.h[1]&=8191,xe=2;xe<10;xe++)this.h[xe]+=K,K=this.h[xe]>>>13,this.h[xe]&=8191;for(this.h[0]+=K*5,K=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=K,K=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=K,re[0]=this.h[0]+5,K=re[0]>>>13,re[0]&=8191,xe=1;xe<10;xe++)re[xe]=this.h[xe]+K,K=re[xe]>>>13,re[xe]&=8191;for(re[9]-=8192,ue=(K^1)-1,xe=0;xe<10;xe++)re[xe]&=ue;for(ue=~ue,xe=0;xe<10;xe++)this.h[xe]=this.h[xe]&ue|re[xe];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Ae=this.h[0]+this.pad[0],this.h[0]=Ae&65535,xe=1;xe<8;xe++)Ae=(this.h[xe]+this.pad[xe]|0)+(Ae>>>16)|0,this.h[xe]=Ae&65535;U[G+0]=this.h[0]>>>0&255,U[G+1]=this.h[0]>>>8&255,U[G+2]=this.h[1]>>>0&255,U[G+3]=this.h[1]>>>8&255,U[G+4]=this.h[2]>>>0&255,U[G+5]=this.h[2]>>>8&255,U[G+6]=this.h[3]>>>0&255,U[G+7]=this.h[3]>>>8&255,U[G+8]=this.h[4]>>>0&255,U[G+9]=this.h[4]>>>8&255,U[G+10]=this.h[5]>>>0&255,U[G+11]=this.h[5]>>>8&255,U[G+12]=this.h[6]>>>0&255,U[G+13]=this.h[6]>>>8&255,U[G+14]=this.h[7]>>>0&255,U[G+15]=this.h[7]>>>8&255},te.prototype.update=function(U,G,re){var K,ue;if(this.leftover){for(ue=16-this.leftover,ue>re&&(ue=re),K=0;K<ue;K++)this.buffer[this.leftover+K]=U[G+K];if(re-=ue,G+=ue,this.leftover+=ue,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(re>=16&&(ue=re-re%16,this.blocks(U,G,ue),G+=ue,re-=ue),re){for(K=0;K<re;K++)this.buffer[this.leftover+K]=U[G+K];this.leftover+=re}};function k(U,G,re,K,ue,Ae){var xe=new te(Ae);return xe.update(re,K,ue),xe.finish(U,G),0}function q(U,G,re,K,ue,Ae){var xe=new Uint8Array(16);return k(xe,0,re,K,ue,Ae),L(U,G,xe,0)}function y(U,G,re,K,ue){var Ae;if(re<32)return-1;for(we(U,0,G,0,re,K,ue),k(U,16,U,32,re-32,U),Ae=0;Ae<16;Ae++)U[Ae]=0;return 0}function B(U,G,re,K,ue){var Ae,xe=new Uint8Array(32);if(re<32||(he(xe,0,32,K,ue),q(G,16,G,32,re-32,xe)!==0))return-1;for(we(U,0,G,0,re,K,ue),Ae=0;Ae<32;Ae++)U[Ae]=0;return 0}function $(U,G){var re;for(re=0;re<16;re++)U[re]=G[re]|0}function I(U){var G,re,K=1;for(G=0;G<16;G++)re=U[G]+K+65535,K=Math.floor(re/65536),U[G]=re-K*65536;U[0]+=K-1+37*(K-1)}function F(U,G,re){for(var K,ue=~(re-1),Ae=0;Ae<16;Ae++)K=ue&(U[Ae]^G[Ae]),U[Ae]^=K,G[Ae]^=K}function j(U,G){var re,K,ue,Ae=d(),xe=d();for(re=0;re<16;re++)xe[re]=G[re];for(I(xe),I(xe),I(xe),K=0;K<2;K++){for(Ae[0]=xe[0]-65517,re=1;re<15;re++)Ae[re]=xe[re]-65535-(Ae[re-1]>>16&1),Ae[re-1]&=65535;Ae[15]=xe[15]-32767-(Ae[14]>>16&1),ue=Ae[15]>>16&1,Ae[14]&=65535,F(xe,Ae,1-ue)}for(re=0;re<16;re++)U[2*re]=xe[re]&255,U[2*re+1]=xe[re]>>8}function D(U,G){var re=new Uint8Array(32),K=new Uint8Array(32);return j(re,U),j(K,G),O(re,0,K,0)}function W(U){var G=new Uint8Array(32);return j(G,U),G[0]&1}function R(U,G){var re;for(re=0;re<16;re++)U[re]=G[2*re]+(G[2*re+1]<<8);U[15]&=32767}function z(U,G,re){for(var K=0;K<16;K++)U[K]=G[K]+re[K]}function ye(U,G,re){for(var K=0;K<16;K++)U[K]=G[K]-re[K]}function Ce(U,G,re){var K,ue,Ae=0,xe=0,Te=0,Pe=0,Fe=0,Ne=0,At=0,ot=0,yt=0,vt=0,_t=0,Ve=0,ft=0,et=0,ht=0,it=0,pt=0,at=0,ct=0,dt=0,nt=0,Le=0,Be=0,Ke=0,We=0,ze=0,Qe=0,Et=0,Bt=0,qt=0,Rt=0,Me=re[0],$t=re[1],Lt=re[2],Dt=re[3],kt=re[4],It=re[5],Pt=re[6],Wt=re[7],Ot=re[8],Nt=re[9],Ft=re[10],Ut=re[11],jt=re[12],Ht=re[13],Kt=re[14],Vt=re[15];K=G[0],Ae+=K*Me,xe+=K*$t,Te+=K*Lt,Pe+=K*Dt,Fe+=K*kt,Ne+=K*It,At+=K*Pt,ot+=K*Wt,yt+=K*Ot,vt+=K*Nt,_t+=K*Ft,Ve+=K*Ut,ft+=K*jt,et+=K*Ht,ht+=K*Kt,it+=K*Vt,K=G[1],xe+=K*Me,Te+=K*$t,Pe+=K*Lt,Fe+=K*Dt,Ne+=K*kt,At+=K*It,ot+=K*Pt,yt+=K*Wt,vt+=K*Ot,_t+=K*Nt,Ve+=K*Ft,ft+=K*Ut,et+=K*jt,ht+=K*Ht,it+=K*Kt,pt+=K*Vt,K=G[2],Te+=K*Me,Pe+=K*$t,Fe+=K*Lt,Ne+=K*Dt,At+=K*kt,ot+=K*It,yt+=K*Pt,vt+=K*Wt,_t+=K*Ot,Ve+=K*Nt,ft+=K*Ft,et+=K*Ut,ht+=K*jt,it+=K*Ht,pt+=K*Kt,at+=K*Vt,K=G[3],Pe+=K*Me,Fe+=K*$t,Ne+=K*Lt,At+=K*Dt,ot+=K*kt,yt+=K*It,vt+=K*Pt,_t+=K*Wt,Ve+=K*Ot,ft+=K*Nt,et+=K*Ft,ht+=K*Ut,it+=K*jt,pt+=K*Ht,at+=K*Kt,ct+=K*Vt,K=G[4],Fe+=K*Me,Ne+=K*$t,At+=K*Lt,ot+=K*Dt,yt+=K*kt,vt+=K*It,_t+=K*Pt,Ve+=K*Wt,ft+=K*Ot,et+=K*Nt,ht+=K*Ft,it+=K*Ut,pt+=K*jt,at+=K*Ht,ct+=K*Kt,dt+=K*Vt,K=G[5],Ne+=K*Me,At+=K*$t,ot+=K*Lt,yt+=K*Dt,vt+=K*kt,_t+=K*It,Ve+=K*Pt,ft+=K*Wt,et+=K*Ot,ht+=K*Nt,it+=K*Ft,pt+=K*Ut,at+=K*jt,ct+=K*Ht,dt+=K*Kt,nt+=K*Vt,K=G[6],At+=K*Me,ot+=K*$t,yt+=K*Lt,vt+=K*Dt,_t+=K*kt,Ve+=K*It,ft+=K*Pt,et+=K*Wt,ht+=K*Ot,it+=K*Nt,pt+=K*Ft,at+=K*Ut,ct+=K*jt,dt+=K*Ht,nt+=K*Kt,Le+=K*Vt,K=G[7],ot+=K*Me,yt+=K*$t,vt+=K*Lt,_t+=K*Dt,Ve+=K*kt,ft+=K*It,et+=K*Pt,ht+=K*Wt,it+=K*Ot,pt+=K*Nt,at+=K*Ft,ct+=K*Ut,dt+=K*jt,nt+=K*Ht,Le+=K*Kt,Be+=K*Vt,K=G[8],yt+=K*Me,vt+=K*$t,_t+=K*Lt,Ve+=K*Dt,ft+=K*kt,et+=K*It,ht+=K*Pt,it+=K*Wt,pt+=K*Ot,at+=K*Nt,ct+=K*Ft,dt+=K*Ut,nt+=K*jt,Le+=K*Ht,Be+=K*Kt,Ke+=K*Vt,K=G[9],vt+=K*Me,_t+=K*$t,Ve+=K*Lt,ft+=K*Dt,et+=K*kt,ht+=K*It,it+=K*Pt,pt+=K*Wt,at+=K*Ot,ct+=K*Nt,dt+=K*Ft,nt+=K*Ut,Le+=K*jt,Be+=K*Ht,Ke+=K*Kt,We+=K*Vt,K=G[10],_t+=K*Me,Ve+=K*$t,ft+=K*Lt,et+=K*Dt,ht+=K*kt,it+=K*It,pt+=K*Pt,at+=K*Wt,ct+=K*Ot,dt+=K*Nt,nt+=K*Ft,Le+=K*Ut,Be+=K*jt,Ke+=K*Ht,We+=K*Kt,ze+=K*Vt,K=G[11],Ve+=K*Me,ft+=K*$t,et+=K*Lt,ht+=K*Dt,it+=K*kt,pt+=K*It,at+=K*Pt,ct+=K*Wt,dt+=K*Ot,nt+=K*Nt,Le+=K*Ft,Be+=K*Ut,Ke+=K*jt,We+=K*Ht,ze+=K*Kt,Qe+=K*Vt,K=G[12],ft+=K*Me,et+=K*$t,ht+=K*Lt,it+=K*Dt,pt+=K*kt,at+=K*It,ct+=K*Pt,dt+=K*Wt,nt+=K*Ot,Le+=K*Nt,Be+=K*Ft,Ke+=K*Ut,We+=K*jt,ze+=K*Ht,Qe+=K*Kt,Et+=K*Vt,K=G[13],et+=K*Me,ht+=K*$t,it+=K*Lt,pt+=K*Dt,at+=K*kt,ct+=K*It,dt+=K*Pt,nt+=K*Wt,Le+=K*Ot,Be+=K*Nt,Ke+=K*Ft,We+=K*Ut,ze+=K*jt,Qe+=K*Ht,Et+=K*Kt,Bt+=K*Vt,K=G[14],ht+=K*Me,it+=K*$t,pt+=K*Lt,at+=K*Dt,ct+=K*kt,dt+=K*It,nt+=K*Pt,Le+=K*Wt,Be+=K*Ot,Ke+=K*Nt,We+=K*Ft,ze+=K*Ut,Qe+=K*jt,Et+=K*Ht,Bt+=K*Kt,qt+=K*Vt,K=G[15],it+=K*Me,pt+=K*$t,at+=K*Lt,ct+=K*Dt,dt+=K*kt,nt+=K*It,Le+=K*Pt,Be+=K*Wt,Ke+=K*Ot,We+=K*Nt,ze+=K*Ft,Qe+=K*Ut,Et+=K*jt,Bt+=K*Ht,qt+=K*Kt,Rt+=K*Vt,Ae+=38*pt,xe+=38*at,Te+=38*ct,Pe+=38*dt,Fe+=38*nt,Ne+=38*Le,At+=38*Be,ot+=38*Ke,yt+=38*We,vt+=38*ze,_t+=38*Qe,Ve+=38*Et,ft+=38*Bt,et+=38*qt,ht+=38*Rt,ue=1,K=Ae+ue+65535,ue=Math.floor(K/65536),Ae=K-ue*65536,K=xe+ue+65535,ue=Math.floor(K/65536),xe=K-ue*65536,K=Te+ue+65535,ue=Math.floor(K/65536),Te=K-ue*65536,K=Pe+ue+65535,ue=Math.floor(K/65536),Pe=K-ue*65536,K=Fe+ue+65535,ue=Math.floor(K/65536),Fe=K-ue*65536,K=Ne+ue+65535,ue=Math.floor(K/65536),Ne=K-ue*65536,K=At+ue+65535,ue=Math.floor(K/65536),At=K-ue*65536,K=ot+ue+65535,ue=Math.floor(K/65536),ot=K-ue*65536,K=yt+ue+65535,ue=Math.floor(K/65536),yt=K-ue*65536,K=vt+ue+65535,ue=Math.floor(K/65536),vt=K-ue*65536,K=_t+ue+65535,ue=Math.floor(K/65536),_t=K-ue*65536,K=Ve+ue+65535,ue=Math.floor(K/65536),Ve=K-ue*65536,K=ft+ue+65535,ue=Math.floor(K/65536),ft=K-ue*65536,K=et+ue+65535,ue=Math.floor(K/65536),et=K-ue*65536,K=ht+ue+65535,ue=Math.floor(K/65536),ht=K-ue*65536,K=it+ue+65535,ue=Math.floor(K/65536),it=K-ue*65536,Ae+=ue-1+37*(ue-1),ue=1,K=Ae+ue+65535,ue=Math.floor(K/65536),Ae=K-ue*65536,K=xe+ue+65535,ue=Math.floor(K/65536),xe=K-ue*65536,K=Te+ue+65535,ue=Math.floor(K/65536),Te=K-ue*65536,K=Pe+ue+65535,ue=Math.floor(K/65536),Pe=K-ue*65536,K=Fe+ue+65535,ue=Math.floor(K/65536),Fe=K-ue*65536,K=Ne+ue+65535,ue=Math.floor(K/65536),Ne=K-ue*65536,K=At+ue+65535,ue=Math.floor(K/65536),At=K-ue*65536,K=ot+ue+65535,ue=Math.floor(K/65536),ot=K-ue*65536,K=yt+ue+65535,ue=Math.floor(K/65536),yt=K-ue*65536,K=vt+ue+65535,ue=Math.floor(K/65536),vt=K-ue*65536,K=_t+ue+65535,ue=Math.floor(K/65536),_t=K-ue*65536,K=Ve+ue+65535,ue=Math.floor(K/65536),Ve=K-ue*65536,K=ft+ue+65535,ue=Math.floor(K/65536),ft=K-ue*65536,K=et+ue+65535,ue=Math.floor(K/65536),et=K-ue*65536,K=ht+ue+65535,ue=Math.floor(K/65536),ht=K-ue*65536,K=it+ue+65535,ue=Math.floor(K/65536),it=K-ue*65536,Ae+=ue-1+37*(ue-1),U[0]=Ae,U[1]=xe,U[2]=Te,U[3]=Pe,U[4]=Fe,U[5]=Ne,U[6]=At,U[7]=ot,U[8]=yt,U[9]=vt,U[10]=_t,U[11]=Ve,U[12]=ft,U[13]=et,U[14]=ht,U[15]=it}function me(U,G){Ce(U,G,G)}function ie(U,G){var re=d(),K;for(K=0;K<16;K++)re[K]=G[K];for(K=253;K>=0;K--)me(re,re),K!==2&&K!==4&&Ce(re,re,G);for(K=0;K<16;K++)U[K]=re[K]}function ee(U,G){var re=d(),K;for(K=0;K<16;K++)re[K]=G[K];for(K=250;K>=0;K--)me(re,re),K!==1&&Ce(re,re,G);for(K=0;K<16;K++)U[K]=re[K]}function pe(U,G,re){var K=new Uint8Array(32),ue=new Float64Array(80),Ae,xe,Te=d(),Pe=d(),Fe=d(),Ne=d(),At=d(),ot=d();for(xe=0;xe<31;xe++)K[xe]=G[xe];for(K[31]=G[31]&127|64,K[0]&=248,R(ue,re),xe=0;xe<16;xe++)Pe[xe]=ue[xe],Ne[xe]=Te[xe]=Fe[xe]=0;for(Te[0]=Ne[0]=1,xe=254;xe>=0;--xe)Ae=K[xe>>>3]>>>(xe&7)&1,F(Te,Pe,Ae),F(Fe,Ne,Ae),z(At,Te,Fe),ye(Te,Te,Fe),z(Fe,Pe,Ne),ye(Pe,Pe,Ne),me(Ne,At),me(ot,Te),Ce(Te,Fe,Te),Ce(Fe,Pe,At),z(At,Te,Fe),ye(Te,Te,Fe),me(Pe,Te),ye(Fe,Ne,ot),Ce(Te,Fe,S),z(Te,Te,Ne),Ce(Fe,Fe,Te),Ce(Te,Ne,ot),Ce(Ne,Pe,ue),me(Pe,At),F(Te,Pe,Ae),F(Fe,Ne,Ae);for(xe=0;xe<16;xe++)ue[xe+16]=Te[xe],ue[xe+32]=Fe[xe],ue[xe+48]=Pe[xe],ue[xe+64]=Ne[xe];var yt=ue.subarray(32),vt=ue.subarray(16);return ie(yt,yt),Ce(vt,vt,yt),j(U,vt),0}function be(U,G){return pe(U,G,g)}function ae(U,G){return m(G,32),be(U,G)}function ne(U,G,re){var K=new Uint8Array(32);return pe(K,re,G),X(U,v,K,oe)}var Se=y,qe=B;function Ie(U,G,re,K,ue,Ae){var xe=new Uint8Array(32);return ne(xe,ue,Ae),Se(U,G,re,K,xe)}function Oe(U,G,re,K,ue,Ae){var xe=new Uint8Array(32);return ne(xe,ue,Ae),qe(U,G,re,K,xe)}var Ue=[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];function De(U,G,re,K){for(var ue=new Int32Array(16),Ae=new Int32Array(16),xe,Te,Pe,Fe,Ne,At,ot,yt,vt,_t,Ve,ft,et,ht,it,pt,at,ct,dt,nt,Le,Be,Ke,We,ze,Qe,Et=U[0],Bt=U[1],qt=U[2],Rt=U[3],Me=U[4],$t=U[5],Lt=U[6],Dt=U[7],kt=G[0],It=G[1],Pt=G[2],Wt=G[3],Ot=G[4],Nt=G[5],Ft=G[6],Ut=G[7],jt=0;K>=128;){for(dt=0;dt<16;dt++)nt=8*dt+jt,ue[dt]=re[nt+0]<<24|re[nt+1]<<16|re[nt+2]<<8|re[nt+3],Ae[dt]=re[nt+4]<<24|re[nt+5]<<16|re[nt+6]<<8|re[nt+7];for(dt=0;dt<80;dt++)if(xe=Et,Te=Bt,Pe=qt,Fe=Rt,Ne=Me,At=$t,ot=Lt,yt=Dt,vt=kt,_t=It,Ve=Pt,ft=Wt,et=Ot,ht=Nt,it=Ft,pt=Ut,Le=Dt,Be=Ut,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=(Me>>>14|Ot<<18)^(Me>>>18|Ot<<14)^(Ot>>>9|Me<<23),Be=(Ot>>>14|Me<<18)^(Ot>>>18|Me<<14)^(Me>>>9|Ot<<23),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Me&$t^~Me&Lt,Be=Ot&Nt^~Ot&Ft,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Ue[dt*2],Be=Ue[dt*2+1],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=ue[dt%16],Be=Ae[dt%16],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,at=ze&65535|Qe<<16,ct=Ke&65535|We<<16,Le=at,Be=ct,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=(Et>>>28|kt<<4)^(kt>>>2|Et<<30)^(kt>>>7|Et<<25),Be=(kt>>>28|Et<<4)^(Et>>>2|kt<<30)^(Et>>>7|kt<<25),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Et&Bt^Et&qt^Bt&qt,Be=kt&It^kt&Pt^It&Pt,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,yt=ze&65535|Qe<<16,pt=Ke&65535|We<<16,Le=Fe,Be=ft,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=at,Be=ct,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,Fe=ze&65535|Qe<<16,ft=Ke&65535|We<<16,Bt=xe,qt=Te,Rt=Pe,Me=Fe,$t=Ne,Lt=At,Dt=ot,Et=yt,It=vt,Pt=_t,Wt=Ve,Ot=ft,Nt=et,Ft=ht,Ut=it,kt=pt,dt%16===15)for(nt=0;nt<16;nt++)Le=ue[nt],Be=Ae[nt],Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=ue[(nt+9)%16],Be=Ae[(nt+9)%16],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,at=ue[(nt+1)%16],ct=Ae[(nt+1)%16],Le=(at>>>1|ct<<31)^(at>>>8|ct<<24)^at>>>7,Be=(ct>>>1|at<<31)^(ct>>>8|at<<24)^(ct>>>7|at<<25),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,at=ue[(nt+14)%16],ct=Ae[(nt+14)%16],Le=(at>>>19|ct<<13)^(ct>>>29|at<<3)^at>>>6,Be=(ct>>>19|at<<13)^(at>>>29|ct<<3)^(ct>>>6|at<<26),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,ue[nt]=ze&65535|Qe<<16,Ae[nt]=Ke&65535|We<<16;Le=Et,Be=kt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[0],Be=G[0],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[0]=Et=ze&65535|Qe<<16,G[0]=kt=Ke&65535|We<<16,Le=Bt,Be=It,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[1],Be=G[1],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[1]=Bt=ze&65535|Qe<<16,G[1]=It=Ke&65535|We<<16,Le=qt,Be=Pt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[2],Be=G[2],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[2]=qt=ze&65535|Qe<<16,G[2]=Pt=Ke&65535|We<<16,Le=Rt,Be=Wt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[3],Be=G[3],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[3]=Rt=ze&65535|Qe<<16,G[3]=Wt=Ke&65535|We<<16,Le=Me,Be=Ot,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[4],Be=G[4],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[4]=Me=ze&65535|Qe<<16,G[4]=Ot=Ke&65535|We<<16,Le=$t,Be=Nt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[5],Be=G[5],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[5]=$t=ze&65535|Qe<<16,G[5]=Nt=Ke&65535|We<<16,Le=Lt,Be=Ft,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[6],Be=G[6],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[6]=Lt=ze&65535|Qe<<16,G[6]=Ft=Ke&65535|We<<16,Le=Dt,Be=Ut,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=U[7],Be=G[7],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,U[7]=Dt=ze&65535|Qe<<16,G[7]=Ut=Ke&65535|We<<16,jt+=128,K-=128}return K}function $e(U,G,re){var K=new Int32Array(8),ue=new Int32Array(8),Ae=new Uint8Array(256),xe,Te=re;for(K[0]=1779033703,K[1]=3144134277,K[2]=1013904242,K[3]=2773480762,K[4]=1359893119,K[5]=2600822924,K[6]=528734635,K[7]=1541459225,ue[0]=4089235720,ue[1]=2227873595,ue[2]=4271175723,ue[3]=1595750129,ue[4]=2917565137,ue[5]=725511199,ue[6]=4215389547,ue[7]=327033209,De(K,ue,G,re),re%=128,xe=0;xe<re;xe++)Ae[xe]=G[Te-re+xe];for(Ae[re]=128,re=256-128*(re<112?1:0),Ae[re-9]=0,A(Ae,re-8,Te/536870912|0,Te<<3),De(K,ue,Ae,re),xe=0;xe<8;xe++)A(U,8*xe,K[xe],ue[xe]);return 0}function je(U,G){var re=d(),K=d(),ue=d(),Ae=d(),xe=d(),Te=d(),Pe=d(),Fe=d(),Ne=d();ye(re,U[1],U[0]),ye(Ne,G[1],G[0]),Ce(re,re,Ne),z(K,U[0],U[1]),z(Ne,G[0],G[1]),Ce(K,K,Ne),Ce(ue,U[3],G[3]),Ce(ue,ue,b),Ce(Ae,U[2],G[2]),z(Ae,Ae,Ae),ye(xe,K,re),ye(Te,Ae,ue),z(Pe,Ae,ue),z(Fe,K,re),Ce(U[0],xe,Te),Ce(U[1],Fe,Pe),Ce(U[2],Pe,Te),Ce(U[3],xe,Fe)}function Ye(U,G,re){var K;for(K=0;K<4;K++)F(U[K],G[K],re)}function st(U,G){var re=d(),K=d(),ue=d();ie(ue,G[2]),Ce(re,G[0],ue),Ce(K,G[1],ue),j(U,K),U[31]^=W(re)<<7}function Je(U,G,re){var K,ue;for($(U[0],w),$(U[1],x),$(U[2],x),$(U[3],w),ue=255;ue>=0;--ue)K=re[ue/8|0]>>(ue&7)&1,Ye(U,G,K),je(G,U),je(U,U),Ye(U,G,K)}function Ge(U,G){var re=[d(),d(),d(),d()];$(re[0],C),$(re[1],E),$(re[2],x),Ce(re[3],C,E),Je(U,re,G)}function ut(U,G,re){var K=new Uint8Array(64),ue=[d(),d(),d(),d()],Ae;for(re||m(G,32),$e(K,G,32),K[0]&=248,K[31]&=127,K[31]|=64,Ge(ue,K),st(U,ue),Ae=0;Ae<32;Ae++)G[Ae+32]=U[Ae];return 0}var gt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function rt(U,G){var re,K,ue,Ae;for(K=63;K>=32;--K){for(re=0,ue=K-32,Ae=K-12;ue<Ae;++ue)G[ue]+=re-16*G[K]*gt[ue-(K-32)],re=Math.floor((G[ue]+128)/256),G[ue]-=re*256;G[ue]+=re,G[K]=0}for(re=0,ue=0;ue<32;ue++)G[ue]+=re-(G[31]>>4)*gt[ue],re=G[ue]>>8,G[ue]&=255;for(ue=0;ue<32;ue++)G[ue]-=re*gt[ue];for(K=0;K<32;K++)G[K+1]+=G[K]>>8,U[K]=G[K]&255}function wt(U){var G=new Float64Array(64),re;for(re=0;re<64;re++)G[re]=U[re];for(re=0;re<64;re++)U[re]=0;rt(U,G)}function bt(U,G,re,K){var ue=new Uint8Array(64),Ae=new Uint8Array(64),xe=new Uint8Array(64),Te,Pe,Fe=new Float64Array(64),Ne=[d(),d(),d(),d()];$e(ue,K,32),ue[0]&=248,ue[31]&=127,ue[31]|=64;var At=re+64;for(Te=0;Te<re;Te++)U[64+Te]=G[Te];for(Te=0;Te<32;Te++)U[32+Te]=ue[32+Te];for($e(xe,U.subarray(32),re+32),wt(xe),Ge(Ne,xe),st(U,Ne),Te=32;Te<64;Te++)U[Te]=K[Te];for($e(Ae,U,re+64),wt(Ae),Te=0;Te<64;Te++)Fe[Te]=0;for(Te=0;Te<32;Te++)Fe[Te]=xe[Te];for(Te=0;Te<32;Te++)for(Pe=0;Pe<32;Pe++)Fe[Te+Pe]+=Ae[Te]*ue[Pe];return rt(U.subarray(32),Fe),At}function le(U,G){var re=d(),K=d(),ue=d(),Ae=d(),xe=d(),Te=d(),Pe=d();return $(U[2],x),R(U[1],G),me(ue,U[1]),Ce(Ae,ue,_),ye(ue,ue,U[2]),z(Ae,U[2],Ae),me(xe,Ae),me(Te,xe),Ce(Pe,Te,xe),Ce(re,Pe,ue),Ce(re,re,Ae),ee(re,re),Ce(re,re,ue),Ce(re,re,Ae),Ce(re,re,Ae),Ce(U[0],re,Ae),me(K,U[0]),Ce(K,K,Ae),D(K,ue)&&Ce(U[0],U[0],M),me(K,U[0]),Ce(K,K,Ae),D(K,ue)?-1:(W(U[0])===G[31]>>7&&ye(U[0],w,U[0]),Ce(U[3],U[0],U[1]),0)}function Z(U,G,re,K){var ue,Ae=new Uint8Array(32),xe=new Uint8Array(64),Te=[d(),d(),d(),d()],Pe=[d(),d(),d(),d()];if(re<64||le(Pe,K))return-1;for(ue=0;ue<re;ue++)U[ue]=G[ue];for(ue=0;ue<32;ue++)U[ue+32]=K[ue];if($e(xe,U,re),wt(xe),Je(Te,Pe,xe),Ge(Pe,G.subarray(32)),je(Te,Pe),st(Ae,Te),re-=64,O(G,0,Ae,0)){for(ue=0;ue<re;ue++)U[ue]=0;return-1}for(ue=0;ue<re;ue++)U[ue]=G[ue+64];return re}var J=32,ge=24,Ee=32,Re=16,ke=32,Xe=32,He=32,Ze=32,xt=32,tt=ge,mt=Ee,Tt=Re,St=64,lt=32,Mt=64,Ct=32,ce=64;f.lowlevel={crypto_core_hsalsa20:X,crypto_stream_xor:we,crypto_stream:he,crypto_stream_salsa20_xor:se,crypto_stream_salsa20:de,crypto_onetimeauth:k,crypto_onetimeauth_verify:q,crypto_verify_16:L,crypto_verify_32:O,crypto_secretbox:y,crypto_secretbox_open:B,crypto_scalarmult:pe,crypto_scalarmult_base:be,crypto_box_beforenm:ne,crypto_box_afternm:Se,crypto_box:Ie,crypto_box_open:Oe,crypto_box_keypair:ae,crypto_hash:$e,crypto_sign:bt,crypto_sign_keypair:ut,crypto_sign_open:Z,crypto_secretbox_KEYBYTES:J,crypto_secretbox_NONCEBYTES:ge,crypto_secretbox_ZEROBYTES:Ee,crypto_secretbox_BOXZEROBYTES:Re,crypto_scalarmult_BYTES:ke,crypto_scalarmult_SCALARBYTES:Xe,crypto_box_PUBLICKEYBYTES:He,crypto_box_SECRETKEYBYTES:Ze,crypto_box_BEFORENMBYTES:xt,crypto_box_NONCEBYTES:tt,crypto_box_ZEROBYTES:mt,crypto_box_BOXZEROBYTES:Tt,crypto_sign_BYTES:St,crypto_sign_PUBLICKEYBYTES:lt,crypto_sign_SECRETKEYBYTES:Mt,crypto_sign_SEEDBYTES:Ct,crypto_hash_BYTES:ce,gf:d,D:_,L:gt,pack25519:j,unpack25519:R,M:Ce,A:z,S:me,Z:ye,pow2523:ee,add:je,set25519:$,modL:rt,scalarmult:Je,scalarbase:Ge};function Y(U,G){if(U.length!==J)throw new Error("bad key size");if(G.length!==ge)throw new Error("bad nonce size")}function Q(U,G){if(U.length!==He)throw new Error("bad public key size");if(G.length!==Ze)throw new Error("bad secret key size")}function ve(){for(var U=0;U<arguments.length;U++)if(!(arguments[U]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function fe(U){for(var G=0;G<U.length;G++)U[G]=0}f.randomBytes=function(U){var G=new Uint8Array(U);return m(G,U),G},f.secretbox=function(U,G,re){ve(U,G,re),Y(re,G);for(var K=new Uint8Array(Ee+U.length),ue=new Uint8Array(K.length),Ae=0;Ae<U.length;Ae++)K[Ae+Ee]=U[Ae];return y(ue,K,K.length,G,re),ue.subarray(Re)},f.secretbox.open=function(U,G,re){ve(U,G,re),Y(re,G);for(var K=new Uint8Array(Re+U.length),ue=new Uint8Array(K.length),Ae=0;Ae<U.length;Ae++)K[Ae+Re]=U[Ae];return K.length<32||B(ue,K,K.length,G,re)!==0?null:ue.subarray(Ee)},f.secretbox.keyLength=J,f.secretbox.nonceLength=ge,f.secretbox.overheadLength=Re,f.scalarMult=function(U,G){if(ve(U,G),U.length!==Xe)throw new Error("bad n size");if(G.length!==ke)throw new Error("bad p size");var re=new Uint8Array(ke);return pe(re,U,G),re},f.scalarMult.base=function(U){if(ve(U),U.length!==Xe)throw new Error("bad n size");var G=new Uint8Array(ke);return be(G,U),G},f.scalarMult.scalarLength=Xe,f.scalarMult.groupElementLength=ke,f.box=function(U,G,re,K){var ue=f.box.before(re,K);return f.secretbox(U,G,ue)},f.box.before=function(U,G){ve(U,G),Q(U,G);var re=new Uint8Array(xt);return ne(re,U,G),re},f.box.after=f.secretbox,f.box.open=function(U,G,re,K){var ue=f.box.before(re,K);return f.secretbox.open(U,G,ue)},f.box.open.after=f.secretbox.open,f.box.keyPair=function(){var U=new Uint8Array(He),G=new Uint8Array(Ze);return ae(U,G),{publicKey:U,secretKey:G}},f.box.keyPair.fromSecretKey=function(U){if(ve(U),U.length!==Ze)throw new Error("bad secret key size");var G=new Uint8Array(He);return be(G,U),{publicKey:G,secretKey:new Uint8Array(U)}},f.box.publicKeyLength=He,f.box.secretKeyLength=Ze,f.box.sharedKeyLength=xt,f.box.nonceLength=tt,f.box.overheadLength=f.secretbox.overheadLength,f.sign=function(U,G){if(ve(U,G),G.length!==Mt)throw new Error("bad secret key size");var re=new Uint8Array(St+U.length);return bt(re,U,U.length,G),re},f.sign.open=function(U,G){if(ve(U,G),G.length!==lt)throw new Error("bad public key size");var re=new Uint8Array(U.length),K=Z(re,U,U.length,G);if(K<0)return null;for(var ue=new Uint8Array(K),Ae=0;Ae<ue.length;Ae++)ue[Ae]=re[Ae];return ue},f.sign.detached=function(U,G){for(var re=f.sign(U,G),K=new Uint8Array(St),ue=0;ue<K.length;ue++)K[ue]=re[ue];return K},f.sign.detached.verify=function(U,G,re){if(ve(U,G,re),G.length!==St)throw new Error("bad signature size");if(re.length!==lt)throw new Error("bad public key size");var K=new Uint8Array(St+U.length),ue=new Uint8Array(St+U.length),Ae;for(Ae=0;Ae<St;Ae++)K[Ae]=G[Ae];for(Ae=0;Ae<U.length;Ae++)K[Ae+St]=U[Ae];return Z(ue,K,K.length,re)>=0},f.sign.keyPair=function(){var U=new Uint8Array(lt),G=new Uint8Array(Mt);return ut(U,G),{publicKey:U,secretKey:G}},f.sign.keyPair.fromSecretKey=function(U){if(ve(U),U.length!==Mt)throw new Error("bad secret key size");for(var G=new Uint8Array(lt),re=0;re<G.length;re++)G[re]=U[32+re];return{publicKey:G,secretKey:new Uint8Array(U)}},f.sign.keyPair.fromSeed=function(U){if(ve(U),U.length!==Ct)throw new Error("bad seed size");for(var G=new Uint8Array(lt),re=new Uint8Array(Mt),K=0;K<32;K++)re[K]=U[K];return ut(G,re,!0),{publicKey:G,secretKey:re}},f.sign.publicKeyLength=lt,f.sign.secretKeyLength=Mt,f.sign.seedLength=Ct,f.sign.signatureLength=St,f.hash=function(U){ve(U);var G=new Uint8Array(ce);return $e(G,U,U.length),G},f.hash.hashLength=ce,f.verify=function(U,G){return ve(U,G),U.length===0||G.length===0||U.length!==G.length?!1:T(U,0,G,0,U.length)===0},f.setPRNG=function(U){m=U},(function(){var U=typeof self<"u"?self.crypto||self.msCrypto:null;if(U&&U.getRandomValues){var G=65536;f.setPRNG(function(re,K){var ue,Ae=new Uint8Array(K);for(ue=0;ue<K;ue+=G)U.getRandomValues(Ae.subarray(ue,ue+Math.min(K-ue,G)));for(ue=0;ue<K;ue++)re[ue]=Ae[ue];fe(Ae)})}else typeof commonjsRequire<"u"&&(U=requireCryptoBrowserify(),U&&U.randomBytes&&f.setPRNG(function(re,K){var ue,Ae=U.randomBytes(K);for(ue=0;ue<K;ue++)re[ue]=Ae[ue];fe(Ae)}))})()})(r.exports?r.exports:self.nacl=self.nacl||{})})(naclFast)),naclFast.exports}var naclFastExports=requireNaclFast();const nacl$1=getDefaultExportFromCjs(naclFastExports);var CONNECT_EVENT_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",r[r.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(CONNECT_EVENT_ERROR_CODES||(CONNECT_EVENT_ERROR_CODES={}));var CONNECT_ITEM_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(CONNECT_ITEM_ERROR_CODES||(CONNECT_ITEM_ERROR_CODES={}));var SEND_TRANSACTION_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(SEND_TRANSACTION_ERROR_CODES||(SEND_TRANSACTION_ERROR_CODES={}));var SIGN_DATA_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(SIGN_DATA_ERROR_CODES||(SIGN_DATA_ERROR_CODES={}));var DISCONNECT_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(DISCONNECT_ERROR_CODES||(DISCONNECT_ERROR_CODES={}));var CHAIN;(function(r){r.MAINNET="-239",r.TESTNET="-3"})(CHAIN||(CHAIN={}));function encodeUint8Array(r,f){const d=nacl.encodeBase64(r);return f?encodeURIComponent(d):d}function decodeToUint8Array(r,f){return f&&(r=decodeURIComponent(r)),nacl.decodeBase64(r)}function encode(r,f=!1){let d;return r instanceof Uint8Array?d=r:(typeof r!="string"&&(r=JSON.stringify(r)),d=nacl.decodeUTF8(r)),encodeUint8Array(d,f)}function decode(r,f=!1){const d=decodeToUint8Array(r,f);return{toString(){return nacl.encodeUTF8(d)},toObject(){try{return JSON.parse(nacl.encodeUTF8(d))}catch{return null}},toUint8Array(){return d}}}const Base64={encode,decode};function concatUint8Arrays(r,f){const d=new Uint8Array(r.length+f.length);return d.set(r),d.set(f,r.length),d}function splitToUint8Arrays(r,f){if(f>=r.length)throw new Error("Index is out of buffer");const d=r.slice(0,f),m=r.slice(f);return[d,m]}function toHexString(r){let f="";return r.forEach(d=>{f+=("0"+(d&255).toString(16)).slice(-2)}),f}function hexToByteArray(r){if(r.length%2!==0)throw new Error(`Cannot convert ${r} to bytesArray`);const f=new Uint8Array(r.length/2);for(let d=0;d<r.length;d+=2)f[d/2]=parseInt(r.slice(d,d+2),16);return f}class SessionCrypto{constructor(f){this.nonceLength=24,this.keyPair=f?this.createKeypairFromString(f):this.createKeypair(),this.sessionId=toHexString(this.keyPair.publicKey)}createKeypair(){return nacl$1.box.keyPair()}createKeypairFromString(f){return{publicKey:hexToByteArray(f.publicKey),secretKey:hexToByteArray(f.secretKey)}}createNonce(){return nacl$1.randomBytes(this.nonceLength)}encrypt(f,d){const m=new TextEncoder().encode(f),v=this.createNonce(),g=nacl$1.box(m,v,d,this.keyPair.secretKey);return concatUint8Arrays(v,g)}decrypt(f,d){const[m,v]=splitToUint8Arrays(f,this.nonceLength),g=nacl$1.box.open(v,m,d,this.keyPair.secretKey);if(!g)throw new Error(`Decryption error:
32
+ https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var hasRequiredNaclFast;function requireNaclFast(){return hasRequiredNaclFast||(hasRequiredNaclFast=1,(function(r){(function(f){var d=function(F){var G,re=new Float64Array(16);if(F)for(G=0;G<F.length;G++)re[G]=F[G];return re},m=function(){throw new Error("no PRNG")},v=new Uint8Array(16),g=new Uint8Array(32);g[0]=9;var w=d(),x=d([1]),S=d([56129,1]),_=d([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),b=d([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),C=d([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),E=d([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),M=d([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(F,G,re,K){F[G]=re>>24&255,F[G+1]=re>>16&255,F[G+2]=re>>8&255,F[G+3]=re&255,F[G+4]=K>>24&255,F[G+5]=K>>16&255,F[G+6]=K>>8&255,F[G+7]=K&255}function T(F,G,re,K,ue){var Ae,xe=0;for(Ae=0;Ae<ue;Ae++)xe|=F[G+Ae]^re[K+Ae];return(1&xe-1>>>8)-1}function L(F,G,re,K){return T(F,G,re,K,16)}function O(F,G,re,K){return T(F,G,re,K,32)}function N(F,G,re,K){for(var ue=K[0]&255|(K[1]&255)<<8|(K[2]&255)<<16|(K[3]&255)<<24,Ae=re[0]&255|(re[1]&255)<<8|(re[2]&255)<<16|(re[3]&255)<<24,xe=re[4]&255|(re[5]&255)<<8|(re[6]&255)<<16|(re[7]&255)<<24,Te=re[8]&255|(re[9]&255)<<8|(re[10]&255)<<16|(re[11]&255)<<24,Pe=re[12]&255|(re[13]&255)<<8|(re[14]&255)<<16|(re[15]&255)<<24,Ue=K[4]&255|(K[5]&255)<<8|(K[6]&255)<<16|(K[7]&255)<<24,Ne=G[0]&255|(G[1]&255)<<8|(G[2]&255)<<16|(G[3]&255)<<24,At=G[4]&255|(G[5]&255)<<8|(G[6]&255)<<16|(G[7]&255)<<24,ot=G[8]&255|(G[9]&255)<<8|(G[10]&255)<<16|(G[11]&255)<<24,yt=G[12]&255|(G[13]&255)<<8|(G[14]&255)<<16|(G[15]&255)<<24,vt=K[8]&255|(K[9]&255)<<8|(K[10]&255)<<16|(K[11]&255)<<24,_t=re[16]&255|(re[17]&255)<<8|(re[18]&255)<<16|(re[19]&255)<<24,Ve=re[20]&255|(re[21]&255)<<8|(re[22]&255)<<16|(re[23]&255)<<24,ft=re[24]&255|(re[25]&255)<<8|(re[26]&255)<<16|(re[27]&255)<<24,et=re[28]&255|(re[29]&255)<<8|(re[30]&255)<<16|(re[31]&255)<<24,ht=K[12]&255|(K[13]&255)<<8|(K[14]&255)<<16|(K[15]&255)<<24,it=ue,pt=Ae,at=xe,ct=Te,dt=Pe,nt=Ue,Le=Ne,Be=At,Ke=ot,We=yt,ze=vt,Qe=_t,Et=Ve,Bt=ft,qt=et,Rt=ht,Me,$t=0;$t<20;$t+=2)Me=it+Et|0,dt^=Me<<7|Me>>>25,Me=dt+it|0,Ke^=Me<<9|Me>>>23,Me=Ke+dt|0,Et^=Me<<13|Me>>>19,Me=Et+Ke|0,it^=Me<<18|Me>>>14,Me=nt+pt|0,We^=Me<<7|Me>>>25,Me=We+nt|0,Bt^=Me<<9|Me>>>23,Me=Bt+We|0,pt^=Me<<13|Me>>>19,Me=pt+Bt|0,nt^=Me<<18|Me>>>14,Me=ze+Le|0,qt^=Me<<7|Me>>>25,Me=qt+ze|0,at^=Me<<9|Me>>>23,Me=at+qt|0,Le^=Me<<13|Me>>>19,Me=Le+at|0,ze^=Me<<18|Me>>>14,Me=Rt+Qe|0,ct^=Me<<7|Me>>>25,Me=ct+Rt|0,Be^=Me<<9|Me>>>23,Me=Be+ct|0,Qe^=Me<<13|Me>>>19,Me=Qe+Be|0,Rt^=Me<<18|Me>>>14,Me=it+ct|0,pt^=Me<<7|Me>>>25,Me=pt+it|0,at^=Me<<9|Me>>>23,Me=at+pt|0,ct^=Me<<13|Me>>>19,Me=ct+at|0,it^=Me<<18|Me>>>14,Me=nt+dt|0,Le^=Me<<7|Me>>>25,Me=Le+nt|0,Be^=Me<<9|Me>>>23,Me=Be+Le|0,dt^=Me<<13|Me>>>19,Me=dt+Be|0,nt^=Me<<18|Me>>>14,Me=ze+We|0,Qe^=Me<<7|Me>>>25,Me=Qe+ze|0,Ke^=Me<<9|Me>>>23,Me=Ke+Qe|0,We^=Me<<13|Me>>>19,Me=We+Ke|0,ze^=Me<<18|Me>>>14,Me=Rt+qt|0,Et^=Me<<7|Me>>>25,Me=Et+Rt|0,Bt^=Me<<9|Me>>>23,Me=Bt+Et|0,qt^=Me<<13|Me>>>19,Me=qt+Bt|0,Rt^=Me<<18|Me>>>14;it=it+ue|0,pt=pt+Ae|0,at=at+xe|0,ct=ct+Te|0,dt=dt+Pe|0,nt=nt+Ue|0,Le=Le+Ne|0,Be=Be+At|0,Ke=Ke+ot|0,We=We+yt|0,ze=ze+vt|0,Qe=Qe+_t|0,Et=Et+Ve|0,Bt=Bt+ft|0,qt=qt+et|0,Rt=Rt+ht|0,F[0]=it>>>0&255,F[1]=it>>>8&255,F[2]=it>>>16&255,F[3]=it>>>24&255,F[4]=pt>>>0&255,F[5]=pt>>>8&255,F[6]=pt>>>16&255,F[7]=pt>>>24&255,F[8]=at>>>0&255,F[9]=at>>>8&255,F[10]=at>>>16&255,F[11]=at>>>24&255,F[12]=ct>>>0&255,F[13]=ct>>>8&255,F[14]=ct>>>16&255,F[15]=ct>>>24&255,F[16]=dt>>>0&255,F[17]=dt>>>8&255,F[18]=dt>>>16&255,F[19]=dt>>>24&255,F[20]=nt>>>0&255,F[21]=nt>>>8&255,F[22]=nt>>>16&255,F[23]=nt>>>24&255,F[24]=Le>>>0&255,F[25]=Le>>>8&255,F[26]=Le>>>16&255,F[27]=Le>>>24&255,F[28]=Be>>>0&255,F[29]=Be>>>8&255,F[30]=Be>>>16&255,F[31]=Be>>>24&255,F[32]=Ke>>>0&255,F[33]=Ke>>>8&255,F[34]=Ke>>>16&255,F[35]=Ke>>>24&255,F[36]=We>>>0&255,F[37]=We>>>8&255,F[38]=We>>>16&255,F[39]=We>>>24&255,F[40]=ze>>>0&255,F[41]=ze>>>8&255,F[42]=ze>>>16&255,F[43]=ze>>>24&255,F[44]=Qe>>>0&255,F[45]=Qe>>>8&255,F[46]=Qe>>>16&255,F[47]=Qe>>>24&255,F[48]=Et>>>0&255,F[49]=Et>>>8&255,F[50]=Et>>>16&255,F[51]=Et>>>24&255,F[52]=Bt>>>0&255,F[53]=Bt>>>8&255,F[54]=Bt>>>16&255,F[55]=Bt>>>24&255,F[56]=qt>>>0&255,F[57]=qt>>>8&255,F[58]=qt>>>16&255,F[59]=qt>>>24&255,F[60]=Rt>>>0&255,F[61]=Rt>>>8&255,F[62]=Rt>>>16&255,F[63]=Rt>>>24&255}function H(F,G,re,K){for(var ue=K[0]&255|(K[1]&255)<<8|(K[2]&255)<<16|(K[3]&255)<<24,Ae=re[0]&255|(re[1]&255)<<8|(re[2]&255)<<16|(re[3]&255)<<24,xe=re[4]&255|(re[5]&255)<<8|(re[6]&255)<<16|(re[7]&255)<<24,Te=re[8]&255|(re[9]&255)<<8|(re[10]&255)<<16|(re[11]&255)<<24,Pe=re[12]&255|(re[13]&255)<<8|(re[14]&255)<<16|(re[15]&255)<<24,Ue=K[4]&255|(K[5]&255)<<8|(K[6]&255)<<16|(K[7]&255)<<24,Ne=G[0]&255|(G[1]&255)<<8|(G[2]&255)<<16|(G[3]&255)<<24,At=G[4]&255|(G[5]&255)<<8|(G[6]&255)<<16|(G[7]&255)<<24,ot=G[8]&255|(G[9]&255)<<8|(G[10]&255)<<16|(G[11]&255)<<24,yt=G[12]&255|(G[13]&255)<<8|(G[14]&255)<<16|(G[15]&255)<<24,vt=K[8]&255|(K[9]&255)<<8|(K[10]&255)<<16|(K[11]&255)<<24,_t=re[16]&255|(re[17]&255)<<8|(re[18]&255)<<16|(re[19]&255)<<24,Ve=re[20]&255|(re[21]&255)<<8|(re[22]&255)<<16|(re[23]&255)<<24,ft=re[24]&255|(re[25]&255)<<8|(re[26]&255)<<16|(re[27]&255)<<24,et=re[28]&255|(re[29]&255)<<8|(re[30]&255)<<16|(re[31]&255)<<24,ht=K[12]&255|(K[13]&255)<<8|(K[14]&255)<<16|(K[15]&255)<<24,it=ue,pt=Ae,at=xe,ct=Te,dt=Pe,nt=Ue,Le=Ne,Be=At,Ke=ot,We=yt,ze=vt,Qe=_t,Et=Ve,Bt=ft,qt=et,Rt=ht,Me,$t=0;$t<20;$t+=2)Me=it+Et|0,dt^=Me<<7|Me>>>25,Me=dt+it|0,Ke^=Me<<9|Me>>>23,Me=Ke+dt|0,Et^=Me<<13|Me>>>19,Me=Et+Ke|0,it^=Me<<18|Me>>>14,Me=nt+pt|0,We^=Me<<7|Me>>>25,Me=We+nt|0,Bt^=Me<<9|Me>>>23,Me=Bt+We|0,pt^=Me<<13|Me>>>19,Me=pt+Bt|0,nt^=Me<<18|Me>>>14,Me=ze+Le|0,qt^=Me<<7|Me>>>25,Me=qt+ze|0,at^=Me<<9|Me>>>23,Me=at+qt|0,Le^=Me<<13|Me>>>19,Me=Le+at|0,ze^=Me<<18|Me>>>14,Me=Rt+Qe|0,ct^=Me<<7|Me>>>25,Me=ct+Rt|0,Be^=Me<<9|Me>>>23,Me=Be+ct|0,Qe^=Me<<13|Me>>>19,Me=Qe+Be|0,Rt^=Me<<18|Me>>>14,Me=it+ct|0,pt^=Me<<7|Me>>>25,Me=pt+it|0,at^=Me<<9|Me>>>23,Me=at+pt|0,ct^=Me<<13|Me>>>19,Me=ct+at|0,it^=Me<<18|Me>>>14,Me=nt+dt|0,Le^=Me<<7|Me>>>25,Me=Le+nt|0,Be^=Me<<9|Me>>>23,Me=Be+Le|0,dt^=Me<<13|Me>>>19,Me=dt+Be|0,nt^=Me<<18|Me>>>14,Me=ze+We|0,Qe^=Me<<7|Me>>>25,Me=Qe+ze|0,Ke^=Me<<9|Me>>>23,Me=Ke+Qe|0,We^=Me<<13|Me>>>19,Me=We+Ke|0,ze^=Me<<18|Me>>>14,Me=Rt+qt|0,Et^=Me<<7|Me>>>25,Me=Et+Rt|0,Bt^=Me<<9|Me>>>23,Me=Bt+Et|0,qt^=Me<<13|Me>>>19,Me=qt+Bt|0,Rt^=Me<<18|Me>>>14;F[0]=it>>>0&255,F[1]=it>>>8&255,F[2]=it>>>16&255,F[3]=it>>>24&255,F[4]=nt>>>0&255,F[5]=nt>>>8&255,F[6]=nt>>>16&255,F[7]=nt>>>24&255,F[8]=ze>>>0&255,F[9]=ze>>>8&255,F[10]=ze>>>16&255,F[11]=ze>>>24&255,F[12]=Rt>>>0&255,F[13]=Rt>>>8&255,F[14]=Rt>>>16&255,F[15]=Rt>>>24&255,F[16]=Le>>>0&255,F[17]=Le>>>8&255,F[18]=Le>>>16&255,F[19]=Le>>>24&255,F[20]=Be>>>0&255,F[21]=Be>>>8&255,F[22]=Be>>>16&255,F[23]=Be>>>24&255,F[24]=Ke>>>0&255,F[25]=Ke>>>8&255,F[26]=Ke>>>16&255,F[27]=Ke>>>24&255,F[28]=We>>>0&255,F[29]=We>>>8&255,F[30]=We>>>16&255,F[31]=We>>>24&255}function V(F,G,re,K){N(F,G,re,K)}function X(F,G,re,K){H(F,G,re,K)}var oe=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function se(F,G,re,K,ue,Ae,xe){var Te=new Uint8Array(16),Pe=new Uint8Array(64),Ue,Ne;for(Ne=0;Ne<16;Ne++)Te[Ne]=0;for(Ne=0;Ne<8;Ne++)Te[Ne]=Ae[Ne];for(;ue>=64;){for(V(Pe,Te,xe,oe),Ne=0;Ne<64;Ne++)F[G+Ne]=re[K+Ne]^Pe[Ne];for(Ue=1,Ne=8;Ne<16;Ne++)Ue=Ue+(Te[Ne]&255)|0,Te[Ne]=Ue&255,Ue>>>=8;ue-=64,G+=64,K+=64}if(ue>0)for(V(Pe,Te,xe,oe),Ne=0;Ne<ue;Ne++)F[G+Ne]=re[K+Ne]^Pe[Ne];return 0}function de(F,G,re,K,ue){var Ae=new Uint8Array(16),xe=new Uint8Array(64),Te,Pe;for(Pe=0;Pe<16;Pe++)Ae[Pe]=0;for(Pe=0;Pe<8;Pe++)Ae[Pe]=K[Pe];for(;re>=64;){for(V(xe,Ae,ue,oe),Pe=0;Pe<64;Pe++)F[G+Pe]=xe[Pe];for(Te=1,Pe=8;Pe<16;Pe++)Te=Te+(Ae[Pe]&255)|0,Ae[Pe]=Te&255,Te>>>=8;re-=64,G+=64}if(re>0)for(V(xe,Ae,ue,oe),Pe=0;Pe<re;Pe++)F[G+Pe]=xe[Pe];return 0}function he(F,G,re,K,ue){var Ae=new Uint8Array(32);X(Ae,K,ue,oe);for(var xe=new Uint8Array(8),Te=0;Te<8;Te++)xe[Te]=K[Te+16];return de(F,G,re,xe,Ae)}function we(F,G,re,K,ue,Ae,xe){var Te=new Uint8Array(32);X(Te,Ae,xe,oe);for(var Pe=new Uint8Array(8),Ue=0;Ue<8;Ue++)Pe[Ue]=Ae[Ue+16];return se(F,G,re,K,ue,Pe,Te)}var te=function(F){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var G,re,K,ue,Ae,xe,Te,Pe;G=F[0]&255|(F[1]&255)<<8,this.r[0]=G&8191,re=F[2]&255|(F[3]&255)<<8,this.r[1]=(G>>>13|re<<3)&8191,K=F[4]&255|(F[5]&255)<<8,this.r[2]=(re>>>10|K<<6)&7939,ue=F[6]&255|(F[7]&255)<<8,this.r[3]=(K>>>7|ue<<9)&8191,Ae=F[8]&255|(F[9]&255)<<8,this.r[4]=(ue>>>4|Ae<<12)&255,this.r[5]=Ae>>>1&8190,xe=F[10]&255|(F[11]&255)<<8,this.r[6]=(Ae>>>14|xe<<2)&8191,Te=F[12]&255|(F[13]&255)<<8,this.r[7]=(xe>>>11|Te<<5)&8065,Pe=F[14]&255|(F[15]&255)<<8,this.r[8]=(Te>>>8|Pe<<8)&8191,this.r[9]=Pe>>>5&127,this.pad[0]=F[16]&255|(F[17]&255)<<8,this.pad[1]=F[18]&255|(F[19]&255)<<8,this.pad[2]=F[20]&255|(F[21]&255)<<8,this.pad[3]=F[22]&255|(F[23]&255)<<8,this.pad[4]=F[24]&255|(F[25]&255)<<8,this.pad[5]=F[26]&255|(F[27]&255)<<8,this.pad[6]=F[28]&255|(F[29]&255)<<8,this.pad[7]=F[30]&255|(F[31]&255)<<8};te.prototype.blocks=function(F,G,re){for(var K=this.fin?0:2048,ue,Ae,xe,Te,Pe,Ue,Ne,At,ot,yt,vt,_t,Ve,ft,et,ht,it,pt,at,ct=this.h[0],dt=this.h[1],nt=this.h[2],Le=this.h[3],Be=this.h[4],Ke=this.h[5],We=this.h[6],ze=this.h[7],Qe=this.h[8],Et=this.h[9],Bt=this.r[0],qt=this.r[1],Rt=this.r[2],Me=this.r[3],$t=this.r[4],Lt=this.r[5],Dt=this.r[6],kt=this.r[7],It=this.r[8],Pt=this.r[9];re>=16;)ue=F[G+0]&255|(F[G+1]&255)<<8,ct+=ue&8191,Ae=F[G+2]&255|(F[G+3]&255)<<8,dt+=(ue>>>13|Ae<<3)&8191,xe=F[G+4]&255|(F[G+5]&255)<<8,nt+=(Ae>>>10|xe<<6)&8191,Te=F[G+6]&255|(F[G+7]&255)<<8,Le+=(xe>>>7|Te<<9)&8191,Pe=F[G+8]&255|(F[G+9]&255)<<8,Be+=(Te>>>4|Pe<<12)&8191,Ke+=Pe>>>1&8191,Ue=F[G+10]&255|(F[G+11]&255)<<8,We+=(Pe>>>14|Ue<<2)&8191,Ne=F[G+12]&255|(F[G+13]&255)<<8,ze+=(Ue>>>11|Ne<<5)&8191,At=F[G+14]&255|(F[G+15]&255)<<8,Qe+=(Ne>>>8|At<<8)&8191,Et+=At>>>5|K,ot=0,yt=ot,yt+=ct*Bt,yt+=dt*(5*Pt),yt+=nt*(5*It),yt+=Le*(5*kt),yt+=Be*(5*Dt),ot=yt>>>13,yt&=8191,yt+=Ke*(5*Lt),yt+=We*(5*$t),yt+=ze*(5*Me),yt+=Qe*(5*Rt),yt+=Et*(5*qt),ot+=yt>>>13,yt&=8191,vt=ot,vt+=ct*qt,vt+=dt*Bt,vt+=nt*(5*Pt),vt+=Le*(5*It),vt+=Be*(5*kt),ot=vt>>>13,vt&=8191,vt+=Ke*(5*Dt),vt+=We*(5*Lt),vt+=ze*(5*$t),vt+=Qe*(5*Me),vt+=Et*(5*Rt),ot+=vt>>>13,vt&=8191,_t=ot,_t+=ct*Rt,_t+=dt*qt,_t+=nt*Bt,_t+=Le*(5*Pt),_t+=Be*(5*It),ot=_t>>>13,_t&=8191,_t+=Ke*(5*kt),_t+=We*(5*Dt),_t+=ze*(5*Lt),_t+=Qe*(5*$t),_t+=Et*(5*Me),ot+=_t>>>13,_t&=8191,Ve=ot,Ve+=ct*Me,Ve+=dt*Rt,Ve+=nt*qt,Ve+=Le*Bt,Ve+=Be*(5*Pt),ot=Ve>>>13,Ve&=8191,Ve+=Ke*(5*It),Ve+=We*(5*kt),Ve+=ze*(5*Dt),Ve+=Qe*(5*Lt),Ve+=Et*(5*$t),ot+=Ve>>>13,Ve&=8191,ft=ot,ft+=ct*$t,ft+=dt*Me,ft+=nt*Rt,ft+=Le*qt,ft+=Be*Bt,ot=ft>>>13,ft&=8191,ft+=Ke*(5*Pt),ft+=We*(5*It),ft+=ze*(5*kt),ft+=Qe*(5*Dt),ft+=Et*(5*Lt),ot+=ft>>>13,ft&=8191,et=ot,et+=ct*Lt,et+=dt*$t,et+=nt*Me,et+=Le*Rt,et+=Be*qt,ot=et>>>13,et&=8191,et+=Ke*Bt,et+=We*(5*Pt),et+=ze*(5*It),et+=Qe*(5*kt),et+=Et*(5*Dt),ot+=et>>>13,et&=8191,ht=ot,ht+=ct*Dt,ht+=dt*Lt,ht+=nt*$t,ht+=Le*Me,ht+=Be*Rt,ot=ht>>>13,ht&=8191,ht+=Ke*qt,ht+=We*Bt,ht+=ze*(5*Pt),ht+=Qe*(5*It),ht+=Et*(5*kt),ot+=ht>>>13,ht&=8191,it=ot,it+=ct*kt,it+=dt*Dt,it+=nt*Lt,it+=Le*$t,it+=Be*Me,ot=it>>>13,it&=8191,it+=Ke*Rt,it+=We*qt,it+=ze*Bt,it+=Qe*(5*Pt),it+=Et*(5*It),ot+=it>>>13,it&=8191,pt=ot,pt+=ct*It,pt+=dt*kt,pt+=nt*Dt,pt+=Le*Lt,pt+=Be*$t,ot=pt>>>13,pt&=8191,pt+=Ke*Me,pt+=We*Rt,pt+=ze*qt,pt+=Qe*Bt,pt+=Et*(5*Pt),ot+=pt>>>13,pt&=8191,at=ot,at+=ct*Pt,at+=dt*It,at+=nt*kt,at+=Le*Dt,at+=Be*Lt,ot=at>>>13,at&=8191,at+=Ke*$t,at+=We*Me,at+=ze*Rt,at+=Qe*qt,at+=Et*Bt,ot+=at>>>13,at&=8191,ot=(ot<<2)+ot|0,ot=ot+yt|0,yt=ot&8191,ot=ot>>>13,vt+=ot,ct=yt,dt=vt,nt=_t,Le=Ve,Be=ft,Ke=et,We=ht,ze=it,Qe=pt,Et=at,G+=16,re-=16;this.h[0]=ct,this.h[1]=dt,this.h[2]=nt,this.h[3]=Le,this.h[4]=Be,this.h[5]=Ke,this.h[6]=We,this.h[7]=ze,this.h[8]=Qe,this.h[9]=Et},te.prototype.finish=function(F,G){var re=new Uint16Array(10),K,ue,Ae,xe;if(this.leftover){for(xe=this.leftover,this.buffer[xe++]=1;xe<16;xe++)this.buffer[xe]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(K=this.h[1]>>>13,this.h[1]&=8191,xe=2;xe<10;xe++)this.h[xe]+=K,K=this.h[xe]>>>13,this.h[xe]&=8191;for(this.h[0]+=K*5,K=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=K,K=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=K,re[0]=this.h[0]+5,K=re[0]>>>13,re[0]&=8191,xe=1;xe<10;xe++)re[xe]=this.h[xe]+K,K=re[xe]>>>13,re[xe]&=8191;for(re[9]-=8192,ue=(K^1)-1,xe=0;xe<10;xe++)re[xe]&=ue;for(ue=~ue,xe=0;xe<10;xe++)this.h[xe]=this.h[xe]&ue|re[xe];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,Ae=this.h[0]+this.pad[0],this.h[0]=Ae&65535,xe=1;xe<8;xe++)Ae=(this.h[xe]+this.pad[xe]|0)+(Ae>>>16)|0,this.h[xe]=Ae&65535;F[G+0]=this.h[0]>>>0&255,F[G+1]=this.h[0]>>>8&255,F[G+2]=this.h[1]>>>0&255,F[G+3]=this.h[1]>>>8&255,F[G+4]=this.h[2]>>>0&255,F[G+5]=this.h[2]>>>8&255,F[G+6]=this.h[3]>>>0&255,F[G+7]=this.h[3]>>>8&255,F[G+8]=this.h[4]>>>0&255,F[G+9]=this.h[4]>>>8&255,F[G+10]=this.h[5]>>>0&255,F[G+11]=this.h[5]>>>8&255,F[G+12]=this.h[6]>>>0&255,F[G+13]=this.h[6]>>>8&255,F[G+14]=this.h[7]>>>0&255,F[G+15]=this.h[7]>>>8&255},te.prototype.update=function(F,G,re){var K,ue;if(this.leftover){for(ue=16-this.leftover,ue>re&&(ue=re),K=0;K<ue;K++)this.buffer[this.leftover+K]=F[G+K];if(re-=ue,G+=ue,this.leftover+=ue,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(re>=16&&(ue=re-re%16,this.blocks(F,G,ue),G+=ue,re-=ue),re){for(K=0;K<re;K++)this.buffer[this.leftover+K]=F[G+K];this.leftover+=re}};function k(F,G,re,K,ue,Ae){var xe=new te(Ae);return xe.update(re,K,ue),xe.finish(F,G),0}function q(F,G,re,K,ue,Ae){var xe=new Uint8Array(16);return k(xe,0,re,K,ue,Ae),L(F,G,xe,0)}function y(F,G,re,K,ue){var Ae;if(re<32)return-1;for(we(F,0,G,0,re,K,ue),k(F,16,F,32,re-32,F),Ae=0;Ae<16;Ae++)F[Ae]=0;return 0}function B(F,G,re,K,ue){var Ae,xe=new Uint8Array(32);if(re<32||(he(xe,0,32,K,ue),q(G,16,G,32,re-32,xe)!==0))return-1;for(we(F,0,G,0,re,K,ue),Ae=0;Ae<32;Ae++)F[Ae]=0;return 0}function $(F,G){var re;for(re=0;re<16;re++)F[re]=G[re]|0}function I(F){var G,re,K=1;for(G=0;G<16;G++)re=F[G]+K+65535,K=Math.floor(re/65536),F[G]=re-K*65536;F[0]+=K-1+37*(K-1)}function U(F,G,re){for(var K,ue=~(re-1),Ae=0;Ae<16;Ae++)K=ue&(F[Ae]^G[Ae]),F[Ae]^=K,G[Ae]^=K}function j(F,G){var re,K,ue,Ae=d(),xe=d();for(re=0;re<16;re++)xe[re]=G[re];for(I(xe),I(xe),I(xe),K=0;K<2;K++){for(Ae[0]=xe[0]-65517,re=1;re<15;re++)Ae[re]=xe[re]-65535-(Ae[re-1]>>16&1),Ae[re-1]&=65535;Ae[15]=xe[15]-32767-(Ae[14]>>16&1),ue=Ae[15]>>16&1,Ae[14]&=65535,U(xe,Ae,1-ue)}for(re=0;re<16;re++)F[2*re]=xe[re]&255,F[2*re+1]=xe[re]>>8}function D(F,G){var re=new Uint8Array(32),K=new Uint8Array(32);return j(re,F),j(K,G),O(re,0,K,0)}function W(F){var G=new Uint8Array(32);return j(G,F),G[0]&1}function R(F,G){var re;for(re=0;re<16;re++)F[re]=G[2*re]+(G[2*re+1]<<8);F[15]&=32767}function z(F,G,re){for(var K=0;K<16;K++)F[K]=G[K]+re[K]}function ye(F,G,re){for(var K=0;K<16;K++)F[K]=G[K]-re[K]}function Ce(F,G,re){var K,ue,Ae=0,xe=0,Te=0,Pe=0,Ue=0,Ne=0,At=0,ot=0,yt=0,vt=0,_t=0,Ve=0,ft=0,et=0,ht=0,it=0,pt=0,at=0,ct=0,dt=0,nt=0,Le=0,Be=0,Ke=0,We=0,ze=0,Qe=0,Et=0,Bt=0,qt=0,Rt=0,Me=re[0],$t=re[1],Lt=re[2],Dt=re[3],kt=re[4],It=re[5],Pt=re[6],Wt=re[7],Ot=re[8],Nt=re[9],Ut=re[10],Ft=re[11],jt=re[12],Ht=re[13],Kt=re[14],Vt=re[15];K=G[0],Ae+=K*Me,xe+=K*$t,Te+=K*Lt,Pe+=K*Dt,Ue+=K*kt,Ne+=K*It,At+=K*Pt,ot+=K*Wt,yt+=K*Ot,vt+=K*Nt,_t+=K*Ut,Ve+=K*Ft,ft+=K*jt,et+=K*Ht,ht+=K*Kt,it+=K*Vt,K=G[1],xe+=K*Me,Te+=K*$t,Pe+=K*Lt,Ue+=K*Dt,Ne+=K*kt,At+=K*It,ot+=K*Pt,yt+=K*Wt,vt+=K*Ot,_t+=K*Nt,Ve+=K*Ut,ft+=K*Ft,et+=K*jt,ht+=K*Ht,it+=K*Kt,pt+=K*Vt,K=G[2],Te+=K*Me,Pe+=K*$t,Ue+=K*Lt,Ne+=K*Dt,At+=K*kt,ot+=K*It,yt+=K*Pt,vt+=K*Wt,_t+=K*Ot,Ve+=K*Nt,ft+=K*Ut,et+=K*Ft,ht+=K*jt,it+=K*Ht,pt+=K*Kt,at+=K*Vt,K=G[3],Pe+=K*Me,Ue+=K*$t,Ne+=K*Lt,At+=K*Dt,ot+=K*kt,yt+=K*It,vt+=K*Pt,_t+=K*Wt,Ve+=K*Ot,ft+=K*Nt,et+=K*Ut,ht+=K*Ft,it+=K*jt,pt+=K*Ht,at+=K*Kt,ct+=K*Vt,K=G[4],Ue+=K*Me,Ne+=K*$t,At+=K*Lt,ot+=K*Dt,yt+=K*kt,vt+=K*It,_t+=K*Pt,Ve+=K*Wt,ft+=K*Ot,et+=K*Nt,ht+=K*Ut,it+=K*Ft,pt+=K*jt,at+=K*Ht,ct+=K*Kt,dt+=K*Vt,K=G[5],Ne+=K*Me,At+=K*$t,ot+=K*Lt,yt+=K*Dt,vt+=K*kt,_t+=K*It,Ve+=K*Pt,ft+=K*Wt,et+=K*Ot,ht+=K*Nt,it+=K*Ut,pt+=K*Ft,at+=K*jt,ct+=K*Ht,dt+=K*Kt,nt+=K*Vt,K=G[6],At+=K*Me,ot+=K*$t,yt+=K*Lt,vt+=K*Dt,_t+=K*kt,Ve+=K*It,ft+=K*Pt,et+=K*Wt,ht+=K*Ot,it+=K*Nt,pt+=K*Ut,at+=K*Ft,ct+=K*jt,dt+=K*Ht,nt+=K*Kt,Le+=K*Vt,K=G[7],ot+=K*Me,yt+=K*$t,vt+=K*Lt,_t+=K*Dt,Ve+=K*kt,ft+=K*It,et+=K*Pt,ht+=K*Wt,it+=K*Ot,pt+=K*Nt,at+=K*Ut,ct+=K*Ft,dt+=K*jt,nt+=K*Ht,Le+=K*Kt,Be+=K*Vt,K=G[8],yt+=K*Me,vt+=K*$t,_t+=K*Lt,Ve+=K*Dt,ft+=K*kt,et+=K*It,ht+=K*Pt,it+=K*Wt,pt+=K*Ot,at+=K*Nt,ct+=K*Ut,dt+=K*Ft,nt+=K*jt,Le+=K*Ht,Be+=K*Kt,Ke+=K*Vt,K=G[9],vt+=K*Me,_t+=K*$t,Ve+=K*Lt,ft+=K*Dt,et+=K*kt,ht+=K*It,it+=K*Pt,pt+=K*Wt,at+=K*Ot,ct+=K*Nt,dt+=K*Ut,nt+=K*Ft,Le+=K*jt,Be+=K*Ht,Ke+=K*Kt,We+=K*Vt,K=G[10],_t+=K*Me,Ve+=K*$t,ft+=K*Lt,et+=K*Dt,ht+=K*kt,it+=K*It,pt+=K*Pt,at+=K*Wt,ct+=K*Ot,dt+=K*Nt,nt+=K*Ut,Le+=K*Ft,Be+=K*jt,Ke+=K*Ht,We+=K*Kt,ze+=K*Vt,K=G[11],Ve+=K*Me,ft+=K*$t,et+=K*Lt,ht+=K*Dt,it+=K*kt,pt+=K*It,at+=K*Pt,ct+=K*Wt,dt+=K*Ot,nt+=K*Nt,Le+=K*Ut,Be+=K*Ft,Ke+=K*jt,We+=K*Ht,ze+=K*Kt,Qe+=K*Vt,K=G[12],ft+=K*Me,et+=K*$t,ht+=K*Lt,it+=K*Dt,pt+=K*kt,at+=K*It,ct+=K*Pt,dt+=K*Wt,nt+=K*Ot,Le+=K*Nt,Be+=K*Ut,Ke+=K*Ft,We+=K*jt,ze+=K*Ht,Qe+=K*Kt,Et+=K*Vt,K=G[13],et+=K*Me,ht+=K*$t,it+=K*Lt,pt+=K*Dt,at+=K*kt,ct+=K*It,dt+=K*Pt,nt+=K*Wt,Le+=K*Ot,Be+=K*Nt,Ke+=K*Ut,We+=K*Ft,ze+=K*jt,Qe+=K*Ht,Et+=K*Kt,Bt+=K*Vt,K=G[14],ht+=K*Me,it+=K*$t,pt+=K*Lt,at+=K*Dt,ct+=K*kt,dt+=K*It,nt+=K*Pt,Le+=K*Wt,Be+=K*Ot,Ke+=K*Nt,We+=K*Ut,ze+=K*Ft,Qe+=K*jt,Et+=K*Ht,Bt+=K*Kt,qt+=K*Vt,K=G[15],it+=K*Me,pt+=K*$t,at+=K*Lt,ct+=K*Dt,dt+=K*kt,nt+=K*It,Le+=K*Pt,Be+=K*Wt,Ke+=K*Ot,We+=K*Nt,ze+=K*Ut,Qe+=K*Ft,Et+=K*jt,Bt+=K*Ht,qt+=K*Kt,Rt+=K*Vt,Ae+=38*pt,xe+=38*at,Te+=38*ct,Pe+=38*dt,Ue+=38*nt,Ne+=38*Le,At+=38*Be,ot+=38*Ke,yt+=38*We,vt+=38*ze,_t+=38*Qe,Ve+=38*Et,ft+=38*Bt,et+=38*qt,ht+=38*Rt,ue=1,K=Ae+ue+65535,ue=Math.floor(K/65536),Ae=K-ue*65536,K=xe+ue+65535,ue=Math.floor(K/65536),xe=K-ue*65536,K=Te+ue+65535,ue=Math.floor(K/65536),Te=K-ue*65536,K=Pe+ue+65535,ue=Math.floor(K/65536),Pe=K-ue*65536,K=Ue+ue+65535,ue=Math.floor(K/65536),Ue=K-ue*65536,K=Ne+ue+65535,ue=Math.floor(K/65536),Ne=K-ue*65536,K=At+ue+65535,ue=Math.floor(K/65536),At=K-ue*65536,K=ot+ue+65535,ue=Math.floor(K/65536),ot=K-ue*65536,K=yt+ue+65535,ue=Math.floor(K/65536),yt=K-ue*65536,K=vt+ue+65535,ue=Math.floor(K/65536),vt=K-ue*65536,K=_t+ue+65535,ue=Math.floor(K/65536),_t=K-ue*65536,K=Ve+ue+65535,ue=Math.floor(K/65536),Ve=K-ue*65536,K=ft+ue+65535,ue=Math.floor(K/65536),ft=K-ue*65536,K=et+ue+65535,ue=Math.floor(K/65536),et=K-ue*65536,K=ht+ue+65535,ue=Math.floor(K/65536),ht=K-ue*65536,K=it+ue+65535,ue=Math.floor(K/65536),it=K-ue*65536,Ae+=ue-1+37*(ue-1),ue=1,K=Ae+ue+65535,ue=Math.floor(K/65536),Ae=K-ue*65536,K=xe+ue+65535,ue=Math.floor(K/65536),xe=K-ue*65536,K=Te+ue+65535,ue=Math.floor(K/65536),Te=K-ue*65536,K=Pe+ue+65535,ue=Math.floor(K/65536),Pe=K-ue*65536,K=Ue+ue+65535,ue=Math.floor(K/65536),Ue=K-ue*65536,K=Ne+ue+65535,ue=Math.floor(K/65536),Ne=K-ue*65536,K=At+ue+65535,ue=Math.floor(K/65536),At=K-ue*65536,K=ot+ue+65535,ue=Math.floor(K/65536),ot=K-ue*65536,K=yt+ue+65535,ue=Math.floor(K/65536),yt=K-ue*65536,K=vt+ue+65535,ue=Math.floor(K/65536),vt=K-ue*65536,K=_t+ue+65535,ue=Math.floor(K/65536),_t=K-ue*65536,K=Ve+ue+65535,ue=Math.floor(K/65536),Ve=K-ue*65536,K=ft+ue+65535,ue=Math.floor(K/65536),ft=K-ue*65536,K=et+ue+65535,ue=Math.floor(K/65536),et=K-ue*65536,K=ht+ue+65535,ue=Math.floor(K/65536),ht=K-ue*65536,K=it+ue+65535,ue=Math.floor(K/65536),it=K-ue*65536,Ae+=ue-1+37*(ue-1),F[0]=Ae,F[1]=xe,F[2]=Te,F[3]=Pe,F[4]=Ue,F[5]=Ne,F[6]=At,F[7]=ot,F[8]=yt,F[9]=vt,F[10]=_t,F[11]=Ve,F[12]=ft,F[13]=et,F[14]=ht,F[15]=it}function me(F,G){Ce(F,G,G)}function ie(F,G){var re=d(),K;for(K=0;K<16;K++)re[K]=G[K];for(K=253;K>=0;K--)me(re,re),K!==2&&K!==4&&Ce(re,re,G);for(K=0;K<16;K++)F[K]=re[K]}function ee(F,G){var re=d(),K;for(K=0;K<16;K++)re[K]=G[K];for(K=250;K>=0;K--)me(re,re),K!==1&&Ce(re,re,G);for(K=0;K<16;K++)F[K]=re[K]}function pe(F,G,re){var K=new Uint8Array(32),ue=new Float64Array(80),Ae,xe,Te=d(),Pe=d(),Ue=d(),Ne=d(),At=d(),ot=d();for(xe=0;xe<31;xe++)K[xe]=G[xe];for(K[31]=G[31]&127|64,K[0]&=248,R(ue,re),xe=0;xe<16;xe++)Pe[xe]=ue[xe],Ne[xe]=Te[xe]=Ue[xe]=0;for(Te[0]=Ne[0]=1,xe=254;xe>=0;--xe)Ae=K[xe>>>3]>>>(xe&7)&1,U(Te,Pe,Ae),U(Ue,Ne,Ae),z(At,Te,Ue),ye(Te,Te,Ue),z(Ue,Pe,Ne),ye(Pe,Pe,Ne),me(Ne,At),me(ot,Te),Ce(Te,Ue,Te),Ce(Ue,Pe,At),z(At,Te,Ue),ye(Te,Te,Ue),me(Pe,Te),ye(Ue,Ne,ot),Ce(Te,Ue,S),z(Te,Te,Ne),Ce(Ue,Ue,Te),Ce(Te,Ne,ot),Ce(Ne,Pe,ue),me(Pe,At),U(Te,Pe,Ae),U(Ue,Ne,Ae);for(xe=0;xe<16;xe++)ue[xe+16]=Te[xe],ue[xe+32]=Ue[xe],ue[xe+48]=Pe[xe],ue[xe+64]=Ne[xe];var yt=ue.subarray(32),vt=ue.subarray(16);return ie(yt,yt),Ce(vt,vt,yt),j(F,vt),0}function be(F,G){return pe(F,G,g)}function ae(F,G){return m(G,32),be(F,G)}function ne(F,G,re){var K=new Uint8Array(32);return pe(K,re,G),X(F,v,K,oe)}var Se=y,qe=B;function Ie(F,G,re,K,ue,Ae){var xe=new Uint8Array(32);return ne(xe,ue,Ae),Se(F,G,re,K,xe)}function Oe(F,G,re,K,ue,Ae){var xe=new Uint8Array(32);return ne(xe,ue,Ae),qe(F,G,re,K,xe)}var Fe=[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];function De(F,G,re,K){for(var ue=new Int32Array(16),Ae=new Int32Array(16),xe,Te,Pe,Ue,Ne,At,ot,yt,vt,_t,Ve,ft,et,ht,it,pt,at,ct,dt,nt,Le,Be,Ke,We,ze,Qe,Et=F[0],Bt=F[1],qt=F[2],Rt=F[3],Me=F[4],$t=F[5],Lt=F[6],Dt=F[7],kt=G[0],It=G[1],Pt=G[2],Wt=G[3],Ot=G[4],Nt=G[5],Ut=G[6],Ft=G[7],jt=0;K>=128;){for(dt=0;dt<16;dt++)nt=8*dt+jt,ue[dt]=re[nt+0]<<24|re[nt+1]<<16|re[nt+2]<<8|re[nt+3],Ae[dt]=re[nt+4]<<24|re[nt+5]<<16|re[nt+6]<<8|re[nt+7];for(dt=0;dt<80;dt++)if(xe=Et,Te=Bt,Pe=qt,Ue=Rt,Ne=Me,At=$t,ot=Lt,yt=Dt,vt=kt,_t=It,Ve=Pt,ft=Wt,et=Ot,ht=Nt,it=Ut,pt=Ft,Le=Dt,Be=Ft,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=(Me>>>14|Ot<<18)^(Me>>>18|Ot<<14)^(Ot>>>9|Me<<23),Be=(Ot>>>14|Me<<18)^(Ot>>>18|Me<<14)^(Me>>>9|Ot<<23),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Me&$t^~Me&Lt,Be=Ot&Nt^~Ot&Ut,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Fe[dt*2],Be=Fe[dt*2+1],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=ue[dt%16],Be=Ae[dt%16],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,at=ze&65535|Qe<<16,ct=Ke&65535|We<<16,Le=at,Be=ct,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=(Et>>>28|kt<<4)^(kt>>>2|Et<<30)^(kt>>>7|Et<<25),Be=(kt>>>28|Et<<4)^(Et>>>2|kt<<30)^(Et>>>7|kt<<25),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,Le=Et&Bt^Et&qt^Bt&qt,Be=kt&It^kt&Pt^It&Pt,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,yt=ze&65535|Qe<<16,pt=Ke&65535|We<<16,Le=Ue,Be=ft,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=at,Be=ct,Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,Ue=ze&65535|Qe<<16,ft=Ke&65535|We<<16,Bt=xe,qt=Te,Rt=Pe,Me=Ue,$t=Ne,Lt=At,Dt=ot,Et=yt,It=vt,Pt=_t,Wt=Ve,Ot=ft,Nt=et,Ut=ht,Ft=it,kt=pt,dt%16===15)for(nt=0;nt<16;nt++)Le=ue[nt],Be=Ae[nt],Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=ue[(nt+9)%16],Be=Ae[(nt+9)%16],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,at=ue[(nt+1)%16],ct=Ae[(nt+1)%16],Le=(at>>>1|ct<<31)^(at>>>8|ct<<24)^at>>>7,Be=(ct>>>1|at<<31)^(ct>>>8|at<<24)^(ct>>>7|at<<25),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,at=ue[(nt+14)%16],ct=Ae[(nt+14)%16],Le=(at>>>19|ct<<13)^(ct>>>29|at<<3)^at>>>6,Be=(ct>>>19|at<<13)^(at>>>29|ct<<3)^(ct>>>6|at<<26),Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,ue[nt]=ze&65535|Qe<<16,Ae[nt]=Ke&65535|We<<16;Le=Et,Be=kt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[0],Be=G[0],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[0]=Et=ze&65535|Qe<<16,G[0]=kt=Ke&65535|We<<16,Le=Bt,Be=It,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[1],Be=G[1],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[1]=Bt=ze&65535|Qe<<16,G[1]=It=Ke&65535|We<<16,Le=qt,Be=Pt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[2],Be=G[2],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[2]=qt=ze&65535|Qe<<16,G[2]=Pt=Ke&65535|We<<16,Le=Rt,Be=Wt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[3],Be=G[3],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[3]=Rt=ze&65535|Qe<<16,G[3]=Wt=Ke&65535|We<<16,Le=Me,Be=Ot,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[4],Be=G[4],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[4]=Me=ze&65535|Qe<<16,G[4]=Ot=Ke&65535|We<<16,Le=$t,Be=Nt,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[5],Be=G[5],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[5]=$t=ze&65535|Qe<<16,G[5]=Nt=Ke&65535|We<<16,Le=Lt,Be=Ut,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[6],Be=G[6],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[6]=Lt=ze&65535|Qe<<16,G[6]=Ut=Ke&65535|We<<16,Le=Dt,Be=Ft,Ke=Be&65535,We=Be>>>16,ze=Le&65535,Qe=Le>>>16,Le=F[7],Be=G[7],Ke+=Be&65535,We+=Be>>>16,ze+=Le&65535,Qe+=Le>>>16,We+=Ke>>>16,ze+=We>>>16,Qe+=ze>>>16,F[7]=Dt=ze&65535|Qe<<16,G[7]=Ft=Ke&65535|We<<16,jt+=128,K-=128}return K}function $e(F,G,re){var K=new Int32Array(8),ue=new Int32Array(8),Ae=new Uint8Array(256),xe,Te=re;for(K[0]=1779033703,K[1]=3144134277,K[2]=1013904242,K[3]=2773480762,K[4]=1359893119,K[5]=2600822924,K[6]=528734635,K[7]=1541459225,ue[0]=4089235720,ue[1]=2227873595,ue[2]=4271175723,ue[3]=1595750129,ue[4]=2917565137,ue[5]=725511199,ue[6]=4215389547,ue[7]=327033209,De(K,ue,G,re),re%=128,xe=0;xe<re;xe++)Ae[xe]=G[Te-re+xe];for(Ae[re]=128,re=256-128*(re<112?1:0),Ae[re-9]=0,A(Ae,re-8,Te/536870912|0,Te<<3),De(K,ue,Ae,re),xe=0;xe<8;xe++)A(F,8*xe,K[xe],ue[xe]);return 0}function je(F,G){var re=d(),K=d(),ue=d(),Ae=d(),xe=d(),Te=d(),Pe=d(),Ue=d(),Ne=d();ye(re,F[1],F[0]),ye(Ne,G[1],G[0]),Ce(re,re,Ne),z(K,F[0],F[1]),z(Ne,G[0],G[1]),Ce(K,K,Ne),Ce(ue,F[3],G[3]),Ce(ue,ue,b),Ce(Ae,F[2],G[2]),z(Ae,Ae,Ae),ye(xe,K,re),ye(Te,Ae,ue),z(Pe,Ae,ue),z(Ue,K,re),Ce(F[0],xe,Te),Ce(F[1],Ue,Pe),Ce(F[2],Pe,Te),Ce(F[3],xe,Ue)}function Ye(F,G,re){var K;for(K=0;K<4;K++)U(F[K],G[K],re)}function st(F,G){var re=d(),K=d(),ue=d();ie(ue,G[2]),Ce(re,G[0],ue),Ce(K,G[1],ue),j(F,K),F[31]^=W(re)<<7}function Je(F,G,re){var K,ue;for($(F[0],w),$(F[1],x),$(F[2],x),$(F[3],w),ue=255;ue>=0;--ue)K=re[ue/8|0]>>(ue&7)&1,Ye(F,G,K),je(G,F),je(F,F),Ye(F,G,K)}function Ge(F,G){var re=[d(),d(),d(),d()];$(re[0],C),$(re[1],E),$(re[2],x),Ce(re[3],C,E),Je(F,re,G)}function ut(F,G,re){var K=new Uint8Array(64),ue=[d(),d(),d(),d()],Ae;for(re||m(G,32),$e(K,G,32),K[0]&=248,K[31]&=127,K[31]|=64,Ge(ue,K),st(F,ue),Ae=0;Ae<32;Ae++)G[Ae+32]=F[Ae];return 0}var gt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function rt(F,G){var re,K,ue,Ae;for(K=63;K>=32;--K){for(re=0,ue=K-32,Ae=K-12;ue<Ae;++ue)G[ue]+=re-16*G[K]*gt[ue-(K-32)],re=Math.floor((G[ue]+128)/256),G[ue]-=re*256;G[ue]+=re,G[K]=0}for(re=0,ue=0;ue<32;ue++)G[ue]+=re-(G[31]>>4)*gt[ue],re=G[ue]>>8,G[ue]&=255;for(ue=0;ue<32;ue++)G[ue]-=re*gt[ue];for(K=0;K<32;K++)G[K+1]+=G[K]>>8,F[K]=G[K]&255}function wt(F){var G=new Float64Array(64),re;for(re=0;re<64;re++)G[re]=F[re];for(re=0;re<64;re++)F[re]=0;rt(F,G)}function bt(F,G,re,K){var ue=new Uint8Array(64),Ae=new Uint8Array(64),xe=new Uint8Array(64),Te,Pe,Ue=new Float64Array(64),Ne=[d(),d(),d(),d()];$e(ue,K,32),ue[0]&=248,ue[31]&=127,ue[31]|=64;var At=re+64;for(Te=0;Te<re;Te++)F[64+Te]=G[Te];for(Te=0;Te<32;Te++)F[32+Te]=ue[32+Te];for($e(xe,F.subarray(32),re+32),wt(xe),Ge(Ne,xe),st(F,Ne),Te=32;Te<64;Te++)F[Te]=K[Te];for($e(Ae,F,re+64),wt(Ae),Te=0;Te<64;Te++)Ue[Te]=0;for(Te=0;Te<32;Te++)Ue[Te]=xe[Te];for(Te=0;Te<32;Te++)for(Pe=0;Pe<32;Pe++)Ue[Te+Pe]+=Ae[Te]*ue[Pe];return rt(F.subarray(32),Ue),At}function le(F,G){var re=d(),K=d(),ue=d(),Ae=d(),xe=d(),Te=d(),Pe=d();return $(F[2],x),R(F[1],G),me(ue,F[1]),Ce(Ae,ue,_),ye(ue,ue,F[2]),z(Ae,F[2],Ae),me(xe,Ae),me(Te,xe),Ce(Pe,Te,xe),Ce(re,Pe,ue),Ce(re,re,Ae),ee(re,re),Ce(re,re,ue),Ce(re,re,Ae),Ce(re,re,Ae),Ce(F[0],re,Ae),me(K,F[0]),Ce(K,K,Ae),D(K,ue)&&Ce(F[0],F[0],M),me(K,F[0]),Ce(K,K,Ae),D(K,ue)?-1:(W(F[0])===G[31]>>7&&ye(F[0],w,F[0]),Ce(F[3],F[0],F[1]),0)}function Z(F,G,re,K){var ue,Ae=new Uint8Array(32),xe=new Uint8Array(64),Te=[d(),d(),d(),d()],Pe=[d(),d(),d(),d()];if(re<64||le(Pe,K))return-1;for(ue=0;ue<re;ue++)F[ue]=G[ue];for(ue=0;ue<32;ue++)F[ue+32]=K[ue];if($e(xe,F,re),wt(xe),Je(Te,Pe,xe),Ge(Pe,G.subarray(32)),je(Te,Pe),st(Ae,Te),re-=64,O(G,0,Ae,0)){for(ue=0;ue<re;ue++)F[ue]=0;return-1}for(ue=0;ue<re;ue++)F[ue]=G[ue+64];return re}var J=32,ge=24,Ee=32,Re=16,ke=32,Xe=32,He=32,Ze=32,xt=32,tt=ge,mt=Ee,Tt=Re,St=64,lt=32,Mt=64,Ct=32,ce=64;f.lowlevel={crypto_core_hsalsa20:X,crypto_stream_xor:we,crypto_stream:he,crypto_stream_salsa20_xor:se,crypto_stream_salsa20:de,crypto_onetimeauth:k,crypto_onetimeauth_verify:q,crypto_verify_16:L,crypto_verify_32:O,crypto_secretbox:y,crypto_secretbox_open:B,crypto_scalarmult:pe,crypto_scalarmult_base:be,crypto_box_beforenm:ne,crypto_box_afternm:Se,crypto_box:Ie,crypto_box_open:Oe,crypto_box_keypair:ae,crypto_hash:$e,crypto_sign:bt,crypto_sign_keypair:ut,crypto_sign_open:Z,crypto_secretbox_KEYBYTES:J,crypto_secretbox_NONCEBYTES:ge,crypto_secretbox_ZEROBYTES:Ee,crypto_secretbox_BOXZEROBYTES:Re,crypto_scalarmult_BYTES:ke,crypto_scalarmult_SCALARBYTES:Xe,crypto_box_PUBLICKEYBYTES:He,crypto_box_SECRETKEYBYTES:Ze,crypto_box_BEFORENMBYTES:xt,crypto_box_NONCEBYTES:tt,crypto_box_ZEROBYTES:mt,crypto_box_BOXZEROBYTES:Tt,crypto_sign_BYTES:St,crypto_sign_PUBLICKEYBYTES:lt,crypto_sign_SECRETKEYBYTES:Mt,crypto_sign_SEEDBYTES:Ct,crypto_hash_BYTES:ce,gf:d,D:_,L:gt,pack25519:j,unpack25519:R,M:Ce,A:z,S:me,Z:ye,pow2523:ee,add:je,set25519:$,modL:rt,scalarmult:Je,scalarbase:Ge};function Y(F,G){if(F.length!==J)throw new Error("bad key size");if(G.length!==ge)throw new Error("bad nonce size")}function Q(F,G){if(F.length!==He)throw new Error("bad public key size");if(G.length!==Ze)throw new Error("bad secret key size")}function ve(){for(var F=0;F<arguments.length;F++)if(!(arguments[F]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function fe(F){for(var G=0;G<F.length;G++)F[G]=0}f.randomBytes=function(F){var G=new Uint8Array(F);return m(G,F),G},f.secretbox=function(F,G,re){ve(F,G,re),Y(re,G);for(var K=new Uint8Array(Ee+F.length),ue=new Uint8Array(K.length),Ae=0;Ae<F.length;Ae++)K[Ae+Ee]=F[Ae];return y(ue,K,K.length,G,re),ue.subarray(Re)},f.secretbox.open=function(F,G,re){ve(F,G,re),Y(re,G);for(var K=new Uint8Array(Re+F.length),ue=new Uint8Array(K.length),Ae=0;Ae<F.length;Ae++)K[Ae+Re]=F[Ae];return K.length<32||B(ue,K,K.length,G,re)!==0?null:ue.subarray(Ee)},f.secretbox.keyLength=J,f.secretbox.nonceLength=ge,f.secretbox.overheadLength=Re,f.scalarMult=function(F,G){if(ve(F,G),F.length!==Xe)throw new Error("bad n size");if(G.length!==ke)throw new Error("bad p size");var re=new Uint8Array(ke);return pe(re,F,G),re},f.scalarMult.base=function(F){if(ve(F),F.length!==Xe)throw new Error("bad n size");var G=new Uint8Array(ke);return be(G,F),G},f.scalarMult.scalarLength=Xe,f.scalarMult.groupElementLength=ke,f.box=function(F,G,re,K){var ue=f.box.before(re,K);return f.secretbox(F,G,ue)},f.box.before=function(F,G){ve(F,G),Q(F,G);var re=new Uint8Array(xt);return ne(re,F,G),re},f.box.after=f.secretbox,f.box.open=function(F,G,re,K){var ue=f.box.before(re,K);return f.secretbox.open(F,G,ue)},f.box.open.after=f.secretbox.open,f.box.keyPair=function(){var F=new Uint8Array(He),G=new Uint8Array(Ze);return ae(F,G),{publicKey:F,secretKey:G}},f.box.keyPair.fromSecretKey=function(F){if(ve(F),F.length!==Ze)throw new Error("bad secret key size");var G=new Uint8Array(He);return be(G,F),{publicKey:G,secretKey:new Uint8Array(F)}},f.box.publicKeyLength=He,f.box.secretKeyLength=Ze,f.box.sharedKeyLength=xt,f.box.nonceLength=tt,f.box.overheadLength=f.secretbox.overheadLength,f.sign=function(F,G){if(ve(F,G),G.length!==Mt)throw new Error("bad secret key size");var re=new Uint8Array(St+F.length);return bt(re,F,F.length,G),re},f.sign.open=function(F,G){if(ve(F,G),G.length!==lt)throw new Error("bad public key size");var re=new Uint8Array(F.length),K=Z(re,F,F.length,G);if(K<0)return null;for(var ue=new Uint8Array(K),Ae=0;Ae<ue.length;Ae++)ue[Ae]=re[Ae];return ue},f.sign.detached=function(F,G){for(var re=f.sign(F,G),K=new Uint8Array(St),ue=0;ue<K.length;ue++)K[ue]=re[ue];return K},f.sign.detached.verify=function(F,G,re){if(ve(F,G,re),G.length!==St)throw new Error("bad signature size");if(re.length!==lt)throw new Error("bad public key size");var K=new Uint8Array(St+F.length),ue=new Uint8Array(St+F.length),Ae;for(Ae=0;Ae<St;Ae++)K[Ae]=G[Ae];for(Ae=0;Ae<F.length;Ae++)K[Ae+St]=F[Ae];return Z(ue,K,K.length,re)>=0},f.sign.keyPair=function(){var F=new Uint8Array(lt),G=new Uint8Array(Mt);return ut(F,G),{publicKey:F,secretKey:G}},f.sign.keyPair.fromSecretKey=function(F){if(ve(F),F.length!==Mt)throw new Error("bad secret key size");for(var G=new Uint8Array(lt),re=0;re<G.length;re++)G[re]=F[32+re];return{publicKey:G,secretKey:new Uint8Array(F)}},f.sign.keyPair.fromSeed=function(F){if(ve(F),F.length!==Ct)throw new Error("bad seed size");for(var G=new Uint8Array(lt),re=new Uint8Array(Mt),K=0;K<32;K++)re[K]=F[K];return ut(G,re,!0),{publicKey:G,secretKey:re}},f.sign.publicKeyLength=lt,f.sign.secretKeyLength=Mt,f.sign.seedLength=Ct,f.sign.signatureLength=St,f.hash=function(F){ve(F);var G=new Uint8Array(ce);return $e(G,F,F.length),G},f.hash.hashLength=ce,f.verify=function(F,G){return ve(F,G),F.length===0||G.length===0||F.length!==G.length?!1:T(F,0,G,0,F.length)===0},f.setPRNG=function(F){m=F},(function(){var F=typeof self<"u"?self.crypto||self.msCrypto:null;if(F&&F.getRandomValues){var G=65536;f.setPRNG(function(re,K){var ue,Ae=new Uint8Array(K);for(ue=0;ue<K;ue+=G)F.getRandomValues(Ae.subarray(ue,ue+Math.min(K-ue,G)));for(ue=0;ue<K;ue++)re[ue]=Ae[ue];fe(Ae)})}else typeof commonjsRequire<"u"&&(F=requireCryptoBrowserify(),F&&F.randomBytes&&f.setPRNG(function(re,K){var ue,Ae=F.randomBytes(K);for(ue=0;ue<K;ue++)re[ue]=Ae[ue];fe(Ae)}))})()})(r.exports?r.exports:self.nacl=self.nacl||{})})(naclFast)),naclFast.exports}var naclFastExports=requireNaclFast();const nacl$1=getDefaultExportFromCjs(naclFastExports);var CONNECT_EVENT_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.MANIFEST_NOT_FOUND_ERROR=2]="MANIFEST_NOT_FOUND_ERROR",r[r.MANIFEST_CONTENT_ERROR=3]="MANIFEST_CONTENT_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(CONNECT_EVENT_ERROR_CODES||(CONNECT_EVENT_ERROR_CODES={}));var CONNECT_ITEM_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(CONNECT_ITEM_ERROR_CODES||(CONNECT_ITEM_ERROR_CODES={}));var SEND_TRANSACTION_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(SEND_TRANSACTION_ERROR_CODES||(SEND_TRANSACTION_ERROR_CODES={}));var SIGN_DATA_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(SIGN_DATA_ERROR_CODES||(SIGN_DATA_ERROR_CODES={}));var DISCONNECT_ERROR_CODES;(function(r){r[r.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",r[r.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",r[r.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",r[r.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"})(DISCONNECT_ERROR_CODES||(DISCONNECT_ERROR_CODES={}));var CHAIN;(function(r){r.MAINNET="-239",r.TESTNET="-3"})(CHAIN||(CHAIN={}));function encodeUint8Array(r,f){const d=nacl.encodeBase64(r);return f?encodeURIComponent(d):d}function decodeToUint8Array(r,f){return f&&(r=decodeURIComponent(r)),nacl.decodeBase64(r)}function encode(r,f=!1){let d;return r instanceof Uint8Array?d=r:(typeof r!="string"&&(r=JSON.stringify(r)),d=nacl.decodeUTF8(r)),encodeUint8Array(d,f)}function decode(r,f=!1){const d=decodeToUint8Array(r,f);return{toString(){return nacl.encodeUTF8(d)},toObject(){try{return JSON.parse(nacl.encodeUTF8(d))}catch{return null}},toUint8Array(){return d}}}const Base64={encode,decode};function concatUint8Arrays(r,f){const d=new Uint8Array(r.length+f.length);return d.set(r),d.set(f,r.length),d}function splitToUint8Arrays(r,f){if(f>=r.length)throw new Error("Index is out of buffer");const d=r.slice(0,f),m=r.slice(f);return[d,m]}function toHexString(r){let f="";return r.forEach(d=>{f+=("0"+(d&255).toString(16)).slice(-2)}),f}function hexToByteArray(r){if(r.length%2!==0)throw new Error(`Cannot convert ${r} to bytesArray`);const f=new Uint8Array(r.length/2);for(let d=0;d<r.length;d+=2)f[d/2]=parseInt(r.slice(d,d+2),16);return f}class SessionCrypto{constructor(f){this.nonceLength=24,this.keyPair=f?this.createKeypairFromString(f):this.createKeypair(),this.sessionId=toHexString(this.keyPair.publicKey)}createKeypair(){return nacl$1.box.keyPair()}createKeypairFromString(f){return{publicKey:hexToByteArray(f.publicKey),secretKey:hexToByteArray(f.secretKey)}}createNonce(){return nacl$1.randomBytes(this.nonceLength)}encrypt(f,d){const m=new TextEncoder().encode(f),v=this.createNonce(),g=nacl$1.box(m,v,d,this.keyPair.secretKey);return concatUint8Arrays(v,g)}decrypt(f,d){const[m,v]=splitToUint8Arrays(f,this.nonceLength),g=nacl$1.box.open(v,m,d,this.keyPair.secretKey);if(!g)throw new Error(`Decryption error:
33
33
  message: ${f.toString()}
34
34
  sender pubkey: ${d.toString()}
35
35
  keypair pubkey: ${this.keyPair.publicKey.toString()}
@@ -47,7 +47,7 @@ https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={D
47
47
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
48
48
  PERFORMANCE OF THIS SOFTWARE.
49
49
  ***************************************************************************** */function __rest(r,f){var d={};for(var m in r)Object.prototype.hasOwnProperty.call(r,m)&&f.indexOf(m)<0&&(d[m]=r[m]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,m=Object.getOwnPropertySymbols(r);v<m.length;v++)f.indexOf(m[v])<0&&Object.prototype.propertyIsEnumerable.call(r,m[v])&&(d[m[v]]=r[m[v]]);return d}function __awaiter(r,f,d,m){function v(g){return g instanceof d?g:new d(function(w){w(g)})}return new(d||(d=Promise))(function(g,w){function x(b){try{_(m.next(b))}catch(C){w(C)}}function S(b){try{_(m.throw(b))}catch(C){w(C)}}function _(b){b.done?g(b.value):v(b.value).then(x,S)}_((m=m.apply(r,[])).next())})}class TonConnectError extends Error{constructor(f,d){super(f,d),this.message=`${TonConnectError.prefix} ${this.constructor.name}${this.info?": "+this.info:""}${f?`
50
- `+f:""}`,Object.setPrototypeOf(this,TonConnectError.prototype)}get info(){return""}}TonConnectError.prefix="[TON_CONNECT_SDK_ERROR]";class DappMetadataError extends TonConnectError{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,DappMetadataError.prototype)}}class ManifestContentErrorError extends TonConnectError{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...f){super(...f),Object.setPrototypeOf(this,ManifestContentErrorError.prototype)}}class ManifestNotFoundError extends TonConnectError{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...f){super(...f),Object.setPrototypeOf(this,ManifestNotFoundError.prototype)}}class WalletAlreadyConnectedError extends TonConnectError{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletAlreadyConnectedError.prototype)}}class WalletNotConnectedError extends TonConnectError{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletNotConnectedError.prototype)}}class WalletNotInjectedError extends TonConnectError{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletNotInjectedError.prototype)}}class WalletNotSupportFeatureError extends TonConnectError{get info(){return"Wallet doesn't support requested feature method."}constructor(f,d){super(f,d),Object.setPrototypeOf(this,WalletNotSupportFeatureError.prototype)}}class WalletMissingRequiredFeaturesError extends TonConnectError{get info(){return"Missing required features. You need to update your wallet."}constructor(f,d){super(f,d),Object.setPrototypeOf(this,WalletMissingRequiredFeaturesError.prototype)}}function isWalletConnectionSourceJS(r){return"jsBridgeKey"in r}class UserRejectsError extends TonConnectError{get info(){return"User rejects the action in the wallet."}constructor(...f){super(...f),Object.setPrototypeOf(this,UserRejectsError.prototype)}}class BadRequestError extends TonConnectError{get info(){return"Request to the wallet contains errors."}constructor(...f){super(...f),Object.setPrototypeOf(this,BadRequestError.prototype)}}class UnknownAppError extends TonConnectError{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...f){super(...f),Object.setPrototypeOf(this,UnknownAppError.prototype)}}class FetchWalletsError extends TonConnectError{get info(){return"An error occurred while fetching the wallets list."}constructor(...f){super(...f),Object.setPrototypeOf(this,FetchWalletsError.prototype)}}class WrongAddressError extends TonConnectError{get info(){return"Passed address is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,WrongAddressError.prototype)}}class ParseHexError extends TonConnectError{get info(){return"Passed hex is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,ParseHexError.prototype)}}class UnknownError extends TonConnectError{constructor(...f){super(...f),Object.setPrototypeOf(this,UnknownError.prototype)}}const connectEventErrorsCodes={[CONNECT_EVENT_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[CONNECT_EVENT_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_NOT_FOUND_ERROR]:ManifestNotFoundError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_CONTENT_ERROR]:ManifestContentErrorError};class ConnectErrorsParser{parseError(f){let d=UnknownError;return f.code in connectEventErrorsCodes&&(d=connectEventErrorsCodes[f.code]||UnknownError),new d(f.message)}}const connectErrorsParser=new ConnectErrorsParser;class RpcParser{isError(f){return"error"in f}}const sendTransactionErrors={[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SendTransactionParser extends RpcParser{convertToRpcRequest(f){return{method:"sendTransaction",params:[JSON.stringify(f)]}}parseAndThrowError(f){let d=UnknownError;throw f.error.code in sendTransactionErrors&&(d=sendTransactionErrors[f.error.code]||UnknownError),new d(f.error.message)}convertFromRpcResponse(f){return{boc:f.result}}}const sendTransactionParser=new SendTransactionParser,signDataErrors={[SIGN_DATA_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SIGN_DATA_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SIGN_DATA_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SIGN_DATA_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SignDataParser extends RpcParser{convertToRpcRequest(f){return{method:"signData",params:[JSON.stringify(f)]}}parseAndThrowError(f){let d=UnknownError;throw f.error.code in signDataErrors&&(d=signDataErrors[f.error.code]||UnknownError),new d(f.error.message)}convertFromRpcResponse(f){return f.result}}const signDataParser=new SignDataParser;class HttpBridgeGatewayStorage{constructor(f,d){this.storage=f,this.storeKey="ton-connect-storage_http-bridge-gateway::"+d}storeLastEventId(f){return __awaiter(this,void 0,void 0,function*(){return this.storage.setItem(this.storeKey,f)})}removeLastEventId(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);return f||null})}}function removeUrlLastSlash(r){return r.slice(-1)==="/"?r.slice(0,-1):r}function addPathToUrl(r,f){return removeUrlLastSlash(r)+"/"+f}function isTelegramUrl(r){if(!r)return!1;const f=new URL(r);return f.protocol==="tg:"||f.hostname==="t.me"}function encodeTelegramUrlParameters(r){return r.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function delay(r,f){return __awaiter(this,void 0,void 0,function*(){return new Promise((d,m)=>{var v,g;if(!((v=void 0)===null||v===void 0)&&v.aborted){m(new TonConnectError("Delay aborted"));return}const w=setTimeout(()=>d(),r);(g=void 0)===null||g===void 0||g.addEventListener("abort",()=>{clearTimeout(w),m(new TonConnectError("Delay aborted"))})})})}function createAbortController(r){const f=new AbortController;return r!=null&&r.aborted?f.abort():r==null||r.addEventListener("abort",()=>f.abort(),{once:!0}),f}function callForSuccess(r,f){var d,m;return __awaiter(this,void 0,void 0,function*(){const v=(d=f==null?void 0:f.attempts)!==null&&d!==void 0?d:10,g=(m=f==null?void 0:f.delayMs)!==null&&m!==void 0?m:200,w=createAbortController(f==null?void 0:f.signal);if(typeof r!="function")throw new TonConnectError(`Expected a function, got ${typeof r}`);let x=0,S;for(;x<v;){if(w.signal.aborted)throw new TonConnectError(`Aborted after attempts ${x}`);try{return yield r({signal:w.signal})}catch(_){S=_,x++,x<v&&(yield delay(g))}}throw S})}function logDebug$1(...r){}function logError$1(...r){}function logWarning$1(...r){}function createResource$1(r,f){let d=null,m=null,v=null,g=null,w=null;const x=(C,...E)=>__awaiter(this,void 0,void 0,function*(){if(g=C??null,w==null||w.abort(),w=createAbortController(C),w.signal.aborted)throw new TonConnectError("Resource creation was aborted");m=E??null;const M=r(w.signal,...E);v=M;const A=yield M;if(v!==M&&A!==d)throw yield f(A),new TonConnectError("Resource creation was aborted by a new resource creation");return d=A,d});return{create:x,current:()=>d??null,dispose:()=>__awaiter(this,void 0,void 0,function*(){try{const C=d;d=null;const E=v;v=null;try{w==null||w.abort()}catch{}yield Promise.allSettled([C?f(C):Promise.resolve(),E?f(yield E):Promise.resolve()])}catch{}}),recreate:C=>__awaiter(this,void 0,void 0,function*(){const E=d,M=v,A=m,T=g;if(yield delay(C),E===d&&M===v&&A===m&&T===g)return yield x(g,...A??[]);throw new TonConnectError("Resource recreation was aborted by a new resource creation")})}}function timeout(r,f){const d=f==null?void 0:f.timeout,m=f==null?void 0:f.signal,v=createAbortController(m);return new Promise((g,w)=>__awaiter(this,void 0,void 0,function*(){if(v.signal.aborted){w(new TonConnectError("Operation aborted"));return}let x;typeof d<"u"&&(x=setTimeout(()=>{v.abort(),w(new TonConnectError(`Timeout after ${d}ms`))},d)),v.signal.addEventListener("abort",()=>{clearTimeout(x),w(new TonConnectError("Operation aborted"))},{once:!0});const S={timeout:d,abort:v.signal};yield r((..._)=>{clearTimeout(x),g(..._)},()=>{clearTimeout(x),w()},S)}))}class BridgeGateway{constructor(f,d,m,v,g){this.bridgeUrl=d,this.sessionId=m,this.listener=v,this.errorsListener=g,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=createResource$1((w,x)=>__awaiter(this,void 0,void 0,function*(){const S={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:w,openingDeadlineMS:x};return yield createEventSource(S)}),w=>__awaiter(this,void 0,void 0,function*(){w.close()})),this.bridgeGatewayStorage=new HttpBridgeGatewayStorage(f,d)}get isReady(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)===EventSource.OPEN}get isClosed(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)!==EventSource.OPEN}get isConnecting(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)===EventSource.CONNECTING}registerSession(f){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.create(f==null?void 0:f.signal,f==null?void 0:f.openingDeadlineMS)})}send(f,d,m,v){var g;return __awaiter(this,void 0,void 0,function*(){const w={};typeof v=="number"?w.ttl=v:(w.ttl=v==null?void 0:v.ttl,w.signal=v==null?void 0:v.signal,w.attempts=v==null?void 0:v.attempts);const x=new URL(addPathToUrl(this.bridgeUrl,this.postPath));x.searchParams.append("client_id",this.sessionId),x.searchParams.append("to",d),x.searchParams.append("ttl",((w==null?void 0:w.ttl)||this.defaultTtl).toString()),x.searchParams.append("topic",m);const S=Base64.encode(f);yield callForSuccess(_=>__awaiter(this,void 0,void 0,function*(){const b=yield this.post(x,S,_.signal);if(!b.ok)throw new TonConnectError(`Bridge send failed, status ${b.status}`)}),{attempts:(g=w==null?void 0:w.attempts)!==null&&g!==void 0?g:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:w==null?void 0:w.signal})})}pause(){this.eventSource.dispose().catch(f=>logError$1(`Bridge pause failed, ${f}`))}unPause(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(f=>logError$1(`Bridge close failed, ${f}`))})}setListener(f){this.listener=f}setErrorsListener(f){this.errorsListener=f}post(f,d,m){return __awaiter(this,void 0,void 0,function*(){const v=yield fetch(f,{method:"post",body:d,signal:m});if(!v.ok)throw new TonConnectError(`Bridge send failed, status ${v.status}`);return v})}errorsHandler(f,d){return __awaiter(this,void 0,void 0,function*(){if(this.isConnecting)throw f.close(),new TonConnectError("Bridge error, failed to connect");if(this.isReady){try{this.errorsListener(d)}catch{}return}if(this.isClosed)return f.close(),logDebug$1(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new TonConnectError("Bridge error, unknown state")})}messagesHandler(f){return __awaiter(this,void 0,void 0,function*(){if(f.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(f.lastEventId),this.isClosed))return;let d;try{d=JSON.parse(f.data)}catch{throw new TonConnectError(`Bridge message parse failed, message ${f.data}`)}this.listener(d)})}}function createEventSource(r){return __awaiter(this,void 0,void 0,function*(){return yield timeout((f,d,m)=>__awaiter(this,void 0,void 0,function*(){var v;const w=createAbortController(m.signal).signal;if(w.aborted){d(new TonConnectError("Bridge connection aborted"));return}const x=new URL(addPathToUrl(r.bridgeUrl,r.ssePath));x.searchParams.append("client_id",r.sessionId);const S=yield r.bridgeGatewayStorage.getLastEventId();if(S&&x.searchParams.append("last_event_id",S),w.aborted){d(new TonConnectError("Bridge connection aborted"));return}const _=new EventSource(x.toString());_.onerror=b=>__awaiter(this,void 0,void 0,function*(){if(w.aborted){_.close(),d(new TonConnectError("Bridge connection aborted"));return}try{const C=yield r.errorHandler(_,b);C!==_&&_.close(),C&&C!==_&&f(C)}catch(C){_.close(),d(C)}}),_.onopen=()=>{if(w.aborted){_.close(),d(new TonConnectError("Bridge connection aborted"));return}f(_)},_.onmessage=b=>{if(w.aborted){_.close(),d(new TonConnectError("Bridge connection aborted"));return}r.messageHandler(b)},(v=r.signal)===null||v===void 0||v.addEventListener("abort",()=>{_.close(),d(new TonConnectError("Bridge connection aborted"))})}),{timeout:r.openingDeadlineMS,signal:r.signal})})}const CONNECTION_HTTP_EXPIRATION_TIME=300*1e3;function isPendingConnectionHttp(r){return!("connectEvent"in r)}function isPendingConnectionHttpRaw(r){return!("connectEvent"in r)}function isExpiredPendingConnectionHttpRaw(r){var f;return Date.now()-((f=r.createdAt)!==null&&f!==void 0?f:0)>CONNECTION_HTTP_EXPIRATION_TIME}class BridgeConnectionStorage{constructor(f){this.storage=f,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(f){return __awaiter(this,void 0,void 0,function*(){if(f.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(f));if(!isPendingConnectionHttp(f)){const m={sessionKeyPair:f.session.sessionCrypto.stringifyKeypair(),walletPublicKey:f.session.walletPublicKey,bridgeUrl:f.session.bridgeUrl},v={type:"http",connectEvent:f.connectEvent,session:m,lastWalletEventId:f.lastWalletEventId,nextRpcRequestId:f.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(v))}const d={type:"http",connectionSource:f.connectionSource,sessionCrypto:f.sessionCrypto.stringifyKeypair(),createdAt:Date.now()};return this.storage.setItem(this.storeKey,JSON.stringify(d))})}removeConnection(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);if(!f)return null;const d=JSON.parse(f);if(d.type==="injected")return d;if(!isPendingConnectionHttpRaw(d)){const m=new SessionCrypto(d.session.sessionKeyPair);return{type:"http",connectEvent:d.connectEvent,lastWalletEventId:d.lastWalletEventId,nextRpcRequestId:d.nextRpcRequestId,session:{sessionCrypto:m,bridgeUrl:d.session.bridgeUrl,walletPublicKey:d.session.walletPublicKey}}}return isExpiredPendingConnectionHttpRaw(d)?(yield this.removeConnection(),null):{type:"http",sessionCrypto:new SessionCrypto(d.sessionCrypto),connectionSource:d.connectionSource}})}getHttpConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(f.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");return f})}getHttpPendingConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(f.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");if(!isPendingConnectionHttp(f))throw new TonConnectError("Trying to read HTTP-pending connection while http connection is stored");return f})}getInjectedConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read Injected bridge connection source while nothing is stored");if((f==null?void 0:f.type)==="http")throw new TonConnectError("Trying to read Injected bridge connection source while HTTP connection is stored");return f})}storedConnectionType(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);return f?JSON.parse(f).type:null})}storeLastWalletEventId(f){return __awaiter(this,void 0,void 0,function*(){const d=yield this.getConnection();if(d&&d.type==="http"&&!isPendingConnectionHttp(d))return d.lastWalletEventId=f,this.storeConnection(d)})}getLastWalletEventId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(f&&"lastWalletEventId"in f)return f.lastWalletEventId})}increaseNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(f&&"nextRpcRequestId"in f){const d=f.nextRpcRequestId||0;return f.nextRpcRequestId=d+1,this.storeConnection(f)}})}getNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();return f&&"nextRpcRequestId"in f&&f.nextRpcRequestId||0})}}const PROTOCOL_VERSION=2;class BridgeProvider{constructor(f,d){this.storage=f,this.walletConnectionSource=d,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new BridgeConnectionStorage(f)}static fromStorage(f){return __awaiter(this,void 0,void 0,function*(){const m=yield new BridgeConnectionStorage(f).getHttpConnection();return isPendingConnectionHttp(m)?new BridgeProvider(f,m.connectionSource):new BridgeProvider(f,{bridgeUrl:m.session.bridgeUrl})})}connect(f,d){var m;const v=createAbortController(d==null?void 0:d.signal);(m=this.abortController)===null||m===void 0||m.abort(),this.abortController=v,this.closeGateways();const g=new SessionCrypto;this.session={sessionCrypto:g,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:g}).then(()=>__awaiter(this,void 0,void 0,function*(){v.signal.aborted||(yield callForSuccess(x=>{var S;return this.openGateways(g,{openingDeadlineMS:(S=d==null?void 0:d.openingDeadlineMS)!==null&&S!==void 0?S:this.defaultOpeningDeadlineMS,signal:x==null?void 0:x.signal})},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:v.signal}))}));const w="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(w,f)}restoreConnection(f){var d,m;return __awaiter(this,void 0,void 0,function*(){const v=createAbortController(f==null?void 0:f.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=v,v.signal.aborted)return;this.closeGateways();const g=yield this.connectionStorage.getHttpConnection();if(!g||v.signal.aborted)return;const w=(m=f==null?void 0:f.openingDeadlineMS)!==null&&m!==void 0?m:this.defaultOpeningDeadlineMS;if(isPendingConnectionHttp(g))return this.session={sessionCrypto:g.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(g.sessionCrypto,{openingDeadlineMS:w,signal:v==null?void 0:v.signal});if(Array.isArray(this.walletConnectionSource))throw new TonConnectError("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=g.session,this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,g.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!v.signal.aborted){this.listeners.forEach(x=>x(g.connectEvent));try{yield callForSuccess(x=>this.gateway.registerSession({openingDeadlineMS:w,signal:x.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:v.signal})}catch{yield this.disconnect({signal:v.signal});return}}})}sendRequest(f,d){const m={};return typeof d=="function"?m.onRequestSent=d:(m.onRequestSent=d==null?void 0:d.onRequestSent,m.signal=d==null?void 0:d.signal,m.attempts=d==null?void 0:d.attempts),new Promise((v,g)=>__awaiter(this,void 0,void 0,function*(){var w;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new TonConnectError("Trying to send bridge request without session");const x=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send http-bridge request:",Object.assign(Object.assign({},f),{id:x}));const S=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},f),{id:x})),hexToByteArray(this.session.walletPublicKey));try{yield this.gateway.send(S,this.session.walletPublicKey,f.method,{attempts:m==null?void 0:m.attempts,signal:m==null?void 0:m.signal}),(w=m==null?void 0:m.onRequestSent)===null||w===void 0||w.call(m),this.pendingRequests.set(x.toString(),v)}catch(_){g(_)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(f){return __awaiter(this,void 0,void 0,function*(){return new Promise(d=>__awaiter(this,void 0,void 0,function*(){let m=!1,v=null;const g=()=>{m||(m=!0,this.removeBridgeAndSession().then(d))};try{this.closeGateways();const w=createAbortController(f==null?void 0:f.signal);v=setTimeout(()=>{w.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:g,signal:w.signal,attempts:1})}catch(w){logDebug$1("Disconnect error:",w),m||this.removeBridgeAndSession().then(d)}finally{v&&clearTimeout(v),g()}}))})}listen(f){return this.listeners.push(f),()=>this.listeners=this.listeners.filter(d=>d!==f)}pause(){var f;(f=this.gateway)===null||f===void 0||f.pause(),this.pendingGateways.forEach(d=>d.pause())}unPause(){return __awaiter(this,void 0,void 0,function*(){const f=this.pendingGateways.map(d=>d.unPause());this.gateway&&f.push(this.gateway.unPause()),yield Promise.all(f)})}pendingGatewaysListener(f,d,m){return __awaiter(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(f)){yield f.close();return}return this.closeGateways({except:f}),this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=d,this.gateway=f,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(m)})}gatewayListener(f){return __awaiter(this,void 0,void 0,function*(){const d=JSON.parse(this.session.sessionCrypto.decrypt(Base64.decode(f.message).toUint8Array(),hexToByteArray(f.from)));if(logDebug$1("Wallet message received:",d),!("event"in d)){const v=d.id.toString(),g=this.pendingRequests.get(v);if(!g){logDebug$1(`Response id ${v} doesn't match any request's id`);return}g(d),this.pendingRequests.delete(v);return}if(d.id!==void 0){const v=yield this.connectionStorage.getLastWalletEventId();if(v!==void 0&&d.id<=v){logError$1(`Received event id (=${d.id}) must be greater than stored last wallet event id (=${v}) `);return}d.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(d.id))}const m=this.listeners;d.event==="connect"&&(yield this.updateSession(d,f.from)),d.event==="disconnect"&&(logDebug$1("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),m.forEach(v=>v(d))})}gatewayErrorsListener(f){return __awaiter(this,void 0,void 0,function*(){throw new TonConnectError(`Bridge error ${JSON.stringify(f)}`)})}updateSession(f,d){return __awaiter(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:d});const m=f.payload.items.find(g=>g.name==="ton_addr"),v=Object.assign(Object.assign({},f),{payload:Object.assign(Object.assign({},f.payload),{items:[m]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:f.id,connectEvent:v,nextRpcRequestId:0})})}removeBridgeAndSession(){return __awaiter(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(f,d){return isTelegramUrl(f)?this.generateTGUniversalLink(f,d):this.generateRegularUniversalLink(f,d)}generateRegularUniversalLink(f,d){const m=new URL(f);return m.searchParams.append("v",PROTOCOL_VERSION.toString()),m.searchParams.append("id",this.session.sessionCrypto.sessionId),m.searchParams.append("r",JSON.stringify(d)),m.toString()}generateTGUniversalLink(f,d){const v=this.generateRegularUniversalLink("about:blank",d).split("?")[1],g="tonconnect-"+encodeTelegramUrlParameters(v),w=this.convertToDirectLink(f),x=new URL(w);return x.searchParams.append("startapp",g),x.toString()}convertToDirectLink(f){const d=new URL(f);return d.searchParams.has("attach")&&(d.searchParams.delete("attach"),d.pathname+="/start"),d.toString()}openGateways(f,d){return __awaiter(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(m=>m.close().catch()),this.pendingGateways=this.walletConnectionSource.map(m=>{const v=new BridgeGateway(this.storage,m.bridgeUrl,f.sessionId,()=>{},()=>{});return v.setListener(g=>this.pendingGatewaysListener(v,m.bridgeUrl,g)),v}),yield Promise.allSettled(this.pendingGateways.map(m=>callForSuccess(v=>{var g;return this.pendingGateways.some(w=>w===m)?m.registerSession({openingDeadlineMS:(g=d==null?void 0:d.openingDeadlineMS)!==null&&g!==void 0?g:this.defaultOpeningDeadlineMS,signal:v.signal}):m.close()},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:d==null?void 0:d.signal})));return}else return this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,f.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:d==null?void 0:d.openingDeadlineMS,signal:d==null?void 0:d.signal})})}closeGateways(f){var d;(d=this.gateway)===null||d===void 0||d.close(),this.pendingGateways.filter(m=>m!==(f==null?void 0:f.except)).forEach(m=>m.close()),this.pendingGateways=[]}}function hasProperty(r,f){return hasProperties(r,[f])}function hasProperties(r,f){return!r||typeof r!="object"?!1:f.every(d=>d in r)}function isJSBridgeWithMetadata(r){try{return!hasProperty(r,"tonconnect")||!hasProperty(r.tonconnect,"walletInfo")?!1:hasProperties(r.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let InMemoryStorage$1=class zt{constructor(){this.storage={}}static getInstance(){return zt.instance||(zt.instance=new zt),zt.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(f){var d;return(d=this.storage[f])!==null&&d!==void 0?d:null}key(f){var d;const m=Object.keys(this.storage);return f<0||f>=m.length?null:(d=m[f])!==null&&d!==void 0?d:null}removeItem(f){delete this.storage[f]}setItem(f,d){this.storage[f]=d}};function getWindow$2(){if(!(typeof window>"u"))return window}function tryGetWindowKeys(){const r=getWindow$2();if(!r)return[];try{return Object.keys(r)}catch{return[]}}function getDocument(){if(!(typeof document>"u"))return document}function getWebPageManifest(){var r;const f=(r=getWindow$2())===null||r===void 0?void 0:r.location.origin;return f?f+"/tonconnect-manifest.json":""}function tryGetLocalStorage$1(){if(isLocalStorageAvailable$1())return localStorage;if(isNodeJs$1())throw new TonConnectError("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return InMemoryStorage$1.getInstance()}function isLocalStorageAvailable$1(){try{return typeof localStorage<"u"}catch{return!1}}function isNodeJs$1(){return typeof process$1<"u"&&process$1.versions!=null&&process$1.versions.node!=null}class InjectedProvider{constructor(f,d){this.injectedWalletKey=d,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const m=InjectedProvider.window;if(!InjectedProvider.isWindowContainsWallet(m,d))throw new WalletNotInjectedError;this.connectionStorage=new BridgeConnectionStorage(f),this.injectedWallet=m[d].tonconnect}static fromStorage(f){return __awaiter(this,void 0,void 0,function*(){const m=yield new BridgeConnectionStorage(f).getInjectedConnection();return new InjectedProvider(f,m.jsBridgeKey)})}static isWalletInjected(f){return InjectedProvider.isWindowContainsWallet(this.window,f)}static isInsideWalletBrowser(f){return InjectedProvider.isWindowContainsWallet(this.window,f)?this.window[f].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?tryGetWindowKeys().filter(([m,v])=>isJSBridgeWithMetadata(v)).map(([m,v])=>({name:v.tonconnect.walletInfo.name,appName:v.tonconnect.walletInfo.app_name,aboutUrl:v.tonconnect.walletInfo.about_url,imageUrl:v.tonconnect.walletInfo.image,tondns:v.tonconnect.walletInfo.tondns,jsBridgeKey:m,injected:!0,embedded:v.tonconnect.isWalletBrowser,platforms:v.tonconnect.walletInfo.platforms,features:v.tonconnect.walletInfo.features})):[]}static isWindowContainsWallet(f,d){return!!f&&d in f&&typeof f[d]=="object"&&"tonconnect"in f[d]}connect(f){this._connect(PROTOCOL_VERSION,f)}restoreConnection(){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1("Injected Provider restoring connection...");const f=yield this.injectedWallet.restoreConnection();logDebug$1("Injected Provider restoring connection response",f),f.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(d=>d(f))):yield this.connectionStorage.removeConnection()}catch{yield this.connectionStorage.removeConnection()}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return __awaiter(this,void 0,void 0,function*(){return new Promise(f=>{const d=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(f)};try{this.injectedWallet.disconnect(),d()}catch(m){logDebug$1(m),this.sendRequest({method:"disconnect",params:[]},d)}})})}closeAllListeners(){var f;this.listenSubscriptions=!1,this.listeners=[],(f=this.unsubscribeCallback)===null||f===void 0||f.call(this)}listen(f){return this.listeners.push(f),()=>this.listeners=this.listeners.filter(d=>d!==f)}sendRequest(f,d){var m;return __awaiter(this,void 0,void 0,function*(){const v={};typeof d=="function"?v.onRequestSent=d:(v.onRequestSent=d==null?void 0:d.onRequestSent,v.signal=d==null?void 0:d.signal);const g=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send injected-bridge request:",Object.assign(Object.assign({},f),{id:g}));const w=this.injectedWallet.send(Object.assign(Object.assign({},f),{id:g}));return w.then(x=>logDebug$1("Wallet message received:",x)),(m=v==null?void 0:v.onRequestSent)===null||m===void 0||m.call(v),w})}_connect(f,d){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1(`Injected Provider connect request: protocolVersion: ${f}, message:`,d);const m=yield this.injectedWallet.connect(f,d);logDebug$1("Injected Provider connect response:",m),m.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(v=>v(m))}catch(m){logDebug$1("Injected Provider connect error:",m);const v={event:"connect_error",payload:{code:0,message:m==null?void 0:m.toString()}};this.listeners.forEach(g=>g(v))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(f=>{logDebug$1("Wallet message received:",f),this.listenSubscriptions&&this.listeners.forEach(d=>d(f)),f.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}InjectedProvider.window=getWindow$2();class DefaultStorage{constructor(){this.localStorage=tryGetLocalStorage$1()}getItem(f){return __awaiter(this,void 0,void 0,function*(){return this.localStorage.getItem(f)})}removeItem(f){return __awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(f)})}setItem(f,d){return __awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(f,d)})}}function isWalletInfoCurrentlyInjected(r){return isWalletInfoInjectable(r)&&r.injected}function isWalletInfoCurrentlyEmbedded(r){return isWalletInfoCurrentlyInjected(r)&&r.embedded}function isWalletInfoInjectable(r){return"jsBridgeKey"in r}function isWalletInfoRemote(r){return"bridgeUrl"in r}const FALLBACK_WALLETS_LIST=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"binanceWeb3TonWallet",name:"Binance Web3 Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"},{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect"},{app_name:"fintopio-tg",name:"Fintopio",image:"https://fintopio.com/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gateio.go.link/gateio/web3?adj_t=1ff8khdw_1fu4ccc7"},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"​https://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"]},{app_name:"tobi",name:"Tobi",image:"https://app.tobiwallet.app/icons/logo-288.png",about_url:"https://tobi.fun",universal_url:"https://t.me/TobiCopilotBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-bridge.tobiwallet.app/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class WalletsListManager{constructor(f){var d;this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource=(d=f==null?void 0:f.walletsListSource)!==null&&d!==void 0?d:"https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",this.cacheTTLMs=f==null?void 0:f.cacheTTLMs}getWallets(){return __awaiter(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return __awaiter(this,void 0,void 0,function*(){const d=(yield this.getWallets()).filter(isWalletInfoCurrentlyEmbedded);return d.length===1?d[0]:null})}fetchWalletsList(){return __awaiter(this,void 0,void 0,function*(){let f=[];try{if(f=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(f))throw new FetchWalletsError("Wrong wallets list format, wallets list must be an array.");const v=f.filter(g=>!this.isCorrectWalletConfigDTO(g));v.length&&(logError$1(`Wallet(s) ${v.map(g=>(g==null?void 0:g.name)||"unknown").join(", ")} config format is wrong. They were removed from the wallets list.`),f=f.filter(g=>this.isCorrectWalletConfigDTO(g)))}catch(m){logError$1(m),f=FALLBACK_WALLETS_LIST}let d=[];try{d=InjectedProvider.getCurrentlyInjectedWallets()}catch(m){logError$1(m)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(f),d)})}walletConfigDTOListToWalletConfigList(f){return f.map(d=>{const m={name:d.name,appName:d.app_name,imageUrl:d.image,aboutUrl:d.about_url,tondns:d.tondns,platforms:d.platforms,features:d.features};return d.bridge.forEach(v=>{if(v.type==="sse"&&(m.bridgeUrl=v.url,m.universalLink=d.universal_url,m.deepLink=d.deepLink),v.type==="js"){const g=v.key;m.jsBridgeKey=g,m.injected=InjectedProvider.isWalletInjected(g),m.embedded=InjectedProvider.isInsideWalletBrowser(g)}}),m})}mergeWalletsLists(f,d){return[...new Set(f.concat(d).map(v=>v.name)).values()].map(v=>{const g=f.find(x=>x.name===v),w=d.find(x=>x.name===v);return Object.assign(Object.assign({},g&&Object.assign({},g)),w&&Object.assign({},w))})}isCorrectWalletConfigDTO(f){if(!f||typeof f!="object")return!1;const d="name"in f,m="app_name"in f,v="image"in f,g="about_url"in f,w="platforms"in f;if(!d||!v||!g||!w||!m||!f.platforms||!Array.isArray(f.platforms)||!f.platforms.length||!("bridge"in f)||!Array.isArray(f.bridge)||!f.bridge.length)return!1;const x=f.bridge;if(x.some(b=>!b||typeof b!="object"||!("type"in b)))return!1;const S=x.find(b=>b.type==="sse");if(S&&(!(typeof S=="object"&&"url"in S)||!S.url||!f.universal_url))return!1;const _=x.find(b=>b.type==="js");return!(_&&(typeof _!="object"||!("key"in _)||!_.key))}}function checkSendTransactionSupport(r,f){const d=r.includes("SendTransaction"),m=findFeature(r,"SendTransaction"),v={minMessages:f.requiredMessagesNumber,extraCurrencyRequired:f.requireExtraCurrencies};if(!d&&!m)throw new WalletNotSupportFeatureError("Wallet doesn't support SendTransaction feature.",{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});if(f.requireExtraCurrencies&&(!m||!m.extraCurrencySupported))throw new WalletNotSupportFeatureError("Wallet is not able to handle such SendTransaction request. Extra currencies support is required.",{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});if(m&&m.maxMessages!==void 0){if(m.maxMessages<f.requiredMessagesNumber)throw new WalletNotSupportFeatureError(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${m.maxMessages}, but ${f.requiredMessagesNumber} is required.`,{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});return}logWarning$1("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function checkSignDataSupport(r,f){const d=r.find(v=>v&&typeof v=="object"&&v.name==="SignData");if(!d)throw new WalletNotSupportFeatureError("Wallet doesn't support SignData feature.",{cause:{requiredFeature:{featureName:"SignData",value:{types:f.requiredTypes}}}});const m=f.requiredTypes.filter(v=>!d.types.includes(v));if(m.length)throw new WalletNotSupportFeatureError(`Wallet doesn't support required SignData types: ${m.join(", ")}.`,{cause:{requiredFeature:{featureName:"SignData",value:{types:m}}}})}function checkRequiredWalletFeatures(r,f){if(typeof f!="object")return!0;const{sendTransaction:d,signData:m}=f;if(d){const v=findFeature(r,"SendTransaction");if(!v||!checkSendTransaction(v,d))return!1}if(m){const v=findFeature(r,"SignData");if(!v||!checkSignData(v,m))return!1}return!0}function findFeature(r,f){return r.find(d=>d&&typeof d=="object"&&d.name===f)}function checkSendTransaction(r,f){const d=f.minMessages===void 0||f.minMessages<=r.maxMessages,m=!f.extraCurrencyRequired||r.extraCurrencySupported;return!!(d&&m)}function checkSignData(r,f){return f.types.every(d=>r.types.includes(d))}function createRequestVersionEvent(){return{type:"request-version"}}function createResponseVersionEvent(r){return{type:"response-version",version:r}}function createVersionInfo(r){return{ton_connect_sdk_lib:r.ton_connect_sdk_lib,ton_connect_ui_lib:r.ton_connect_ui_lib}}function createConnectionInfo(r,f){var d,m,v,g,w,x,S,_;const C=((d=f==null?void 0:f.connectItems)===null||d===void 0?void 0:d.tonProof)&&"proof"in f.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:(v=(m=f==null?void 0:f.account)===null||m===void 0?void 0:m.address)!==null&&v!==void 0?v:null,wallet_type:(g=f==null?void 0:f.device.appName)!==null&&g!==void 0?g:null,wallet_version:(w=f==null?void 0:f.device.appVersion)!==null&&w!==void 0?w:null,auth_type:C,custom_data:Object.assign({chain_id:(S=(x=f==null?void 0:f.account)===null||x===void 0?void 0:x.chain)!==null&&S!==void 0?S:null,provider:(_=f==null?void 0:f.provider)!==null&&_!==void 0?_:null},createVersionInfo(r))}}function createConnectionStartedEvent(r){return{type:"connection-started",custom_data:createVersionInfo(r)}}function createConnectionCompletedEvent(r,f){return Object.assign({type:"connection-completed",is_success:!0},createConnectionInfo(r,f))}function createConnectionErrorEvent(r,f,d){return{type:"connection-error",is_success:!1,error_message:f,error_code:d??null,custom_data:createVersionInfo(r)}}function createConnectionRestoringStartedEvent(r){return{type:"connection-restoring-started",custom_data:createVersionInfo(r)}}function createConnectionRestoringCompletedEvent(r,f){return Object.assign({type:"connection-restoring-completed",is_success:!0},createConnectionInfo(r,f))}function createConnectionRestoringErrorEvent(r,f){return{type:"connection-restoring-error",is_success:!1,error_message:f,custom_data:createVersionInfo(r)}}function createTransactionInfo(r,f){var d,m,v,g;return{valid_until:(d=String(f.validUntil))!==null&&d!==void 0?d:null,from:(g=(m=f.from)!==null&&m!==void 0?m:(v=r==null?void 0:r.account)===null||v===void 0?void 0:v.address)!==null&&g!==void 0?g:null,messages:f.messages.map(w=>{var x,S;return{address:(x=w.address)!==null&&x!==void 0?x:null,amount:(S=w.amount)!==null&&S!==void 0?S:null}})}}function createTransactionSentForSignatureEvent(r,f,d){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createTransactionSignedEvent(r,f,d,m){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:m.boc},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createTransactionSigningFailedEvent(r,f,d,m,v){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:m,error_code:v??null},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createDataSentForSignatureEvent(r,f,d){return Object.assign({type:"sign-data-request-initiated",data:d},createConnectionInfo(r,f))}function createDataSignedEvent(r,f,d,m){return Object.assign({type:"sign-data-request-completed",is_success:!0,data:d,signed_data:m},createConnectionInfo(r,f))}function createDataSigningFailedEvent(r,f,d,m,v){return Object.assign({type:"sign-data-request-failed",is_success:!1,data:d,error_message:m,error_code:v??null},createConnectionInfo(r,f))}function createDisconnectionEvent(r,f,d){return Object.assign({type:"disconnection",scope:d},createConnectionInfo(r,f))}class BrowserEventDispatcher{constructor(){this.window=getWindow$2()}dispatchEvent(f,d){var m;return __awaiter(this,void 0,void 0,function*(){const v=new CustomEvent(f,{detail:d});(m=this.window)===null||m===void 0||m.dispatchEvent(v)})}addEventListener(f,d,m){var v;return __awaiter(this,void 0,void 0,function*(){return(v=this.window)===null||v===void 0||v.addEventListener(f,d,m),()=>{var g;return(g=this.window)===null||g===void 0?void 0:g.removeEventListener(f,d)}})}}class TonConnectTracker{constructor(f){var d;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(d=f==null?void 0:f.eventDispatcher)!==null&&d!==void 0?d:new BrowserEventDispatcher,this.tonConnectSdkVersion=f.tonConnectSdkVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __awaiter(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return __awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>__awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",createResponseVersionEvent(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return __awaiter(this,void 0,void 0,function*(){return new Promise((f,d)=>__awaiter(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",m=>{f(m.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",createRequestVersionEvent())}catch(m){d(m)}}))})}dispatchUserActionEvent(f){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${f.type}`,f).catch()}catch{}}trackConnectionStarted(...f){try{const d=createConnectionStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(...f){try{const d=createConnectionCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(...f){try{const d=createConnectionErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(...f){try{const d=createConnectionRestoringStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(...f){try{const d=createConnectionRestoringCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(...f){try{const d=createConnectionRestoringErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(...f){try{const d=createDisconnectionEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(...f){try{const d=createTransactionSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(...f){try{const d=createTransactionSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(...f){try{const d=createTransactionSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSentForSignature(...f){try{const d=createDataSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigned(...f){try{const d=createDataSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigningFailed(...f){try{const d=createDataSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectSdkVersion="3.2.0";class TonConnect{constructor(f){if(this.walletsList=new WalletsListManager,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(f==null?void 0:f.manifestUrl)||getWebPageManifest(),storage:(f==null?void 0:f.storage)||new DefaultStorage},this.walletsRequiredFeatures=f==null?void 0:f.walletsRequiredFeatures,this.walletsList=new WalletsListManager({walletsListSource:f==null?void 0:f.walletsListSource,cacheTTLMs:f==null?void 0:f.walletsListCacheTTLMs}),this.tracker=new TonConnectTracker({eventDispatcher:f==null?void 0:f.eventDispatcher,tonConnectSdkVersion}),!this.dappSettings.manifestUrl)throw new DappMetadataError("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new BridgeConnectionStorage(this.dappSettings.storage),f!=null&&f.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var f;return((f=this._wallet)===null||f===void 0?void 0:f.account)||null}get wallet(){return this._wallet}set wallet(f){this._wallet=f,this.statusChangeSubscriptions.forEach(d=>d(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(f,d){return this.statusChangeSubscriptions.push(f),d&&this.statusChangeErrorSubscriptions.push(d),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(m=>m!==f),d&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(m=>m!==d))}}connect(f,d){var m,v;const g={};if(typeof d=="object"&&"tonProof"in d&&(g.request=d),typeof d=="object"&&("openingDeadlineMS"in d||"signal"in d||"request"in d)&&(g.request=d==null?void 0:d.request,g.openingDeadlineMS=d==null?void 0:d.openingDeadlineMS,g.signal=d==null?void 0:d.signal),this.connected)throw new WalletAlreadyConnectedError;const w=createAbortController(g==null?void 0:g.signal);if((m=this.abortController)===null||m===void 0||m.abort(),this.abortController=w,w.signal.aborted)throw new TonConnectError("Connection was aborted");return(v=this.provider)===null||v===void 0||v.closeConnection(),this.provider=this.createProvider(f),w.signal.addEventListener("abort",()=>{var x;(x=this.provider)===null||x===void 0||x.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(g==null?void 0:g.request),{openingDeadlineMS:g==null?void 0:g.openingDeadlineMS,signal:w.signal})}restoreConnection(f){var d,m;return __awaiter(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const v=createAbortController(f==null?void 0:f.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=v,v.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[g,w]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(v.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let x=null;try{switch(g){case"http":x=yield BridgeProvider.fromStorage(this.dappSettings.storage);break;case"injected":x=yield InjectedProvider.fromStorage(this.dappSettings.storage);break;default:if(w)x=this.createProvider(w);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),x==null||x.closeConnection(),x=null;return}if(v.signal.aborted){x==null||x.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!x){logError$1("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(m=this.provider)===null||m===void 0||m.closeConnection(),this.provider=x,x.listen(this.walletEventsListener.bind(this));const S=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),x==null||x.closeConnection(),x=null};v.signal.addEventListener("abort",S);const _=callForSuccess(C=>__awaiter(this,void 0,void 0,function*(){yield x==null?void 0:x.restoreConnection({openingDeadlineMS:f==null?void 0:f.openingDeadlineMS,signal:C.signal}),v.signal.removeEventListener("abort",S),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:f==null?void 0:f.signal}),b=new Promise(C=>setTimeout(()=>C(),12e3));return Promise.race([_,b])})}sendTransaction(f,d){return __awaiter(this,void 0,void 0,function*(){const m={};typeof d=="function"?m.onRequestSent=d:(m.onRequestSent=d==null?void 0:d.onRequestSent,m.signal=d==null?void 0:d.signal);const v=createAbortController(m==null?void 0:m.signal);if(v.signal.aborted)throw new TonConnectError("Transaction sending was aborted");this.checkConnection();const g=f.messages.length,w=f.messages.some(A=>A.extraCurrency&&Object.keys(A.extraCurrency).length>0);checkSendTransactionSupport(this.wallet.device.features,{requiredMessagesNumber:g,requireExtraCurrencies:w}),this.tracker.trackTransactionSentForSignature(this.wallet,f);const{validUntil:x,messages:S}=f,_=__rest(f,["validUntil","messages"]),b=f.from||this.account.address,C=f.network||this.account.chain,E=yield this.provider.sendRequest(sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({},_),{from:b,network:C,valid_until:x,messages:S.map(A=>{var{extraCurrency:T}=A,L=__rest(A,["extraCurrency"]);return Object.assign(Object.assign({},L),{extra_currency:T})})})),{onRequestSent:m.onRequestSent,signal:v.signal});if(sendTransactionParser.isError(E))return this.tracker.trackTransactionSigningFailed(this.wallet,f,E.error.message,E.error.code),sendTransactionParser.parseAndThrowError(E);const M=sendTransactionParser.convertFromRpcResponse(E);return this.tracker.trackTransactionSigned(this.wallet,f,M),M})}signData(f,d){return __awaiter(this,void 0,void 0,function*(){const m=createAbortController(d==null?void 0:d.signal);if(m.signal.aborted)throw new TonConnectError("data sending was aborted");this.checkConnection(),checkSignDataSupport(this.wallet.device.features,{requiredTypes:[f.type]}),this.tracker.trackDataSentForSignature(this.wallet,f);const v=f.from||this.account.address,g=f.network||this.account.chain,w=yield this.provider.sendRequest(signDataParser.convertToRpcRequest(Object.assign(Object.assign({},f),{from:v,network:g})),{onRequestSent:d==null?void 0:d.onRequestSent,signal:m.signal});if(signDataParser.isError(w))return this.tracker.trackDataSigningFailed(this.wallet,f,w.error.message,w.error.code),signDataParser.parseAndThrowError(w);const x=signDataParser.convertFromRpcResponse(w);return this.tracker.trackDataSigned(this.wallet,f,x),x})}disconnect(f){var d;return __awaiter(this,void 0,void 0,function*(){if(!this.connected)throw new WalletNotConnectedError;const m=createAbortController(f==null?void 0:f.signal),v=this.abortController;if(this.abortController=m,m.signal.aborted)throw new TonConnectError("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(d=this.provider)===null||d===void 0?void 0:d.disconnect({signal:m.signal}),v==null||v.abort()})}pauseConnection(){var f;((f=this.provider)===null||f===void 0?void 0:f.type)==="http"&&this.provider.pause()}unPauseConnection(){var f;return((f=this.provider)===null||f===void 0?void 0:f.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const f=getDocument();if(f)try{f.addEventListener("visibilitychange",()=>{f.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(d){logError$1("Cannot subscribe to the document.visibilitychange: ",d)}}createProvider(f){let d;return!Array.isArray(f)&&isWalletConnectionSourceJS(f)?d=new InjectedProvider(this.dappSettings.storage,f.jsBridgeKey):d=new BridgeProvider(this.dappSettings.storage,f),d.listen(this.walletEventsListener.bind(this)),d}walletEventsListener(f){switch(f.event){case"connect":this.onWalletConnected(f.payload);break;case"connect_error":this.tracker.trackConnectionError(f.payload.message,f.payload.code);const d=connectErrorsParser.parseError(f.payload);this.onWalletConnectError(d);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(f){var d;const m=f.items.find(x=>x.name==="ton_addr"),v=f.items.find(x=>x.name==="ton_proof");if(!m)throw new TonConnectError("ton_addr connection item was not found");if(!checkRequiredWalletFeatures(f.device.features,this.walletsRequiredFeatures)){(d=this.provider)===null||d===void 0||d.disconnect(),this.onWalletConnectError(new WalletMissingRequiredFeaturesError("Wallet does not support required features",{cause:{connectEvent:f}}));return}const w={device:f.device,provider:this.provider.type,account:{address:m.address,chain:m.network,walletStateInit:m.walletStateInit,publicKey:m.publicKey}};if(v){let x;try{if("proof"in v)x={name:"ton_proof",proof:{timestamp:v.proof.timestamp,domain:{lengthBytes:v.proof.domain.lengthBytes,value:v.proof.domain.value},payload:v.proof.payload,signature:v.proof.signature}};else if("error"in v)x={name:"ton_proof",error:{code:v.error.code,message:v.error.message}};else throw new TonConnectError("Invalid data format")}catch{x={name:"ton_proof",error:{code:CONNECT_ITEM_ERROR_CODES.UNKNOWN_ERROR,message:"Invalid data format"}}}w.connectItems={tonProof:x}}this.wallet=w,this.tracker.trackConnectionCompleted(w)}onWalletConnectError(f){if(this.statusChangeErrorSubscriptions.forEach(d=>d(f)),logDebug$1(f),f instanceof ManifestNotFoundError||f instanceof ManifestContentErrorError)throw logError$1(f),f}onWalletDisconnected(f){this.tracker.trackDisconnection(this.wallet,f),this.wallet=null}checkConnection(){if(!this.connected)throw new WalletNotConnectedError}createConnectRequest(f){const d=[{name:"ton_addr"}];return f!=null&&f.tonProof&&d.push({name:"ton_proof",payload:f.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:d}}}TonConnect.walletsList=new WalletsListManager,TonConnect.isWalletInjected=r=>InjectedProvider.isWalletInjected(r),TonConnect.isInsideWalletBrowser=r=>InjectedProvider.isInsideWalletBrowser(r);const noBounceableTag=81,testOnlyTag=128;function toUserFriendlyAddress(r,f=!1){const{wc:d,hex:m}=parseHexAddress(r);let v=noBounceableTag;f&&(v|=testOnlyTag);const g=new Int8Array(34);g[0]=v,g[1]=d,g.set(m,2);const w=new Uint8Array(36);return w.set(g),w.set(crc16(g),34),Base64.encode(w).replace(/\+/g,"-").replace(/\//g,"_")}function parseHexAddress(r){if(!r.includes(":"))throw new WrongAddressError(`Wrong address ${r}. Address must include ":".`);const f=r.split(":");if(f.length!==2)throw new WrongAddressError(`Wrong address ${r}. Address must include ":" only once.`);const d=parseInt(f[0]);if(d!==0&&d!==-1)throw new WrongAddressError(`Wrong address ${r}. WC must be eq 0 or -1, but ${d} received.`);const m=f[1];if((m==null?void 0:m.length)!==64)throw new WrongAddressError(`Wrong address ${r}. Hex part must be 64bytes length, but ${m==null?void 0:m.length} received.`);return{wc:d,hex:hexToBytes(m)}}function crc16(r){let d=0;const m=new Uint8Array(r.length+2);m.set(r);for(let v of m){let g=128;for(;g>0;)d<<=1,v&g&&(d+=1),g>>=1,d>65535&&(d&=65535,d^=4129)}return new Uint8Array([Math.floor(d/256),d%256])}const toByteMap={};for(let r=0;r<=255;r++){let f=r.toString(16);f.length<2&&(f="0"+f),toByteMap[f]=r}function hexToBytes(r){r=r.toLowerCase();const f=r.length;if(f%2!==0)throw new ParseHexError("Hex string must have length a multiple of 2: "+r);const d=f/2,m=new Uint8Array(d);for(let v=0;v<d;v++){const g=v*2,w=r.substring(g,g+2);if(!toByteMap.hasOwnProperty(w))throw new ParseHexError("Invalid hex character: "+w);m[v]=toByteMap[w]}return m}var uaParser$1={exports:{}},uaParser=uaParser$1.exports,hasRequiredUaParser;function requireUaParser(){return hasRequiredUaParser||(hasRequiredUaParser=1,(function(r,f){(function(d,m){var v="1.0.41",g="",w="?",x="function",S="undefined",_="object",b="string",C="major",E="model",M="name",A="type",T="vendor",L="version",O="architecture",N="console",H="mobile",V="tablet",X="smarttv",oe="wearable",se="embedded",de=500,he="Amazon",we="Apple",te="ASUS",k="BlackBerry",q="Browser",y="Chrome",B="Edge",$="Firefox",I="Google",F="Honor",j="Huawei",D="Lenovo",W="LG",R="Microsoft",z="Motorola",ye="Nvidia",Ce="OnePlus",me="Opera",ie="OPPO",ee="Samsung",pe="Sharp",be="Sony",ae="Xiaomi",ne="Zebra",Se="Facebook",qe="Chromium OS",Ie="Mac OS",Oe=" Browser",Ue=function(Z,J){var ge={};for(var Ee in Z)J[Ee]&&J[Ee].length%2===0?ge[Ee]=J[Ee].concat(Z[Ee]):ge[Ee]=Z[Ee];return ge},De=function(Z){for(var J={},ge=0;ge<Z.length;ge++)J[Z[ge].toUpperCase()]=Z[ge];return J},$e=function(Z,J){return typeof Z===b?je(J).indexOf(je(Z))!==-1:!1},je=function(Z){return Z.toLowerCase()},Ye=function(Z){return typeof Z===b?Z.replace(/[^\d\.]/g,g).split(".")[0]:m},st=function(Z,J){if(typeof Z===b)return Z=Z.replace(/^\s\s*/,g),typeof J===S?Z:Z.substring(0,de)},Je=function(Z,J){for(var ge=0,Ee,Re,ke,Xe,He,Ze;ge<J.length&&!He;){var xt=J[ge],tt=J[ge+1];for(Ee=Re=0;Ee<xt.length&&!He&&xt[Ee];)if(He=xt[Ee++].exec(Z),He)for(ke=0;ke<tt.length;ke++)Ze=He[++Re],Xe=tt[ke],typeof Xe===_&&Xe.length>0?Xe.length===2?typeof Xe[1]==x?this[Xe[0]]=Xe[1].call(this,Ze):this[Xe[0]]=Xe[1]:Xe.length===3?typeof Xe[1]===x&&!(Xe[1].exec&&Xe[1].test)?this[Xe[0]]=Ze?Xe[1].call(this,Ze,Xe[2]):m:this[Xe[0]]=Ze?Ze.replace(Xe[1],Xe[2]):m:Xe.length===4&&(this[Xe[0]]=Ze?Xe[3].call(this,Ze.replace(Xe[1],Xe[2])):m):this[Xe]=Ze||m;ge+=2}},Ge=function(Z,J){for(var ge in J)if(typeof J[ge]===_&&J[ge].length>0){for(var Ee=0;Ee<J[ge].length;Ee++)if($e(J[ge][Ee],Z))return ge===w?m:ge}else if($e(J[ge],Z))return ge===w?m:ge;return J.hasOwnProperty("*")?J["*"]:Z},ut={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},gt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},rt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[L,[M,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[L,[M,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[M,L],[/opios[\/ ]+([\w\.]+)/i],[L,[M,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[L,[M,me+" GX"]],[/\bopr\/([\w\.]+)/i],[L,[M,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[L,[M,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[L,[M,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[M,L],[/quark(?:pc)?\/([-\w\.]+)/i],[L,[M,"Quark"]],[/\bddg\/([\w\.]+)/i],[L,[M,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[L,[M,"UC"+q]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[L,[M,"WeChat"]],[/konqueror\/([\w\.]+)/i],[L,[M,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[L,[M,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[L,[M,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[L,[M,"Smart Lenovo "+q]],[/(avast|avg)\/([\w\.]+)/i],[[M,/(.+)/,"$1 Secure "+q],L],[/\bfocus\/([\w\.]+)/i],[L,[M,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[L,[M,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[L,[M,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[L,[M,"Dolphin"]],[/coast\/([\w\.]+)/i],[L,[M,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[L,[M,"MIUI"+Oe]],[/fxios\/([\w\.-]+)/i],[L,[M,$]],[/\bqihoobrowser\/?([\w\.]*)/i],[L,[M,"360"]],[/\b(qq)\/([\w\.]+)/i],[[M,/(.+)/,"$1Browser"],L],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[M,/(.+)/,"$1"+Oe],L],[/samsungbrowser\/([\w\.]+)/i],[L,[M,ee+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[L,[M,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[M,"Sogou Mobile"],L],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[M,L],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[M],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[L,M],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[M,Se],L],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[M,L],[/\bgsa\/([\w\.]+) .*safari\//i],[L,[M,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[L,[M,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[L,[M,y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[M,y+" WebView"],L],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[L,[M,"Android "+q]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[M,L],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[L,[M,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[L,M],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[M,[L,Ge,ut]],[/(webkit|khtml)\/([\w\.]+)/i],[M,L],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[M,"Netscape"],L],[/(wolvic|librewolf)\/([\w\.]+)/i],[M,L],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[L,[M,$+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[M,[L,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[M,[L,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[O,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[O,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[O,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[O,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[O,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[O,/ower/,g,je]],[/ sun4\w[;\)]/i],[[O,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[O,je]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[E,[T,ee],[A,V]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[E,[T,ee],[A,H]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[E,[T,we],[A,H]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[E,[T,we],[A,V]],[/(macintosh);/i],[E,[T,we]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[T,pe],[A,H]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[E,[T,F],[A,V]],[/honor([-\w ]+)[;\)]/i],[E,[T,F],[A,H]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[E,[T,j],[A,V]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[E,[T,j],[A,H]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[E,/_/g," "],[T,ae],[A,V]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[E,/_/g," "],[T,ae],[A,H]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[T,ie],[A,H]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[E,[T,Ge,{OnePlus:["304","403","203"],"*":ie}],[A,V]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[T,"Vivo"],[A,H]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[T,"Realme"],[A,H]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[E,[T,z],[A,H]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[T,z],[A,V]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[T,W],[A,V]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[T,W],[A,H]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[E,[T,D],[A,V]],[/(nokia) (t[12][01])/i],[T,E,[A,V]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[E,/_/g," "],[A,H],[T,"Nokia"]],[/(pixel (c|tablet))\b/i],[E,[T,I],[A,V]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[E,[T,I],[A,H]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[T,be],[A,H]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[T,be],[A,V]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[T,Ce],[A,H]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[T,he],[A,V]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[T,he],[A,H]],[/(playbook);[-\w\),; ]+(rim)/i],[E,T,[A,V]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[E,[T,k],[A,H]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[T,te],[A,V]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[T,te],[A,H]],[/(nexus 9)/i],[E,[T,"HTC"],[A,V]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[T,[E,/_/g," "],[A,H]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[E,[T,"TCL"],[A,V]],[/(itel) ((\w+))/i],[[T,je],E,[A,Ge,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[T,"Acer"],[A,V]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[T,"Meizu"],[A,H]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[T,"Ulefone"],[A,H]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[E,[T,"Energizer"],[A,H]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[E,[T,"Cat"],[A,H]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[E,[T,"Smartfren"],[A,H]],[/droid.+; (a(?:015|06[35]|142p?))/i],[E,[T,"Nothing"],[A,H]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[E,[T,"Archos"],[A,V]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[E,[T,"Archos"],[A,H]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[T,E,[A,V]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[T,E,[A,H]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[T,E,[A,V]],[/(surface duo)/i],[E,[T,R],[A,V]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[T,"Fairphone"],[A,H]],[/(u304aa)/i],[E,[T,"AT&T"],[A,H]],[/\bsie-(\w*)/i],[E,[T,"Siemens"],[A,H]],[/\b(rct\w+) b/i],[E,[T,"RCA"],[A,V]],[/\b(venue[\d ]{2,7}) b/i],[E,[T,"Dell"],[A,V]],[/\b(q(?:mv|ta)\w+) b/i],[E,[T,"Verizon"],[A,V]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[E,[T,"Barnes & Noble"],[A,V]],[/\b(tm\d{3}\w+) b/i],[E,[T,"NuVision"],[A,V]],[/\b(k88) b/i],[E,[T,"ZTE"],[A,V]],[/\b(nx\d{3}j) b/i],[E,[T,"ZTE"],[A,H]],[/\b(gen\d{3}) b.+49h/i],[E,[T,"Swiss"],[A,H]],[/\b(zur\d{3}) b/i],[E,[T,"Swiss"],[A,V]],[/\b((zeki)?tb.*\b) b/i],[E,[T,"Zeki"],[A,V]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[T,"Dragon Touch"],E,[A,V]],[/\b(ns-?\w{0,9}) b/i],[E,[T,"Insignia"],[A,V]],[/\b((nxa|next)-?\w{0,9}) b/i],[E,[T,"NextBook"],[A,V]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[T,"Voice"],E,[A,H]],[/\b(lvtel\-)?(v1[12]) b/i],[[T,"LvTel"],E,[A,H]],[/\b(ph-1) /i],[E,[T,"Essential"],[A,H]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[E,[T,"Envizen"],[A,V]],[/\b(trio[-\w\. ]+) b/i],[E,[T,"MachSpeed"],[A,V]],[/\btu_(1491) b/i],[E,[T,"Rotor"],[A,V]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[E,[T,ye],[A,V]],[/(sprint) (\w+)/i],[T,E,[A,H]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[T,R],[A,H]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[T,ne],[A,V]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[T,ne],[A,H]],[/smart-tv.+(samsung)/i],[T,[A,X]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[T,ee],[A,X]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[T,W],[A,X]],[/(apple) ?tv/i],[T,[E,we+" TV"],[A,X]],[/crkey/i],[[E,y+"cast"],[T,I],[A,X]],[/droid.+aft(\w+)( bui|\))/i],[E,[T,he],[A,X]],[/(shield \w+ tv)/i],[E,[T,ye],[A,X]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[T,pe],[A,X]],[/(bravia[\w ]+)( bui|\))/i],[E,[T,be],[A,X]],[/(mi(tv|box)-?\w+) bui/i],[E,[T,ae],[A,X]],[/Hbbtv.*(technisat) (.*);/i],[T,E,[A,X]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[T,st],[E,st],[A,X]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[E,[A,X]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[A,X]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[T,E,[A,N]],[/droid.+; (shield)( bui|\))/i],[E,[T,ye],[A,N]],[/(playstation \w+)/i],[E,[T,be],[A,N]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[T,R],[A,N]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[E,[T,ee],[A,oe]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[T,E,[A,oe]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[E,[T,ie],[A,oe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[T,we],[A,oe]],[/(opwwe\d{3})/i],[E,[T,Ce],[A,oe]],[/(moto 360)/i],[E,[T,z],[A,oe]],[/(smartwatch 3)/i],[E,[T,be],[A,oe]],[/(g watch r)/i],[E,[T,W],[A,oe]],[/droid.+; (wt63?0{2,3})\)/i],[E,[T,ne],[A,oe]],[/droid.+; (glass) \d/i],[E,[T,I],[A,oe]],[/(pico) (4|neo3(?: link|pro)?)/i],[T,E,[A,oe]],[/; (quest( \d| pro)?)/i],[E,[T,Se],[A,oe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[T,[A,se]],[/(aeobc)\b/i],[E,[T,he],[A,se]],[/(homepod).+mac os/i],[E,[T,we],[A,se]],[/windows iot/i],[[A,se]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[E,[A,H]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[E,[A,V]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[A,V]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[A,H]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[E,[T,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[L,[M,B+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[M,L],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[L,[M,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[M,L],[/ladybird\//i],[[M,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[L,M]],os:[[/microsoft (windows) (vista|xp)/i],[M,L],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[M,[L,Ge,gt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[L,Ge,gt],[M,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[L,/_/g,"."],[M,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[M,Ie],[L,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[L,M],[/(ubuntu) ([\w\.]+) like android/i],[[M,/(.+)/,"$1 Touch"],L],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[M,L],[/\(bb(10);/i],[L,[M,k]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[L,[M,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[L,[M,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[L,[M,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[L,[M,"watchOS"]],[/crkey\/([\d\.]+)/i],[L,[M,y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[M,qe],L],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[M,L],[/(sunos) ?([\w\.\d]*)/i],[[M,"Solaris"],L],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[M,L]]},wt=function(Z,J){if(typeof Z===_&&(J=Z,Z=m),!(this instanceof wt))return new wt(Z,J).getResult();var ge=typeof d!==S&&d.navigator?d.navigator:m,Ee=Z||(ge&&ge.userAgent?ge.userAgent:g),Re=ge&&ge.userAgentData?ge.userAgentData:m,ke=J?Ue(rt,J):rt,Xe=ge&&ge.userAgent==Ee;return this.getBrowser=function(){var He={};return He[M]=m,He[L]=m,Je.call(He,Ee,ke.browser),He[C]=Ye(He[L]),Xe&&ge&&ge.brave&&typeof ge.brave.isBrave==x&&(He[M]="Brave"),He},this.getCPU=function(){var He={};return He[O]=m,Je.call(He,Ee,ke.cpu),He},this.getDevice=function(){var He={};return He[T]=m,He[E]=m,He[A]=m,Je.call(He,Ee,ke.device),Xe&&!He[A]&&Re&&Re.mobile&&(He[A]=H),Xe&&He[E]=="Macintosh"&&ge&&typeof ge.standalone!==S&&ge.maxTouchPoints&&ge.maxTouchPoints>2&&(He[E]="iPad",He[A]=V),He},this.getEngine=function(){var He={};return He[M]=m,He[L]=m,Je.call(He,Ee,ke.engine),He},this.getOS=function(){var He={};return He[M]=m,He[L]=m,Je.call(He,Ee,ke.os),Xe&&!He[M]&&Re&&Re.platform&&Re.platform!="Unknown"&&(He[M]=Re.platform.replace(/chrome os/i,qe).replace(/macos/i,Ie)),He},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ee},this.setUA=function(He){return Ee=typeof He===b&&He.length>de?st(He,de):He,this},this.setUA(Ee),this};wt.VERSION=v,wt.BROWSER=De([M,L,C]),wt.CPU=De([O]),wt.DEVICE=De([E,T,A,N,H,X,V,oe,se]),wt.ENGINE=wt.OS=De([M,L]),r.exports&&(f=r.exports=wt),f.UAParser=wt;var bt=typeof d!==S&&(d.jQuery||d.Zepto);if(bt&&!bt.ua){var le=new wt;bt.ua=le.getResult(),bt.ua.get=function(){return le.getUA()},bt.ua.set=function(Z){le.setUA(Z);var J=le.getResult();for(var ge in J)bt.ua[ge]=J[ge]}}})(typeof window=="object"?window:uaParser)})(uaParser$1,uaParser$1.exports)),uaParser$1.exports}var uaParserExports=requireUaParser();const UAParser=getDefaultExportFromCjs(uaParserExports);var cjs,hasRequiredCjs;function requireCjs(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var r=function(N){return f(N)&&!d(N)};function f(O){return!!O&&typeof O=="object"}function d(O){var N=Object.prototype.toString.call(O);return N==="[object RegExp]"||N==="[object Date]"||g(O)}var m=typeof Symbol=="function"&&Symbol.for,v=m?Symbol.for("react.element"):60103;function g(O){return O.$$typeof===v}function w(O){return Array.isArray(O)?[]:{}}function x(O,N){return N.clone!==!1&&N.isMergeableObject(O)?T(w(O),O,N):O}function S(O,N,H){return O.concat(N).map(function(V){return x(V,H)})}function _(O,N){if(!N.customMerge)return T;var H=N.customMerge(O);return typeof H=="function"?H:T}function b(O){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(O).filter(function(N){return Object.propertyIsEnumerable.call(O,N)}):[]}function C(O){return Object.keys(O).concat(b(O))}function E(O,N){try{return N in O}catch{return!1}}function M(O,N){return E(O,N)&&!(Object.hasOwnProperty.call(O,N)&&Object.propertyIsEnumerable.call(O,N))}function A(O,N,H){var V={};return H.isMergeableObject(O)&&C(O).forEach(function(X){V[X]=x(O[X],H)}),C(N).forEach(function(X){M(O,X)||(E(O,X)&&H.isMergeableObject(N[X])?V[X]=_(X,H)(O[X],N[X],H):V[X]=x(N[X],H))}),V}function T(O,N,H){H=H||{},H.arrayMerge=H.arrayMerge||S,H.isMergeableObject=H.isMergeableObject||r,H.cloneUnlessOtherwiseSpecified=x;var V=Array.isArray(N),X=Array.isArray(O),oe=V===X;return oe?V?H.arrayMerge(O,N,H):A(O,N,H):x(N,H)}T.all=function(N,H){if(!Array.isArray(N))throw new Error("first argument should be an array");return N.reduce(function(V,X){return T(V,X,H)},{})};var L=T;return cjs=L,cjs}var cjsExports=requireCjs();const deepmerge=getDefaultExportFromCjs(cjsExports);var classnames={exports:{}};/*!
50
+ `+f:""}`,Object.setPrototypeOf(this,TonConnectError.prototype)}get info(){return""}}TonConnectError.prefix="[TON_CONNECT_SDK_ERROR]";class DappMetadataError extends TonConnectError{get info(){return"Passed DappMetadata is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,DappMetadataError.prototype)}}class ManifestContentErrorError extends TonConnectError{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...f){super(...f),Object.setPrototypeOf(this,ManifestContentErrorError.prototype)}}class ManifestNotFoundError extends TonConnectError{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}constructor(...f){super(...f),Object.setPrototypeOf(this,ManifestNotFoundError.prototype)}}class WalletAlreadyConnectedError extends TonConnectError{get info(){return"Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletAlreadyConnectedError.prototype)}}class WalletNotConnectedError extends TonConnectError{get info(){return"Send transaction or other protocol methods called while wallet is not connected."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletNotConnectedError.prototype)}}class WalletNotInjectedError extends TonConnectError{get info(){return"There is an attempt to connect to the injected wallet while it is not exists in the webpage."}constructor(...f){super(...f),Object.setPrototypeOf(this,WalletNotInjectedError.prototype)}}class WalletNotSupportFeatureError extends TonConnectError{get info(){return"Wallet doesn't support requested feature method."}constructor(f,d){super(f,d),Object.setPrototypeOf(this,WalletNotSupportFeatureError.prototype)}}class WalletMissingRequiredFeaturesError extends TonConnectError{get info(){return"Missing required features. You need to update your wallet."}constructor(f,d){super(f,d),Object.setPrototypeOf(this,WalletMissingRequiredFeaturesError.prototype)}}function isWalletConnectionSourceJS(r){return"jsBridgeKey"in r}class UserRejectsError extends TonConnectError{get info(){return"User rejects the action in the wallet."}constructor(...f){super(...f),Object.setPrototypeOf(this,UserRejectsError.prototype)}}class BadRequestError extends TonConnectError{get info(){return"Request to the wallet contains errors."}constructor(...f){super(...f),Object.setPrototypeOf(this,BadRequestError.prototype)}}class UnknownAppError extends TonConnectError{get info(){return"App tries to send rpc request to the injected wallet while not connected."}constructor(...f){super(...f),Object.setPrototypeOf(this,UnknownAppError.prototype)}}class FetchWalletsError extends TonConnectError{get info(){return"An error occurred while fetching the wallets list."}constructor(...f){super(...f),Object.setPrototypeOf(this,FetchWalletsError.prototype)}}class WrongAddressError extends TonConnectError{get info(){return"Passed address is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,WrongAddressError.prototype)}}class ParseHexError extends TonConnectError{get info(){return"Passed hex is in incorrect format."}constructor(...f){super(...f),Object.setPrototypeOf(this,ParseHexError.prototype)}}class UnknownError extends TonConnectError{constructor(...f){super(...f),Object.setPrototypeOf(this,UnknownError.prototype)}}const connectEventErrorsCodes={[CONNECT_EVENT_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[CONNECT_EVENT_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[CONNECT_EVENT_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[CONNECT_EVENT_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_NOT_FOUND_ERROR]:ManifestNotFoundError,[CONNECT_EVENT_ERROR_CODES.MANIFEST_CONTENT_ERROR]:ManifestContentErrorError};class ConnectErrorsParser{parseError(f){let d=UnknownError;return f.code in connectEventErrorsCodes&&(d=connectEventErrorsCodes[f.code]||UnknownError),new d(f.message)}}const connectErrorsParser=new ConnectErrorsParser;class RpcParser{isError(f){return"error"in f}}const sendTransactionErrors={[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SEND_TRANSACTION_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SEND_TRANSACTION_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SEND_TRANSACTION_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SendTransactionParser extends RpcParser{convertToRpcRequest(f){return{method:"sendTransaction",params:[JSON.stringify(f)]}}parseAndThrowError(f){let d=UnknownError;throw f.error.code in sendTransactionErrors&&(d=sendTransactionErrors[f.error.code]||UnknownError),new d(f.error.message)}convertFromRpcResponse(f){return{boc:f.result}}}const sendTransactionParser=new SendTransactionParser,signDataErrors={[SIGN_DATA_ERROR_CODES.UNKNOWN_ERROR]:UnknownError,[SIGN_DATA_ERROR_CODES.USER_REJECTS_ERROR]:UserRejectsError,[SIGN_DATA_ERROR_CODES.BAD_REQUEST_ERROR]:BadRequestError,[SIGN_DATA_ERROR_CODES.UNKNOWN_APP_ERROR]:UnknownAppError};class SignDataParser extends RpcParser{convertToRpcRequest(f){return{method:"signData",params:[JSON.stringify(f)]}}parseAndThrowError(f){let d=UnknownError;throw f.error.code in signDataErrors&&(d=signDataErrors[f.error.code]||UnknownError),new d(f.error.message)}convertFromRpcResponse(f){return f.result}}const signDataParser=new SignDataParser;class HttpBridgeGatewayStorage{constructor(f,d){this.storage=f,this.storeKey="ton-connect-storage_http-bridge-gateway::"+d}storeLastEventId(f){return __awaiter(this,void 0,void 0,function*(){return this.storage.setItem(this.storeKey,f)})}removeLastEventId(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);return f||null})}}function removeUrlLastSlash(r){return r.slice(-1)==="/"?r.slice(0,-1):r}function addPathToUrl(r,f){return removeUrlLastSlash(r)+"/"+f}function isTelegramUrl(r){if(!r)return!1;const f=new URL(r);return f.protocol==="tg:"||f.hostname==="t.me"}function encodeTelegramUrlParameters(r){return r.replaceAll(".","%2E").replaceAll("-","%2D").replaceAll("_","%5F").replaceAll("&","-").replaceAll("=","__").replaceAll("%","--")}function delay(r,f){return __awaiter(this,void 0,void 0,function*(){return new Promise((d,m)=>{var v,g;if(!((v=void 0)===null||v===void 0)&&v.aborted){m(new TonConnectError("Delay aborted"));return}const w=setTimeout(()=>d(),r);(g=void 0)===null||g===void 0||g.addEventListener("abort",()=>{clearTimeout(w),m(new TonConnectError("Delay aborted"))})})})}function createAbortController(r){const f=new AbortController;return r!=null&&r.aborted?f.abort():r==null||r.addEventListener("abort",()=>f.abort(),{once:!0}),f}function callForSuccess(r,f){var d,m;return __awaiter(this,void 0,void 0,function*(){const v=(d=f==null?void 0:f.attempts)!==null&&d!==void 0?d:10,g=(m=f==null?void 0:f.delayMs)!==null&&m!==void 0?m:200,w=createAbortController(f==null?void 0:f.signal);if(typeof r!="function")throw new TonConnectError(`Expected a function, got ${typeof r}`);let x=0,S;for(;x<v;){if(w.signal.aborted)throw new TonConnectError(`Aborted after attempts ${x}`);try{return yield r({signal:w.signal})}catch(_){S=_,x++,x<v&&(yield delay(g))}}throw S})}function logDebug$1(...r){}function logError$1(...r){}function logWarning$1(...r){}function createResource$1(r,f){let d=null,m=null,v=null,g=null,w=null;const x=(C,...E)=>__awaiter(this,void 0,void 0,function*(){if(g=C??null,w==null||w.abort(),w=createAbortController(C),w.signal.aborted)throw new TonConnectError("Resource creation was aborted");m=E??null;const M=r(w.signal,...E);v=M;const A=yield M;if(v!==M&&A!==d)throw yield f(A),new TonConnectError("Resource creation was aborted by a new resource creation");return d=A,d});return{create:x,current:()=>d??null,dispose:()=>__awaiter(this,void 0,void 0,function*(){try{const C=d;d=null;const E=v;v=null;try{w==null||w.abort()}catch{}yield Promise.allSettled([C?f(C):Promise.resolve(),E?f(yield E):Promise.resolve()])}catch{}}),recreate:C=>__awaiter(this,void 0,void 0,function*(){const E=d,M=v,A=m,T=g;if(yield delay(C),E===d&&M===v&&A===m&&T===g)return yield x(g,...A??[]);throw new TonConnectError("Resource recreation was aborted by a new resource creation")})}}function timeout(r,f){const d=f==null?void 0:f.timeout,m=f==null?void 0:f.signal,v=createAbortController(m);return new Promise((g,w)=>__awaiter(this,void 0,void 0,function*(){if(v.signal.aborted){w(new TonConnectError("Operation aborted"));return}let x;typeof d<"u"&&(x=setTimeout(()=>{v.abort(),w(new TonConnectError(`Timeout after ${d}ms`))},d)),v.signal.addEventListener("abort",()=>{clearTimeout(x),w(new TonConnectError("Operation aborted"))},{once:!0});const S={timeout:d,abort:v.signal};yield r((..._)=>{clearTimeout(x),g(..._)},()=>{clearTimeout(x),w()},S)}))}class BridgeGateway{constructor(f,d,m,v,g){this.bridgeUrl=d,this.sessionId=m,this.listener=v,this.errorsListener=g,this.ssePath="events",this.postPath="message",this.heartbeatMessage="heartbeat",this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=createResource$1((w,x)=>__awaiter(this,void 0,void 0,function*(){const S={bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:w,openingDeadlineMS:x};return yield createEventSource(S)}),w=>__awaiter(this,void 0,void 0,function*(){w.close()})),this.bridgeGatewayStorage=new HttpBridgeGatewayStorage(f,d)}get isReady(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)===EventSource.OPEN}get isClosed(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)!==EventSource.OPEN}get isConnecting(){const f=this.eventSource.current();return(f==null?void 0:f.readyState)===EventSource.CONNECTING}registerSession(f){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.create(f==null?void 0:f.signal,f==null?void 0:f.openingDeadlineMS)})}send(f,d,m,v){var g;return __awaiter(this,void 0,void 0,function*(){const w={};typeof v=="number"?w.ttl=v:(w.ttl=v==null?void 0:v.ttl,w.signal=v==null?void 0:v.signal,w.attempts=v==null?void 0:v.attempts);const x=new URL(addPathToUrl(this.bridgeUrl,this.postPath));x.searchParams.append("client_id",this.sessionId),x.searchParams.append("to",d),x.searchParams.append("ttl",((w==null?void 0:w.ttl)||this.defaultTtl).toString()),x.searchParams.append("topic",m);const S=Base64.encode(f);yield callForSuccess(_=>__awaiter(this,void 0,void 0,function*(){const b=yield this.post(x,S,_.signal);if(!b.ok)throw new TonConnectError(`Bridge send failed, status ${b.status}`)}),{attempts:(g=w==null?void 0:w.attempts)!==null&&g!==void 0?g:Number.MAX_SAFE_INTEGER,delayMs:this.defaultResendDelay,signal:w==null?void 0:w.signal})})}pause(){this.eventSource.dispose().catch(f=>logError$1(`Bridge pause failed, ${f}`))}unPause(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return __awaiter(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(f=>logError$1(`Bridge close failed, ${f}`))})}setListener(f){this.listener=f}setErrorsListener(f){this.errorsListener=f}post(f,d,m){return __awaiter(this,void 0,void 0,function*(){const v=yield fetch(f,{method:"post",body:d,signal:m});if(!v.ok)throw new TonConnectError(`Bridge send failed, status ${v.status}`);return v})}errorsHandler(f,d){return __awaiter(this,void 0,void 0,function*(){if(this.isConnecting)throw f.close(),new TonConnectError("Bridge error, failed to connect");if(this.isReady){try{this.errorsListener(d)}catch{}return}if(this.isClosed)return f.close(),logDebug$1(`Bridge reconnecting, ${this.defaultReconnectDelay}ms delay`),yield this.eventSource.recreate(this.defaultReconnectDelay);throw new TonConnectError("Bridge error, unknown state")})}messagesHandler(f){return __awaiter(this,void 0,void 0,function*(){if(f.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(f.lastEventId),this.isClosed))return;let d;try{d=JSON.parse(f.data)}catch{throw new TonConnectError(`Bridge message parse failed, message ${f.data}`)}this.listener(d)})}}function createEventSource(r){return __awaiter(this,void 0,void 0,function*(){return yield timeout((f,d,m)=>__awaiter(this,void 0,void 0,function*(){var v;const w=createAbortController(m.signal).signal;if(w.aborted){d(new TonConnectError("Bridge connection aborted"));return}const x=new URL(addPathToUrl(r.bridgeUrl,r.ssePath));x.searchParams.append("client_id",r.sessionId);const S=yield r.bridgeGatewayStorage.getLastEventId();if(S&&x.searchParams.append("last_event_id",S),w.aborted){d(new TonConnectError("Bridge connection aborted"));return}const _=new EventSource(x.toString());_.onerror=b=>__awaiter(this,void 0,void 0,function*(){if(w.aborted){_.close(),d(new TonConnectError("Bridge connection aborted"));return}try{const C=yield r.errorHandler(_,b);C!==_&&_.close(),C&&C!==_&&f(C)}catch(C){_.close(),d(C)}}),_.onopen=()=>{if(w.aborted){_.close(),d(new TonConnectError("Bridge connection aborted"));return}f(_)},_.onmessage=b=>{if(w.aborted){_.close(),d(new TonConnectError("Bridge connection aborted"));return}r.messageHandler(b)},(v=r.signal)===null||v===void 0||v.addEventListener("abort",()=>{_.close(),d(new TonConnectError("Bridge connection aborted"))})}),{timeout:r.openingDeadlineMS,signal:r.signal})})}const CONNECTION_HTTP_EXPIRATION_TIME=300*1e3;function isPendingConnectionHttp(r){return!("connectEvent"in r)}function isPendingConnectionHttpRaw(r){return!("connectEvent"in r)}function isExpiredPendingConnectionHttpRaw(r){var f;return Date.now()-((f=r.createdAt)!==null&&f!==void 0?f:0)>CONNECTION_HTTP_EXPIRATION_TIME}class BridgeConnectionStorage{constructor(f){this.storage=f,this.storeKey="ton-connect-storage_bridge-connection"}storeConnection(f){return __awaiter(this,void 0,void 0,function*(){if(f.type==="injected")return this.storage.setItem(this.storeKey,JSON.stringify(f));if(!isPendingConnectionHttp(f)){const m={sessionKeyPair:f.session.sessionCrypto.stringifyKeypair(),walletPublicKey:f.session.walletPublicKey,bridgeUrl:f.session.bridgeUrl},v={type:"http",connectEvent:f.connectEvent,session:m,lastWalletEventId:f.lastWalletEventId,nextRpcRequestId:f.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(v))}const d={type:"http",connectionSource:f.connectionSource,sessionCrypto:f.sessionCrypto.stringifyKeypair(),createdAt:Date.now()};return this.storage.setItem(this.storeKey,JSON.stringify(d))})}removeConnection(){return __awaiter(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);if(!f)return null;const d=JSON.parse(f);if(d.type==="injected")return d;if(!isPendingConnectionHttpRaw(d)){const m=new SessionCrypto(d.session.sessionKeyPair);return{type:"http",connectEvent:d.connectEvent,lastWalletEventId:d.lastWalletEventId,nextRpcRequestId:d.nextRpcRequestId,session:{sessionCrypto:m,bridgeUrl:d.session.bridgeUrl,walletPublicKey:d.session.walletPublicKey}}}return isExpiredPendingConnectionHttpRaw(d)?(yield this.removeConnection(),null):{type:"http",sessionCrypto:new SessionCrypto(d.sessionCrypto),connectionSource:d.connectionSource}})}getHttpConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(f.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");return f})}getHttpPendingConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read HTTP connection source while nothing is stored");if(f.type==="injected")throw new TonConnectError("Trying to read HTTP connection source while injected connection is stored");if(!isPendingConnectionHttp(f))throw new TonConnectError("Trying to read HTTP-pending connection while http connection is stored");return f})}getInjectedConnection(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(!f)throw new TonConnectError("Trying to read Injected bridge connection source while nothing is stored");if((f==null?void 0:f.type)==="http")throw new TonConnectError("Trying to read Injected bridge connection source while HTTP connection is stored");return f})}storedConnectionType(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.storage.getItem(this.storeKey);return f?JSON.parse(f).type:null})}storeLastWalletEventId(f){return __awaiter(this,void 0,void 0,function*(){const d=yield this.getConnection();if(d&&d.type==="http"&&!isPendingConnectionHttp(d))return d.lastWalletEventId=f,this.storeConnection(d)})}getLastWalletEventId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(f&&"lastWalletEventId"in f)return f.lastWalletEventId})}increaseNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();if(f&&"nextRpcRequestId"in f){const d=f.nextRpcRequestId||0;return f.nextRpcRequestId=d+1,this.storeConnection(f)}})}getNextRpcRequestId(){return __awaiter(this,void 0,void 0,function*(){const f=yield this.getConnection();return f&&"nextRpcRequestId"in f&&f.nextRpcRequestId||0})}}const PROTOCOL_VERSION=2;class BridgeProvider{constructor(f,d){this.storage=f,this.walletConnectionSource=d,this.type="http",this.standardUniversalLink="tc://",this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.connectionStorage=new BridgeConnectionStorage(f)}static fromStorage(f){return __awaiter(this,void 0,void 0,function*(){const m=yield new BridgeConnectionStorage(f).getHttpConnection();return isPendingConnectionHttp(m)?new BridgeProvider(f,m.connectionSource):new BridgeProvider(f,{bridgeUrl:m.session.bridgeUrl})})}connect(f,d){var m;const v=createAbortController(d==null?void 0:d.signal);(m=this.abortController)===null||m===void 0||m.abort(),this.abortController=v,this.closeGateways();const g=new SessionCrypto;this.session={sessionCrypto:g,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},this.connectionStorage.storeConnection({type:"http",connectionSource:this.walletConnectionSource,sessionCrypto:g}).then(()=>__awaiter(this,void 0,void 0,function*(){v.signal.aborted||(yield callForSuccess(x=>{var S;return this.openGateways(g,{openingDeadlineMS:(S=d==null?void 0:d.openingDeadlineMS)!==null&&S!==void 0?S:this.defaultOpeningDeadlineMS,signal:x==null?void 0:x.signal})},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:v.signal}))}));const w="universalLink"in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink;return this.generateUniversalLink(w,f)}restoreConnection(f){var d,m;return __awaiter(this,void 0,void 0,function*(){const v=createAbortController(f==null?void 0:f.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=v,v.signal.aborted)return;this.closeGateways();const g=yield this.connectionStorage.getHttpConnection();if(!g||v.signal.aborted)return;const w=(m=f==null?void 0:f.openingDeadlineMS)!==null&&m!==void 0?m:this.defaultOpeningDeadlineMS;if(isPendingConnectionHttp(g))return this.session={sessionCrypto:g.sessionCrypto,bridgeUrl:"bridgeUrl"in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:""},yield this.openGateways(g.sessionCrypto,{openingDeadlineMS:w,signal:v==null?void 0:v.signal});if(Array.isArray(this.walletConnectionSource))throw new TonConnectError("Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.");if(this.session=g.session,this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,g.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),!v.signal.aborted){this.listeners.forEach(x=>x(g.connectEvent));try{yield callForSuccess(x=>this.gateway.registerSession({openingDeadlineMS:w,signal:x.signal}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:v.signal})}catch{yield this.disconnect({signal:v.signal});return}}})}sendRequest(f,d){const m={};return typeof d=="function"?m.onRequestSent=d:(m.onRequestSent=d==null?void 0:d.onRequestSent,m.signal=d==null?void 0:d.signal,m.attempts=d==null?void 0:d.attempts),new Promise((v,g)=>__awaiter(this,void 0,void 0,function*(){var w;if(!this.gateway||!this.session||!("walletPublicKey"in this.session))throw new TonConnectError("Trying to send bridge request without session");const x=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send http-bridge request:",Object.assign(Object.assign({},f),{id:x}));const S=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},f),{id:x})),hexToByteArray(this.session.walletPublicKey));try{yield this.gateway.send(S,this.session.walletPublicKey,f.method,{attempts:m==null?void 0:m.attempts,signal:m==null?void 0:m.signal}),(w=m==null?void 0:m.onRequestSent)===null||w===void 0||w.call(m),this.pendingRequests.set(x.toString(),v)}catch(_){g(_)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(f){return __awaiter(this,void 0,void 0,function*(){return new Promise(d=>__awaiter(this,void 0,void 0,function*(){let m=!1,v=null;const g=()=>{m||(m=!0,this.removeBridgeAndSession().then(d))};try{this.closeGateways();const w=createAbortController(f==null?void 0:f.signal);v=setTimeout(()=>{w.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:"disconnect",params:[]},{onRequestSent:g,signal:w.signal,attempts:1})}catch(w){logDebug$1("Disconnect error:",w),m||this.removeBridgeAndSession().then(d)}finally{v&&clearTimeout(v),g()}}))})}listen(f){return this.listeners.push(f),()=>this.listeners=this.listeners.filter(d=>d!==f)}pause(){var f;(f=this.gateway)===null||f===void 0||f.pause(),this.pendingGateways.forEach(d=>d.pause())}unPause(){return __awaiter(this,void 0,void 0,function*(){const f=this.pendingGateways.map(d=>d.unPause());this.gateway&&f.push(this.gateway.unPause()),yield Promise.all(f)})}pendingGatewaysListener(f,d,m){return __awaiter(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(f)){yield f.close();return}return this.closeGateways({except:f}),this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.session.bridgeUrl=d,this.gateway=f,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(m)})}gatewayListener(f){return __awaiter(this,void 0,void 0,function*(){const d=JSON.parse(this.session.sessionCrypto.decrypt(Base64.decode(f.message).toUint8Array(),hexToByteArray(f.from)));if(logDebug$1("Wallet message received:",d),!("event"in d)){const v=d.id.toString(),g=this.pendingRequests.get(v);if(!g){logDebug$1(`Response id ${v} doesn't match any request's id`);return}g(d),this.pendingRequests.delete(v);return}if(d.id!==void 0){const v=yield this.connectionStorage.getLastWalletEventId();if(v!==void 0&&d.id<=v){logError$1(`Received event id (=${d.id}) must be greater than stored last wallet event id (=${v}) `);return}d.event!=="connect"&&(yield this.connectionStorage.storeLastWalletEventId(d.id))}const m=this.listeners;d.event==="connect"&&(yield this.updateSession(d,f.from)),d.event==="disconnect"&&(logDebug$1("Removing bridge and session: received disconnect event"),yield this.removeBridgeAndSession()),m.forEach(v=>v(d))})}gatewayErrorsListener(f){return __awaiter(this,void 0,void 0,function*(){throw new TonConnectError(`Bridge error ${JSON.stringify(f)}`)})}updateSession(f,d){return __awaiter(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:d});const m=f.payload.items.find(g=>g.name==="ton_addr"),v=Object.assign(Object.assign({},f),{payload:Object.assign(Object.assign({},f.payload),{items:[m]})});yield this.connectionStorage.storeConnection({type:"http",session:this.session,lastWalletEventId:f.id,connectEvent:v,nextRpcRequestId:0})})}removeBridgeAndSession(){return __awaiter(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}generateUniversalLink(f,d){return isTelegramUrl(f)?this.generateTGUniversalLink(f,d):this.generateRegularUniversalLink(f,d)}generateRegularUniversalLink(f,d){const m=new URL(f);return m.searchParams.append("v",PROTOCOL_VERSION.toString()),m.searchParams.append("id",this.session.sessionCrypto.sessionId),m.searchParams.append("r",JSON.stringify(d)),m.toString()}generateTGUniversalLink(f,d){const v=this.generateRegularUniversalLink("about:blank",d).split("?")[1],g="tonconnect-"+encodeTelegramUrlParameters(v),w=this.convertToDirectLink(f),x=new URL(w);return x.searchParams.append("startapp",g),x.toString()}convertToDirectLink(f){const d=new URL(f);return d.searchParams.has("attach")&&(d.searchParams.delete("attach"),d.pathname+="/start"),d.toString()}openGateways(f,d){return __awaiter(this,void 0,void 0,function*(){if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(m=>m.close().catch()),this.pendingGateways=this.walletConnectionSource.map(m=>{const v=new BridgeGateway(this.storage,m.bridgeUrl,f.sessionId,()=>{},()=>{});return v.setListener(g=>this.pendingGatewaysListener(v,m.bridgeUrl,g)),v}),yield Promise.allSettled(this.pendingGateways.map(m=>callForSuccess(v=>{var g;return this.pendingGateways.some(w=>w===m)?m.registerSession({openingDeadlineMS:(g=d==null?void 0:d.openingDeadlineMS)!==null&&g!==void 0?g:this.defaultOpeningDeadlineMS,signal:v.signal}):m.close()},{attempts:Number.MAX_SAFE_INTEGER,delayMs:this.defaultRetryTimeoutMS,signal:d==null?void 0:d.signal})));return}else return this.gateway&&(logDebug$1("Gateway is already opened, closing previous gateway"),yield this.gateway.close()),this.gateway=new BridgeGateway(this.storage,this.walletConnectionSource.bridgeUrl,f.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this)),yield this.gateway.registerSession({openingDeadlineMS:d==null?void 0:d.openingDeadlineMS,signal:d==null?void 0:d.signal})})}closeGateways(f){var d;(d=this.gateway)===null||d===void 0||d.close(),this.pendingGateways.filter(m=>m!==(f==null?void 0:f.except)).forEach(m=>m.close()),this.pendingGateways=[]}}function hasProperty(r,f){return hasProperties(r,[f])}function hasProperties(r,f){return!r||typeof r!="object"?!1:f.every(d=>d in r)}function isJSBridgeWithMetadata(r){try{return!hasProperty(r,"tonconnect")||!hasProperty(r.tonconnect,"walletInfo")?!1:hasProperties(r.tonconnect.walletInfo,["name","app_name","image","about_url","platforms"])}catch{return!1}}let InMemoryStorage$1=class zt{constructor(){this.storage={}}static getInstance(){return zt.instance||(zt.instance=new zt),zt.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(f){var d;return(d=this.storage[f])!==null&&d!==void 0?d:null}key(f){var d;const m=Object.keys(this.storage);return f<0||f>=m.length?null:(d=m[f])!==null&&d!==void 0?d:null}removeItem(f){delete this.storage[f]}setItem(f,d){this.storage[f]=d}};function getWindow$2(){if(!(typeof window>"u"))return window}function tryGetWindowKeys(){const r=getWindow$2();if(!r)return[];try{return Object.keys(r)}catch{return[]}}function getDocument(){if(!(typeof document>"u"))return document}function getWebPageManifest(){var r;const f=(r=getWindow$2())===null||r===void 0?void 0:r.location.origin;return f?f+"/tonconnect-manifest.json":""}function tryGetLocalStorage$1(){if(isLocalStorageAvailable$1())return localStorage;if(isNodeJs$1())throw new TonConnectError("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return InMemoryStorage$1.getInstance()}function isLocalStorageAvailable$1(){try{return typeof localStorage<"u"}catch{return!1}}function isNodeJs$1(){return typeof process$1<"u"&&process$1.versions!=null&&process$1.versions.node!=null}class InjectedProvider{constructor(f,d){this.injectedWalletKey=d,this.type="injected",this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];const m=InjectedProvider.window;if(!InjectedProvider.isWindowContainsWallet(m,d))throw new WalletNotInjectedError;this.connectionStorage=new BridgeConnectionStorage(f),this.injectedWallet=m[d].tonconnect}static fromStorage(f){return __awaiter(this,void 0,void 0,function*(){const m=yield new BridgeConnectionStorage(f).getInjectedConnection();return new InjectedProvider(f,m.jsBridgeKey)})}static isWalletInjected(f){return InjectedProvider.isWindowContainsWallet(this.window,f)}static isInsideWalletBrowser(f){return InjectedProvider.isWindowContainsWallet(this.window,f)?this.window[f].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?tryGetWindowKeys().filter(([m,v])=>isJSBridgeWithMetadata(v)).map(([m,v])=>({name:v.tonconnect.walletInfo.name,appName:v.tonconnect.walletInfo.app_name,aboutUrl:v.tonconnect.walletInfo.about_url,imageUrl:v.tonconnect.walletInfo.image,tondns:v.tonconnect.walletInfo.tondns,jsBridgeKey:m,injected:!0,embedded:v.tonconnect.isWalletBrowser,platforms:v.tonconnect.walletInfo.platforms,features:v.tonconnect.walletInfo.features})):[]}static isWindowContainsWallet(f,d){return!!f&&d in f&&typeof f[d]=="object"&&"tonconnect"in f[d]}connect(f){this._connect(PROTOCOL_VERSION,f)}restoreConnection(){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1("Injected Provider restoring connection...");const f=yield this.injectedWallet.restoreConnection();logDebug$1("Injected Provider restoring connection response",f),f.event==="connect"?(this.makeSubscriptions(),this.listeners.forEach(d=>d(f))):yield this.connectionStorage.removeConnection()}catch{yield this.connectionStorage.removeConnection()}})}closeConnection(){this.listenSubscriptions&&this.injectedWallet.disconnect(),this.closeAllListeners()}disconnect(){return __awaiter(this,void 0,void 0,function*(){return new Promise(f=>{const d=()=>{this.closeAllListeners(),this.connectionStorage.removeConnection().then(f)};try{this.injectedWallet.disconnect(),d()}catch(m){logDebug$1(m),this.sendRequest({method:"disconnect",params:[]},d)}})})}closeAllListeners(){var f;this.listenSubscriptions=!1,this.listeners=[],(f=this.unsubscribeCallback)===null||f===void 0||f.call(this)}listen(f){return this.listeners.push(f),()=>this.listeners=this.listeners.filter(d=>d!==f)}sendRequest(f,d){var m;return __awaiter(this,void 0,void 0,function*(){const v={};typeof d=="function"?v.onRequestSent=d:(v.onRequestSent=d==null?void 0:d.onRequestSent,v.signal=d==null?void 0:d.signal);const g=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),logDebug$1("Send injected-bridge request:",Object.assign(Object.assign({},f),{id:g}));const w=this.injectedWallet.send(Object.assign(Object.assign({},f),{id:g}));return w.then(x=>logDebug$1("Wallet message received:",x)),(m=v==null?void 0:v.onRequestSent)===null||m===void 0||m.call(v),w})}_connect(f,d){return __awaiter(this,void 0,void 0,function*(){try{logDebug$1(`Injected Provider connect request: protocolVersion: ${f}, message:`,d);const m=yield this.injectedWallet.connect(f,d);logDebug$1("Injected Provider connect response:",m),m.event==="connect"&&(yield this.updateSession(),this.makeSubscriptions()),this.listeners.forEach(v=>v(m))}catch(m){logDebug$1("Injected Provider connect error:",m);const v={event:"connect_error",payload:{code:0,message:m==null?void 0:m.toString()}};this.listeners.forEach(g=>g(v))}})}makeSubscriptions(){this.listenSubscriptions=!0,this.unsubscribeCallback=this.injectedWallet.listen(f=>{logDebug$1("Wallet message received:",f),this.listenSubscriptions&&this.listeners.forEach(d=>d(f)),f.event==="disconnect"&&this.disconnect()})}updateSession(){return this.connectionStorage.storeConnection({type:"injected",jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}}InjectedProvider.window=getWindow$2();class DefaultStorage{constructor(){this.localStorage=tryGetLocalStorage$1()}getItem(f){return __awaiter(this,void 0,void 0,function*(){return this.localStorage.getItem(f)})}removeItem(f){return __awaiter(this,void 0,void 0,function*(){this.localStorage.removeItem(f)})}setItem(f,d){return __awaiter(this,void 0,void 0,function*(){this.localStorage.setItem(f,d)})}}function isWalletInfoCurrentlyInjected(r){return isWalletInfoInjectable(r)&&r.injected}function isWalletInfoCurrentlyEmbedded(r){return isWalletInfoCurrentlyInjected(r)&&r.embedded}function isWalletInfoInjectable(r){return"jsBridgeKey"in r}function isWalletInfoRemote(r){return"bridgeUrl"in r}const FALLBACK_WALLETS_LIST=[{app_name:"telegram-wallet",name:"Wallet",image:"https://wallet.tg/images/logo-288.png",about_url:"https://wallet.tg/",universal_url:"https://t.me/wallet?attach=wallet",bridge:[{type:"sse",url:"https://walletbot.me/tonconnect-bridge/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"tonkeeper",name:"Tonkeeper",image:"https://tonkeeper.com/assets/tonconnect-icon.png",tondns:"tonkeeper.ton",about_url:"https://tonkeeper.com",universal_url:"https://app.tonkeeper.com/ton-connect",deepLink:"tonkeeper-tc://",bridge:[{type:"sse",url:"https://bridge.tonapi.io/bridge"},{type:"js",key:"tonkeeper"}],platforms:["ios","android","chrome","firefox","macos"]},{app_name:"mytonwallet",name:"MyTonWallet",image:"https://static.mytonwallet.io/icon-256.png",about_url:"https://mytonwallet.io",universal_url:"https://connect.mytonwallet.org",bridge:[{type:"js",key:"mytonwallet"},{type:"sse",url:"https://tonconnectbridge.mytonwallet.org/bridge/"}],platforms:["chrome","windows","macos","linux","ios","android","firefox"]},{app_name:"tonhub",name:"Tonhub",image:"https://tonhub.com/tonconnect_logo.png",about_url:"https://tonhub.com",universal_url:"https://tonhub.com/ton-connect",bridge:[{type:"js",key:"tonhub"},{type:"sse",url:"https://connect.tonhubapi.com/tonconnect"}],platforms:["ios","android"]},{app_name:"bitgetTonWallet",name:"Bitget Wallet",image:"https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png",about_url:"https://web3.bitget.com",deepLink:"bitkeep://",bridge:[{type:"js",key:"bitgetTonWallet"},{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","chrome"],universal_url:"https://bkcode.vip/ton-connect"},{app_name:"okxMiniWallet",name:"OKX Mini Wallet",image:"https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png",about_url:"https://www.okx.com/web3",universal_url:"https://t.me/OKX_WALLET_BOT?attach=wallet",bridge:[{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"binanceWeb3TonWallet",name:"Binance Web3 Wallet",image:"https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png",about_url:"https://www.binance.com/en/web3wallet",deepLink:"bnc://app.binance.com/cedefi/ton-connect",bridge:[{type:"js",key:"binancew3w"},{type:"sse",url:"https://wallet.binance.com/tonbridge/bridge"}],platforms:["ios","android","macos","windows","linux"],universal_url:"https://app.binance.com/cedefi/ton-connect"},{app_name:"fintopio-tg",name:"Fintopio",image:"https://fintopio.com/tonconnect-icon.png",about_url:"https://fintopio.com",universal_url:"https://t.me/fintopio?attach=wallet",bridge:[{type:"sse",url:"https://wallet-bridge.fintopio.com/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"okxTonWallet",name:"OKX Wallet",image:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png",about_url:"https://www.okx.com/web3",universal_url:"https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect",bridge:[{type:"js",key:"okxTonWallet"},{type:"sse",url:"https://www.okx.com/tonbridge/discover/rpc/bridge"}],platforms:["chrome","safari","firefox","ios","android"]},{app_name:"hot",name:"HOT",image:"https://raw.githubusercontent.com/hot-dao/media/main/logo.png",about_url:"https://hot-labs.org/",universal_url:"https://t.me/herewalletbot?attach=wallet",bridge:[{type:"sse",url:"https://sse-bridge.hot-labs.org"},{type:"js",key:"hotWallet"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"bybitTonWallet",name:"Bybit Wallet",image:"https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png",about_url:"https://www.bybit.com/web3",universal_url:"https://app.bybit.com/ton-connect",deepLink:"bybitapp://",bridge:[{type:"js",key:"bybitTonWallet"},{type:"sse",url:"https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge"}],platforms:["ios","android","chrome"]},{app_name:"dewallet",name:"DeWallet",image:"https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png",about_url:"https://delabwallet.com",universal_url:"https://t.me/dewallet?attach=wallet",bridge:[{type:"sse",url:"https://bridge.dewallet.pro/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"safepalwallet",name:"SafePal",image:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",about_url:"https://www.safepal.com",universal_url:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",bridge:[{type:"sse",url:"https://ton-bridge.safepal.com/tonbridge/v1/bridge"},{type:"js",key:"safepalwallet"}],platforms:["ios","android","chrome","firefox"]},{app_name:"GateWallet",name:"GateWallet",image:"https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png",about_url:"https://www.gate.io/",bridge:[{type:"js",key:"gatetonwallet"},{type:"sse",url:"https://dapp.gateio.services/tonbridge_api/bridge/v1"}],platforms:["ios","android"],universal_url:"https://gateio.go.link/gateio/web3?adj_t=1ff8khdw_1fu4ccc7"},{app_name:"openmask",name:"OpenMask",image:"https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png",about_url:"https://www.openmask.app/",bridge:[{type:"js",key:"openmask"}],platforms:["chrome"]},{app_name:"BitgetWeb3",name:"BitgetWeb3",image:"https://img.bitgetimg.com/image/third/1731638059795.png",about_url:"​https://www.bitget.com",universal_url:"https://t.me/BitgetOfficialBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-connect-bridge.bgwapi.io/bridge"}],platforms:["ios","android","windows","macos","linux"]},{app_name:"tobi",name:"Tobi",image:"https://app.tobiwallet.app/icons/logo-288.png",about_url:"https://tobi.fun",universal_url:"https://t.me/TobiCopilotBot?attach=wallet",bridge:[{type:"sse",url:"https://ton-bridge.tobiwallet.app/bridge"}],platforms:["ios","android","macos","windows","linux"]},{app_name:"xtonwallet",name:"XTONWallet",image:"https://xtonwallet.com/assets/img/icon-256-back.png",about_url:"https://xtonwallet.com",bridge:[{type:"js",key:"xtonwallet"}],platforms:["chrome","firefox"]},{app_name:"tonwallet",name:"TON Wallet",image:"https://wallet.ton.org/assets/ui/qr-logo.png",about_url:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",bridge:[{type:"js",key:"tonwallet"}],platforms:["chrome"]}];class WalletsListManager{constructor(f){var d;this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null,this.walletsListSource=(d=f==null?void 0:f.walletsListSource)!==null&&d!==void 0?d:"https://raw.githubusercontent.com/ton-blockchain/wallets-list/main/wallets-v2.json",this.cacheTTLMs=f==null?void 0:f.cacheTTLMs}getWallets(){return __awaiter(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListCacheCreationTimestamp&&Date.now()>this.walletsListCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListCache=null),this.walletsListCache||(this.walletsListCache=this.fetchWalletsList(),this.walletsListCache.then(()=>{this.walletsListCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListCache=null,this.walletsListCacheCreationTimestamp=null})),this.walletsListCache})}getEmbeddedWallet(){return __awaiter(this,void 0,void 0,function*(){const d=(yield this.getWallets()).filter(isWalletInfoCurrentlyEmbedded);return d.length===1?d[0]:null})}fetchWalletsList(){return __awaiter(this,void 0,void 0,function*(){let f=[];try{if(f=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(f))throw new FetchWalletsError("Wrong wallets list format, wallets list must be an array.");const v=f.filter(g=>!this.isCorrectWalletConfigDTO(g));v.length&&(logError$1(`Wallet(s) ${v.map(g=>(g==null?void 0:g.name)||"unknown").join(", ")} config format is wrong. They were removed from the wallets list.`),f=f.filter(g=>this.isCorrectWalletConfigDTO(g)))}catch(m){logError$1(m),f=FALLBACK_WALLETS_LIST}let d=[];try{d=InjectedProvider.getCurrentlyInjectedWallets()}catch(m){logError$1(m)}return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(f),d)})}walletConfigDTOListToWalletConfigList(f){return f.map(d=>{const m={name:d.name,appName:d.app_name,imageUrl:d.image,aboutUrl:d.about_url,tondns:d.tondns,platforms:d.platforms,features:d.features};return d.bridge.forEach(v=>{if(v.type==="sse"&&(m.bridgeUrl=v.url,m.universalLink=d.universal_url,m.deepLink=d.deepLink),v.type==="js"){const g=v.key;m.jsBridgeKey=g,m.injected=InjectedProvider.isWalletInjected(g),m.embedded=InjectedProvider.isInsideWalletBrowser(g)}}),m})}mergeWalletsLists(f,d){return[...new Set(f.concat(d).map(v=>v.name)).values()].map(v=>{const g=f.find(x=>x.name===v),w=d.find(x=>x.name===v);return Object.assign(Object.assign({},g&&Object.assign({},g)),w&&Object.assign({},w))})}isCorrectWalletConfigDTO(f){if(!f||typeof f!="object")return!1;const d="name"in f,m="app_name"in f,v="image"in f,g="about_url"in f,w="platforms"in f;if(!d||!v||!g||!w||!m||!f.platforms||!Array.isArray(f.platforms)||!f.platforms.length||!("bridge"in f)||!Array.isArray(f.bridge)||!f.bridge.length)return!1;const x=f.bridge;if(x.some(b=>!b||typeof b!="object"||!("type"in b)))return!1;const S=x.find(b=>b.type==="sse");if(S&&(!(typeof S=="object"&&"url"in S)||!S.url||!f.universal_url))return!1;const _=x.find(b=>b.type==="js");return!(_&&(typeof _!="object"||!("key"in _)||!_.key))}}function checkSendTransactionSupport(r,f){const d=r.includes("SendTransaction"),m=findFeature(r,"SendTransaction"),v={minMessages:f.requiredMessagesNumber,extraCurrencyRequired:f.requireExtraCurrencies};if(!d&&!m)throw new WalletNotSupportFeatureError("Wallet doesn't support SendTransaction feature.",{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});if(f.requireExtraCurrencies&&(!m||!m.extraCurrencySupported))throw new WalletNotSupportFeatureError("Wallet is not able to handle such SendTransaction request. Extra currencies support is required.",{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});if(m&&m.maxMessages!==void 0){if(m.maxMessages<f.requiredMessagesNumber)throw new WalletNotSupportFeatureError(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${m.maxMessages}, but ${f.requiredMessagesNumber} is required.`,{cause:{requiredFeature:{featureName:"SendTransaction",value:v}}});return}logWarning$1("Connected wallet didn't provide information about max allowed messages in the SendTransaction request. Request may be rejected by the wallet.")}function checkSignDataSupport(r,f){const d=r.find(v=>v&&typeof v=="object"&&v.name==="SignData");if(!d)throw new WalletNotSupportFeatureError("Wallet doesn't support SignData feature.",{cause:{requiredFeature:{featureName:"SignData",value:{types:f.requiredTypes}}}});const m=f.requiredTypes.filter(v=>!d.types.includes(v));if(m.length)throw new WalletNotSupportFeatureError(`Wallet doesn't support required SignData types: ${m.join(", ")}.`,{cause:{requiredFeature:{featureName:"SignData",value:{types:m}}}})}function checkRequiredWalletFeatures(r,f){if(typeof f!="object")return!0;const{sendTransaction:d,signData:m}=f;if(d){const v=findFeature(r,"SendTransaction");if(!v||!checkSendTransaction(v,d))return!1}if(m){const v=findFeature(r,"SignData");if(!v||!checkSignData(v,m))return!1}return!0}function findFeature(r,f){return r.find(d=>d&&typeof d=="object"&&d.name===f)}function checkSendTransaction(r,f){const d=f.minMessages===void 0||f.minMessages<=r.maxMessages,m=!f.extraCurrencyRequired||r.extraCurrencySupported;return!!(d&&m)}function checkSignData(r,f){return f.types.every(d=>r.types.includes(d))}function createRequestVersionEvent(){return{type:"request-version"}}function createResponseVersionEvent(r){return{type:"response-version",version:r}}function createVersionInfo(r){return{ton_connect_sdk_lib:r.ton_connect_sdk_lib,ton_connect_ui_lib:r.ton_connect_ui_lib}}function createConnectionInfo(r,f){var d,m,v,g,w,x,S,_;const C=((d=f==null?void 0:f.connectItems)===null||d===void 0?void 0:d.tonProof)&&"proof"in f.connectItems.tonProof?"ton_proof":"ton_addr";return{wallet_address:(v=(m=f==null?void 0:f.account)===null||m===void 0?void 0:m.address)!==null&&v!==void 0?v:null,wallet_type:(g=f==null?void 0:f.device.appName)!==null&&g!==void 0?g:null,wallet_version:(w=f==null?void 0:f.device.appVersion)!==null&&w!==void 0?w:null,auth_type:C,custom_data:Object.assign({chain_id:(S=(x=f==null?void 0:f.account)===null||x===void 0?void 0:x.chain)!==null&&S!==void 0?S:null,provider:(_=f==null?void 0:f.provider)!==null&&_!==void 0?_:null},createVersionInfo(r))}}function createConnectionStartedEvent(r){return{type:"connection-started",custom_data:createVersionInfo(r)}}function createConnectionCompletedEvent(r,f){return Object.assign({type:"connection-completed",is_success:!0},createConnectionInfo(r,f))}function createConnectionErrorEvent(r,f,d){return{type:"connection-error",is_success:!1,error_message:f,error_code:d??null,custom_data:createVersionInfo(r)}}function createConnectionRestoringStartedEvent(r){return{type:"connection-restoring-started",custom_data:createVersionInfo(r)}}function createConnectionRestoringCompletedEvent(r,f){return Object.assign({type:"connection-restoring-completed",is_success:!0},createConnectionInfo(r,f))}function createConnectionRestoringErrorEvent(r,f){return{type:"connection-restoring-error",is_success:!1,error_message:f,custom_data:createVersionInfo(r)}}function createTransactionInfo(r,f){var d,m,v,g;return{valid_until:(d=String(f.validUntil))!==null&&d!==void 0?d:null,from:(g=(m=f.from)!==null&&m!==void 0?m:(v=r==null?void 0:r.account)===null||v===void 0?void 0:v.address)!==null&&g!==void 0?g:null,messages:f.messages.map(w=>{var x,S;return{address:(x=w.address)!==null&&x!==void 0?x:null,amount:(S=w.amount)!==null&&S!==void 0?S:null}})}}function createTransactionSentForSignatureEvent(r,f,d){return Object.assign(Object.assign({type:"transaction-sent-for-signature"},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createTransactionSignedEvent(r,f,d,m){return Object.assign(Object.assign({type:"transaction-signed",is_success:!0,signed_transaction:m.boc},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createTransactionSigningFailedEvent(r,f,d,m,v){return Object.assign(Object.assign({type:"transaction-signing-failed",is_success:!1,error_message:m,error_code:v??null},createConnectionInfo(r,f)),createTransactionInfo(f,d))}function createDataSentForSignatureEvent(r,f,d){return Object.assign({type:"sign-data-request-initiated",data:d},createConnectionInfo(r,f))}function createDataSignedEvent(r,f,d,m){return Object.assign({type:"sign-data-request-completed",is_success:!0,data:d,signed_data:m},createConnectionInfo(r,f))}function createDataSigningFailedEvent(r,f,d,m,v){return Object.assign({type:"sign-data-request-failed",is_success:!1,data:d,error_message:m,error_code:v??null},createConnectionInfo(r,f))}function createDisconnectionEvent(r,f,d){return Object.assign({type:"disconnection",scope:d},createConnectionInfo(r,f))}class BrowserEventDispatcher{constructor(){this.window=getWindow$2()}dispatchEvent(f,d){var m;return __awaiter(this,void 0,void 0,function*(){const v=new CustomEvent(f,{detail:d});(m=this.window)===null||m===void 0||m.dispatchEvent(v)})}addEventListener(f,d,m){var v;return __awaiter(this,void 0,void 0,function*(){return(v=this.window)===null||v===void 0||v.addEventListener(f,d,m),()=>{var g;return(g=this.window)===null||g===void 0?void 0:g.removeEventListener(f,d)}})}}class TonConnectTracker{constructor(f){var d;this.eventPrefix="ton-connect-",this.tonConnectUiVersion=null,this.eventDispatcher=(d=f==null?void 0:f.eventDispatcher)!==null&&d!==void 0?d:new BrowserEventDispatcher,this.tonConnectSdkVersion=f.tonConnectSdkVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __awaiter(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return __awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener("ton-connect-request-version",()=>__awaiter(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-response-version",createResponseVersionEvent(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return __awaiter(this,void 0,void 0,function*(){return new Promise((f,d)=>__awaiter(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-ui-response-version",m=>{f(m.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-ui-request-version",createRequestVersionEvent())}catch(m){d(m)}}))})}dispatchUserActionEvent(f){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${f.type}`,f).catch()}catch{}}trackConnectionStarted(...f){try{const d=createConnectionStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(...f){try{const d=createConnectionCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(...f){try{const d=createConnectionErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(...f){try{const d=createConnectionRestoringStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(...f){try{const d=createConnectionRestoringCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(...f){try{const d=createConnectionRestoringErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(...f){try{const d=createDisconnectionEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(...f){try{const d=createTransactionSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(...f){try{const d=createTransactionSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(...f){try{const d=createTransactionSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSentForSignature(...f){try{const d=createDataSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigned(...f){try{const d=createDataSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigningFailed(...f){try{const d=createDataSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectSdkVersion="3.2.0";class TonConnect{constructor(f){if(this.walletsList=new WalletsListManager,this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.dappSettings={manifestUrl:(f==null?void 0:f.manifestUrl)||getWebPageManifest(),storage:(f==null?void 0:f.storage)||new DefaultStorage},this.walletsRequiredFeatures=f==null?void 0:f.walletsRequiredFeatures,this.walletsList=new WalletsListManager({walletsListSource:f==null?void 0:f.walletsListSource,cacheTTLMs:f==null?void 0:f.walletsListCacheTTLMs}),this.tracker=new TonConnectTracker({eventDispatcher:f==null?void 0:f.eventDispatcher,tonConnectSdkVersion}),!this.dappSettings.manifestUrl)throw new DappMetadataError("Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest");this.bridgeConnectionStorage=new BridgeConnectionStorage(this.dappSettings.storage),f!=null&&f.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){var f;return((f=this._wallet)===null||f===void 0?void 0:f.account)||null}get wallet(){return this._wallet}set wallet(f){this._wallet=f,this.statusChangeSubscriptions.forEach(d=>d(this._wallet))}getWallets(){return this.walletsList.getWallets()}onStatusChange(f,d){return this.statusChangeSubscriptions.push(f),d&&this.statusChangeErrorSubscriptions.push(d),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(m=>m!==f),d&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(m=>m!==d))}}connect(f,d){var m,v;const g={};if(typeof d=="object"&&"tonProof"in d&&(g.request=d),typeof d=="object"&&("openingDeadlineMS"in d||"signal"in d||"request"in d)&&(g.request=d==null?void 0:d.request,g.openingDeadlineMS=d==null?void 0:d.openingDeadlineMS,g.signal=d==null?void 0:d.signal),this.connected)throw new WalletAlreadyConnectedError;const w=createAbortController(g==null?void 0:g.signal);if((m=this.abortController)===null||m===void 0||m.abort(),this.abortController=w,w.signal.aborted)throw new TonConnectError("Connection was aborted");return(v=this.provider)===null||v===void 0||v.closeConnection(),this.provider=this.createProvider(f),w.signal.addEventListener("abort",()=>{var x;(x=this.provider)===null||x===void 0||x.closeConnection(),this.provider=null}),this.tracker.trackConnectionStarted(),this.provider.connect(this.createConnectRequest(g==null?void 0:g.request),{openingDeadlineMS:g==null?void 0:g.openingDeadlineMS,signal:w.signal})}restoreConnection(f){var d,m;return __awaiter(this,void 0,void 0,function*(){this.tracker.trackConnectionRestoringStarted();const v=createAbortController(f==null?void 0:f.signal);if((d=this.abortController)===null||d===void 0||d.abort(),this.abortController=v,v.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}const[g,w]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(v.signal.aborted){this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}let x=null;try{switch(g){case"http":x=yield BridgeProvider.fromStorage(this.dappSettings.storage);break;case"injected":x=yield InjectedProvider.fromStorage(this.dappSettings.storage);break;default:if(w)x=this.createProvider(w);else return}}catch{this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),x==null||x.closeConnection(),x=null;return}if(v.signal.aborted){x==null||x.closeConnection(),this.tracker.trackConnectionRestoringError("Connection restoring was aborted");return}if(!x){logError$1("Provider is not restored"),this.tracker.trackConnectionRestoringError("Provider is not restored");return}(m=this.provider)===null||m===void 0||m.closeConnection(),this.provider=x,x.listen(this.walletEventsListener.bind(this));const S=()=>{this.tracker.trackConnectionRestoringError("Connection restoring was aborted"),x==null||x.closeConnection(),x=null};v.signal.addEventListener("abort",S);const _=callForSuccess(C=>__awaiter(this,void 0,void 0,function*(){yield x==null?void 0:x.restoreConnection({openingDeadlineMS:f==null?void 0:f.openingDeadlineMS,signal:C.signal}),v.signal.removeEventListener("abort",S),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")}),{attempts:Number.MAX_SAFE_INTEGER,delayMs:2e3,signal:f==null?void 0:f.signal}),b=new Promise(C=>setTimeout(()=>C(),12e3));return Promise.race([_,b])})}sendTransaction(f,d){return __awaiter(this,void 0,void 0,function*(){const m={};typeof d=="function"?m.onRequestSent=d:(m.onRequestSent=d==null?void 0:d.onRequestSent,m.signal=d==null?void 0:d.signal);const v=createAbortController(m==null?void 0:m.signal);if(v.signal.aborted)throw new TonConnectError("Transaction sending was aborted");this.checkConnection();const g=f.messages.length,w=f.messages.some(A=>A.extraCurrency&&Object.keys(A.extraCurrency).length>0);checkSendTransactionSupport(this.wallet.device.features,{requiredMessagesNumber:g,requireExtraCurrencies:w}),this.tracker.trackTransactionSentForSignature(this.wallet,f);const{validUntil:x,messages:S}=f,_=__rest(f,["validUntil","messages"]),b=f.from||this.account.address,C=f.network||this.account.chain,E=yield this.provider.sendRequest(sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({},_),{from:b,network:C,valid_until:x,messages:S.map(A=>{var{extraCurrency:T}=A,L=__rest(A,["extraCurrency"]);return Object.assign(Object.assign({},L),{extra_currency:T})})})),{onRequestSent:m.onRequestSent,signal:v.signal});if(sendTransactionParser.isError(E))return this.tracker.trackTransactionSigningFailed(this.wallet,f,E.error.message,E.error.code),sendTransactionParser.parseAndThrowError(E);const M=sendTransactionParser.convertFromRpcResponse(E);return this.tracker.trackTransactionSigned(this.wallet,f,M),M})}signData(f,d){return __awaiter(this,void 0,void 0,function*(){const m=createAbortController(d==null?void 0:d.signal);if(m.signal.aborted)throw new TonConnectError("data sending was aborted");this.checkConnection(),checkSignDataSupport(this.wallet.device.features,{requiredTypes:[f.type]}),this.tracker.trackDataSentForSignature(this.wallet,f);const v=f.from||this.account.address,g=f.network||this.account.chain,w=yield this.provider.sendRequest(signDataParser.convertToRpcRequest(Object.assign(Object.assign({},f),{from:v,network:g})),{onRequestSent:d==null?void 0:d.onRequestSent,signal:m.signal});if(signDataParser.isError(w))return this.tracker.trackDataSigningFailed(this.wallet,f,w.error.message,w.error.code),signDataParser.parseAndThrowError(w);const x=signDataParser.convertFromRpcResponse(w);return this.tracker.trackDataSigned(this.wallet,f,x),x})}disconnect(f){var d;return __awaiter(this,void 0,void 0,function*(){if(!this.connected)throw new WalletNotConnectedError;const m=createAbortController(f==null?void 0:f.signal),v=this.abortController;if(this.abortController=m,m.signal.aborted)throw new TonConnectError("Disconnect was aborted");this.onWalletDisconnected("dapp"),yield(d=this.provider)===null||d===void 0?void 0:d.disconnect({signal:m.signal}),v==null||v.abort()})}pauseConnection(){var f;((f=this.provider)===null||f===void 0?void 0:f.type)==="http"&&this.provider.pause()}unPauseConnection(){var f;return((f=this.provider)===null||f===void 0?void 0:f.type)!=="http"?Promise.resolve():this.provider.unPause()}addWindowFocusAndBlurSubscriptions(){const f=getDocument();if(f)try{f.addEventListener("visibilitychange",()=>{f.hidden?this.pauseConnection():this.unPauseConnection().catch()})}catch(d){logError$1("Cannot subscribe to the document.visibilitychange: ",d)}}createProvider(f){let d;return!Array.isArray(f)&&isWalletConnectionSourceJS(f)?d=new InjectedProvider(this.dappSettings.storage,f.jsBridgeKey):d=new BridgeProvider(this.dappSettings.storage,f),d.listen(this.walletEventsListener.bind(this)),d}walletEventsListener(f){switch(f.event){case"connect":this.onWalletConnected(f.payload);break;case"connect_error":this.tracker.trackConnectionError(f.payload.message,f.payload.code);const d=connectErrorsParser.parseError(f.payload);this.onWalletConnectError(d);break;case"disconnect":this.onWalletDisconnected("wallet")}}onWalletConnected(f){var d;const m=f.items.find(x=>x.name==="ton_addr"),v=f.items.find(x=>x.name==="ton_proof");if(!m)throw new TonConnectError("ton_addr connection item was not found");if(!checkRequiredWalletFeatures(f.device.features,this.walletsRequiredFeatures)){(d=this.provider)===null||d===void 0||d.disconnect(),this.onWalletConnectError(new WalletMissingRequiredFeaturesError("Wallet does not support required features",{cause:{connectEvent:f}}));return}const w={device:f.device,provider:this.provider.type,account:{address:m.address,chain:m.network,walletStateInit:m.walletStateInit,publicKey:m.publicKey}};if(v){let x;try{if("proof"in v)x={name:"ton_proof",proof:{timestamp:v.proof.timestamp,domain:{lengthBytes:v.proof.domain.lengthBytes,value:v.proof.domain.value},payload:v.proof.payload,signature:v.proof.signature}};else if("error"in v)x={name:"ton_proof",error:{code:v.error.code,message:v.error.message}};else throw new TonConnectError("Invalid data format")}catch{x={name:"ton_proof",error:{code:CONNECT_ITEM_ERROR_CODES.UNKNOWN_ERROR,message:"Invalid data format"}}}w.connectItems={tonProof:x}}this.wallet=w,this.tracker.trackConnectionCompleted(w)}onWalletConnectError(f){if(this.statusChangeErrorSubscriptions.forEach(d=>d(f)),logDebug$1(f),f instanceof ManifestNotFoundError||f instanceof ManifestContentErrorError)throw logError$1(f),f}onWalletDisconnected(f){this.tracker.trackDisconnection(this.wallet,f),this.wallet=null}checkConnection(){if(!this.connected)throw new WalletNotConnectedError}createConnectRequest(f){const d=[{name:"ton_addr"}];return f!=null&&f.tonProof&&d.push({name:"ton_proof",payload:f.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:d}}}TonConnect.walletsList=new WalletsListManager,TonConnect.isWalletInjected=r=>InjectedProvider.isWalletInjected(r),TonConnect.isInsideWalletBrowser=r=>InjectedProvider.isInsideWalletBrowser(r);const noBounceableTag=81,testOnlyTag=128;function toUserFriendlyAddress(r,f=!1){const{wc:d,hex:m}=parseHexAddress(r);let v=noBounceableTag;f&&(v|=testOnlyTag);const g=new Int8Array(34);g[0]=v,g[1]=d,g.set(m,2);const w=new Uint8Array(36);return w.set(g),w.set(crc16(g),34),Base64.encode(w).replace(/\+/g,"-").replace(/\//g,"_")}function parseHexAddress(r){if(!r.includes(":"))throw new WrongAddressError(`Wrong address ${r}. Address must include ":".`);const f=r.split(":");if(f.length!==2)throw new WrongAddressError(`Wrong address ${r}. Address must include ":" only once.`);const d=parseInt(f[0]);if(d!==0&&d!==-1)throw new WrongAddressError(`Wrong address ${r}. WC must be eq 0 or -1, but ${d} received.`);const m=f[1];if((m==null?void 0:m.length)!==64)throw new WrongAddressError(`Wrong address ${r}. Hex part must be 64bytes length, but ${m==null?void 0:m.length} received.`);return{wc:d,hex:hexToBytes(m)}}function crc16(r){let d=0;const m=new Uint8Array(r.length+2);m.set(r);for(let v of m){let g=128;for(;g>0;)d<<=1,v&g&&(d+=1),g>>=1,d>65535&&(d&=65535,d^=4129)}return new Uint8Array([Math.floor(d/256),d%256])}const toByteMap={};for(let r=0;r<=255;r++){let f=r.toString(16);f.length<2&&(f="0"+f),toByteMap[f]=r}function hexToBytes(r){r=r.toLowerCase();const f=r.length;if(f%2!==0)throw new ParseHexError("Hex string must have length a multiple of 2: "+r);const d=f/2,m=new Uint8Array(d);for(let v=0;v<d;v++){const g=v*2,w=r.substring(g,g+2);if(!toByteMap.hasOwnProperty(w))throw new ParseHexError("Invalid hex character: "+w);m[v]=toByteMap[w]}return m}var uaParser$1={exports:{}},uaParser=uaParser$1.exports,hasRequiredUaParser;function requireUaParser(){return hasRequiredUaParser||(hasRequiredUaParser=1,(function(r,f){(function(d,m){var v="1.0.41",g="",w="?",x="function",S="undefined",_="object",b="string",C="major",E="model",M="name",A="type",T="vendor",L="version",O="architecture",N="console",H="mobile",V="tablet",X="smarttv",oe="wearable",se="embedded",de=500,he="Amazon",we="Apple",te="ASUS",k="BlackBerry",q="Browser",y="Chrome",B="Edge",$="Firefox",I="Google",U="Honor",j="Huawei",D="Lenovo",W="LG",R="Microsoft",z="Motorola",ye="Nvidia",Ce="OnePlus",me="Opera",ie="OPPO",ee="Samsung",pe="Sharp",be="Sony",ae="Xiaomi",ne="Zebra",Se="Facebook",qe="Chromium OS",Ie="Mac OS",Oe=" Browser",Fe=function(Z,J){var ge={};for(var Ee in Z)J[Ee]&&J[Ee].length%2===0?ge[Ee]=J[Ee].concat(Z[Ee]):ge[Ee]=Z[Ee];return ge},De=function(Z){for(var J={},ge=0;ge<Z.length;ge++)J[Z[ge].toUpperCase()]=Z[ge];return J},$e=function(Z,J){return typeof Z===b?je(J).indexOf(je(Z))!==-1:!1},je=function(Z){return Z.toLowerCase()},Ye=function(Z){return typeof Z===b?Z.replace(/[^\d\.]/g,g).split(".")[0]:m},st=function(Z,J){if(typeof Z===b)return Z=Z.replace(/^\s\s*/,g),typeof J===S?Z:Z.substring(0,de)},Je=function(Z,J){for(var ge=0,Ee,Re,ke,Xe,He,Ze;ge<J.length&&!He;){var xt=J[ge],tt=J[ge+1];for(Ee=Re=0;Ee<xt.length&&!He&&xt[Ee];)if(He=xt[Ee++].exec(Z),He)for(ke=0;ke<tt.length;ke++)Ze=He[++Re],Xe=tt[ke],typeof Xe===_&&Xe.length>0?Xe.length===2?typeof Xe[1]==x?this[Xe[0]]=Xe[1].call(this,Ze):this[Xe[0]]=Xe[1]:Xe.length===3?typeof Xe[1]===x&&!(Xe[1].exec&&Xe[1].test)?this[Xe[0]]=Ze?Xe[1].call(this,Ze,Xe[2]):m:this[Xe[0]]=Ze?Ze.replace(Xe[1],Xe[2]):m:Xe.length===4&&(this[Xe[0]]=Ze?Xe[3].call(this,Ze.replace(Xe[1],Xe[2])):m):this[Xe]=Ze||m;ge+=2}},Ge=function(Z,J){for(var ge in J)if(typeof J[ge]===_&&J[ge].length>0){for(var Ee=0;Ee<J[ge].length;Ee++)if($e(J[ge][Ee],Z))return ge===w?m:ge}else if($e(J[ge],Z))return ge===w?m:ge;return J.hasOwnProperty("*")?J["*"]:Z},ut={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},gt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},rt={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[L,[M,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[L,[M,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[M,L],[/opios[\/ ]+([\w\.]+)/i],[L,[M,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[L,[M,me+" GX"]],[/\bopr\/([\w\.]+)/i],[L,[M,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[L,[M,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[L,[M,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[M,L],[/quark(?:pc)?\/([-\w\.]+)/i],[L,[M,"Quark"]],[/\bddg\/([\w\.]+)/i],[L,[M,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[L,[M,"UC"+q]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[L,[M,"WeChat"]],[/konqueror\/([\w\.]+)/i],[L,[M,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[L,[M,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[L,[M,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[L,[M,"Smart Lenovo "+q]],[/(avast|avg)\/([\w\.]+)/i],[[M,/(.+)/,"$1 Secure "+q],L],[/\bfocus\/([\w\.]+)/i],[L,[M,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[L,[M,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[L,[M,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[L,[M,"Dolphin"]],[/coast\/([\w\.]+)/i],[L,[M,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[L,[M,"MIUI"+Oe]],[/fxios\/([\w\.-]+)/i],[L,[M,$]],[/\bqihoobrowser\/?([\w\.]*)/i],[L,[M,"360"]],[/\b(qq)\/([\w\.]+)/i],[[M,/(.+)/,"$1Browser"],L],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[M,/(.+)/,"$1"+Oe],L],[/samsungbrowser\/([\w\.]+)/i],[L,[M,ee+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[L,[M,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[M,"Sogou Mobile"],L],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[M,L],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[M],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[L,M],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[M,Se],L],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[M,L],[/\bgsa\/([\w\.]+) .*safari\//i],[L,[M,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[L,[M,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[L,[M,y+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[M,y+" WebView"],L],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[L,[M,"Android "+q]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[M,L],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[L,[M,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[L,M],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[M,[L,Ge,ut]],[/(webkit|khtml)\/([\w\.]+)/i],[M,L],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[M,"Netscape"],L],[/(wolvic|librewolf)\/([\w\.]+)/i],[M,L],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[L,[M,$+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[M,[L,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[M,[L,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[O,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[O,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[O,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[O,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[O,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[O,/ower/,g,je]],[/ sun4\w[;\)]/i],[[O,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[O,je]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[E,[T,ee],[A,V]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[E,[T,ee],[A,H]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[E,[T,we],[A,H]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[E,[T,we],[A,V]],[/(macintosh);/i],[E,[T,we]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[T,pe],[A,H]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[E,[T,U],[A,V]],[/honor([-\w ]+)[;\)]/i],[E,[T,U],[A,H]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[E,[T,j],[A,V]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[E,[T,j],[A,H]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[E,/_/g," "],[T,ae],[A,V]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[E,/_/g," "],[T,ae],[A,H]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[T,ie],[A,H]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[E,[T,Ge,{OnePlus:["304","403","203"],"*":ie}],[A,V]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[T,"Vivo"],[A,H]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[T,"Realme"],[A,H]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[E,[T,z],[A,H]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[T,z],[A,V]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[T,W],[A,V]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[T,W],[A,H]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[E,[T,D],[A,V]],[/(nokia) (t[12][01])/i],[T,E,[A,V]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[E,/_/g," "],[A,H],[T,"Nokia"]],[/(pixel (c|tablet))\b/i],[E,[T,I],[A,V]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[E,[T,I],[A,H]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[T,be],[A,H]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[T,be],[A,V]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[T,Ce],[A,H]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[T,he],[A,V]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[T,he],[A,H]],[/(playbook);[-\w\),; ]+(rim)/i],[E,T,[A,V]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[E,[T,k],[A,H]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[T,te],[A,V]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[T,te],[A,H]],[/(nexus 9)/i],[E,[T,"HTC"],[A,V]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[T,[E,/_/g," "],[A,H]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[E,[T,"TCL"],[A,V]],[/(itel) ((\w+))/i],[[T,je],E,[A,Ge,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[T,"Acer"],[A,V]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[T,"Meizu"],[A,H]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[T,"Ulefone"],[A,H]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[E,[T,"Energizer"],[A,H]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[E,[T,"Cat"],[A,H]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[E,[T,"Smartfren"],[A,H]],[/droid.+; (a(?:015|06[35]|142p?))/i],[E,[T,"Nothing"],[A,H]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[E,[T,"Archos"],[A,V]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[E,[T,"Archos"],[A,H]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[T,E,[A,V]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[T,E,[A,H]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[T,E,[A,V]],[/(surface duo)/i],[E,[T,R],[A,V]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[T,"Fairphone"],[A,H]],[/(u304aa)/i],[E,[T,"AT&T"],[A,H]],[/\bsie-(\w*)/i],[E,[T,"Siemens"],[A,H]],[/\b(rct\w+) b/i],[E,[T,"RCA"],[A,V]],[/\b(venue[\d ]{2,7}) b/i],[E,[T,"Dell"],[A,V]],[/\b(q(?:mv|ta)\w+) b/i],[E,[T,"Verizon"],[A,V]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[E,[T,"Barnes & Noble"],[A,V]],[/\b(tm\d{3}\w+) b/i],[E,[T,"NuVision"],[A,V]],[/\b(k88) b/i],[E,[T,"ZTE"],[A,V]],[/\b(nx\d{3}j) b/i],[E,[T,"ZTE"],[A,H]],[/\b(gen\d{3}) b.+49h/i],[E,[T,"Swiss"],[A,H]],[/\b(zur\d{3}) b/i],[E,[T,"Swiss"],[A,V]],[/\b((zeki)?tb.*\b) b/i],[E,[T,"Zeki"],[A,V]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[T,"Dragon Touch"],E,[A,V]],[/\b(ns-?\w{0,9}) b/i],[E,[T,"Insignia"],[A,V]],[/\b((nxa|next)-?\w{0,9}) b/i],[E,[T,"NextBook"],[A,V]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[T,"Voice"],E,[A,H]],[/\b(lvtel\-)?(v1[12]) b/i],[[T,"LvTel"],E,[A,H]],[/\b(ph-1) /i],[E,[T,"Essential"],[A,H]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[E,[T,"Envizen"],[A,V]],[/\b(trio[-\w\. ]+) b/i],[E,[T,"MachSpeed"],[A,V]],[/\btu_(1491) b/i],[E,[T,"Rotor"],[A,V]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[E,[T,ye],[A,V]],[/(sprint) (\w+)/i],[T,E,[A,H]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[T,R],[A,H]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[T,ne],[A,V]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[T,ne],[A,H]],[/smart-tv.+(samsung)/i],[T,[A,X]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[T,ee],[A,X]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[T,W],[A,X]],[/(apple) ?tv/i],[T,[E,we+" TV"],[A,X]],[/crkey/i],[[E,y+"cast"],[T,I],[A,X]],[/droid.+aft(\w+)( bui|\))/i],[E,[T,he],[A,X]],[/(shield \w+ tv)/i],[E,[T,ye],[A,X]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[T,pe],[A,X]],[/(bravia[\w ]+)( bui|\))/i],[E,[T,be],[A,X]],[/(mi(tv|box)-?\w+) bui/i],[E,[T,ae],[A,X]],[/Hbbtv.*(technisat) (.*);/i],[T,E,[A,X]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[T,st],[E,st],[A,X]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[E,[A,X]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[A,X]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[T,E,[A,N]],[/droid.+; (shield)( bui|\))/i],[E,[T,ye],[A,N]],[/(playstation \w+)/i],[E,[T,be],[A,N]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[T,R],[A,N]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[E,[T,ee],[A,oe]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[T,E,[A,oe]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[E,[T,ie],[A,oe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[T,we],[A,oe]],[/(opwwe\d{3})/i],[E,[T,Ce],[A,oe]],[/(moto 360)/i],[E,[T,z],[A,oe]],[/(smartwatch 3)/i],[E,[T,be],[A,oe]],[/(g watch r)/i],[E,[T,W],[A,oe]],[/droid.+; (wt63?0{2,3})\)/i],[E,[T,ne],[A,oe]],[/droid.+; (glass) \d/i],[E,[T,I],[A,oe]],[/(pico) (4|neo3(?: link|pro)?)/i],[T,E,[A,oe]],[/; (quest( \d| pro)?)/i],[E,[T,Se],[A,oe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[T,[A,se]],[/(aeobc)\b/i],[E,[T,he],[A,se]],[/(homepod).+mac os/i],[E,[T,we],[A,se]],[/windows iot/i],[[A,se]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[E,[A,H]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[E,[A,V]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[A,V]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[A,H]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[E,[T,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[L,[M,B+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[M,L],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[L,[M,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[M,L],[/ladybird\//i],[[M,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[L,M]],os:[[/microsoft (windows) (vista|xp)/i],[M,L],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[M,[L,Ge,gt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[L,Ge,gt],[M,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[L,/_/g,"."],[M,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[M,Ie],[L,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[L,M],[/(ubuntu) ([\w\.]+) like android/i],[[M,/(.+)/,"$1 Touch"],L],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[M,L],[/\(bb(10);/i],[L,[M,k]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[L,[M,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[L,[M,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[L,[M,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[L,[M,"watchOS"]],[/crkey\/([\d\.]+)/i],[L,[M,y+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[M,qe],L],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[M,L],[/(sunos) ?([\w\.\d]*)/i],[[M,"Solaris"],L],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[M,L]]},wt=function(Z,J){if(typeof Z===_&&(J=Z,Z=m),!(this instanceof wt))return new wt(Z,J).getResult();var ge=typeof d!==S&&d.navigator?d.navigator:m,Ee=Z||(ge&&ge.userAgent?ge.userAgent:g),Re=ge&&ge.userAgentData?ge.userAgentData:m,ke=J?Fe(rt,J):rt,Xe=ge&&ge.userAgent==Ee;return this.getBrowser=function(){var He={};return He[M]=m,He[L]=m,Je.call(He,Ee,ke.browser),He[C]=Ye(He[L]),Xe&&ge&&ge.brave&&typeof ge.brave.isBrave==x&&(He[M]="Brave"),He},this.getCPU=function(){var He={};return He[O]=m,Je.call(He,Ee,ke.cpu),He},this.getDevice=function(){var He={};return He[T]=m,He[E]=m,He[A]=m,Je.call(He,Ee,ke.device),Xe&&!He[A]&&Re&&Re.mobile&&(He[A]=H),Xe&&He[E]=="Macintosh"&&ge&&typeof ge.standalone!==S&&ge.maxTouchPoints&&ge.maxTouchPoints>2&&(He[E]="iPad",He[A]=V),He},this.getEngine=function(){var He={};return He[M]=m,He[L]=m,Je.call(He,Ee,ke.engine),He},this.getOS=function(){var He={};return He[M]=m,He[L]=m,Je.call(He,Ee,ke.os),Xe&&!He[M]&&Re&&Re.platform&&Re.platform!="Unknown"&&(He[M]=Re.platform.replace(/chrome os/i,qe).replace(/macos/i,Ie)),He},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ee},this.setUA=function(He){return Ee=typeof He===b&&He.length>de?st(He,de):He,this},this.setUA(Ee),this};wt.VERSION=v,wt.BROWSER=De([M,L,C]),wt.CPU=De([O]),wt.DEVICE=De([E,T,A,N,H,X,V,oe,se]),wt.ENGINE=wt.OS=De([M,L]),r.exports&&(f=r.exports=wt),f.UAParser=wt;var bt=typeof d!==S&&(d.jQuery||d.Zepto);if(bt&&!bt.ua){var le=new wt;bt.ua=le.getResult(),bt.ua.get=function(){return le.getUA()},bt.ua.set=function(Z){le.setUA(Z);var J=le.getResult();for(var ge in J)bt.ua[ge]=J[ge]}}})(typeof window=="object"?window:uaParser)})(uaParser$1,uaParser$1.exports)),uaParser$1.exports}var uaParserExports=requireUaParser();const UAParser=getDefaultExportFromCjs(uaParserExports);var cjs,hasRequiredCjs;function requireCjs(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var r=function(N){return f(N)&&!d(N)};function f(O){return!!O&&typeof O=="object"}function d(O){var N=Object.prototype.toString.call(O);return N==="[object RegExp]"||N==="[object Date]"||g(O)}var m=typeof Symbol=="function"&&Symbol.for,v=m?Symbol.for("react.element"):60103;function g(O){return O.$$typeof===v}function w(O){return Array.isArray(O)?[]:{}}function x(O,N){return N.clone!==!1&&N.isMergeableObject(O)?T(w(O),O,N):O}function S(O,N,H){return O.concat(N).map(function(V){return x(V,H)})}function _(O,N){if(!N.customMerge)return T;var H=N.customMerge(O);return typeof H=="function"?H:T}function b(O){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(O).filter(function(N){return Object.propertyIsEnumerable.call(O,N)}):[]}function C(O){return Object.keys(O).concat(b(O))}function E(O,N){try{return N in O}catch{return!1}}function M(O,N){return E(O,N)&&!(Object.hasOwnProperty.call(O,N)&&Object.propertyIsEnumerable.call(O,N))}function A(O,N,H){var V={};return H.isMergeableObject(O)&&C(O).forEach(function(X){V[X]=x(O[X],H)}),C(N).forEach(function(X){M(O,X)||(E(O,X)&&H.isMergeableObject(N[X])?V[X]=_(X,H)(O[X],N[X],H):V[X]=x(N[X],H))}),V}function T(O,N,H){H=H||{},H.arrayMerge=H.arrayMerge||S,H.isMergeableObject=H.isMergeableObject||r,H.cloneUnlessOtherwiseSpecified=x;var V=Array.isArray(N),X=Array.isArray(O),oe=V===X;return oe?V?H.arrayMerge(O,N,H):A(O,N,H):x(N,H)}T.all=function(N,H){if(!Array.isArray(N))throw new Error("first argument should be an array");return N.reduce(function(V,X){return T(V,X,H)},{})};var L=T;return cjs=L,cjs}var cjsExports=requireCjs();const deepmerge=getDefaultExportFromCjs(cjsExports);var classnames={exports:{}};/*!
51
51
  Copyright (c) 2018 Jed Watson.
52
52
  Licensed under the MIT License (MIT), see
53
53
  http://jedwatson.github.io/classnames
@@ -365,9 +365,9 @@ https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={D
365
365
 
366
366
  filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08));
367
367
  background-color: ${r=>r.theme.colors.background.segment};
368
- `;var qrcode$1={exports:{}};(function(r,f){var d=(function(){var m=function(X,oe){var se=236,de=17,he=X,we=g[oe],te=null,k=0,q=null,y=[],B={},$=function(ee,pe){k=he*4+17,te=(function(be){for(var ae=new Array(be),ne=0;ne<be;ne+=1){ae[ne]=new Array(be);for(var Se=0;Se<be;Se+=1)ae[ne][Se]=null}return ae})(k),I(0,0),I(k-7,0),I(0,k-7),D(),j(),R(ee,pe),he>=7&&W(ee),q==null&&(q=Ce(he,we,y)),z(q,pe)},I=function(ee,pe){for(var be=-1;be<=7;be+=1)if(!(ee+be<=-1||k<=ee+be))for(var ae=-1;ae<=7;ae+=1)pe+ae<=-1||k<=pe+ae||(0<=be&&be<=6&&(ae==0||ae==6)||0<=ae&&ae<=6&&(be==0||be==6)||2<=be&&be<=4&&2<=ae&&ae<=4?te[ee+be][pe+ae]=!0:te[ee+be][pe+ae]=!1)},F=function(){for(var ee=0,pe=0,be=0;be<8;be+=1){$(!0,be);var ae=x.getLostPoint(B);(be==0||ee>ae)&&(ee=ae,pe=be)}return pe},j=function(){for(var ee=8;ee<k-8;ee+=1)te[ee][6]==null&&(te[ee][6]=ee%2==0);for(var pe=8;pe<k-8;pe+=1)te[6][pe]==null&&(te[6][pe]=pe%2==0)},D=function(){for(var ee=x.getPatternPosition(he),pe=0;pe<ee.length;pe+=1)for(var be=0;be<ee.length;be+=1){var ae=ee[pe],ne=ee[be];if(te[ae][ne]==null)for(var Se=-2;Se<=2;Se+=1)for(var qe=-2;qe<=2;qe+=1)Se==-2||Se==2||qe==-2||qe==2||Se==0&&qe==0?te[ae+Se][ne+qe]=!0:te[ae+Se][ne+qe]=!1}},W=function(ee){for(var pe=x.getBCHTypeNumber(he),be=0;be<18;be+=1){var ae=!ee&&(pe>>be&1)==1;te[Math.floor(be/3)][be%3+k-8-3]=ae}for(var be=0;be<18;be+=1){var ae=!ee&&(pe>>be&1)==1;te[be%3+k-8-3][Math.floor(be/3)]=ae}},R=function(ee,pe){for(var be=we<<3|pe,ae=x.getBCHTypeInfo(be),ne=0;ne<15;ne+=1){var Se=!ee&&(ae>>ne&1)==1;ne<6?te[ne][8]=Se:ne<8?te[ne+1][8]=Se:te[k-15+ne][8]=Se}for(var ne=0;ne<15;ne+=1){var Se=!ee&&(ae>>ne&1)==1;ne<8?te[8][k-ne-1]=Se:ne<9?te[8][15-ne-1+1]=Se:te[8][15-ne-1]=Se}te[k-8][8]=!ee},z=function(ee,pe){for(var be=-1,ae=k-1,ne=7,Se=0,qe=x.getMaskFunction(pe),Ie=k-1;Ie>0;Ie-=2)for(Ie==6&&(Ie-=1);;){for(var Oe=0;Oe<2;Oe+=1)if(te[ae][Ie-Oe]==null){var Ue=!1;Se<ee.length&&(Ue=(ee[Se]>>>ne&1)==1);var De=qe(ae,Ie-Oe);De&&(Ue=!Ue),te[ae][Ie-Oe]=Ue,ne-=1,ne==-1&&(Se+=1,ne=7)}if(ae+=be,ae<0||k<=ae){ae-=be,be=-be;break}}},ye=function(ee,pe){for(var be=0,ae=0,ne=0,Se=new Array(pe.length),qe=new Array(pe.length),Ie=0;Ie<pe.length;Ie+=1){var Oe=pe[Ie].dataCount,Ue=pe[Ie].totalCount-Oe;ae=Math.max(ae,Oe),ne=Math.max(ne,Ue),Se[Ie]=new Array(Oe);for(var De=0;De<Se[Ie].length;De+=1)Se[Ie][De]=255&ee.getBuffer()[De+be];be+=Oe;var $e=x.getErrorCorrectPolynomial(Ue),je=_(Se[Ie],$e.getLength()-1),Ye=je.mod($e);qe[Ie]=new Array($e.getLength()-1);for(var De=0;De<qe[Ie].length;De+=1){var st=De+Ye.getLength()-qe[Ie].length;qe[Ie][De]=st>=0?Ye.getAt(st):0}}for(var Je=0,De=0;De<pe.length;De+=1)Je+=pe[De].totalCount;for(var Ge=new Array(Je),ut=0,De=0;De<ae;De+=1)for(var Ie=0;Ie<pe.length;Ie+=1)De<Se[Ie].length&&(Ge[ut]=Se[Ie][De],ut+=1);for(var De=0;De<ne;De+=1)for(var Ie=0;Ie<pe.length;Ie+=1)De<qe[Ie].length&&(Ge[ut]=qe[Ie][De],ut+=1);return Ge},Ce=function(ee,pe,be){for(var ae=b.getRSBlocks(ee,pe),ne=C(),Se=0;Se<be.length;Se+=1){var qe=be[Se];ne.put(qe.getMode(),4),ne.put(qe.getLength(),x.getLengthInBits(qe.getMode(),ee)),qe.write(ne)}for(var Ie=0,Se=0;Se<ae.length;Se+=1)Ie+=ae[Se].dataCount;if(ne.getLengthInBits()>Ie*8)throw"code length overflow. ("+ne.getLengthInBits()+">"+Ie*8+")";for(ne.getLengthInBits()+4<=Ie*8&&ne.put(0,4);ne.getLengthInBits()%8!=0;)ne.putBit(!1);for(;!(ne.getLengthInBits()>=Ie*8||(ne.put(se,8),ne.getLengthInBits()>=Ie*8));)ne.put(de,8);return ye(ne,ae)};B.addData=function(ee,pe){pe=pe||"Byte";var be=null;switch(pe){case"Numeric":be=E(ee);break;case"Alphanumeric":be=M(ee);break;case"Byte":be=A(ee);break;case"Kanji":be=T(ee);break;default:throw"mode:"+pe}y.push(be),q=null},B.isDark=function(ee,pe){if(ee<0||k<=ee||pe<0||k<=pe)throw ee+","+pe;return te[ee][pe]},B.getModuleCount=function(){return k},B.make=function(){if(he<1){for(var ee=1;ee<40;ee++){for(var pe=b.getRSBlocks(ee,we),be=C(),ae=0;ae<y.length;ae++){var ne=y[ae];be.put(ne.getMode(),4),be.put(ne.getLength(),x.getLengthInBits(ne.getMode(),ee)),ne.write(be)}for(var Se=0,ae=0;ae<pe.length;ae++)Se+=pe[ae].dataCount;if(be.getLengthInBits()<=Se*8)break}he=ee}$(!1,F())},B.createTableTag=function(ee,pe){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var be="";be+='<table style="',be+=" border-width: 0px; border-style: none;",be+=" border-collapse: collapse;",be+=" padding: 0px; margin: "+pe+"px;",be+='">',be+="<tbody>";for(var ae=0;ae<B.getModuleCount();ae+=1){be+="<tr>";for(var ne=0;ne<B.getModuleCount();ne+=1)be+='<td style="',be+=" border-width: 0px; border-style: none;",be+=" border-collapse: collapse;",be+=" padding: 0px; margin: 0px;",be+=" width: "+ee+"px;",be+=" height: "+ee+"px;",be+=" background-color: ",be+=B.isDark(ae,ne)?"#000000":"#ffffff",be+=";",be+='"/>';be+="</tr>"}return be+="</tbody>",be+="</table>",be},B.createSvgTag=function(ee,pe,be,ae){var ne={};typeof arguments[0]=="object"&&(ne=arguments[0],ee=ne.cellSize,pe=ne.margin,be=ne.alt,ae=ne.title),ee=ee||2,pe=typeof pe>"u"?ee*4:pe,be=typeof be=="string"?{text:be}:be||{},be.text=be.text||null,be.id=be.text?be.id||"qrcode-description":null,ae=typeof ae=="string"?{text:ae}:ae||{},ae.text=ae.text||null,ae.id=ae.text?ae.id||"qrcode-title":null;var Se=B.getModuleCount()*ee+pe*2,qe,Ie,Oe,Ue,De="",$e;for($e="l"+ee+",0 0,"+ee+" -"+ee+",0 0,-"+ee+"z ",De+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',De+=ne.scalable?"":' width="'+Se+'px" height="'+Se+'px"',De+=' viewBox="0 0 '+Se+" "+Se+'" ',De+=' preserveAspectRatio="xMinYMin meet"',De+=ae.text||be.text?' role="img" aria-labelledby="'+me([ae.id,be.id].join(" ").trim())+'"':"",De+=">",De+=ae.text?'<title id="'+me(ae.id)+'">'+me(ae.text)+"</title>":"",De+=be.text?'<description id="'+me(be.id)+'">'+me(be.text)+"</description>":"",De+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',De+='<path d="',Oe=0;Oe<B.getModuleCount();Oe+=1)for(Ue=Oe*ee+pe,qe=0;qe<B.getModuleCount();qe+=1)B.isDark(Oe,qe)&&(Ie=qe*ee+pe,De+="M"+Ie+","+Ue+$e);return De+='" stroke="transparent" fill="black"/>',De+="</svg>",De},B.createDataURL=function(ee,pe){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var be=B.getModuleCount()*ee+pe*2,ae=pe,ne=be-pe;return V(be,be,function(Se,qe){if(ae<=Se&&Se<ne&&ae<=qe&&qe<ne){var Ie=Math.floor((Se-ae)/ee),Oe=Math.floor((qe-ae)/ee);return B.isDark(Oe,Ie)?0:1}else return 1})},B.createImgTag=function(ee,pe,be){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var ae=B.getModuleCount()*ee+pe*2,ne="";return ne+="<img",ne+=' src="',ne+=B.createDataURL(ee,pe),ne+='"',ne+=' width="',ne+=ae,ne+='"',ne+=' height="',ne+=ae,ne+='"',be&&(ne+=' alt="',ne+=me(be),ne+='"'),ne+="/>",ne};var me=function(ee){for(var pe="",be=0;be<ee.length;be+=1){var ae=ee.charAt(be);switch(ae){case"<":pe+="&lt;";break;case">":pe+="&gt;";break;case"&":pe+="&amp;";break;case'"':pe+="&quot;";break;default:pe+=ae;break}}return pe},ie=function(ee){var pe=1;ee=typeof ee>"u"?pe*2:ee;var be=B.getModuleCount()*pe+ee*2,ae=ee,ne=be-ee,Se,qe,Ie,Oe,Ue,De={"██":"█","█ ":"▀"," █":"▄"," ":" "},$e={"██":"▀","█ ":"▀"," █":" "," ":" "},je="";for(Se=0;Se<be;Se+=2){for(Ie=Math.floor((Se-ae)/pe),Oe=Math.floor((Se+1-ae)/pe),qe=0;qe<be;qe+=1)Ue="█",ae<=qe&&qe<ne&&ae<=Se&&Se<ne&&B.isDark(Ie,Math.floor((qe-ae)/pe))&&(Ue=" "),ae<=qe&&qe<ne&&ae<=Se+1&&Se+1<ne&&B.isDark(Oe,Math.floor((qe-ae)/pe))?Ue+=" ":Ue+="█",je+=ee<1&&Se+1>=ne?$e[Ue]:De[Ue];je+=`
369
- `}return be%2&&ee>0?je.substring(0,je.length-be-1)+Array(be+1).join("▀"):je.substring(0,je.length-1)};return B.createASCII=function(ee,pe){if(ee=ee||1,ee<2)return ie(pe);ee-=1,pe=typeof pe>"u"?ee*2:pe;var be=B.getModuleCount()*ee+pe*2,ae=pe,ne=be-pe,Se,qe,Ie,Oe,Ue=Array(ee+1).join("██"),De=Array(ee+1).join(" "),$e="",je="";for(Se=0;Se<be;Se+=1){for(Ie=Math.floor((Se-ae)/ee),je="",qe=0;qe<be;qe+=1)Oe=1,ae<=qe&&qe<ne&&ae<=Se&&Se<ne&&B.isDark(Ie,Math.floor((qe-ae)/ee))&&(Oe=0),je+=Oe?Ue:De;for(Ie=0;Ie<ee;Ie+=1)$e+=je+`
370
- `}return $e.substring(0,$e.length-1)},B.renderTo2dContext=function(ee,pe){pe=pe||2;for(var be=B.getModuleCount(),ae=0;ae<be;ae++)for(var ne=0;ne<be;ne++)ee.fillStyle=B.isDark(ae,ne)?"black":"white",ee.fillRect(ae*pe,ne*pe,pe,pe)},B};m.stringToBytesFuncs={default:function(X){for(var oe=[],se=0;se<X.length;se+=1){var de=X.charCodeAt(se);oe.push(de&255)}return oe}},m.stringToBytes=m.stringToBytesFuncs.default,m.createStringToBytes=function(X,oe){var se=(function(){for(var he=N(X),we=function(){var j=he.read();if(j==-1)throw"eof";return j},te=0,k={};;){var q=he.read();if(q==-1)break;var y=we(),B=we(),$=we(),I=String.fromCharCode(q<<8|y),F=B<<8|$;k[I]=F,te+=1}if(te!=oe)throw te+" != "+oe;return k})(),de=63;return function(he){for(var we=[],te=0;te<he.length;te+=1){var k=he.charCodeAt(te);if(k<128)we.push(k);else{var q=se[he.charAt(te)];typeof q=="number"?(q&255)==q?we.push(q):(we.push(q>>>8),we.push(q&255)):we.push(de)}}return we}};var v={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},g={L:1,M:0,Q:3,H:2},w={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},x=(function(){var X=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],oe=1335,se=7973,de=21522,he={},we=function(te){for(var k=0;te!=0;)k+=1,te>>>=1;return k};return he.getBCHTypeInfo=function(te){for(var k=te<<10;we(k)-we(oe)>=0;)k^=oe<<we(k)-we(oe);return(te<<10|k)^de},he.getBCHTypeNumber=function(te){for(var k=te<<12;we(k)-we(se)>=0;)k^=se<<we(k)-we(se);return te<<12|k},he.getPatternPosition=function(te){return X[te-1]},he.getMaskFunction=function(te){switch(te){case w.PATTERN000:return function(k,q){return(k+q)%2==0};case w.PATTERN001:return function(k,q){return k%2==0};case w.PATTERN010:return function(k,q){return q%3==0};case w.PATTERN011:return function(k,q){return(k+q)%3==0};case w.PATTERN100:return function(k,q){return(Math.floor(k/2)+Math.floor(q/3))%2==0};case w.PATTERN101:return function(k,q){return k*q%2+k*q%3==0};case w.PATTERN110:return function(k,q){return(k*q%2+k*q%3)%2==0};case w.PATTERN111:return function(k,q){return(k*q%3+(k+q)%2)%2==0};default:throw"bad maskPattern:"+te}},he.getErrorCorrectPolynomial=function(te){for(var k=_([1],0),q=0;q<te;q+=1)k=k.multiply(_([1,S.gexp(q)],0));return k},he.getLengthInBits=function(te,k){if(1<=k&&k<10)switch(te){case v.MODE_NUMBER:return 10;case v.MODE_ALPHA_NUM:return 9;case v.MODE_8BIT_BYTE:return 8;case v.MODE_KANJI:return 8;default:throw"mode:"+te}else if(k<27)switch(te){case v.MODE_NUMBER:return 12;case v.MODE_ALPHA_NUM:return 11;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 10;default:throw"mode:"+te}else if(k<41)switch(te){case v.MODE_NUMBER:return 14;case v.MODE_ALPHA_NUM:return 13;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 12;default:throw"mode:"+te}else throw"type:"+k},he.getLostPoint=function(te){for(var k=te.getModuleCount(),q=0,y=0;y<k;y+=1)for(var B=0;B<k;B+=1){for(var $=0,I=te.isDark(y,B),F=-1;F<=1;F+=1)if(!(y+F<0||k<=y+F))for(var j=-1;j<=1;j+=1)B+j<0||k<=B+j||F==0&&j==0||I==te.isDark(y+F,B+j)&&($+=1);$>5&&(q+=3+$-5)}for(var y=0;y<k-1;y+=1)for(var B=0;B<k-1;B+=1){var D=0;te.isDark(y,B)&&(D+=1),te.isDark(y+1,B)&&(D+=1),te.isDark(y,B+1)&&(D+=1),te.isDark(y+1,B+1)&&(D+=1),(D==0||D==4)&&(q+=3)}for(var y=0;y<k;y+=1)for(var B=0;B<k-6;B+=1)te.isDark(y,B)&&!te.isDark(y,B+1)&&te.isDark(y,B+2)&&te.isDark(y,B+3)&&te.isDark(y,B+4)&&!te.isDark(y,B+5)&&te.isDark(y,B+6)&&(q+=40);for(var B=0;B<k;B+=1)for(var y=0;y<k-6;y+=1)te.isDark(y,B)&&!te.isDark(y+1,B)&&te.isDark(y+2,B)&&te.isDark(y+3,B)&&te.isDark(y+4,B)&&!te.isDark(y+5,B)&&te.isDark(y+6,B)&&(q+=40);for(var W=0,B=0;B<k;B+=1)for(var y=0;y<k;y+=1)te.isDark(y,B)&&(W+=1);var R=Math.abs(100*W/k/k-50)/5;return q+=R*10,q},he})(),S=(function(){for(var X=new Array(256),oe=new Array(256),se=0;se<8;se+=1)X[se]=1<<se;for(var se=8;se<256;se+=1)X[se]=X[se-4]^X[se-5]^X[se-6]^X[se-8];for(var se=0;se<255;se+=1)oe[X[se]]=se;var de={};return de.glog=function(he){if(he<1)throw"glog("+he+")";return oe[he]},de.gexp=function(he){for(;he<0;)he+=255;for(;he>=256;)he-=255;return X[he]},de})();function _(X,oe){if(typeof X.length>"u")throw X.length+"/"+oe;var se=(function(){for(var he=0;he<X.length&&X[he]==0;)he+=1;for(var we=new Array(X.length-he+oe),te=0;te<X.length-he;te+=1)we[te]=X[te+he];return we})(),de={};return de.getAt=function(he){return se[he]},de.getLength=function(){return se.length},de.multiply=function(he){for(var we=new Array(de.getLength()+he.getLength()-1),te=0;te<de.getLength();te+=1)for(var k=0;k<he.getLength();k+=1)we[te+k]^=S.gexp(S.glog(de.getAt(te))+S.glog(he.getAt(k)));return _(we,0)},de.mod=function(he){if(de.getLength()-he.getLength()<0)return de;for(var we=S.glog(de.getAt(0))-S.glog(he.getAt(0)),te=new Array(de.getLength()),k=0;k<de.getLength();k+=1)te[k]=de.getAt(k);for(var k=0;k<he.getLength();k+=1)te[k]^=S.gexp(S.glog(he.getAt(k))+we);return _(te,0).mod(he)},de}var b=(function(){var X=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],oe=function(he,we){var te={};return te.totalCount=he,te.dataCount=we,te},se={},de=function(he,we){switch(we){case g.L:return X[(he-1)*4+0];case g.M:return X[(he-1)*4+1];case g.Q:return X[(he-1)*4+2];case g.H:return X[(he-1)*4+3];default:return}};return se.getRSBlocks=function(he,we){var te=de(he,we);if(typeof te>"u")throw"bad rs block @ typeNumber:"+he+"/errorCorrectionLevel:"+we;for(var k=te.length/3,q=[],y=0;y<k;y+=1)for(var B=te[y*3+0],$=te[y*3+1],I=te[y*3+2],F=0;F<B;F+=1)q.push(oe($,I));return q},se})(),C=function(){var X=[],oe=0,se={};return se.getBuffer=function(){return X},se.getAt=function(de){var he=Math.floor(de/8);return(X[he]>>>7-de%8&1)==1},se.put=function(de,he){for(var we=0;we<he;we+=1)se.putBit((de>>>he-we-1&1)==1)},se.getLengthInBits=function(){return oe},se.putBit=function(de){var he=Math.floor(oe/8);X.length<=he&&X.push(0),de&&(X[he]|=128>>>oe%8),oe+=1},se},E=function(X){var oe=v.MODE_NUMBER,se=X,de={};de.getMode=function(){return oe},de.getLength=function(te){return se.length},de.write=function(te){for(var k=se,q=0;q+2<k.length;)te.put(he(k.substring(q,q+3)),10),q+=3;q<k.length&&(k.length-q==1?te.put(he(k.substring(q,q+1)),4):k.length-q==2&&te.put(he(k.substring(q,q+2)),7))};var he=function(te){for(var k=0,q=0;q<te.length;q+=1)k=k*10+we(te.charAt(q));return k},we=function(te){if("0"<=te&&te<="9")return te.charCodeAt(0)-48;throw"illegal char :"+te};return de},M=function(X){var oe=v.MODE_ALPHA_NUM,se=X,de={};de.getMode=function(){return oe},de.getLength=function(we){return se.length},de.write=function(we){for(var te=se,k=0;k+1<te.length;)we.put(he(te.charAt(k))*45+he(te.charAt(k+1)),11),k+=2;k<te.length&&we.put(he(te.charAt(k)),6)};var he=function(we){if("0"<=we&&we<="9")return we.charCodeAt(0)-48;if("A"<=we&&we<="Z")return we.charCodeAt(0)-65+10;switch(we){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+we}};return de},A=function(X){var oe=v.MODE_8BIT_BYTE,se=m.stringToBytes(X),de={};return de.getMode=function(){return oe},de.getLength=function(he){return se.length},de.write=function(he){for(var we=0;we<se.length;we+=1)he.put(se[we],8)},de},T=function(X){var oe=v.MODE_KANJI,se=m.stringToBytesFuncs.SJIS;if(!se)throw"sjis not supported.";(function(we,te){var k=se(we);if(k.length!=2||(k[0]<<8|k[1])!=te)throw"sjis not supported."})("友",38726);var de=se(X),he={};return he.getMode=function(){return oe},he.getLength=function(we){return~~(de.length/2)},he.write=function(we){for(var te=de,k=0;k+1<te.length;){var q=(255&te[k])<<8|255&te[k+1];if(33088<=q&&q<=40956)q-=33088;else if(57408<=q&&q<=60351)q-=49472;else throw"illegal char at "+(k+1)+"/"+q;q=(q>>>8&255)*192+(q&255),we.put(q,13),k+=2}if(k<te.length)throw"illegal char at "+(k+1)},he},L=function(){var X=[],oe={};return oe.writeByte=function(se){X.push(se&255)},oe.writeShort=function(se){oe.writeByte(se),oe.writeByte(se>>>8)},oe.writeBytes=function(se,de,he){de=de||0,he=he||se.length;for(var we=0;we<he;we+=1)oe.writeByte(se[we+de])},oe.writeString=function(se){for(var de=0;de<se.length;de+=1)oe.writeByte(se.charCodeAt(de))},oe.toByteArray=function(){return X},oe.toString=function(){var se="";se+="[";for(var de=0;de<X.length;de+=1)de>0&&(se+=","),se+=X[de];return se+="]",se},oe},O=function(){var X=0,oe=0,se=0,de="",he={},we=function(k){de+=String.fromCharCode(te(k&63))},te=function(k){if(!(k<0)){if(k<26)return 65+k;if(k<52)return 97+(k-26);if(k<62)return 48+(k-52);if(k==62)return 43;if(k==63)return 47}throw"n:"+k};return he.writeByte=function(k){for(X=X<<8|k&255,oe+=8,se+=1;oe>=6;)we(X>>>oe-6),oe-=6},he.flush=function(){if(oe>0&&(we(X<<6-oe),X=0,oe=0),se%3!=0)for(var k=3-se%3,q=0;q<k;q+=1)de+="="},he.toString=function(){return de},he},N=function(X){var oe=X,se=0,de=0,he=0,we={};we.read=function(){for(;he<8;){if(se>=oe.length){if(he==0)return-1;throw"unexpected end of file./"+he}var k=oe.charAt(se);if(se+=1,k=="=")return he=0,-1;if(k.match(/^\s$/))continue;de=de<<6|te(k.charCodeAt(0)),he+=6}var q=de>>>he-8&255;return he-=8,q};var te=function(k){if(65<=k&&k<=90)return k-65;if(97<=k&&k<=122)return k-97+26;if(48<=k&&k<=57)return k-48+52;if(k==43)return 62;if(k==47)return 63;throw"c:"+k};return we},H=function(X,oe){var se=X,de=oe,he=new Array(X*oe),we={};we.setPixel=function(y,B,$){he[B*se+y]=$},we.write=function(y){y.writeString("GIF87a"),y.writeShort(se),y.writeShort(de),y.writeByte(128),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(255),y.writeByte(255),y.writeByte(255),y.writeString(","),y.writeShort(0),y.writeShort(0),y.writeShort(se),y.writeShort(de),y.writeByte(0);var B=2,$=k(B);y.writeByte(B);for(var I=0;$.length-I>255;)y.writeByte(255),y.writeBytes($,I,255),I+=255;y.writeByte($.length-I),y.writeBytes($,I,$.length-I),y.writeByte(0),y.writeString(";")};var te=function(y){var B=y,$=0,I=0,F={};return F.write=function(j,D){if(j>>>D)throw"length over";for(;$+D>=8;)B.writeByte(255&(j<<$|I)),D-=8-$,j>>>=8-$,I=0,$=0;I=j<<$|I,$=$+D},F.flush=function(){$>0&&B.writeByte(I)},F},k=function(y){for(var B=1<<y,$=(1<<y)+1,I=y+1,F=q(),j=0;j<B;j+=1)F.add(String.fromCharCode(j));F.add(String.fromCharCode(B)),F.add(String.fromCharCode($));var D=L(),W=te(D);W.write(B,I);var R=0,z=String.fromCharCode(he[R]);for(R+=1;R<he.length;){var ye=String.fromCharCode(he[R]);R+=1,F.contains(z+ye)?z=z+ye:(W.write(F.indexOf(z),I),F.size()<4095&&(F.size()==1<<I&&(I+=1),F.add(z+ye)),z=ye)}return W.write(F.indexOf(z),I),W.write($,I),W.flush(),D.toByteArray()},q=function(){var y={},B=0,$={};return $.add=function(I){if($.contains(I))throw"dup key:"+I;y[I]=B,B+=1},$.size=function(){return B},$.indexOf=function(I){return y[I]},$.contains=function(I){return typeof y[I]<"u"},$};return we},V=function(X,oe,se){for(var de=H(X,oe),he=0;he<oe;he+=1)for(var we=0;we<X;we+=1)de.setPixel(we,he,se(we,he));var te=L();de.write(te);for(var k=O(),q=te.toByteArray(),y=0;y<q.length;y+=1)k.writeByte(q[y]);return k.flush(),"data:image/gif;base64,"+k};return m})();(function(){d.stringToBytesFuncs["UTF-8"]=function(m){function v(g){for(var w=[],x=0;x<g.length;x++){var S=g.charCodeAt(x);S<128?w.push(S):S<2048?w.push(192|S>>6,128|S&63):S<55296||S>=57344?w.push(224|S>>12,128|S>>6&63,128|S&63):(x++,S=65536+((S&1023)<<10|g.charCodeAt(x)&1023),w.push(240|S>>18,128|S>>12&63,128|S>>6&63,128|S&63))}return w}return v(m)}})(),(function(m){r.exports=m()})(function(){return d})})(qrcode$1);const qrcode=qrcode$1.exports;function copyToClipboard(r){return __async(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new TonConnectUIError("Clipboard API not available");return yield navigator.clipboard.writeText(r)}catch{}fallbackCopyTextToClipboard(r)})}function fallbackCopyTextToClipboard(r){const f=document.createElement("textarea");f.value=r,f.style.top="0",f.style.left="0",f.style.position="fixed",document.body.appendChild(f),f.focus(),f.select();try{document.execCommand("copy")}finally{document.body.removeChild(f)}}const _tmpl$$s=template$1("<div></div>"),QRCode=r=>{let f,d,m;const[v,g]=createSignal(!1),[w,x]=createSignal(picSizeDefault);createEffect(()=>{const E=qrcode(0,"L");E.addData(r.sourceUrl),E.make(),f.innerHTML=E.createSvgTag(4,0);const M=f.firstElementChild.clientWidth,A=Math.round(qrNormalSize/M*1e5)/1e5;if(m){const T=Math.ceil(imgSizeDefault/(A*4))*4,L=toPx(Math.ceil((M-T)/8)*4);m.style.top=L,m.style.left=L,m.style.height=toPx(T),m.style.width=toPx(T),x(Math.round(picSizeDefault/A))}d.style.transform=`scale(${A})`});let S=null;return createComponent(QrCodeBackground,{get class(){return r.class},onClick:()=>{g(!0),copyToClipboard(r.sourceUrl),S!=null&&clearTimeout(S),S=setTimeout(()=>g(!1),1500)},get children(){return[createComponent(QrCodeWrapper$2,{ref(b){const C=d;typeof C=="function"?C(b):d=b},get children(){return[(()=>{const b=_tmpl$$s.cloneNode(!0),C=f;return typeof C=="function"?use(C,b):f=b,b})(),createComponent(Show,{get when(){return r.imageUrl},get children(){return createComponent(ImageBackground,{ref(b){const C=m;typeof C=="function"?C(b):m=b},get children(){return createComponent(ImageStyled$3,{get src(){return r.imageUrl},alt:"",get size(){return w()}})}})}})]}}),createComponent(Transition,{onBeforeEnter:b=>{animate(b,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(b,C)=>{animate(b,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{C()})},get children(){return createComponent(Show,{get when(){return v()&&!r.disableCopy},get children(){return createComponent(CopiedBoxStyled,{get children(){return[createComponent(SuccessIcon,{size:"xs"}),createComponent(Text,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),createComponent(Show,{get when(){return!r.disableCopy},get children(){return createComponent(CopyIconButton,{get children(){return createComponent(CopyLightIcon,{})}})}})]}})};var deepReadObject=(r,f,d)=>{const m=f.trim().split(".").reduce((v,g)=>v?v[g]:void 0,r);return m!==void 0?m:d},template=(r,f,d=/{{(.*?)}}/g)=>r.replace(d,(m,v)=>deepReadObject(f,v,"")),createI18nContext=(r={},f=navigator.language in r?navigator.language:Object.keys(r)[0])=>{const[d,m]=createSignal(f),[v,g]=createStore(r);return[(S,_,b)=>{const C=deepReadObject(v[d()],S,b||"");return typeof C=="function"?C(_):typeof C=="string"?template(C,_||{}):C},{add(S,_){g(S,b=>Object.assign(b||{},_))},locale:S=>S?m(S):d(),dict:S=>deepReadObject(v,S)}]},I18nContext=createContext({}),useI18n=()=>useContext(I18nContext);const TextStyled$4=styled.div`
368
+ `;var qrcode$1={exports:{}};(function(r,f){var d=(function(){var m=function(X,oe){var se=236,de=17,he=X,we=g[oe],te=null,k=0,q=null,y=[],B={},$=function(ee,pe){k=he*4+17,te=(function(be){for(var ae=new Array(be),ne=0;ne<be;ne+=1){ae[ne]=new Array(be);for(var Se=0;Se<be;Se+=1)ae[ne][Se]=null}return ae})(k),I(0,0),I(k-7,0),I(0,k-7),D(),j(),R(ee,pe),he>=7&&W(ee),q==null&&(q=Ce(he,we,y)),z(q,pe)},I=function(ee,pe){for(var be=-1;be<=7;be+=1)if(!(ee+be<=-1||k<=ee+be))for(var ae=-1;ae<=7;ae+=1)pe+ae<=-1||k<=pe+ae||(0<=be&&be<=6&&(ae==0||ae==6)||0<=ae&&ae<=6&&(be==0||be==6)||2<=be&&be<=4&&2<=ae&&ae<=4?te[ee+be][pe+ae]=!0:te[ee+be][pe+ae]=!1)},U=function(){for(var ee=0,pe=0,be=0;be<8;be+=1){$(!0,be);var ae=x.getLostPoint(B);(be==0||ee>ae)&&(ee=ae,pe=be)}return pe},j=function(){for(var ee=8;ee<k-8;ee+=1)te[ee][6]==null&&(te[ee][6]=ee%2==0);for(var pe=8;pe<k-8;pe+=1)te[6][pe]==null&&(te[6][pe]=pe%2==0)},D=function(){for(var ee=x.getPatternPosition(he),pe=0;pe<ee.length;pe+=1)for(var be=0;be<ee.length;be+=1){var ae=ee[pe],ne=ee[be];if(te[ae][ne]==null)for(var Se=-2;Se<=2;Se+=1)for(var qe=-2;qe<=2;qe+=1)Se==-2||Se==2||qe==-2||qe==2||Se==0&&qe==0?te[ae+Se][ne+qe]=!0:te[ae+Se][ne+qe]=!1}},W=function(ee){for(var pe=x.getBCHTypeNumber(he),be=0;be<18;be+=1){var ae=!ee&&(pe>>be&1)==1;te[Math.floor(be/3)][be%3+k-8-3]=ae}for(var be=0;be<18;be+=1){var ae=!ee&&(pe>>be&1)==1;te[be%3+k-8-3][Math.floor(be/3)]=ae}},R=function(ee,pe){for(var be=we<<3|pe,ae=x.getBCHTypeInfo(be),ne=0;ne<15;ne+=1){var Se=!ee&&(ae>>ne&1)==1;ne<6?te[ne][8]=Se:ne<8?te[ne+1][8]=Se:te[k-15+ne][8]=Se}for(var ne=0;ne<15;ne+=1){var Se=!ee&&(ae>>ne&1)==1;ne<8?te[8][k-ne-1]=Se:ne<9?te[8][15-ne-1+1]=Se:te[8][15-ne-1]=Se}te[k-8][8]=!ee},z=function(ee,pe){for(var be=-1,ae=k-1,ne=7,Se=0,qe=x.getMaskFunction(pe),Ie=k-1;Ie>0;Ie-=2)for(Ie==6&&(Ie-=1);;){for(var Oe=0;Oe<2;Oe+=1)if(te[ae][Ie-Oe]==null){var Fe=!1;Se<ee.length&&(Fe=(ee[Se]>>>ne&1)==1);var De=qe(ae,Ie-Oe);De&&(Fe=!Fe),te[ae][Ie-Oe]=Fe,ne-=1,ne==-1&&(Se+=1,ne=7)}if(ae+=be,ae<0||k<=ae){ae-=be,be=-be;break}}},ye=function(ee,pe){for(var be=0,ae=0,ne=0,Se=new Array(pe.length),qe=new Array(pe.length),Ie=0;Ie<pe.length;Ie+=1){var Oe=pe[Ie].dataCount,Fe=pe[Ie].totalCount-Oe;ae=Math.max(ae,Oe),ne=Math.max(ne,Fe),Se[Ie]=new Array(Oe);for(var De=0;De<Se[Ie].length;De+=1)Se[Ie][De]=255&ee.getBuffer()[De+be];be+=Oe;var $e=x.getErrorCorrectPolynomial(Fe),je=_(Se[Ie],$e.getLength()-1),Ye=je.mod($e);qe[Ie]=new Array($e.getLength()-1);for(var De=0;De<qe[Ie].length;De+=1){var st=De+Ye.getLength()-qe[Ie].length;qe[Ie][De]=st>=0?Ye.getAt(st):0}}for(var Je=0,De=0;De<pe.length;De+=1)Je+=pe[De].totalCount;for(var Ge=new Array(Je),ut=0,De=0;De<ae;De+=1)for(var Ie=0;Ie<pe.length;Ie+=1)De<Se[Ie].length&&(Ge[ut]=Se[Ie][De],ut+=1);for(var De=0;De<ne;De+=1)for(var Ie=0;Ie<pe.length;Ie+=1)De<qe[Ie].length&&(Ge[ut]=qe[Ie][De],ut+=1);return Ge},Ce=function(ee,pe,be){for(var ae=b.getRSBlocks(ee,pe),ne=C(),Se=0;Se<be.length;Se+=1){var qe=be[Se];ne.put(qe.getMode(),4),ne.put(qe.getLength(),x.getLengthInBits(qe.getMode(),ee)),qe.write(ne)}for(var Ie=0,Se=0;Se<ae.length;Se+=1)Ie+=ae[Se].dataCount;if(ne.getLengthInBits()>Ie*8)throw"code length overflow. ("+ne.getLengthInBits()+">"+Ie*8+")";for(ne.getLengthInBits()+4<=Ie*8&&ne.put(0,4);ne.getLengthInBits()%8!=0;)ne.putBit(!1);for(;!(ne.getLengthInBits()>=Ie*8||(ne.put(se,8),ne.getLengthInBits()>=Ie*8));)ne.put(de,8);return ye(ne,ae)};B.addData=function(ee,pe){pe=pe||"Byte";var be=null;switch(pe){case"Numeric":be=E(ee);break;case"Alphanumeric":be=M(ee);break;case"Byte":be=A(ee);break;case"Kanji":be=T(ee);break;default:throw"mode:"+pe}y.push(be),q=null},B.isDark=function(ee,pe){if(ee<0||k<=ee||pe<0||k<=pe)throw ee+","+pe;return te[ee][pe]},B.getModuleCount=function(){return k},B.make=function(){if(he<1){for(var ee=1;ee<40;ee++){for(var pe=b.getRSBlocks(ee,we),be=C(),ae=0;ae<y.length;ae++){var ne=y[ae];be.put(ne.getMode(),4),be.put(ne.getLength(),x.getLengthInBits(ne.getMode(),ee)),ne.write(be)}for(var Se=0,ae=0;ae<pe.length;ae++)Se+=pe[ae].dataCount;if(be.getLengthInBits()<=Se*8)break}he=ee}$(!1,U())},B.createTableTag=function(ee,pe){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var be="";be+='<table style="',be+=" border-width: 0px; border-style: none;",be+=" border-collapse: collapse;",be+=" padding: 0px; margin: "+pe+"px;",be+='">',be+="<tbody>";for(var ae=0;ae<B.getModuleCount();ae+=1){be+="<tr>";for(var ne=0;ne<B.getModuleCount();ne+=1)be+='<td style="',be+=" border-width: 0px; border-style: none;",be+=" border-collapse: collapse;",be+=" padding: 0px; margin: 0px;",be+=" width: "+ee+"px;",be+=" height: "+ee+"px;",be+=" background-color: ",be+=B.isDark(ae,ne)?"#000000":"#ffffff",be+=";",be+='"/>';be+="</tr>"}return be+="</tbody>",be+="</table>",be},B.createSvgTag=function(ee,pe,be,ae){var ne={};typeof arguments[0]=="object"&&(ne=arguments[0],ee=ne.cellSize,pe=ne.margin,be=ne.alt,ae=ne.title),ee=ee||2,pe=typeof pe>"u"?ee*4:pe,be=typeof be=="string"?{text:be}:be||{},be.text=be.text||null,be.id=be.text?be.id||"qrcode-description":null,ae=typeof ae=="string"?{text:ae}:ae||{},ae.text=ae.text||null,ae.id=ae.text?ae.id||"qrcode-title":null;var Se=B.getModuleCount()*ee+pe*2,qe,Ie,Oe,Fe,De="",$e;for($e="l"+ee+",0 0,"+ee+" -"+ee+",0 0,-"+ee+"z ",De+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',De+=ne.scalable?"":' width="'+Se+'px" height="'+Se+'px"',De+=' viewBox="0 0 '+Se+" "+Se+'" ',De+=' preserveAspectRatio="xMinYMin meet"',De+=ae.text||be.text?' role="img" aria-labelledby="'+me([ae.id,be.id].join(" ").trim())+'"':"",De+=">",De+=ae.text?'<title id="'+me(ae.id)+'">'+me(ae.text)+"</title>":"",De+=be.text?'<description id="'+me(be.id)+'">'+me(be.text)+"</description>":"",De+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',De+='<path d="',Oe=0;Oe<B.getModuleCount();Oe+=1)for(Fe=Oe*ee+pe,qe=0;qe<B.getModuleCount();qe+=1)B.isDark(Oe,qe)&&(Ie=qe*ee+pe,De+="M"+Ie+","+Fe+$e);return De+='" stroke="transparent" fill="black"/>',De+="</svg>",De},B.createDataURL=function(ee,pe){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var be=B.getModuleCount()*ee+pe*2,ae=pe,ne=be-pe;return V(be,be,function(Se,qe){if(ae<=Se&&Se<ne&&ae<=qe&&qe<ne){var Ie=Math.floor((Se-ae)/ee),Oe=Math.floor((qe-ae)/ee);return B.isDark(Oe,Ie)?0:1}else return 1})},B.createImgTag=function(ee,pe,be){ee=ee||2,pe=typeof pe>"u"?ee*4:pe;var ae=B.getModuleCount()*ee+pe*2,ne="";return ne+="<img",ne+=' src="',ne+=B.createDataURL(ee,pe),ne+='"',ne+=' width="',ne+=ae,ne+='"',ne+=' height="',ne+=ae,ne+='"',be&&(ne+=' alt="',ne+=me(be),ne+='"'),ne+="/>",ne};var me=function(ee){for(var pe="",be=0;be<ee.length;be+=1){var ae=ee.charAt(be);switch(ae){case"<":pe+="&lt;";break;case">":pe+="&gt;";break;case"&":pe+="&amp;";break;case'"':pe+="&quot;";break;default:pe+=ae;break}}return pe},ie=function(ee){var pe=1;ee=typeof ee>"u"?pe*2:ee;var be=B.getModuleCount()*pe+ee*2,ae=ee,ne=be-ee,Se,qe,Ie,Oe,Fe,De={"██":"█","█ ":"▀"," █":"▄"," ":" "},$e={"██":"▀","█ ":"▀"," █":" "," ":" "},je="";for(Se=0;Se<be;Se+=2){for(Ie=Math.floor((Se-ae)/pe),Oe=Math.floor((Se+1-ae)/pe),qe=0;qe<be;qe+=1)Fe="█",ae<=qe&&qe<ne&&ae<=Se&&Se<ne&&B.isDark(Ie,Math.floor((qe-ae)/pe))&&(Fe=" "),ae<=qe&&qe<ne&&ae<=Se+1&&Se+1<ne&&B.isDark(Oe,Math.floor((qe-ae)/pe))?Fe+=" ":Fe+="█",je+=ee<1&&Se+1>=ne?$e[Fe]:De[Fe];je+=`
369
+ `}return be%2&&ee>0?je.substring(0,je.length-be-1)+Array(be+1).join("▀"):je.substring(0,je.length-1)};return B.createASCII=function(ee,pe){if(ee=ee||1,ee<2)return ie(pe);ee-=1,pe=typeof pe>"u"?ee*2:pe;var be=B.getModuleCount()*ee+pe*2,ae=pe,ne=be-pe,Se,qe,Ie,Oe,Fe=Array(ee+1).join("██"),De=Array(ee+1).join(" "),$e="",je="";for(Se=0;Se<be;Se+=1){for(Ie=Math.floor((Se-ae)/ee),je="",qe=0;qe<be;qe+=1)Oe=1,ae<=qe&&qe<ne&&ae<=Se&&Se<ne&&B.isDark(Ie,Math.floor((qe-ae)/ee))&&(Oe=0),je+=Oe?Fe:De;for(Ie=0;Ie<ee;Ie+=1)$e+=je+`
370
+ `}return $e.substring(0,$e.length-1)},B.renderTo2dContext=function(ee,pe){pe=pe||2;for(var be=B.getModuleCount(),ae=0;ae<be;ae++)for(var ne=0;ne<be;ne++)ee.fillStyle=B.isDark(ae,ne)?"black":"white",ee.fillRect(ae*pe,ne*pe,pe,pe)},B};m.stringToBytesFuncs={default:function(X){for(var oe=[],se=0;se<X.length;se+=1){var de=X.charCodeAt(se);oe.push(de&255)}return oe}},m.stringToBytes=m.stringToBytesFuncs.default,m.createStringToBytes=function(X,oe){var se=(function(){for(var he=N(X),we=function(){var j=he.read();if(j==-1)throw"eof";return j},te=0,k={};;){var q=he.read();if(q==-1)break;var y=we(),B=we(),$=we(),I=String.fromCharCode(q<<8|y),U=B<<8|$;k[I]=U,te+=1}if(te!=oe)throw te+" != "+oe;return k})(),de=63;return function(he){for(var we=[],te=0;te<he.length;te+=1){var k=he.charCodeAt(te);if(k<128)we.push(k);else{var q=se[he.charAt(te)];typeof q=="number"?(q&255)==q?we.push(q):(we.push(q>>>8),we.push(q&255)):we.push(de)}}return we}};var v={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},g={L:1,M:0,Q:3,H:2},w={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},x=(function(){var X=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],oe=1335,se=7973,de=21522,he={},we=function(te){for(var k=0;te!=0;)k+=1,te>>>=1;return k};return he.getBCHTypeInfo=function(te){for(var k=te<<10;we(k)-we(oe)>=0;)k^=oe<<we(k)-we(oe);return(te<<10|k)^de},he.getBCHTypeNumber=function(te){for(var k=te<<12;we(k)-we(se)>=0;)k^=se<<we(k)-we(se);return te<<12|k},he.getPatternPosition=function(te){return X[te-1]},he.getMaskFunction=function(te){switch(te){case w.PATTERN000:return function(k,q){return(k+q)%2==0};case w.PATTERN001:return function(k,q){return k%2==0};case w.PATTERN010:return function(k,q){return q%3==0};case w.PATTERN011:return function(k,q){return(k+q)%3==0};case w.PATTERN100:return function(k,q){return(Math.floor(k/2)+Math.floor(q/3))%2==0};case w.PATTERN101:return function(k,q){return k*q%2+k*q%3==0};case w.PATTERN110:return function(k,q){return(k*q%2+k*q%3)%2==0};case w.PATTERN111:return function(k,q){return(k*q%3+(k+q)%2)%2==0};default:throw"bad maskPattern:"+te}},he.getErrorCorrectPolynomial=function(te){for(var k=_([1],0),q=0;q<te;q+=1)k=k.multiply(_([1,S.gexp(q)],0));return k},he.getLengthInBits=function(te,k){if(1<=k&&k<10)switch(te){case v.MODE_NUMBER:return 10;case v.MODE_ALPHA_NUM:return 9;case v.MODE_8BIT_BYTE:return 8;case v.MODE_KANJI:return 8;default:throw"mode:"+te}else if(k<27)switch(te){case v.MODE_NUMBER:return 12;case v.MODE_ALPHA_NUM:return 11;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 10;default:throw"mode:"+te}else if(k<41)switch(te){case v.MODE_NUMBER:return 14;case v.MODE_ALPHA_NUM:return 13;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 12;default:throw"mode:"+te}else throw"type:"+k},he.getLostPoint=function(te){for(var k=te.getModuleCount(),q=0,y=0;y<k;y+=1)for(var B=0;B<k;B+=1){for(var $=0,I=te.isDark(y,B),U=-1;U<=1;U+=1)if(!(y+U<0||k<=y+U))for(var j=-1;j<=1;j+=1)B+j<0||k<=B+j||U==0&&j==0||I==te.isDark(y+U,B+j)&&($+=1);$>5&&(q+=3+$-5)}for(var y=0;y<k-1;y+=1)for(var B=0;B<k-1;B+=1){var D=0;te.isDark(y,B)&&(D+=1),te.isDark(y+1,B)&&(D+=1),te.isDark(y,B+1)&&(D+=1),te.isDark(y+1,B+1)&&(D+=1),(D==0||D==4)&&(q+=3)}for(var y=0;y<k;y+=1)for(var B=0;B<k-6;B+=1)te.isDark(y,B)&&!te.isDark(y,B+1)&&te.isDark(y,B+2)&&te.isDark(y,B+3)&&te.isDark(y,B+4)&&!te.isDark(y,B+5)&&te.isDark(y,B+6)&&(q+=40);for(var B=0;B<k;B+=1)for(var y=0;y<k-6;y+=1)te.isDark(y,B)&&!te.isDark(y+1,B)&&te.isDark(y+2,B)&&te.isDark(y+3,B)&&te.isDark(y+4,B)&&!te.isDark(y+5,B)&&te.isDark(y+6,B)&&(q+=40);for(var W=0,B=0;B<k;B+=1)for(var y=0;y<k;y+=1)te.isDark(y,B)&&(W+=1);var R=Math.abs(100*W/k/k-50)/5;return q+=R*10,q},he})(),S=(function(){for(var X=new Array(256),oe=new Array(256),se=0;se<8;se+=1)X[se]=1<<se;for(var se=8;se<256;se+=1)X[se]=X[se-4]^X[se-5]^X[se-6]^X[se-8];for(var se=0;se<255;se+=1)oe[X[se]]=se;var de={};return de.glog=function(he){if(he<1)throw"glog("+he+")";return oe[he]},de.gexp=function(he){for(;he<0;)he+=255;for(;he>=256;)he-=255;return X[he]},de})();function _(X,oe){if(typeof X.length>"u")throw X.length+"/"+oe;var se=(function(){for(var he=0;he<X.length&&X[he]==0;)he+=1;for(var we=new Array(X.length-he+oe),te=0;te<X.length-he;te+=1)we[te]=X[te+he];return we})(),de={};return de.getAt=function(he){return se[he]},de.getLength=function(){return se.length},de.multiply=function(he){for(var we=new Array(de.getLength()+he.getLength()-1),te=0;te<de.getLength();te+=1)for(var k=0;k<he.getLength();k+=1)we[te+k]^=S.gexp(S.glog(de.getAt(te))+S.glog(he.getAt(k)));return _(we,0)},de.mod=function(he){if(de.getLength()-he.getLength()<0)return de;for(var we=S.glog(de.getAt(0))-S.glog(he.getAt(0)),te=new Array(de.getLength()),k=0;k<de.getLength();k+=1)te[k]=de.getAt(k);for(var k=0;k<he.getLength();k+=1)te[k]^=S.gexp(S.glog(he.getAt(k))+we);return _(te,0).mod(he)},de}var b=(function(){var X=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],oe=function(he,we){var te={};return te.totalCount=he,te.dataCount=we,te},se={},de=function(he,we){switch(we){case g.L:return X[(he-1)*4+0];case g.M:return X[(he-1)*4+1];case g.Q:return X[(he-1)*4+2];case g.H:return X[(he-1)*4+3];default:return}};return se.getRSBlocks=function(he,we){var te=de(he,we);if(typeof te>"u")throw"bad rs block @ typeNumber:"+he+"/errorCorrectionLevel:"+we;for(var k=te.length/3,q=[],y=0;y<k;y+=1)for(var B=te[y*3+0],$=te[y*3+1],I=te[y*3+2],U=0;U<B;U+=1)q.push(oe($,I));return q},se})(),C=function(){var X=[],oe=0,se={};return se.getBuffer=function(){return X},se.getAt=function(de){var he=Math.floor(de/8);return(X[he]>>>7-de%8&1)==1},se.put=function(de,he){for(var we=0;we<he;we+=1)se.putBit((de>>>he-we-1&1)==1)},se.getLengthInBits=function(){return oe},se.putBit=function(de){var he=Math.floor(oe/8);X.length<=he&&X.push(0),de&&(X[he]|=128>>>oe%8),oe+=1},se},E=function(X){var oe=v.MODE_NUMBER,se=X,de={};de.getMode=function(){return oe},de.getLength=function(te){return se.length},de.write=function(te){for(var k=se,q=0;q+2<k.length;)te.put(he(k.substring(q,q+3)),10),q+=3;q<k.length&&(k.length-q==1?te.put(he(k.substring(q,q+1)),4):k.length-q==2&&te.put(he(k.substring(q,q+2)),7))};var he=function(te){for(var k=0,q=0;q<te.length;q+=1)k=k*10+we(te.charAt(q));return k},we=function(te){if("0"<=te&&te<="9")return te.charCodeAt(0)-48;throw"illegal char :"+te};return de},M=function(X){var oe=v.MODE_ALPHA_NUM,se=X,de={};de.getMode=function(){return oe},de.getLength=function(we){return se.length},de.write=function(we){for(var te=se,k=0;k+1<te.length;)we.put(he(te.charAt(k))*45+he(te.charAt(k+1)),11),k+=2;k<te.length&&we.put(he(te.charAt(k)),6)};var he=function(we){if("0"<=we&&we<="9")return we.charCodeAt(0)-48;if("A"<=we&&we<="Z")return we.charCodeAt(0)-65+10;switch(we){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+we}};return de},A=function(X){var oe=v.MODE_8BIT_BYTE,se=m.stringToBytes(X),de={};return de.getMode=function(){return oe},de.getLength=function(he){return se.length},de.write=function(he){for(var we=0;we<se.length;we+=1)he.put(se[we],8)},de},T=function(X){var oe=v.MODE_KANJI,se=m.stringToBytesFuncs.SJIS;if(!se)throw"sjis not supported.";(function(we,te){var k=se(we);if(k.length!=2||(k[0]<<8|k[1])!=te)throw"sjis not supported."})("友",38726);var de=se(X),he={};return he.getMode=function(){return oe},he.getLength=function(we){return~~(de.length/2)},he.write=function(we){for(var te=de,k=0;k+1<te.length;){var q=(255&te[k])<<8|255&te[k+1];if(33088<=q&&q<=40956)q-=33088;else if(57408<=q&&q<=60351)q-=49472;else throw"illegal char at "+(k+1)+"/"+q;q=(q>>>8&255)*192+(q&255),we.put(q,13),k+=2}if(k<te.length)throw"illegal char at "+(k+1)},he},L=function(){var X=[],oe={};return oe.writeByte=function(se){X.push(se&255)},oe.writeShort=function(se){oe.writeByte(se),oe.writeByte(se>>>8)},oe.writeBytes=function(se,de,he){de=de||0,he=he||se.length;for(var we=0;we<he;we+=1)oe.writeByte(se[we+de])},oe.writeString=function(se){for(var de=0;de<se.length;de+=1)oe.writeByte(se.charCodeAt(de))},oe.toByteArray=function(){return X},oe.toString=function(){var se="";se+="[";for(var de=0;de<X.length;de+=1)de>0&&(se+=","),se+=X[de];return se+="]",se},oe},O=function(){var X=0,oe=0,se=0,de="",he={},we=function(k){de+=String.fromCharCode(te(k&63))},te=function(k){if(!(k<0)){if(k<26)return 65+k;if(k<52)return 97+(k-26);if(k<62)return 48+(k-52);if(k==62)return 43;if(k==63)return 47}throw"n:"+k};return he.writeByte=function(k){for(X=X<<8|k&255,oe+=8,se+=1;oe>=6;)we(X>>>oe-6),oe-=6},he.flush=function(){if(oe>0&&(we(X<<6-oe),X=0,oe=0),se%3!=0)for(var k=3-se%3,q=0;q<k;q+=1)de+="="},he.toString=function(){return de},he},N=function(X){var oe=X,se=0,de=0,he=0,we={};we.read=function(){for(;he<8;){if(se>=oe.length){if(he==0)return-1;throw"unexpected end of file./"+he}var k=oe.charAt(se);if(se+=1,k=="=")return he=0,-1;if(k.match(/^\s$/))continue;de=de<<6|te(k.charCodeAt(0)),he+=6}var q=de>>>he-8&255;return he-=8,q};var te=function(k){if(65<=k&&k<=90)return k-65;if(97<=k&&k<=122)return k-97+26;if(48<=k&&k<=57)return k-48+52;if(k==43)return 62;if(k==47)return 63;throw"c:"+k};return we},H=function(X,oe){var se=X,de=oe,he=new Array(X*oe),we={};we.setPixel=function(y,B,$){he[B*se+y]=$},we.write=function(y){y.writeString("GIF87a"),y.writeShort(se),y.writeShort(de),y.writeByte(128),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(0),y.writeByte(255),y.writeByte(255),y.writeByte(255),y.writeString(","),y.writeShort(0),y.writeShort(0),y.writeShort(se),y.writeShort(de),y.writeByte(0);var B=2,$=k(B);y.writeByte(B);for(var I=0;$.length-I>255;)y.writeByte(255),y.writeBytes($,I,255),I+=255;y.writeByte($.length-I),y.writeBytes($,I,$.length-I),y.writeByte(0),y.writeString(";")};var te=function(y){var B=y,$=0,I=0,U={};return U.write=function(j,D){if(j>>>D)throw"length over";for(;$+D>=8;)B.writeByte(255&(j<<$|I)),D-=8-$,j>>>=8-$,I=0,$=0;I=j<<$|I,$=$+D},U.flush=function(){$>0&&B.writeByte(I)},U},k=function(y){for(var B=1<<y,$=(1<<y)+1,I=y+1,U=q(),j=0;j<B;j+=1)U.add(String.fromCharCode(j));U.add(String.fromCharCode(B)),U.add(String.fromCharCode($));var D=L(),W=te(D);W.write(B,I);var R=0,z=String.fromCharCode(he[R]);for(R+=1;R<he.length;){var ye=String.fromCharCode(he[R]);R+=1,U.contains(z+ye)?z=z+ye:(W.write(U.indexOf(z),I),U.size()<4095&&(U.size()==1<<I&&(I+=1),U.add(z+ye)),z=ye)}return W.write(U.indexOf(z),I),W.write($,I),W.flush(),D.toByteArray()},q=function(){var y={},B=0,$={};return $.add=function(I){if($.contains(I))throw"dup key:"+I;y[I]=B,B+=1},$.size=function(){return B},$.indexOf=function(I){return y[I]},$.contains=function(I){return typeof y[I]<"u"},$};return we},V=function(X,oe,se){for(var de=H(X,oe),he=0;he<oe;he+=1)for(var we=0;we<X;we+=1)de.setPixel(we,he,se(we,he));var te=L();de.write(te);for(var k=O(),q=te.toByteArray(),y=0;y<q.length;y+=1)k.writeByte(q[y]);return k.flush(),"data:image/gif;base64,"+k};return m})();(function(){d.stringToBytesFuncs["UTF-8"]=function(m){function v(g){for(var w=[],x=0;x<g.length;x++){var S=g.charCodeAt(x);S<128?w.push(S):S<2048?w.push(192|S>>6,128|S&63):S<55296||S>=57344?w.push(224|S>>12,128|S>>6&63,128|S&63):(x++,S=65536+((S&1023)<<10|g.charCodeAt(x)&1023),w.push(240|S>>18,128|S>>12&63,128|S>>6&63,128|S&63))}return w}return v(m)}})(),(function(m){r.exports=m()})(function(){return d})})(qrcode$1);const qrcode=qrcode$1.exports;function copyToClipboard(r){return __async(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new TonConnectUIError("Clipboard API not available");return yield navigator.clipboard.writeText(r)}catch{}fallbackCopyTextToClipboard(r)})}function fallbackCopyTextToClipboard(r){const f=document.createElement("textarea");f.value=r,f.style.top="0",f.style.left="0",f.style.position="fixed",document.body.appendChild(f),f.focus(),f.select();try{document.execCommand("copy")}finally{document.body.removeChild(f)}}const _tmpl$$s=template$1("<div></div>"),QRCode=r=>{let f,d,m;const[v,g]=createSignal(!1),[w,x]=createSignal(picSizeDefault);createEffect(()=>{const E=qrcode(0,"L");E.addData(r.sourceUrl),E.make(),f.innerHTML=E.createSvgTag(4,0);const M=f.firstElementChild.clientWidth,A=Math.round(qrNormalSize/M*1e5)/1e5;if(m){const T=Math.ceil(imgSizeDefault/(A*4))*4,L=toPx(Math.ceil((M-T)/8)*4);m.style.top=L,m.style.left=L,m.style.height=toPx(T),m.style.width=toPx(T),x(Math.round(picSizeDefault/A))}d.style.transform=`scale(${A})`});let S=null;return createComponent(QrCodeBackground,{get class(){return r.class},onClick:()=>{g(!0),copyToClipboard(r.sourceUrl),S!=null&&clearTimeout(S),S=setTimeout(()=>g(!1),1500)},get children(){return[createComponent(QrCodeWrapper$2,{ref(b){const C=d;typeof C=="function"?C(b):d=b},get children(){return[(()=>{const b=_tmpl$$s.cloneNode(!0),C=f;return typeof C=="function"?use(C,b):f=b,b})(),createComponent(Show,{get when(){return r.imageUrl},get children(){return createComponent(ImageBackground,{ref(b){const C=m;typeof C=="function"?C(b):m=b},get children(){return createComponent(ImageStyled$3,{get src(){return r.imageUrl},alt:"",get size(){return w()}})}})}})]}}),createComponent(Transition,{onBeforeEnter:b=>{animate(b,[{opacity:0,transform:"translate(-50%, 44px)"},{opacity:1,transform:"translate(-50%, 0)"}],{duration:150,easing:"ease-out"})},onExit:(b,C)=>{animate(b,[{opacity:1,transform:"translate(-50%, 0)"},{opacity:0,transform:"translate(-50%, 44px)"}],{duration:150,easing:"ease-out"}).finished.then(()=>{C()})},get children(){return createComponent(Show,{get when(){return v()&&!r.disableCopy},get children(){return createComponent(CopiedBoxStyled,{get children(){return[createComponent(SuccessIcon,{size:"xs"}),createComponent(Text,{translationKey:"common.linkCopied",children:"Link Copied"})]}})}})}}),createComponent(Show,{get when(){return!r.disableCopy},get children(){return createComponent(CopyIconButton,{get children(){return createComponent(CopyLightIcon,{})}})}})]}})};var deepReadObject=(r,f,d)=>{const m=f.trim().split(".").reduce((v,g)=>v?v[g]:void 0,r);return m!==void 0?m:d},template=(r,f,d=/{{(.*?)}}/g)=>r.replace(d,(m,v)=>deepReadObject(f,v,"")),createI18nContext=(r={},f=navigator.language in r?navigator.language:Object.keys(r)[0])=>{const[d,m]=createSignal(f),[v,g]=createStore(r);return[(S,_,b)=>{const C=deepReadObject(v[d()],S,b||"");return typeof C=="function"?C(_):typeof C=="string"?template(C,_||{}):C},{add(S,_){g(S,b=>Object.assign(b||{},_))},locale:S=>S?m(S):d(),dict:S=>deepReadObject(v,S)}]},I18nContext=createContext({}),useI18n=()=>useContext(I18nContext);const TextStyled$4=styled.div`
371
371
  font-style: normal;
372
372
  font-weight: ${r=>r.fontWeight};
373
373
  font-size: ${r=>r.fontSize};
@@ -1242,4 +1242,4 @@ https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={D
1242
1242
  width: 16px;
1243
1243
  `,ButtonStyled=styled(Button)`
1244
1244
  margin-top: 32px;
1245
- `,ActionModal=r=>{const f=useDataAttributes(r),d=useContext(TonConnectUiContext),[m,v]=createSignal(!0),[g,w]=createSignal(!1),[x,S]=createSignal(!1),[_,b]=createSignal(!1);createEffect(()=>{const A=action();w(!!A&&("sent"in A&&A.sent||A.name==="transaction-sent")),S(!!A&&("signed"in A&&A.signed||A.name==="data-signed")),b(!!A&&(A.name==="transaction-canceled"||A.name==="sign-data-canceled"))});let C;d!=null&&d.wallet&&"universalLink"in d.wallet&&(d.wallet.openMethod==="universal-link"||isTelegramUrl(d.wallet.universalLink)&&isInTMA())&&(C=d.wallet.universalLink);let E;d!=null&&d.wallet&&"deepLink"in d.wallet&&(d.wallet.openMethod==="custom-deeplink"||isTelegramUrl(d.wallet.deepLink)&&isInTMA())&&(E=d.wallet.deepLink);const M=()=>{const A=action(),T="returnStrategy"in A?A.returnStrategy:appState.returnStrategy,L=!m();v(!1),isTelegramUrl(C)?redirectToTelegram(C,{returnStrategy:T,twaReturnUrl:"twaReturnUrl"in A?A.twaReturnUrl:appState.twaReturnUrl,forceRedirect:L}):redirectToWallet(C,E,{returnStrategy:T,forceRedirect:L},()=>{})};return createComponent(ActionModalStyled,mergeProps(f,{get children(){return[createMemo(()=>r.icon),createComponent(H1Styled,{get translationKey(){return r.headerTranslationKey},get translationValues(){return r.headerTranslationValues}}),createComponent(TextStyled,{get translationKey(){return r.textTranslationKey},get translationValues(){return r.textTranslationValues}}),createComponent(Show,{get when(){return!g()&&!x()&&!_()&&(r.showButton==="open-wallet"&&C||r.showButton!=="open-wallet")},get children(){return createComponent(LoaderButtonStyled,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return createComponent(LoaderIconStyled,{})}})}}),createComponent(Show,{get when(){return g()||x()},get children(){return[createComponent(Show,{get when(){return r.showButton!=="open-wallet"},get children(){return createComponent(ButtonStyled,{onClick:()=>r.onClose(),get children(){return createComponent(Translation,{translationKey:"common.close",children:"Close"})}})}}),createComponent(Show,{get when(){return r.showButton==="open-wallet"&&C},get children(){return createComponent(ButtonStyled,{onClick:M,get children(){return createComponent(Translation,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},ConfirmTransactionModal=r=>{const f=useContext(TonConnectUiContext),[d]=useI18n(),m=()=>f.wallet&&"name"in f.wallet?f.wallet.name:d("common.yourWallet",{},"Your wallet");return createComponent(ActionModal,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:m()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return createComponent(LoaderIcon,{size:"m"})},onClose:()=>r.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},TransactionCanceledModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return createComponent(ErrorIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-transaction-canceled-modal":"true"}),TransactionSentModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return createComponent(SuccessIcon,{size:"m"})},showButton:"open-wallet",onClose:()=>r.onClose(),"data-tc-transaction-sent-modal":"true"}),ConfirmSignDataModal=r=>{const f=useContext(TonConnectUiContext),[d]=useI18n(),m=()=>f.wallet&&"name"in f.wallet?f.wallet.name:d("common.yourWallet",{},"Your wallet");return createComponent(ActionModal,{headerTranslationKey:"actionModal.signData.header",get headerTranslationValues(){return{name:m()}},textTranslationKey:"actionModal.signData.text",get icon(){return createComponent(LoaderIcon,{size:"m"})},onClose:()=>r.onClose(),showButton:"open-wallet","data-tc-sign-data-confirm-modal":"true"})},SignDataCanceledModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.signDataCanceled.header",get icon(){return createComponent(ErrorIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-sign-data-canceled-modal":"true"}),DataSignedModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.dataSigned.header",get icon(){return createComponent(SuccessIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-data-signed-modal":"true"}),ActionsModal=()=>createComponent(Modal,{get opened(){var r;return createMemo(()=>action()!==null)()&&((r=action())==null?void 0:r.openModal)===!0},get enableAndroidBackHandler(){return appState.enableAndroidBackHandler},onClose:()=>setAction(null),showFooter:!1,"data-tc-actions-modal-container":"true",get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return action().name==="transaction-sent"},get children(){return createComponent(TransactionSentModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="transaction-canceled"},get children(){return createComponent(TransactionCanceledModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="confirm-transaction"},get children(){return createComponent(ConfirmTransactionModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="data-signed"},get children(){return createComponent(DataSignedModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="sign-data-canceled"},get children(){return createComponent(SignDataCanceledModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="confirm-sign-data"},get children(){return createComponent(ConfirmSignDataModal,{onClose:()=>setAction(null)})}})]}})}}),SingleWalletModal=()=>{const{locale:r}=useI18n()[1];createEffect(()=>r(appState.language)),createEffect(()=>{getSingleWalletModalIsOpened()&&updateIsMobile()});const f=useContext(ConnectorContext),d=useContext(TonConnectUiContext),[m,v]=createSignal(!1),g=()=>{var _;return((_=appState.connectRequestParameters)==null?void 0:_.state)==="loading"},w=createMemo(()=>{var _;if(!g())return(_=appState.connectRequestParameters)==null?void 0:_.value}),x=_=>{d.closeSingleWalletModal(_)},S=f.onStatusChange(_=>{_&&x("wallet-selected")});return onCleanup(S),onCleanup(()=>{v(!1)}),createComponent(StyledModal,{get opened(){return getSingleWalletModalIsOpened()},get enableAndroidBackHandler(){return appState.enableAndroidBackHandler},onClose:()=>x("action-cancelled"),onClickQuestion:()=>v(_=>!_),showFooter:!0,"data-tc-wallets-modal-container":"true",get children(){return[createComponent(Show,{get when(){return m()},get children(){return createComponent(InfoModal,{onBackClick:()=>v(!1)})}}),createComponent(Show,{get when(){return!m()},get children(){return[createComponent(Show,{get when(){return g()},get children(){return[createComponent(H1Styled$a,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),createComponent(LoaderContainerStyled,{get children(){return createComponent(LoaderIcon,{size:"m"})}})]}}),createComponent(Show,{get when(){return!g()},get children(){return createComponent(Dynamic,{get component(){return isMobile()?MobileConnectionModal:DesktopConnectionModal},get wallet(){return getSingleWalletModalWalletInfo()},get additionalRequest(){return w()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},App=r=>{const f=createI18nContext(i18nDictionary,appState.language);return defineStylesRoot(),fixMobileSafariActiveTransition(),createComponent(I18nContext.Provider,{value:f,get children(){return createComponent(TonConnectUiContext.Provider,{get value(){return r.tonConnectUI},get children(){return createComponent(ConnectorContext.Provider,{get value(){return appState.connector},get children(){return[createComponent(GlobalStyles,{}),createComponent(ThemeProvider,{theme:themeState,get children(){return[createComponent(Show,{get when(){return appState.buttonRootId},get children(){return createComponent(Portal,{get mount(){return document.getElementById(appState.buttonRootId)},get children(){return createComponent(AccountButton,{})}})}}),createComponent(Dynamic,{component:globalStylesTag,get children(){return[createComponent(WalletsModal,{}),createComponent(SingleWalletModal,{}),createComponent(ActionsModal,{})]}})]}})]}})}})}})},widgetController={openWalletsModal:()=>void setTimeout(()=>setWalletsModalState({status:"opened",closeReason:null})),closeWalletsModal:r=>void setTimeout(()=>setWalletsModalState({status:"closed",closeReason:r})),openSingleWalletModal:r=>{setTimeout(()=>setSingleWalletModalState({status:"opened",closeReason:null,walletInfo:r}))},closeSingleWalletModal:r=>void setTimeout(()=>setSingleWalletModalState({status:"closed",closeReason:r})),openWalletNotSupportFeatureModal:r=>void setTimeout(()=>setWalletsModalState({status:"opened",closeReason:null,type:"wallet-not-support-feature",requiredFeature:r.requiredFeature})),setAction:r=>void setTimeout(()=>setAction(r)),clearAction:()=>void setTimeout(()=>setAction(null)),getSelectedWalletInfo:()=>lastSelectedWalletInfo(),removeSelectedWalletInfo:()=>setLastSelectedWalletInfo(null),renderApp:(r,f)=>render(()=>createComponent(App,{tonConnectUI:f}),document.getElementById(r))};class WalletsModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"tracker"),__publicField(this,"state",walletsModalState()),this.connector=f.connector,this.tracker=f.tracker,this.setConnectRequestParametersCallback=f.setConnectRequestParametersCallback,createEffect(()=>{const d=walletsModalState();this.state=d,this.consumers.forEach(m=>m(d))})}open(){return __async(this,null,function*(){this.tracker.trackConnectionStarted();const d=(yield this.connector.getWallets()).find(isWalletInfoCurrentlyEmbedded);return d?this.connectEmbeddedWallet(d):this.openWalletsModal()})}close(f="action-cancelled"){f==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),widgetController.closeWalletsModal(f)}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}connectEmbeddedWallet(f){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},m=appState.connectRequestParameters;(m==null?void 0:m.state)==="loading"?this.setConnectRequestParametersCallback(d):d(m==null?void 0:m.value)}openWalletsModal(){return __async(this,null,function*(){return isInTMA()&&sendExpand(),widgetController.openWalletsModal(),new Promise(f=>{const d=this.onStateChange(m=>{const{status:v}=m;v==="opened"&&(d(),f())})})})}}class TransactionModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"consumers",[]),this.connector=f.connector,createEffect(()=>{const d=action();this.consumers.forEach(m=>m(d))})}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}}class SingleWalletModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"tracker"),__publicField(this,"state",singleWalletModalState()),this.connector=f.connector,this.tracker=f.tracker,this.setConnectRequestParametersCallback=f.setConnectRequestParametersCallback,createEffect(()=>{const d=singleWalletModalState();this.state=d,this.consumers.forEach(m=>m(d))})}open(f){return __async(this,null,function*(){this.tracker.trackConnectionStarted();const d=yield this.connector.getWallets(),m=applyWalletsListConfiguration(d,appState.walletsListConfiguration),v=m.find(isWalletInfoCurrentlyEmbedded);if(!!v)return this.connectEmbeddedWallet(v);const x=m.filter(isWalletInfoRemote).find(b=>eqWalletName(b,f));if(!!x)return this.openSingleWalletModal(x);const _=`Trying to open modal window with unknown wallet "${f}".`;throw this.tracker.trackConnectionError(_),new TonConnectUIError(_)})}close(f="action-cancelled"){f==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),widgetController.closeSingleWalletModal("action-cancelled")}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}connectEmbeddedWallet(f){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},m=appState.connectRequestParameters;(m==null?void 0:m.state)==="loading"?this.setConnectRequestParametersCallback(d):d(m==null?void 0:m.value)}openSingleWalletModal(f){return __async(this,null,function*(){return isInTMA()&&sendExpand(),widgetController.openSingleWalletModal(f),new Promise(d=>{const m=this.onStateChange(v=>{const{status:g}=v;g==="opened"&&(m(),d())})})})}}class TonConnectUITracker{constructor(f){__publicField(this,"eventPrefix","ton-connect-ui-"),__publicField(this,"tonConnectUiVersion"),__publicField(this,"tonConnectSdkVersion",null),__publicField(this,"eventDispatcher");var d;this.eventDispatcher=(d=f==null?void 0:f.eventDispatcher)!=null?d:new BrowserEventDispatcher,this.tonConnectUiVersion=f.tonConnectUiVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __async(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return __async(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>__async(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",createResponseVersionEvent(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return __async(this,null,function*(){return new Promise((f,d)=>__async(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",m=>{f(m.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",createRequestVersionEvent())}catch(m){d(m)}}))})}dispatchUserActionEvent(f){var d;try{(d=this.eventDispatcher)==null||d.dispatchEvent(`${this.eventPrefix}${f.type}`,f).catch()}catch{}}trackConnectionStarted(...f){try{const d=createConnectionStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(...f){try{const d=createConnectionCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(...f){try{const d=createConnectionErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(...f){try{const d=createConnectionRestoringStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(...f){try{const d=createConnectionRestoringCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(...f){try{const d=createConnectionRestoringErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(...f){try{const d=createDisconnectionEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(...f){try{const d=createTransactionSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(...f){try{const d=createTransactionSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(...f){try{const d=createTransactionSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSentForSignature(...f){try{const d=createDataSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigned(...f){try{const d=createDataSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigningFailed(...f){try{const d=createDataSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectUiVersion="2.2.0";class TonConnectUI{constructor(f){if(__publicField(this,"walletInfoStorage",new WalletInfoStorage),__publicField(this,"preferredWalletStorage",new PreferredWalletStorage),__publicField(this,"tracker"),__publicField(this,"walletInfo",null),__publicField(this,"systemThemeChangeUnsubscribe",null),__publicField(this,"actionsConfiguration"),__publicField(this,"walletsList"),__publicField(this,"_walletsRequiredFeatures"),__publicField(this,"_walletsPreferredFeatures"),__publicField(this,"connectRequestParametersCallback"),__publicField(this,"connector"),__publicField(this,"modal"),__publicField(this,"singleWalletModal"),__publicField(this,"transactionModal"),__publicField(this,"connectionRestored",Promise.resolve(!1)),f&&"connector"in f&&f.connector)this.connector=f.connector;else if(f&&"manifestUrl"in f&&f.manifestUrl)this.connector=new TonConnect({manifestUrl:f.manifestUrl,eventDispatcher:f.eventDispatcher,walletsRequiredFeatures:f.walletsRequiredFeatures});else throw new TonConnectUIError("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new TonConnectUITracker({eventDispatcher:f==null?void 0:f.eventDispatcher,tonConnectUiVersion}),this.modal=new WalletsModalManager({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:v=>{this.connectRequestParametersCallback=v}}),this.singleWalletModal=new SingleWalletModalManager({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:v=>{this.connectRequestParametersCallback=v}}),this.transactionModal=new TransactionModalManager({connector:this.connector}),this._walletsRequiredFeatures=f.walletsRequiredFeatures,this._walletsPreferredFeatures=f.walletsPreferredFeatures,this.walletsList=this.getWallets(),this.walletsList.then(v=>preloadImages(uniq(v.map(g=>g.imageUrl))));const d=this.normalizeWidgetRoot(f==null?void 0:f.widgetRootId);this.subscribeToWalletChange(),(f==null?void 0:f.restoreConnection)!==!1&&(this.connectionRestored=createMacrotaskAsync(()=>__async(this,null,function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))),this.uiOptions=mergeOptions(f,{uiPreferences:{theme:"SYSTEM"}});const m=this.preferredWalletStorage.getPreferredWalletAppName();setAppState({connector:this.connector,preferredWalletAppName:m}),widgetController.renderApp(d,this)}static getWallets(){return TonConnect.getWallets()}get walletsRequiredFeatures(){return this._walletsRequiredFeatures}get walletsPreferredFeatures(){return this._walletsPreferredFeatures}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?__spreadValues(__spreadValues({},this.connector.wallet),this.walletInfo):null}set uiOptions(f){var d,m,v,g,w;this.checkButtonRootExist(f.buttonRootId),this.actionsConfiguration=f.actionsConfiguration,"walletsRequiredFeatures"in f&&(this._walletsRequiredFeatures=f.walletsRequiredFeatures),"walletsPreferredFeatures"in f&&(this._walletsPreferredFeatures=f.walletsPreferredFeatures),(d=f.uiPreferences)!=null&&d.theme?((m=f.uiPreferences)==null?void 0:m.theme)!=="SYSTEM"?((v=this.systemThemeChangeUnsubscribe)==null||v.call(this),setTheme(f.uiPreferences.theme,f.uiPreferences.colorsSet)):(setTheme(getSystemTheme(),f.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=subscribeToThemeChange(setTheme))):(g=f.uiPreferences)!=null&&g.colorsSet&&setColors(f.uiPreferences.colorsSet),(w=f.uiPreferences)!=null&&w.borderRadius&&setBorderRadius(f.uiPreferences.borderRadius),setAppState(x=>{var S,_;const b=mergeOptions(__spreadValues(__spreadValues(__spreadValues(__spreadValues({},f.language&&{language:f.language}),!!((S=f.actionsConfiguration)!=null&&S.returnStrategy)&&{returnStrategy:f.actionsConfiguration.returnStrategy}),!!((_=f.actionsConfiguration)!=null&&_.twaReturnUrl)&&{twaReturnUrl:f.actionsConfiguration.twaReturnUrl}),!!f.walletsListConfiguration&&{walletsListConfiguration:f.walletsListConfiguration}),unwrap(x));return f.buttonRootId!==void 0&&(b.buttonRootId=f.buttonRootId),f.enableAndroidBackHandler!==void 0&&(b.enableAndroidBackHandler=f.enableAndroidBackHandler),b})}setConnectRequestParameters(f){var d;setAppState({connectRequestParameters:f}),((f==null?void 0:f.state)==="ready"||!f)&&((d=this.connectRequestParametersCallback)==null||d.call(this,f==null?void 0:f.value))}getWallets(){return __async(this,null,function*(){return this.connector.getWallets()})}onStatusChange(f,d){return this.connector.onStatusChange(m=>__async(this,null,function*(){if(m){const v=yield this.getSelectedWalletInfo(m);f(__spreadValues(__spreadValues({},m),v||this.walletInfoStorage.getWalletInfo()))}else f(m)}),d)}openModal(){return __async(this,null,function*(){return this.modal.open()})}closeModal(f){this.modal.close(f)}onModalStateChange(f){return this.modal.onStateChange(f)}get modalState(){return this.modal.state}openSingleWalletModal(f){return __async(this,null,function*(){return this.singleWalletModal.open(f)})}closeSingleWalletModal(f){this.singleWalletModal.close(f)}onSingleWalletModalStateChange(f){return this.singleWalletModal.onStateChange(f)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return __async(this,null,function*(){const d=(yield this.getWallets()).find(isWalletInfoCurrentlyEmbedded);return d?yield this.connectEmbeddedWallet(d):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),widgetController.clearAction(),widgetController.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(f,d){return __async(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,f),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,f,"Wallet was not connected"),new TonConnectUIError("Connect wallet to send a transaction.");isInTMA()&&sendExpand();const{notifications:m,modals:v,returnStrategy:g,twaReturnUrl:w}=this.getModalsAndNotificationsConfiguration(d);widgetController.setAction({name:"confirm-transaction",showNotification:m.includes("before"),openModal:v.includes("before"),sent:!1});const x=new AbortController,S=()=>{x.signal.aborted||(widgetController.setAction({name:"confirm-transaction",showNotification:m.includes("before"),openModal:v.includes("before"),sent:!0}),this.redirectAfterRequestSent({returnStrategy:g,twaReturnUrl:w}))},_=this.onTransactionModalStateChange(b=>{b!=null&&b.openModal||(_(),b||x.abort())});try{const b=yield this.waitForSendTransaction({transaction:f,signal:x.signal},S);return this.tracker.trackTransactionSigned(this.wallet,f,b),widgetController.setAction({name:"transaction-sent",showNotification:m.includes("success"),openModal:v.includes("success")}),b}catch(b){throw b instanceof WalletNotSupportFeatureError?(widgetController.clearAction(),widgetController.openWalletNotSupportFeatureModal(b.cause),b):(widgetController.setAction({name:"transaction-canceled",showNotification:m.includes("error"),openModal:v.includes("error")}),b instanceof TonConnectError?b:new TonConnectUIError("Unhandled error:"+b))}finally{_()}})}signData(f){return __async(this,null,function*(){if(this.tracker.trackDataSentForSignature(this.wallet,f),!this.connected)throw this.tracker.trackDataSigningFailed(this.wallet,f,"Wallet was not connected"),new TonConnectUIError("Connect wallet to send a transaction.");isInTMA()&&sendExpand();const{notifications:d,modals:m,returnStrategy:v,twaReturnUrl:g}=this.getModalsAndNotificationsConfiguration();widgetController.setAction({name:"confirm-sign-data",showNotification:d.includes("before"),openModal:m.includes("before"),signed:!1});const w=new AbortController,x=()=>{w.signal.aborted||(widgetController.setAction({name:"confirm-sign-data",showNotification:d.includes("before"),openModal:m.includes("before"),signed:!0}),this.redirectAfterRequestSent({returnStrategy:v,twaReturnUrl:g}))},S=this.onTransactionModalStateChange(_=>{_!=null&&_.openModal||(S(),_||w.abort())});try{const _=yield this.waitForSignData({data:f,signal:new AbortController().signal},x);return this.tracker.trackDataSigned(this.wallet,f,_),widgetController.setAction({name:"data-signed",showNotification:d.includes("success"),openModal:m.includes("success")}),_}catch(_){throw _ instanceof WalletNotSupportFeatureError?(widgetController.clearAction(),widgetController.openWalletNotSupportFeatureModal(_.cause),_):(widgetController.setAction({name:"sign-data-canceled",showNotification:d.includes("error"),openModal:m.includes("error")}),_ instanceof TonConnectError?_:new TonConnectUIError("Unhandled error:"+_))}finally{S()}})}redirectAfterRequestSent({returnStrategy:f,twaReturnUrl:d}){this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(isTelegramUrl(this.walletInfo.universalLink)?redirectToTelegram(this.walletInfo.universalLink,{returnStrategy:f,twaReturnUrl:d||appState.twaReturnUrl,forceRedirect:!1}):redirectToWallet(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:f,forceRedirect:!1},()=>{}))}connectEmbeddedWallet(f){return __async(this,null,function*(){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},m=appState.connectRequestParameters;return(m==null?void 0:m.state)==="loading"?this.connectRequestParametersCallback=d:d(m==null?void 0:m.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return __async(this,null,function*(){const f=new AbortController;widgetController.openWalletsModal();const d=this.onModalStateChange(m=>{const{status:v,closeReason:g}=m;v!=="opened"&&(d(),g==="action-cancelled"&&f.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:f.signal})})}waitForWalletConnection(f){return __async(this,null,function*(){return new Promise((d,m)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:v=!1,signal:g=null}=f;if(g&&g.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),m(new TonConnectUIError("Wallet was not connected"));const w=_=>__async(this,null,function*(){if(_)this.tracker.trackConnectionCompleted(_),S(),d(_);else{if(this.tracker.trackConnectionError("Connection was cancelled"),v)return;S(),m(new TonConnectUIError("Wallet was not connected"))}}),x=_=>{this.tracker.trackConnectionError(_.message),!v&&(S(),m(_))},S=this.onStatusChange(_=>w(_),_=>x(_));g&&g.addEventListener("abort",()=>{S(),m(new TonConnectUIError("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(f,d){return __async(this,null,function*(){return new Promise((m,v)=>{const{transaction:g,signal:w}=f;if(w.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,g,"Transaction was cancelled"),v(new TonConnectUIError("Transaction was not sent"));const x=b=>__async(this,null,function*(){m(b)}),S=b=>{v(b)},_=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,g,"Transaction was cancelled"),v(new TonConnectUIError("Transaction was not sent"))};w.addEventListener("abort",_,{once:!0}),this.connector.sendTransaction(g,{onRequestSent:d,signal:w}).then(b=>(w.removeEventListener("abort",_),x(b))).catch(b=>(w.removeEventListener("abort",_),S(b)))})})}waitForSignData(f,d){return __async(this,null,function*(){return new Promise((m,v)=>{const{data:g,signal:w}=f;if(w.aborted)return this.tracker.trackDataSigningFailed(this.wallet,g,"SignData was cancelled"),v(new TonConnectUIError("SignData was not sent"));const x=b=>__async(this,null,function*(){m(b)}),S=b=>{v(b)},_=()=>{this.tracker.trackDataSigningFailed(this.wallet,g,"SignData was cancelled"),v(new TonConnectUIError("SignData was not sent"))};w.addEventListener("abort",_,{once:!0}),this.connector.signData(g,{onRequestSent:d,signal:w}).then(b=>x(b)).catch(b=>S(b))})})}onTransactionModalStateChange(f){return this.transactionModal.onStateChange(f)}subscribeToWalletChange(){this.connector.onStatusChange(f=>__async(this,null,function*(){var d;f?(yield this.updateWalletInfo(f),this.setPreferredWalletAppName(((d=this.walletInfo)==null?void 0:d.appName)||f.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(f){this.preferredWalletStorage.setPreferredWalletAppName(f),setAppState({preferredWalletAppName:f})}getSelectedWalletInfo(f){return __async(this,null,function*(){let d=widgetController.getSelectedWalletInfo();if(!d)return null;let m;if("name"in d)m=d;else{const g=applyWalletsListConfiguration(yield this.walletsList,appState.walletsListConfiguration).find(w=>eqWalletName(w,f.device.appName));if(!g)throw new TonConnectUIError(`Cannot find WalletInfo for the '${f.device.appName}' wallet`);m=__spreadValues(__spreadValues({},g),d)}return m})}updateWalletInfo(f){return __async(this,null,function*(){const d=yield this.getSelectedWalletInfo(f);if(d){this.walletInfo=d,this.walletInfoStorage.setWalletInfo(d);return}const m=this.walletInfoStorage.getWalletInfo();if(m){this.walletInfo=m;return}this.walletInfo=(yield this.walletsList).find(v=>eqWalletName(v,f.device.appName))||null})}normalizeWidgetRoot(f){if(!f||!document.getElementById(f)){f="tc-widget-root";const d=document.createElement("div");d.id=f,document.body.appendChild(d)}return f}checkButtonRootExist(f){if(f!=null&&!document.getElementById(f))throw new TonConnectUIError(`${f} element not found in the document.`)}getModalsAndNotificationsConfiguration(f){var d,m,v,g,w,x;const S=["before","success","error"];let _=S;(d=this.actionsConfiguration)!=null&&d.notifications&&((m=this.actionsConfiguration)==null?void 0:m.notifications)!=="all"&&(_=this.actionsConfiguration.notifications),f!=null&&f.notifications&&(f.notifications==="all"?_=S:_=f.notifications);let b=["before"];(v=this.actionsConfiguration)!=null&&v.modals&&(this.actionsConfiguration.modals==="all"?b=S:b=this.actionsConfiguration.modals),f!=null&&f.modals&&(f.modals==="all"?b=S:b=f.modals);const C=(f==null?void 0:f.returnStrategy)||((g=this.actionsConfiguration)==null?void 0:g.returnStrategy)||"back",E=(f==null?void 0:f.twaReturnUrl)||((w=this.actionsConfiguration)==null?void 0:w.twaReturnUrl);let M=(f==null?void 0:f.skipRedirectToWallet)||((x=this.actionsConfiguration)==null?void 0:x.skipRedirectToWallet)||"ios";return isInTMA()&&(M="never"),{notifications:_,modals:b,returnStrategy:C,twaReturnUrl:E,skipRedirectToWallet:M}}}const DEFAULT_MANIFEST_URL="https://miniapp.spinfi.me/tonconnect-manifest.json";let tonConnectUIInstance=null,currentManifestUrl=null;class DefaultTonWalletProvider{constructor(f,d){this.bindWalletCallback=d;const m=f||DEFAULT_MANIFEST_URL;if(!tonConnectUIInstance||currentManifestUrl!==m)try{tonConnectUIInstance=new TonConnectUI({manifestUrl:m}),currentManifestUrl=m}catch{throw new Error("创建TonConnectUI实例失败")}this.ui=tonConnectUIInstance}isConnected(){var f;try{return!!((f=this.ui)!=null&&f.connected)}catch{return!1}}async reportWalletAddress(){const f=this.getUserFriendlyAddress();if(f&&this.bindWalletCallback)try{await this.bindWalletCallback(f)}catch{}}async connect(){if(this.isConnected())return await this.reportWalletAddress(),!0;try{return await new Promise((f,d)=>{this.ui.openModal();const m=this.ui.onStatusChange(()=>{this.isConnected()&&(m(),f())});setTimeout(()=>{this.isConnected()||(m(),d(new Error("连接钱包超时")))},3e5)}),await this.reportWalletAddress(),this.isConnected()}catch{return!1}}getUserFriendlyAddress(){var m,v,g;const f=this.ui,d=((v=(m=f==null?void 0:f.wallet)==null?void 0:m.account)==null?void 0:v.address)||((g=f==null?void 0:f.account)==null?void 0:g.address)||null;return d?toUserFriendlyAddress(d):null}async sendTonTransaction(f){if(!this.isConnected()&&!await this.connect())throw new Error("钱包未连接");const d=await this.ui.sendTransaction(f),m=d==null?void 0:d.boc;let v;if(m)try{v=m.substring(0,16)}catch{}return{transferHash:v,boc:m,raw:d}}async sendUsdtTransaction(f){if(!this.isConnected()&&!await this.connect())throw new Error("钱包未连接");const d=await this.ui.sendTransaction(f),m=d==null?void 0:d.boc;let v;if(m)try{v=m.substring(0,16)}catch{}return{transferHash:v,boc:m,raw:d}}async disconnect(){try{const f=this.ui;if(f!=null&&f.disconnect)await f.disconnect();else if(f!=null&&f.onStatusChange){const d=f.onStatusChange(()=>{});d&&d()}return!this.isConnected()}catch{return!1}}}class HmTrackingSDK{constructor(f){this.options=f,this.token=null,this.user=null;const d=this.options||{};this.storage=new NamespacedStorage(d.storageKeyPrefix||"hm_tracking_sdk"),this.token=this.storage.get("token");const m=d.baseURL||TEST_BASE_URL;this.http=new HttpClient({getToken:()=>this.token,onAuthError:()=>this.clearAuth(),baseURL:m,getAppId:()=>this.options&&this.options.appId||null}),this.api=new APIService(this.http),this.hmAdManager=new HmAdManager({autoInjectScript:!0}),this.adMonitor=new AdMonitor(v=>this.api.adMonitor(v)),this.tonWallet=new DefaultTonWalletProvider(d.tonConnectManifestUrl,this.bindWallet.bind(this))}async init(){const f=isTelegramEnv();try{const d=this.options||{},m=f?getTelegramUserUnsafe():null;if(m?this.user=m:d.customUser?this.user=d.customUser:typeof window<"u"?this.user=getAnonymousBrowserUser():this.user=getDefaultMockUser(),!this.user)throw new Error("未获取到用户信息:请在非 Telegram 环境提供 customUser");this.clearAuth(),await this.auth();try{await this.hmAdManager.init()}catch{}}catch(d){throw d}}async auth(){var f,d;try{const m={...this.user},v=(f=this.options)==null?void 0:f.notifyUrl;v&&(m.notifyUrl=v);const g=await this.api.auth(m);if(g.code!==1)throw new Error(g.msg||"鉴权失败");const w=(d=g.data)==null?void 0:d.token;if(!w)throw new Error("鉴权未返回 token");this.token=w,this.storage.set("token",w)}catch(m){throw m}}clearAuth(){this.token=null,this.storage.remove("token")}ensureTelegramEnvOrThrow(){if(!isTelegramEnv())throw new Error("支付相关功能仅支持在 Telegram 环境内使用")}async getAdPositionConfig(f){const d=await this.api.getAdPositionConfig(String(f));if(d.code!==1)throw new Error(d.msg||"获取广告位配置失败");return d.data||[]}async createAd(f){const d=await this.api.createAd(f);if(d.code!==1)throw new Error(d.msg||"创建广告失败");const m=d.data;return m!=null&&m.spaceId&&await this.hmAdManager.setSpace(String(m.spaceId)),m}async showHmAdByPosition(f,d){const m=await this.getAdPositionConfig(f);if(!m||m.length===0)throw new Error("未找到广告位配置");const v=m[0],g=await this.createAd({adId:v.adId,adPositionId:v.adPositionId}),w={start:g.start,show:g.show,error:g.error,close:g.close,reward:g.reward};await this.showHmAdWithMonitor(w,g.adShowId,d)}async showHmAdWithMonitor(f,d,m){const v=d||"";await this.adMonitor.send(f.start,v),await this.adMonitor.send(f.show,v);try{await this.hmAdManager.show(),await this.adMonitor.send(f.close,v);const g=await this.adMonitor.send(f.reward,v);m!=null&&m.onSuccess&&await m.onSuccess(g)}catch(g){throw await this.adMonitor.send(f.error,v),m!=null&&m.onError&&await m.onError(g),g}}async showHmPopupAd(f,d,m){const v=d||"";await this.adMonitor.send(f.start,v),await this.adMonitor.send(f.show,v);try{await this.hmAdManager.showPopup(),await this.adMonitor.send(f.close,v);const g=await this.adMonitor.send(f.reward,v);m!=null&&m.onSuccess&&await m.onSuccess(g)}catch(g){throw await this.adMonitor.send(f.error,v),m!=null&&m.onError&&await m.onError(g),g}}async showHmInAppAd(f,d,m,v){const g=m||"";await this.adMonitor.send(f.start,g),await this.adMonitor.send(f.show,g);try{await this.hmAdManager.showInApp(d),await this.adMonitor.send(f.close,g);const w=await this.adMonitor.send(f.reward,g);v!=null&&v.onSuccess&&await v.onSuccess(w)}catch(w){throw await this.adMonitor.send(f.error,g),v!=null&&v.onError&&await v.onError(w),w}}async bindWallet(f){try{if((await this.api.bindWalletReq({wallet:f,forceBind:!0})).code!==1)return}catch(d){throw d}}async disconnectWallet(){try{return this.tonWallet?(await this.tonWallet.disconnect(),!this.tonWallet.isConnected()):!0}catch{return!1}}async connectWallet(){return this.tonWallet?await this.tonWallet.connect():!1}isWalletConnected(){var f;return!!((f=this.tonWallet)!=null&&f.isConnected())}async ensureWalletConnected(){return this.ensureTelegramEnvOrThrow(),this.tonWallet?await this.tonWallet.connect():!1}async getSupportedPayModes(){const f=await this.api.merchantPayModeList();if(f.code!==1)throw new Error(f.msg||"获取支付方式失败");const d=f.data;return Array.isArray(d)?{payModeList:d}:{payModeList:Array.isArray(d==null?void 0:d.payModeList)?d.payModeList:[]}}async merchantPayQueryResult(f){const d=await this.api.merchantPayQueryResult(f);if(d.code!==1)throw new Error(d.msg||"查询支付结果失败");return d.data}async finishPayment(f,d,m=""){const v={orderSn:f,status:d,transferHash:m},g=await this.api.merchantPayFinish(v);if(g.code!==1)throw new Error(g.msg||"支付完成回调失败");return g.data}async payByMerchant(f){var x,S,_;this.ensureTelegramEnvOrThrow();const d=(x=f.currencyName)==null?void 0:x.toUpperCase(),m=await this.api.merchantPayCreate(f);if(m.code!==1)throw new Error(m.msg||"创建支付订单失败");const v=m.data;if(d==="STARS"&&v.payUrl)try{return await new Promise((C,E)=>{WebApp.openInvoice(v.payUrl,M=>{M==="paid"?C():E(new Error(`星币支付未完成: ${M||"未知状态"}`))})}),await this.finishPayment(v.orderSn,"success")}catch{return await this.finishPayment(v.orderSn,"failed")}if(!this.tonWallet||!this.tonWallet.isConnected())throw new Error("请先连接钱包");if(!((_=(S=v.transferData)==null?void 0:S.messages)==null?void 0:_[0]))throw new Error("订单未返回链上消息");let w;try{if(d==="TON")w=await this.tonWallet.sendTonTransaction(v.transferData);else if(d==="USDT")w=await this.tonWallet.sendUsdtTransaction(v.transferData);else throw new Error("暂不支持的币种");const b=w==null?void 0:w.transferHash;return await this.finishPayment(v.orderSn,"success",b||"")}catch{return await this.finishPayment(v.orderSn,"failed")}}}var AdPositionName=(r=>(r.GameRewardedAdPosition="game_rewarded_ad_position",r.TaskRewardedAdPosition="task_rewarded_ad_position",r.TaskListAdPosition="task_list_ad_position",r))(AdPositionName||{});globalThis.Buffer=Buffer$1,globalThis.process=process$1,globalThis.global=globalThis,exports.AdPositionName=AdPositionName,exports.HmTrackingSDK=HmTrackingSDK,exports.getAnonymousBrowserUser=getAnonymousBrowserUser,exports.getDefaultMockUser=getDefaultMockUser,exports.getLaunchParams=getLaunchParams,exports.getTelegramUserUnsafe=getTelegramUserUnsafe,exports.isTelegramEnv=isTelegramEnv,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
1245
+ `,ActionModal=r=>{const f=useDataAttributes(r),d=useContext(TonConnectUiContext),[m,v]=createSignal(!0),[g,w]=createSignal(!1),[x,S]=createSignal(!1),[_,b]=createSignal(!1);createEffect(()=>{const A=action();w(!!A&&("sent"in A&&A.sent||A.name==="transaction-sent")),S(!!A&&("signed"in A&&A.signed||A.name==="data-signed")),b(!!A&&(A.name==="transaction-canceled"||A.name==="sign-data-canceled"))});let C;d!=null&&d.wallet&&"universalLink"in d.wallet&&(d.wallet.openMethod==="universal-link"||isTelegramUrl(d.wallet.universalLink)&&isInTMA())&&(C=d.wallet.universalLink);let E;d!=null&&d.wallet&&"deepLink"in d.wallet&&(d.wallet.openMethod==="custom-deeplink"||isTelegramUrl(d.wallet.deepLink)&&isInTMA())&&(E=d.wallet.deepLink);const M=()=>{const A=action(),T="returnStrategy"in A?A.returnStrategy:appState.returnStrategy,L=!m();v(!1),isTelegramUrl(C)?redirectToTelegram(C,{returnStrategy:T,twaReturnUrl:"twaReturnUrl"in A?A.twaReturnUrl:appState.twaReturnUrl,forceRedirect:L}):redirectToWallet(C,E,{returnStrategy:T,forceRedirect:L},()=>{})};return createComponent(ActionModalStyled,mergeProps(f,{get children(){return[createMemo(()=>r.icon),createComponent(H1Styled,{get translationKey(){return r.headerTranslationKey},get translationValues(){return r.headerTranslationValues}}),createComponent(TextStyled,{get translationKey(){return r.textTranslationKey},get translationValues(){return r.textTranslationValues}}),createComponent(Show,{get when(){return!g()&&!x()&&!_()&&(r.showButton==="open-wallet"&&C||r.showButton!=="open-wallet")},get children(){return createComponent(LoaderButtonStyled,{disabled:!0,"data-tc-connect-button-loading":"true",get children(){return createComponent(LoaderIconStyled,{})}})}}),createComponent(Show,{get when(){return g()||x()},get children(){return[createComponent(Show,{get when(){return r.showButton!=="open-wallet"},get children(){return createComponent(ButtonStyled,{onClick:()=>r.onClose(),get children(){return createComponent(Translation,{translationKey:"common.close",children:"Close"})}})}}),createComponent(Show,{get when(){return r.showButton==="open-wallet"&&C},get children(){return createComponent(ButtonStyled,{onClick:M,get children(){return createComponent(Translation,{translationKey:"common.openWallet",children:"Open wallet"})}})}})]}})]}}))},ConfirmTransactionModal=r=>{const f=useContext(TonConnectUiContext),[d]=useI18n(),m=()=>f.wallet&&"name"in f.wallet?f.wallet.name:d("common.yourWallet",{},"Your wallet");return createComponent(ActionModal,{headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){return{name:m()}},textTranslationKey:"actionModal.confirmTransaction.text",get icon(){return createComponent(LoaderIcon,{size:"m"})},onClose:()=>r.onClose(),showButton:"open-wallet","data-tc-confirm-modal":"true"})},TransactionCanceledModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){return createComponent(ErrorIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-transaction-canceled-modal":"true"}),TransactionSentModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){return createComponent(SuccessIcon,{size:"m"})},showButton:"open-wallet",onClose:()=>r.onClose(),"data-tc-transaction-sent-modal":"true"}),ConfirmSignDataModal=r=>{const f=useContext(TonConnectUiContext),[d]=useI18n(),m=()=>f.wallet&&"name"in f.wallet?f.wallet.name:d("common.yourWallet",{},"Your wallet");return createComponent(ActionModal,{headerTranslationKey:"actionModal.signData.header",get headerTranslationValues(){return{name:m()}},textTranslationKey:"actionModal.signData.text",get icon(){return createComponent(LoaderIcon,{size:"m"})},onClose:()=>r.onClose(),showButton:"open-wallet","data-tc-sign-data-confirm-modal":"true"})},SignDataCanceledModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.signDataCanceled.header",get icon(){return createComponent(ErrorIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-sign-data-canceled-modal":"true"}),DataSignedModal=r=>createComponent(ActionModal,{headerTranslationKey:"actionModal.dataSigned.header",get icon(){return createComponent(SuccessIcon,{size:"m"})},onClose:()=>r.onClose(),"data-tc-data-signed-modal":"true"}),ActionsModal=()=>createComponent(Modal,{get opened(){var r;return createMemo(()=>action()!==null)()&&((r=action())==null?void 0:r.openModal)===!0},get enableAndroidBackHandler(){return appState.enableAndroidBackHandler},onClose:()=>setAction(null),showFooter:!1,"data-tc-actions-modal-container":"true",get children(){return createComponent(Switch,{get children(){return[createComponent(Match,{get when(){return action().name==="transaction-sent"},get children(){return createComponent(TransactionSentModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="transaction-canceled"},get children(){return createComponent(TransactionCanceledModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="confirm-transaction"},get children(){return createComponent(ConfirmTransactionModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="data-signed"},get children(){return createComponent(DataSignedModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="sign-data-canceled"},get children(){return createComponent(SignDataCanceledModal,{onClose:()=>setAction(null)})}}),createComponent(Match,{get when(){return action().name==="confirm-sign-data"},get children(){return createComponent(ConfirmSignDataModal,{onClose:()=>setAction(null)})}})]}})}}),SingleWalletModal=()=>{const{locale:r}=useI18n()[1];createEffect(()=>r(appState.language)),createEffect(()=>{getSingleWalletModalIsOpened()&&updateIsMobile()});const f=useContext(ConnectorContext),d=useContext(TonConnectUiContext),[m,v]=createSignal(!1),g=()=>{var _;return((_=appState.connectRequestParameters)==null?void 0:_.state)==="loading"},w=createMemo(()=>{var _;if(!g())return(_=appState.connectRequestParameters)==null?void 0:_.value}),x=_=>{d.closeSingleWalletModal(_)},S=f.onStatusChange(_=>{_&&x("wallet-selected")});return onCleanup(S),onCleanup(()=>{v(!1)}),createComponent(StyledModal,{get opened(){return getSingleWalletModalIsOpened()},get enableAndroidBackHandler(){return appState.enableAndroidBackHandler},onClose:()=>x("action-cancelled"),onClickQuestion:()=>v(_=>!_),showFooter:!0,"data-tc-wallets-modal-container":"true",get children(){return[createComponent(Show,{get when(){return m()},get children(){return createComponent(InfoModal,{onBackClick:()=>v(!1)})}}),createComponent(Show,{get when(){return!m()},get children(){return[createComponent(Show,{get when(){return g()},get children(){return[createComponent(H1Styled$a,{translationKey:"walletModal.loading",children:"Wallets list is loading"}),createComponent(LoaderContainerStyled,{get children(){return createComponent(LoaderIcon,{size:"m"})}})]}}),createComponent(Show,{get when(){return!g()},get children(){return createComponent(Dynamic,{get component(){return isMobile()?MobileConnectionModal:DesktopConnectionModal},get wallet(){return getSingleWalletModalWalletInfo()},get additionalRequest(){return w()},onBackClick:()=>{},backDisabled:!0})}})]}})]}})},App=r=>{const f=createI18nContext(i18nDictionary,appState.language);return defineStylesRoot(),fixMobileSafariActiveTransition(),createComponent(I18nContext.Provider,{value:f,get children(){return createComponent(TonConnectUiContext.Provider,{get value(){return r.tonConnectUI},get children(){return createComponent(ConnectorContext.Provider,{get value(){return appState.connector},get children(){return[createComponent(GlobalStyles,{}),createComponent(ThemeProvider,{theme:themeState,get children(){return[createComponent(Show,{get when(){return appState.buttonRootId},get children(){return createComponent(Portal,{get mount(){return document.getElementById(appState.buttonRootId)},get children(){return createComponent(AccountButton,{})}})}}),createComponent(Dynamic,{component:globalStylesTag,get children(){return[createComponent(WalletsModal,{}),createComponent(SingleWalletModal,{}),createComponent(ActionsModal,{})]}})]}})]}})}})}})},widgetController={openWalletsModal:()=>void setTimeout(()=>setWalletsModalState({status:"opened",closeReason:null})),closeWalletsModal:r=>void setTimeout(()=>setWalletsModalState({status:"closed",closeReason:r})),openSingleWalletModal:r=>{setTimeout(()=>setSingleWalletModalState({status:"opened",closeReason:null,walletInfo:r}))},closeSingleWalletModal:r=>void setTimeout(()=>setSingleWalletModalState({status:"closed",closeReason:r})),openWalletNotSupportFeatureModal:r=>void setTimeout(()=>setWalletsModalState({status:"opened",closeReason:null,type:"wallet-not-support-feature",requiredFeature:r.requiredFeature})),setAction:r=>void setTimeout(()=>setAction(r)),clearAction:()=>void setTimeout(()=>setAction(null)),getSelectedWalletInfo:()=>lastSelectedWalletInfo(),removeSelectedWalletInfo:()=>setLastSelectedWalletInfo(null),renderApp:(r,f)=>render(()=>createComponent(App,{tonConnectUI:f}),document.getElementById(r))};class WalletsModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"tracker"),__publicField(this,"state",walletsModalState()),this.connector=f.connector,this.tracker=f.tracker,this.setConnectRequestParametersCallback=f.setConnectRequestParametersCallback,createEffect(()=>{const d=walletsModalState();this.state=d,this.consumers.forEach(m=>m(d))})}open(){return __async(this,null,function*(){this.tracker.trackConnectionStarted();const d=(yield this.connector.getWallets()).find(isWalletInfoCurrentlyEmbedded);return d?this.connectEmbeddedWallet(d):this.openWalletsModal()})}close(f="action-cancelled"){f==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),widgetController.closeWalletsModal(f)}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}connectEmbeddedWallet(f){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},m=appState.connectRequestParameters;(m==null?void 0:m.state)==="loading"?this.setConnectRequestParametersCallback(d):d(m==null?void 0:m.value)}openWalletsModal(){return __async(this,null,function*(){return isInTMA()&&sendExpand(),widgetController.openWalletsModal(),new Promise(f=>{const d=this.onStateChange(m=>{const{status:v}=m;v==="opened"&&(d(),f())})})})}}class TransactionModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"consumers",[]),this.connector=f.connector,createEffect(()=>{const d=action();this.consumers.forEach(m=>m(d))})}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}}class SingleWalletModalManager{constructor(f){__publicField(this,"connector"),__publicField(this,"setConnectRequestParametersCallback"),__publicField(this,"consumers",[]),__publicField(this,"tracker"),__publicField(this,"state",singleWalletModalState()),this.connector=f.connector,this.tracker=f.tracker,this.setConnectRequestParametersCallback=f.setConnectRequestParametersCallback,createEffect(()=>{const d=singleWalletModalState();this.state=d,this.consumers.forEach(m=>m(d))})}open(f){return __async(this,null,function*(){this.tracker.trackConnectionStarted();const d=yield this.connector.getWallets(),m=applyWalletsListConfiguration(d,appState.walletsListConfiguration),v=m.find(isWalletInfoCurrentlyEmbedded);if(!!v)return this.connectEmbeddedWallet(v);const x=m.filter(isWalletInfoRemote).find(b=>eqWalletName(b,f));if(!!x)return this.openSingleWalletModal(x);const _=`Trying to open modal window with unknown wallet "${f}".`;throw this.tracker.trackConnectionError(_),new TonConnectUIError(_)})}close(f="action-cancelled"){f==="action-cancelled"&&this.tracker.trackConnectionError("Connection was cancelled"),widgetController.closeSingleWalletModal("action-cancelled")}onStateChange(f){return this.consumers.push(f),()=>{this.consumers=this.consumers.filter(d=>d!==f)}}connectEmbeddedWallet(f){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},m=appState.connectRequestParameters;(m==null?void 0:m.state)==="loading"?this.setConnectRequestParametersCallback(d):d(m==null?void 0:m.value)}openSingleWalletModal(f){return __async(this,null,function*(){return isInTMA()&&sendExpand(),widgetController.openSingleWalletModal(f),new Promise(d=>{const m=this.onStateChange(v=>{const{status:g}=v;g==="opened"&&(m(),d())})})})}}class TonConnectUITracker{constructor(f){__publicField(this,"eventPrefix","ton-connect-ui-"),__publicField(this,"tonConnectUiVersion"),__publicField(this,"tonConnectSdkVersion",null),__publicField(this,"eventDispatcher");var d;this.eventDispatcher=(d=f==null?void 0:f.eventDispatcher)!=null?d:new BrowserEventDispatcher,this.tonConnectUiVersion=f.tonConnectUiVersion,this.init().catch()}get version(){return createVersionInfo({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return __async(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return __async(this,null,function*(){yield this.eventDispatcher.addEventListener("ton-connect-ui-request-version",()=>__async(this,null,function*(){yield this.eventDispatcher.dispatchEvent("ton-connect-ui-response-version",createResponseVersionEvent(this.tonConnectUiVersion))}))})}requestTonConnectSdkVersion(){return __async(this,null,function*(){return new Promise((f,d)=>__async(this,null,function*(){try{yield this.eventDispatcher.addEventListener("ton-connect-response-version",m=>{f(m.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent("ton-connect-request-version",createRequestVersionEvent())}catch(m){d(m)}}))})}dispatchUserActionEvent(f){var d;try{(d=this.eventDispatcher)==null||d.dispatchEvent(`${this.eventPrefix}${f.type}`,f).catch()}catch{}}trackConnectionStarted(...f){try{const d=createConnectionStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionCompleted(...f){try{const d=createConnectionCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionError(...f){try{const d=createConnectionErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringStarted(...f){try{const d=createConnectionRestoringStartedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringCompleted(...f){try{const d=createConnectionRestoringCompletedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackConnectionRestoringError(...f){try{const d=createConnectionRestoringErrorEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDisconnection(...f){try{const d=createDisconnectionEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSentForSignature(...f){try{const d=createTransactionSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigned(...f){try{const d=createTransactionSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackTransactionSigningFailed(...f){try{const d=createTransactionSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSentForSignature(...f){try{const d=createDataSentForSignatureEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigned(...f){try{const d=createDataSignedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}trackDataSigningFailed(...f){try{const d=createDataSigningFailedEvent(this.version,...f);this.dispatchUserActionEvent(d)}catch{}}}const tonConnectUiVersion="2.2.0";class TonConnectUI{constructor(f){if(__publicField(this,"walletInfoStorage",new WalletInfoStorage),__publicField(this,"preferredWalletStorage",new PreferredWalletStorage),__publicField(this,"tracker"),__publicField(this,"walletInfo",null),__publicField(this,"systemThemeChangeUnsubscribe",null),__publicField(this,"actionsConfiguration"),__publicField(this,"walletsList"),__publicField(this,"_walletsRequiredFeatures"),__publicField(this,"_walletsPreferredFeatures"),__publicField(this,"connectRequestParametersCallback"),__publicField(this,"connector"),__publicField(this,"modal"),__publicField(this,"singleWalletModal"),__publicField(this,"transactionModal"),__publicField(this,"connectionRestored",Promise.resolve(!1)),f&&"connector"in f&&f.connector)this.connector=f.connector;else if(f&&"manifestUrl"in f&&f.manifestUrl)this.connector=new TonConnect({manifestUrl:f.manifestUrl,eventDispatcher:f.eventDispatcher,walletsRequiredFeatures:f.walletsRequiredFeatures});else throw new TonConnectUIError("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new TonConnectUITracker({eventDispatcher:f==null?void 0:f.eventDispatcher,tonConnectUiVersion}),this.modal=new WalletsModalManager({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:v=>{this.connectRequestParametersCallback=v}}),this.singleWalletModal=new SingleWalletModalManager({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:v=>{this.connectRequestParametersCallback=v}}),this.transactionModal=new TransactionModalManager({connector:this.connector}),this._walletsRequiredFeatures=f.walletsRequiredFeatures,this._walletsPreferredFeatures=f.walletsPreferredFeatures,this.walletsList=this.getWallets(),this.walletsList.then(v=>preloadImages(uniq(v.map(g=>g.imageUrl))));const d=this.normalizeWidgetRoot(f==null?void 0:f.widgetRootId);this.subscribeToWalletChange(),(f==null?void 0:f.restoreConnection)!==!1&&(this.connectionRestored=createMacrotaskAsync(()=>__async(this,null,function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError("Connection was not restored"),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))),this.uiOptions=mergeOptions(f,{uiPreferences:{theme:"SYSTEM"}});const m=this.preferredWalletStorage.getPreferredWalletAppName();setAppState({connector:this.connector,preferredWalletAppName:m}),widgetController.renderApp(d,this)}static getWallets(){return TonConnect.getWallets()}get walletsRequiredFeatures(){return this._walletsRequiredFeatures}get walletsPreferredFeatures(){return this._walletsPreferredFeatures}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?__spreadValues(__spreadValues({},this.connector.wallet),this.walletInfo):null}set uiOptions(f){var d,m,v,g,w;this.checkButtonRootExist(f.buttonRootId),this.actionsConfiguration=f.actionsConfiguration,"walletsRequiredFeatures"in f&&(this._walletsRequiredFeatures=f.walletsRequiredFeatures),"walletsPreferredFeatures"in f&&(this._walletsPreferredFeatures=f.walletsPreferredFeatures),(d=f.uiPreferences)!=null&&d.theme?((m=f.uiPreferences)==null?void 0:m.theme)!=="SYSTEM"?((v=this.systemThemeChangeUnsubscribe)==null||v.call(this),setTheme(f.uiPreferences.theme,f.uiPreferences.colorsSet)):(setTheme(getSystemTheme(),f.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=subscribeToThemeChange(setTheme))):(g=f.uiPreferences)!=null&&g.colorsSet&&setColors(f.uiPreferences.colorsSet),(w=f.uiPreferences)!=null&&w.borderRadius&&setBorderRadius(f.uiPreferences.borderRadius),setAppState(x=>{var S,_;const b=mergeOptions(__spreadValues(__spreadValues(__spreadValues(__spreadValues({},f.language&&{language:f.language}),!!((S=f.actionsConfiguration)!=null&&S.returnStrategy)&&{returnStrategy:f.actionsConfiguration.returnStrategy}),!!((_=f.actionsConfiguration)!=null&&_.twaReturnUrl)&&{twaReturnUrl:f.actionsConfiguration.twaReturnUrl}),!!f.walletsListConfiguration&&{walletsListConfiguration:f.walletsListConfiguration}),unwrap(x));return f.buttonRootId!==void 0&&(b.buttonRootId=f.buttonRootId),f.enableAndroidBackHandler!==void 0&&(b.enableAndroidBackHandler=f.enableAndroidBackHandler),b})}setConnectRequestParameters(f){var d;setAppState({connectRequestParameters:f}),((f==null?void 0:f.state)==="ready"||!f)&&((d=this.connectRequestParametersCallback)==null||d.call(this,f==null?void 0:f.value))}getWallets(){return __async(this,null,function*(){return this.connector.getWallets()})}onStatusChange(f,d){return this.connector.onStatusChange(m=>__async(this,null,function*(){if(m){const v=yield this.getSelectedWalletInfo(m);f(__spreadValues(__spreadValues({},m),v||this.walletInfoStorage.getWalletInfo()))}else f(m)}),d)}openModal(){return __async(this,null,function*(){return this.modal.open()})}closeModal(f){this.modal.close(f)}onModalStateChange(f){return this.modal.onStateChange(f)}get modalState(){return this.modal.state}openSingleWalletModal(f){return __async(this,null,function*(){return this.singleWalletModal.open(f)})}closeSingleWalletModal(f){this.singleWalletModal.close(f)}onSingleWalletModalStateChange(f){return this.singleWalletModal.onStateChange(f)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(){return __async(this,null,function*(){const d=(yield this.getWallets()).find(isWalletInfoCurrentlyEmbedded);return d?yield this.connectEmbeddedWallet(d):yield this.connectExternalWallet()})}disconnect(){return this.tracker.trackDisconnection(this.wallet,"dapp"),widgetController.clearAction(),widgetController.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect()}sendTransaction(f,d){return __async(this,null,function*(){if(this.tracker.trackTransactionSentForSignature(this.wallet,f),!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,f,"Wallet was not connected"),new TonConnectUIError("Connect wallet to send a transaction.");isInTMA()&&sendExpand();const{notifications:m,modals:v,returnStrategy:g,twaReturnUrl:w}=this.getModalsAndNotificationsConfiguration(d);widgetController.setAction({name:"confirm-transaction",showNotification:m.includes("before"),openModal:v.includes("before"),sent:!1});const x=new AbortController,S=()=>{x.signal.aborted||(widgetController.setAction({name:"confirm-transaction",showNotification:m.includes("before"),openModal:v.includes("before"),sent:!0}),this.redirectAfterRequestSent({returnStrategy:g,twaReturnUrl:w}))},_=this.onTransactionModalStateChange(b=>{b!=null&&b.openModal||(_(),b||x.abort())});try{const b=yield this.waitForSendTransaction({transaction:f,signal:x.signal},S);return this.tracker.trackTransactionSigned(this.wallet,f,b),widgetController.setAction({name:"transaction-sent",showNotification:m.includes("success"),openModal:v.includes("success")}),b}catch(b){throw b instanceof WalletNotSupportFeatureError?(widgetController.clearAction(),widgetController.openWalletNotSupportFeatureModal(b.cause),b):(widgetController.setAction({name:"transaction-canceled",showNotification:m.includes("error"),openModal:v.includes("error")}),b instanceof TonConnectError?b:new TonConnectUIError("Unhandled error:"+b))}finally{_()}})}signData(f){return __async(this,null,function*(){if(this.tracker.trackDataSentForSignature(this.wallet,f),!this.connected)throw this.tracker.trackDataSigningFailed(this.wallet,f,"Wallet was not connected"),new TonConnectUIError("Connect wallet to send a transaction.");isInTMA()&&sendExpand();const{notifications:d,modals:m,returnStrategy:v,twaReturnUrl:g}=this.getModalsAndNotificationsConfiguration();widgetController.setAction({name:"confirm-sign-data",showNotification:d.includes("before"),openModal:m.includes("before"),signed:!1});const w=new AbortController,x=()=>{w.signal.aborted||(widgetController.setAction({name:"confirm-sign-data",showNotification:d.includes("before"),openModal:m.includes("before"),signed:!0}),this.redirectAfterRequestSent({returnStrategy:v,twaReturnUrl:g}))},S=this.onTransactionModalStateChange(_=>{_!=null&&_.openModal||(S(),_||w.abort())});try{const _=yield this.waitForSignData({data:f,signal:new AbortController().signal},x);return this.tracker.trackDataSigned(this.wallet,f,_),widgetController.setAction({name:"data-signed",showNotification:d.includes("success"),openModal:m.includes("success")}),_}catch(_){throw _ instanceof WalletNotSupportFeatureError?(widgetController.clearAction(),widgetController.openWalletNotSupportFeatureModal(_.cause),_):(widgetController.setAction({name:"sign-data-canceled",showNotification:d.includes("error"),openModal:m.includes("error")}),_ instanceof TonConnectError?_:new TonConnectUIError("Unhandled error:"+_))}finally{S()}})}redirectAfterRequestSent({returnStrategy:f,twaReturnUrl:d}){this.walletInfo&&"universalLink"in this.walletInfo&&(this.walletInfo.openMethod==="universal-link"||this.walletInfo.openMethod==="custom-deeplink")&&(isTelegramUrl(this.walletInfo.universalLink)?redirectToTelegram(this.walletInfo.universalLink,{returnStrategy:f,twaReturnUrl:d||appState.twaReturnUrl,forceRedirect:!1}):redirectToWallet(this.walletInfo.universalLink,this.walletInfo.deepLink,{returnStrategy:f,forceRedirect:!1},()=>{}))}connectEmbeddedWallet(f){return __async(this,null,function*(){const d=v=>{setLastSelectedWalletInfo(f),this.connector.connect({jsBridgeKey:f.jsBridgeKey},v)},m=appState.connectRequestParameters;return(m==null?void 0:m.state)==="loading"?this.connectRequestParametersCallback=d:d(m==null?void 0:m.value),yield this.waitForWalletConnection({ignoreErrors:!1})})}connectExternalWallet(){return __async(this,null,function*(){const f=new AbortController;widgetController.openWalletsModal();const d=this.onModalStateChange(m=>{const{status:v,closeReason:g}=m;v!=="opened"&&(d(),g==="action-cancelled"&&f.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:f.signal})})}waitForWalletConnection(f){return __async(this,null,function*(){return new Promise((d,m)=>{this.tracker.trackConnectionStarted();const{ignoreErrors:v=!1,signal:g=null}=f;if(g&&g.aborted)return this.tracker.trackConnectionError("Connection was cancelled"),m(new TonConnectUIError("Wallet was not connected"));const w=_=>__async(this,null,function*(){if(_)this.tracker.trackConnectionCompleted(_),S(),d(_);else{if(this.tracker.trackConnectionError("Connection was cancelled"),v)return;S(),m(new TonConnectUIError("Wallet was not connected"))}}),x=_=>{this.tracker.trackConnectionError(_.message),!v&&(S(),m(_))},S=this.onStatusChange(_=>w(_),_=>x(_));g&&g.addEventListener("abort",()=>{S(),m(new TonConnectUIError("Wallet was not connected"))},{once:!0})})})}waitForSendTransaction(f,d){return __async(this,null,function*(){return new Promise((m,v)=>{const{transaction:g,signal:w}=f;if(w.aborted)return this.tracker.trackTransactionSigningFailed(this.wallet,g,"Transaction was cancelled"),v(new TonConnectUIError("Transaction was not sent"));const x=b=>__async(this,null,function*(){m(b)}),S=b=>{v(b)},_=()=>{this.tracker.trackTransactionSigningFailed(this.wallet,g,"Transaction was cancelled"),v(new TonConnectUIError("Transaction was not sent"))};w.addEventListener("abort",_,{once:!0}),this.connector.sendTransaction(g,{onRequestSent:d,signal:w}).then(b=>(w.removeEventListener("abort",_),x(b))).catch(b=>(w.removeEventListener("abort",_),S(b)))})})}waitForSignData(f,d){return __async(this,null,function*(){return new Promise((m,v)=>{const{data:g,signal:w}=f;if(w.aborted)return this.tracker.trackDataSigningFailed(this.wallet,g,"SignData was cancelled"),v(new TonConnectUIError("SignData was not sent"));const x=b=>__async(this,null,function*(){m(b)}),S=b=>{v(b)},_=()=>{this.tracker.trackDataSigningFailed(this.wallet,g,"SignData was cancelled"),v(new TonConnectUIError("SignData was not sent"))};w.addEventListener("abort",_,{once:!0}),this.connector.signData(g,{onRequestSent:d,signal:w}).then(b=>x(b)).catch(b=>S(b))})})}onTransactionModalStateChange(f){return this.transactionModal.onStateChange(f)}subscribeToWalletChange(){this.connector.onStatusChange(f=>__async(this,null,function*(){var d;f?(yield this.updateWalletInfo(f),this.setPreferredWalletAppName(((d=this.walletInfo)==null?void 0:d.appName)||f.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(f){this.preferredWalletStorage.setPreferredWalletAppName(f),setAppState({preferredWalletAppName:f})}getSelectedWalletInfo(f){return __async(this,null,function*(){let d=widgetController.getSelectedWalletInfo();if(!d)return null;let m;if("name"in d)m=d;else{const g=applyWalletsListConfiguration(yield this.walletsList,appState.walletsListConfiguration).find(w=>eqWalletName(w,f.device.appName));if(!g)throw new TonConnectUIError(`Cannot find WalletInfo for the '${f.device.appName}' wallet`);m=__spreadValues(__spreadValues({},g),d)}return m})}updateWalletInfo(f){return __async(this,null,function*(){const d=yield this.getSelectedWalletInfo(f);if(d){this.walletInfo=d,this.walletInfoStorage.setWalletInfo(d);return}const m=this.walletInfoStorage.getWalletInfo();if(m){this.walletInfo=m;return}this.walletInfo=(yield this.walletsList).find(v=>eqWalletName(v,f.device.appName))||null})}normalizeWidgetRoot(f){if(!f||!document.getElementById(f)){f="tc-widget-root";const d=document.createElement("div");d.id=f,document.body.appendChild(d)}return f}checkButtonRootExist(f){if(f!=null&&!document.getElementById(f))throw new TonConnectUIError(`${f} element not found in the document.`)}getModalsAndNotificationsConfiguration(f){var d,m,v,g,w,x;const S=["before","success","error"];let _=S;(d=this.actionsConfiguration)!=null&&d.notifications&&((m=this.actionsConfiguration)==null?void 0:m.notifications)!=="all"&&(_=this.actionsConfiguration.notifications),f!=null&&f.notifications&&(f.notifications==="all"?_=S:_=f.notifications);let b=["before"];(v=this.actionsConfiguration)!=null&&v.modals&&(this.actionsConfiguration.modals==="all"?b=S:b=this.actionsConfiguration.modals),f!=null&&f.modals&&(f.modals==="all"?b=S:b=f.modals);const C=(f==null?void 0:f.returnStrategy)||((g=this.actionsConfiguration)==null?void 0:g.returnStrategy)||"back",E=(f==null?void 0:f.twaReturnUrl)||((w=this.actionsConfiguration)==null?void 0:w.twaReturnUrl);let M=(f==null?void 0:f.skipRedirectToWallet)||((x=this.actionsConfiguration)==null?void 0:x.skipRedirectToWallet)||"ios";return isInTMA()&&(M="never"),{notifications:_,modals:b,returnStrategy:C,twaReturnUrl:E,skipRedirectToWallet:M}}}const DEFAULT_MANIFEST_URL="https://miniapp.spinfi.me/tonconnect-manifest.json";let tonConnectUIInstance=null,currentManifestUrl=null;class DefaultTonWalletProvider{constructor(f,d){this.bindWalletCallback=d;const m=f||DEFAULT_MANIFEST_URL;if(!tonConnectUIInstance||currentManifestUrl!==m)try{tonConnectUIInstance=new TonConnectUI({manifestUrl:m}),currentManifestUrl=m}catch{throw new Error("创建TonConnectUI实例失败")}this.ui=tonConnectUIInstance}isConnected(){var f;try{return!!((f=this.ui)!=null&&f.connected)}catch{return!1}}async reportWalletAddress(){const f=this.getUserFriendlyAddress();if(f&&this.bindWalletCallback)try{await this.bindWalletCallback(f)}catch{}}async connect(){if(this.isConnected())return await this.reportWalletAddress(),!0;try{return await new Promise((f,d)=>{this.ui.openModal();const m=this.ui.onStatusChange(()=>{this.isConnected()&&(m(),f())});setTimeout(()=>{this.isConnected()||(m(),d(new Error("连接钱包超时")))},3e5)}),await this.reportWalletAddress(),this.isConnected()}catch{return!1}}getUserFriendlyAddress(){var m,v,g;const f=this.ui,d=((v=(m=f==null?void 0:f.wallet)==null?void 0:m.account)==null?void 0:v.address)||((g=f==null?void 0:f.account)==null?void 0:g.address)||null;return d?toUserFriendlyAddress(d):null}async sendTonTransaction(f){if(!this.isConnected()&&!await this.connect())throw new Error("钱包未连接");const d=await this.ui.sendTransaction(f),m=d==null?void 0:d.boc;let v;if(m)try{v=m.substring(0,16)}catch{}return{transferHash:v,boc:m,raw:d}}async sendUsdtTransaction(f){if(!this.isConnected()&&!await this.connect())throw new Error("钱包未连接");const d=await this.ui.sendTransaction(f),m=d==null?void 0:d.boc;let v;if(m)try{v=m.substring(0,16)}catch{}return{transferHash:v,boc:m,raw:d}}async disconnect(){try{const f=this.ui;if(f!=null&&f.disconnect)await f.disconnect();else if(f!=null&&f.onStatusChange){const d=f.onStatusChange(()=>{});d&&d()}return!this.isConnected()}catch{return!1}}}class HmTrackingSDK{constructor(f){this.options=f,this.token=null,this.user=null;const d=this.options||{};this.storage=new NamespacedStorage(d.storageKeyPrefix||"hm_tracking_sdk"),this.token=this.storage.get("token");const m=d.baseURL||TEST_BASE_URL;this.http=new HttpClient({getToken:()=>this.token,onAuthError:()=>this.clearAuth(),baseURL:m,getAppId:()=>this.options&&this.options.appId||null}),this.api=new APIService(this.http),this.hmAdManager=new HmAdManager({autoInjectScript:!0}),this.adMonitor=new AdMonitor(v=>this.api.adMonitor(v)),this.tonWallet=new DefaultTonWalletProvider(d.tonConnectManifestUrl,this.bindWallet.bind(this))}async init(){const f=isTelegramEnv();try{const d=this.options||{},m=f?getTelegramUserUnsafe():null;if(m?this.user=m:d.customUser?this.user=d.customUser:typeof window<"u"?this.user=getAnonymousBrowserUser():this.user=getDefaultMockUser(),!this.user)throw new Error("未获取到用户信息:请在非 Telegram 环境提供 customUser");this.clearAuth(),await this.auth();try{await this.hmAdManager.init()}catch{}}catch(d){throw d}}async auth(){var f,d;try{const m={...this.user},v=(f=this.options)==null?void 0:f.notifyUrl;v&&(m.notifyUrl=v);const g=await this.api.auth(m);if(g.code!==1)throw new Error(g.msg||"鉴权失败");const w=(d=g.data)==null?void 0:d.token;if(!w)throw new Error("鉴权未返回 token");this.token=w,this.storage.set("token",w)}catch(m){throw m}}clearAuth(){this.token=null,this.storage.remove("token")}ensureTelegramEnvOrThrow(){if(!isTelegramEnv())throw new Error("支付相关功能仅支持在 Telegram 环境内使用")}async getAdPositionConfig(f){const d=await this.api.getAdPositionConfig(String(f));if(d.code!==1)throw new Error(d.msg||"获取广告位配置失败");return d.data||[]}async createAd(f){const d=await this.api.createAd(f);if(d.code!==1)throw new Error(d.msg||"创建广告失败");const m=d.data;return m!=null&&m.spaceId&&await this.hmAdManager.setSpace(String(m.spaceId)),m}async showHmAdByPosition(f,d){const m=await this.getAdPositionConfig(f);if(!m||m.length===0)throw new Error("未找到广告位配置");const v=m[0],g=await this.createAd({adId:v.adId,adPositionId:v.adPositionId}),w={start:g.start,show:g.show,error:g.error,close:g.close,reward:g.reward};await this.showHmAdWithMonitor(w,g.adShowId,d)}async showHmAdWithMonitor(f,d,m){const v=d||"";await this.adMonitor.send(f.start,v),await this.adMonitor.send(f.show,v);try{await this.hmAdManager.show(),await this.adMonitor.send(f.close,v);const g=await this.adMonitor.send(f.reward,v);m!=null&&m.onSuccess&&await m.onSuccess(g)}catch(g){throw await this.adMonitor.send(f.error,v),m!=null&&m.onError&&await m.onError(g),g}}async showHmPopupAd(f,d,m){const v=d||"";await this.adMonitor.send(f.start,v),await this.adMonitor.send(f.show,v);try{await this.hmAdManager.showPopup(),await this.adMonitor.send(f.close,v);const g=await this.adMonitor.send(f.reward,v);m!=null&&m.onSuccess&&await m.onSuccess(g)}catch(g){throw await this.adMonitor.send(f.error,v),m!=null&&m.onError&&await m.onError(g),g}}async showHmInAppAd(f,d,m,v){const g=m||"";await this.adMonitor.send(f.start,g),await this.adMonitor.send(f.show,g);try{await this.hmAdManager.showInApp(d),await this.adMonitor.send(f.close,g);const w=await this.adMonitor.send(f.reward,g);v!=null&&v.onSuccess&&await v.onSuccess(w)}catch(w){throw await this.adMonitor.send(f.error,g),v!=null&&v.onError&&await v.onError(w),w}}async bindWallet(f){try{if((await this.api.bindWalletReq({wallet:f,forceBind:!0})).code!==1)return}catch(d){throw d}}async disconnectWallet(){try{return this.tonWallet?(await this.tonWallet.disconnect(),!this.tonWallet.isConnected()):!0}catch{return!1}}async connectWallet(){return this.tonWallet?await this.tonWallet.connect():!1}isWalletConnected(){var f;return!!((f=this.tonWallet)!=null&&f.isConnected())}async ensureWalletConnected(){return this.ensureTelegramEnvOrThrow(),this.tonWallet?await this.tonWallet.connect():!1}async getSupportedPayModes(){const f=await this.api.merchantPayModeList();if(f.code!==1)throw new Error(f.msg||"获取支付方式失败");const d=f.data;return Array.isArray(d)?{payModeList:d}:{payModeList:Array.isArray(d==null?void 0:d.payModeList)?d.payModeList:[]}}async merchantPayQueryResult(f){return await this.api.merchantPayQueryResult(f)}async finishPayment(f,d,m=""){const v={orderSn:f,status:d,transferHash:m},g=await this.api.merchantPayFinish(v);if(g.code!==1)throw new Error(g.msg||"支付完成回调失败");return g.data}async payByMerchant(f){var x,S,_;this.ensureTelegramEnvOrThrow();const d=(x=f.currencyName)==null?void 0:x.toUpperCase(),m=await this.api.merchantPayCreate(f);if(m.code!==1)throw new Error(m.msg||"创建支付订单失败");const v=m.data;if(d==="STARS"&&v.payUrl)try{return await new Promise((C,E)=>{WebApp.openInvoice(v.payUrl,M=>{M==="paid"?C():E(new Error(`星币支付未完成: ${M||"未知状态"}`))})}),await this.finishPayment(v.orderSn,"success")}catch{return await this.finishPayment(v.orderSn,"failed")}if(!this.tonWallet||!this.tonWallet.isConnected())throw new Error("请先连接钱包");if(!((_=(S=v.transferData)==null?void 0:S.messages)==null?void 0:_[0]))throw new Error("订单未返回链上消息");let w;try{if(d==="TON")w=await this.tonWallet.sendTonTransaction(v.transferData);else if(d==="USDT")w=await this.tonWallet.sendUsdtTransaction(v.transferData);else throw new Error("暂不支持的币种");const b=w==null?void 0:w.transferHash;return await this.finishPayment(v.orderSn,"success",b||"")}catch{return await this.finishPayment(v.orderSn,"failed")}}}var AdPositionName=(r=>(r.GameRewardedAdPosition="game_rewarded_ad_position",r.TaskRewardedAdPosition="task_rewarded_ad_position",r.TaskListAdPosition="task_list_ad_position",r))(AdPositionName||{});globalThis.Buffer=Buffer$1,globalThis.process=process$1,globalThis.global=globalThis,exports.AdPositionName=AdPositionName,exports.HmTrackingSDK=HmTrackingSDK,exports.getAnonymousBrowserUser=getAnonymousBrowserUser,exports.getDefaultMockUser=getDefaultMockUser,exports.getLaunchParams=getLaunchParams,exports.getTelegramUserUnsafe=getTelegramUserUnsafe,exports.isTelegramEnv=isTelegramEnv,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));