UNPKG

@swtc/serializer

Version:
8 lines 138 kB
"use strict";var t,r,e=require("inherits"),i=require("@swtc/wallet"),n=require("@swtc/common");function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var s,h,u,a=function(){if(r)return t;r=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===i.call(t)},h=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var r,n=e.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&e.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!o)return!1;for(r in t);return void 0===r||e.call(t,r)},u=function(t,r){n&&"__proto__"===r.name?n(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},a=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(o)return o(t,r).value}return t[r]};return t=function t(){var r,e,i,n,o,f,l=arguments[0],c=1,p=arguments.length,m=!1;for("boolean"==typeof l&&(m=l,l=arguments[1]||{},c=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});c<p;++c)if(null!=(r=arguments[c]))for(e in r)i=a(l,e),l!==(n=a(r,e))&&(m&&n&&(h(n)||(o=s(n)))?(o?(o=!1,f=i&&s(i)?i:[]):f=i&&h(i)?i:{},u(l,{name:e,newValue:t(m,f,n)})):void 0!==n&&u(l,{name:e,newValue:n}));return l},t}(),f=o(a),l={},c={};function p(){if(h)return s;function t(t,r){if(!t)throw new Error(r||"Assertion failed")}return h=1,s=t,t.equal=function(t,r,e){if(t!=r)throw new Error(e||"Assertion failed: "+t+" != "+r)},s}function m(){if(u)return c;u=1;var t=p(),r=e;function i(t,r){return 55296==(64512&t.charCodeAt(r))&&(!(r<0||r+1>=t.length)&&56320==(64512&t.charCodeAt(r+1)))}function n(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}return c.inherits=r,c.toArray=function(t,r){if(Array.isArray(t))return t.slice();if(!t)return[];var e=[];if("string"==typeof t)if(r){if("hex"===r)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),o=0;o<t.length;o+=2)e.push(parseInt(t[o]+t[o+1],16))}else for(var n=0,o=0;o<t.length;o++){var s=t.charCodeAt(o);s<128?e[n++]=s:s<2048?(e[n++]=s>>6|192,e[n++]=63&s|128):i(t,o)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++o)),e[n++]=s>>18|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128,e[n++]=63&s|128):(e[n++]=s>>12|224,e[n++]=s>>6&63|128,e[n++]=63&s|128)}else for(o=0;o<t.length;o++)e[o]=0|t[o];return e},c.toHex=function(t){for(var r="",e=0;e<t.length;e++)r+=o(t[e].toString(16));return r},c.htonl=n,c.toHex32=function(t,r){for(var e="",i=0;i<t.length;i++){var o=t[i];"little"===r&&(o=n(o)),e+=s(o.toString(16))}return e},c.zero2=o,c.zero8=s,c.join32=function(r,e,i,n){var o=i-e;t(o%4==0);for(var s=new Array(o/4),h=0,u=e;h<s.length;h++,u+=4){var a;a="big"===n?r[u]<<24|r[u+1]<<16|r[u+2]<<8|r[u+3]:r[u+3]<<24|r[u+2]<<16|r[u+1]<<8|r[u],s[h]=a>>>0}return s},c.split32=function(t,r){for(var e=new Array(4*t.length),i=0,n=0;i<t.length;i++,n+=4){var o=t[i];"big"===r?(e[n]=o>>>24,e[n+1]=o>>>16&255,e[n+2]=o>>>8&255,e[n+3]=255&o):(e[n+3]=o>>>24,e[n+2]=o>>>16&255,e[n+1]=o>>>8&255,e[n]=255&o)}return e},c.rotr32=function(t,r){return t>>>r|t<<32-r},c.rotl32=function(t,r){return t<<r|t>>>32-r},c.sum32=function(t,r){return t+r>>>0},c.sum32_3=function(t,r,e){return t+r+e>>>0},c.sum32_4=function(t,r,e,i){return t+r+e+i>>>0},c.sum32_5=function(t,r,e,i,n){return t+r+e+i+n>>>0},c.sum64=function(t,r,e,i){var n=t[r],o=i+t[r+1]>>>0,s=(o<i?1:0)+e+n;t[r]=s>>>0,t[r+1]=o},c.sum64_hi=function(t,r,e,i){return(r+i>>>0<r?1:0)+t+e>>>0},c.sum64_lo=function(t,r,e,i){return r+i>>>0},c.sum64_4_hi=function(t,r,e,i,n,o,s,h){var u=0,a=r;return u+=(a=a+i>>>0)<r?1:0,u+=(a=a+o>>>0)<o?1:0,t+e+n+s+(u+=(a=a+h>>>0)<h?1:0)>>>0},c.sum64_4_lo=function(t,r,e,i,n,o,s,h){return r+i+o+h>>>0},c.sum64_5_hi=function(t,r,e,i,n,o,s,h,u,a){var f=0,l=r;return f+=(l=l+i>>>0)<r?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+h>>>0)<h?1:0,t+e+n+s+u+(f+=(l=l+a>>>0)<a?1:0)>>>0},c.sum64_5_lo=function(t,r,e,i,n,o,s,h,u,a){return r+i+o+h+a>>>0},c.rotr64_hi=function(t,r,e){return(r<<32-e|t>>>e)>>>0},c.rotr64_lo=function(t,r,e){return(t<<32-e|r>>>e)>>>0},c.shr64_hi=function(t,r,e){return t>>>e},c.shr64_lo=function(t,r,e){return(t<<32-e|r>>>e)>>>0},c}var d,g={};function y(){if(d)return g;d=1;var t=m(),r=p();function e(){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 g.BlockHash=e,e.prototype.update=function(r,e){if(r=t.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){var i=(r=this.pending).length%this._delta8;this.pending=r.slice(r.length-i,r.length),0===this.pending.length&&(this.pending=null),r=t.join32(r,0,r.length-i,this.endian);for(var n=0;n<r.length;n+=this._delta32)this._update(r,n,n+this._delta32)}return this},e.prototype.digest=function(t){return this.update(this._pad()),r(null===this.pending),this._digest(t)},e.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,e=r-(t+this.padLength)%r,i=new Array(e+this.padLength);i[0]=128;for(var n=1;n<e;n++)i[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i},g}var v,w,M,b,_,T,S,A,E,B,N,O,I={},x={};function k(){if(v)return x;v=1;var t=m().rotr32;function r(t,r,e){return t&r^~t&e}function e(t,r,e){return t&r^t&e^r&e}function i(t,r,e){return t^r^e}return x.ft_1=function(t,n,o,s){return 0===t?r(n,o,s):1===t||3===t?i(n,o,s):2===t?e(n,o,s):void 0},x.ch32=r,x.maj32=e,x.p32=i,x.s0_256=function(r){return t(r,2)^t(r,13)^t(r,22)},x.s1_256=function(r){return t(r,6)^t(r,11)^t(r,25)},x.g0_256=function(r){return t(r,7)^t(r,18)^r>>>3},x.g1_256=function(r){return t(r,17)^t(r,19)^r>>>10},x}function L(){if(_)return b;_=1;var t=m(),r=y(),e=k(),i=p(),n=t.sum32,o=t.sum32_4,s=t.sum32_5,h=e.ch32,u=e.maj32,a=e.s0_256,f=e.s1_256,l=e.g0_256,c=e.g1_256,d=r.BlockHash,g=[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 v(){if(!(this instanceof v))return new v;d.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}return t.inherits(v,d),b=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,r){for(var e=this.W,p=0;p<16;p++)e[p]=t[r+p];for(;p<e.length;p++)e[p]=o(c(e[p-2]),e[p-7],l(e[p-15]),e[p-16]);var m=this.h[0],d=this.h[1],g=this.h[2],y=this.h[3],v=this.h[4],w=this.h[5],M=this.h[6],b=this.h[7];for(i(this.k.length===e.length),p=0;p<e.length;p++){var _=s(b,f(v),h(v,w,M),this.k[p],e[p]),T=n(a(m),u(m,d,g));b=M,M=w,w=v,v=n(y,_),y=g,g=d,d=m,m=n(_,T)}this.h[0]=n(this.h[0],m),this.h[1]=n(this.h[1],d),this.h[2]=n(this.h[2],g),this.h[3]=n(this.h[3],y),this.h[4]=n(this.h[4],v),this.h[5]=n(this.h[5],w),this.h[6]=n(this.h[6],M),this.h[7]=n(this.h[7],b)},v.prototype._digest=function(r){return"hex"===r?t.toHex32(this.h,"big"):t.split32(this.h,"big")},b}function D(){if(E)return A;E=1;var t=m(),r=y(),e=p(),i=t.rotr64_hi,n=t.rotr64_lo,o=t.shr64_hi,s=t.shr64_lo,h=t.sum64,u=t.sum64_hi,a=t.sum64_lo,f=t.sum64_4_hi,l=t.sum64_4_lo,c=t.sum64_5_hi,d=t.sum64_5_lo,g=r.BlockHash,v=[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 w(){if(!(this instanceof w))return new w;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function M(t,r,e,i,n){var o=t&e^~t&n;return o<0&&(o+=4294967296),o}function b(t,r,e,i,n,o){var s=r&i^~r&o;return s<0&&(s+=4294967296),s}function _(t,r,e,i,n){var o=t&e^t&n^e&n;return o<0&&(o+=4294967296),o}function T(t,r,e,i,n,o){var s=r&i^r&o^i&o;return s<0&&(s+=4294967296),s}function S(t,r){var e=i(t,r,28)^i(r,t,2)^i(r,t,7);return e<0&&(e+=4294967296),e}function B(t,r){var e=n(t,r,28)^n(r,t,2)^n(r,t,7);return e<0&&(e+=4294967296),e}function N(t,r){var e=i(t,r,14)^i(t,r,18)^i(r,t,9);return e<0&&(e+=4294967296),e}function O(t,r){var e=n(t,r,14)^n(t,r,18)^n(r,t,9);return e<0&&(e+=4294967296),e}function I(t,r){var e=i(t,r,1)^i(t,r,8)^o(t,r,7);return e<0&&(e+=4294967296),e}function x(t,r){var e=n(t,r,1)^n(t,r,8)^s(t,r,7);return e<0&&(e+=4294967296),e}function k(t,r){var e=i(t,r,19)^i(r,t,29)^o(t,r,6);return e<0&&(e+=4294967296),e}function L(t,r){var e=n(t,r,19)^n(r,t,29)^s(t,r,6);return e<0&&(e+=4294967296),e}return t.inherits(w,g),A=w,w.blockSize=1024,w.outSize=512,w.hmacStrength=192,w.padLength=128,w.prototype._prepareBlock=function(t,r){for(var e=this.W,i=0;i<32;i++)e[i]=t[r+i];for(;i<e.length;i+=2){var n=k(e[i-4],e[i-3]),o=L(e[i-4],e[i-3]),s=e[i-14],h=e[i-13],u=I(e[i-30],e[i-29]),a=x(e[i-30],e[i-29]),c=e[i-32],p=e[i-31];e[i]=f(n,o,s,h,u,a,c,p),e[i+1]=l(n,o,s,h,u,a,c,p)}},w.prototype._update=function(t,r){this._prepareBlock(t,r);var i=this.W,n=this.h[0],o=this.h[1],s=this.h[2],f=this.h[3],l=this.h[4],p=this.h[5],m=this.h[6],g=this.h[7],y=this.h[8],v=this.h[9],w=this.h[10],A=this.h[11],E=this.h[12],I=this.h[13],x=this.h[14],k=this.h[15];e(this.k.length===i.length);for(var L=0;L<i.length;L+=2){var D=x,R=k,C=N(y,v),z=O(y,v),P=M(y,v,w,A,E),U=b(y,v,w,A,E,I),j=this.k[L],q=this.k[L+1],F=i[L],V=i[L+1],H=c(D,R,C,z,P,U,j,q,F,V),Z=d(D,R,C,z,P,U,j,q,F,V);D=S(n,o),R=B(n,o),C=_(n,o,s,f,l),z=T(n,o,s,f,l,p);var K=u(D,R,C,z),G=a(D,R,C,z);x=E,k=I,E=w,I=A,w=y,A=v,y=u(m,g,H,Z),v=a(g,g,H,Z),m=l,g=p,l=s,p=f,s=n,f=o,n=u(H,Z,K,G),o=a(H,Z,K,G)}h(this.h,0,n,o),h(this.h,2,s,f),h(this.h,4,l,p),h(this.h,6,m,g),h(this.h,8,y,v),h(this.h,10,w,A),h(this.h,12,E,I),h(this.h,14,x,k)},w.prototype._digest=function(r){return"hex"===r?t.toHex32(this.h,"big"):t.split32(this.h,"big")},A}function R(){return O||(O=1,I.sha1=function(){if(M)return w;M=1;var t=m(),r=y(),e=k(),i=t.rotl32,n=t.sum32,o=t.sum32_5,s=e.ft_1,h=r.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function a(){if(!(this instanceof a))return new a;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return t.inherits(a,h),w=a,a.blockSize=512,a.outSize=160,a.hmacStrength=80,a.padLength=64,a.prototype._update=function(t,r){for(var e=this.W,h=0;h<16;h++)e[h]=t[r+h];for(;h<e.length;h++)e[h]=i(e[h-3]^e[h-8]^e[h-14]^e[h-16],1);var a=this.h[0],f=this.h[1],l=this.h[2],c=this.h[3],p=this.h[4];for(h=0;h<e.length;h++){var m=~~(h/20),d=o(i(a,5),s(m,f,l,c),p,e[h],u[m]);p=c,c=l,l=i(f,30),f=a,a=d}this.h[0]=n(this.h[0],a),this.h[1]=n(this.h[1],f),this.h[2]=n(this.h[2],l),this.h[3]=n(this.h[3],c),this.h[4]=n(this.h[4],p)},a.prototype._digest=function(r){return"hex"===r?t.toHex32(this.h,"big"):t.split32(this.h,"big")},w}(),I.sha224=function(){if(S)return T;S=1;var t=m(),r=L();function e(){if(!(this instanceof e))return new e;r.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return t.inherits(e,r),T=e,e.blockSize=512,e.outSize=224,e.hmacStrength=192,e.padLength=64,e.prototype._digest=function(r){return"hex"===r?t.toHex32(this.h.slice(0,7),"big"):t.split32(this.h.slice(0,7),"big")},T}(),I.sha256=L(),I.sha384=function(){if(N)return B;N=1;var t=m(),r=D();function e(){if(!(this instanceof e))return new e;r.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return t.inherits(e,r),B=e,e.blockSize=1024,e.outSize=384,e.hmacStrength=192,e.padLength=128,e.prototype._digest=function(r){return"hex"===r?t.toHex32(this.h.slice(0,12),"big"):t.split32(this.h.slice(0,12),"big")},B}(),I.sha512=D()),I}var C,z,P,U,j={};var q=(U||(U=1,function(t){var r=t;r.utils=m(),r.common=y(),r.sha=R(),r.ripemd=function(){if(C)return j;C=1;var t=m(),r=y(),e=t.rotl32,i=t.sum32,n=t.sum32_3,o=t.sum32_4,s=r.BlockHash;function h(){if(!(this instanceof h))return new h;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(t,r,e,i){return t<=15?r^e^i:t<=31?r&e|~r&i:t<=47?(r|~e)^i:t<=63?r&i|e&~i:r^(e|~i)}function a(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function f(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}t.inherits(h,s),j.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(t,r){for(var s=this.h[0],h=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],v=s,w=h,M=m,b=g,_=y,T=0;T<80;T++){var S=i(e(o(s,u(T,h,m,g),t[l[T]+r],a(T)),p[T]),y);s=y,y=g,g=e(m,10),m=h,h=S,S=i(e(o(v,u(79-T,w,M,b),t[c[T]+r],f(T)),d[T]),_),v=_,_=b,b=e(M,10),M=w,w=S}S=n(this.h[1],m,b),this.h[1]=n(this.h[2],g,_),this.h[2]=n(this.h[3],y,v),this.h[3]=n(this.h[4],s,w),this.h[4]=n(this.h[0],h,M),this.h[0]=S},h.prototype._digest=function(r){return"hex"===r?t.toHex32(this.h,"little"):t.split32(this.h,"little")};var l=[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],c=[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],p=[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],d=[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 j}(),r.hmac=function(){if(P)return z;P=1;var t=m(),r=p();function e(r,i,n){if(!(this instanceof e))return new e(r,i,n);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(t.toArray(i,n))}return z=e,e.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),r(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},e.prototype.update=function(t,r){return this.inner.update(t,r),this},e.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},z}(),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160}(l)),l),F=o(q),V=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,H=Math.ceil,Z=Math.floor,K="[BigNumber Error] ",G=K+"Number primitive has more than 15 significant digits: ",Y=1e14,$=14,W=9007199254740991,J=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],X=1e7,Q=1e9;function tt(t){var r=0|t;return t>0||t===r?r:r-1}function rt(t){for(var r,e,i=1,n=t.length,o=t[0]+"";i<n;){for(r=t[i++]+"",e=$-r.length;e--;r="0"+r);o+=r}for(n=o.length;48===o.charCodeAt(--n););return o.slice(0,n+1||1)}function et(t,r){var e,i,n=t.c,o=r.c,s=t.s,h=r.s,u=t.e,a=r.e;if(!s||!h)return null;if(e=n&&!n[0],i=o&&!o[0],e||i)return e?i?0:-h:s;if(s!=h)return s;if(e=s<0,i=u==a,!n||!o)return i?0:!n^e?1:-1;if(!i)return u>a^e?1:-1;for(h=(u=n.length)<(a=o.length)?u:a,s=0;s<h;s++)if(n[s]!=o[s])return n[s]>o[s]^e?1:-1;return u==a?0:u>a^e?1:-1}function it(t,r,e,i){if(t<r||t>e||t!==Z(t))throw Error(K+(i||"Argument")+("number"==typeof t?t<r||t>e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function nt(t){var r=t.c.length-1;return tt(t.e/$)==r&&t.c[r]%2!=0}function ot(t,r){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(r<0?"e":"e+")+r}function st(t,r,e){var i,n;if(r<0){for(n=e+".";++r;n+=e);t=n+t}else if(++r>(i=t.length)){for(n=e,r-=i;--r;n+=e);t+=n}else r<i&&(t=t.slice(0,r)+"."+t.slice(r));return t}var ht,ut=function t(r){var e,i,n,o,s,h,u,a,f,l,c=E.prototype={constructor:E,toString:null,valueOf:null},p=new E(1),m=20,d=4,g=-7,y=21,v=-1e7,w=1e7,M=!1,b=1,_=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",A=!0;function E(t,r){var e,o,s,h,u,a,f,l,c=this;if(!(c instanceof E))return new E(t,r);if(null==r){if(t&&!0===t._isBigNumber)return c.s=t.s,void(!t.c||t.e>w?c.c=c.e=null:t.e<v?c.c=[c.e=0]:(c.e=t.e,c.c=t.c.slice()));if((a="number"==typeof t)&&0*t==0){if(c.s=1/t<0?(t=-t,-1):1,t===~~t){for(h=0,u=t;u>=10;u/=10,h++);return void(h>w?c.c=c.e=null:(c.e=h,c.c=[t]))}l=String(t)}else{if(!V.test(l=String(t)))return n(c,l,a);c.s=45==l.charCodeAt(0)?(l=l.slice(1),-1):1}(h=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(h<0&&(h=u),h+=+l.slice(u+1),l=l.substring(0,u)):h<0&&(h=l.length)}else{if(it(r,2,S.length,"Base"),10==r&&A)return I(c=new E(t),m+c.e+1,d);if(l=String(t),a="number"==typeof t){if(0*t!=0)return n(c,l,a,r);if(c.s=1/t<0?(l=l.slice(1),-1):1,E.DEBUG&&l.replace(/^0\.0*|\./,"").length>15)throw Error(G+t)}else c.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1;for(e=S.slice(0,r),h=u=0,f=l.length;u<f;u++)if(e.indexOf(o=l.charAt(u))<0){if("."==o){if(u>h){h=f;continue}}else if(!s&&(l==l.toUpperCase()&&(l=l.toLowerCase())||l==l.toLowerCase()&&(l=l.toUpperCase()))){s=!0,u=-1,h=0;continue}return n(c,String(t),a,r)}a=!1,(h=(l=i(l,r,10,c.s)).indexOf("."))>-1?l=l.replace(".",""):h=l.length}for(u=0;48===l.charCodeAt(u);u++);for(f=l.length;48===l.charCodeAt(--f););if(l=l.slice(u,++f)){if(f-=u,a&&E.DEBUG&&f>15&&(t>W||t!==Z(t)))throw Error(G+c.s*t);if((h=h-u-1)>w)c.c=c.e=null;else if(h<v)c.c=[c.e=0];else{if(c.e=h,c.c=[],u=(h+1)%$,h<0&&(u+=$),u<f){for(u&&c.c.push(+l.slice(0,u)),f-=$;u<f;)c.c.push(+l.slice(u,u+=$));u=$-(l=l.slice(u)).length}else u-=f;for(;u--;l+="0");c.c.push(+l)}}else c.c=[c.e=0]}function B(t,r,e,i){var n,o,s,h,u;if(null==e?e=d:it(e,0,8),!t.c)return t.toString();if(n=t.c[0],s=t.e,null==r)u=rt(t.c),u=1==i||2==i&&(s<=g||s>=y)?ot(u,s):st(u,s,"0");else if(o=(t=I(new E(t),r,e)).e,h=(u=rt(t.c)).length,1==i||2==i&&(r<=o||o<=g)){for(;h<r;u+="0",h++);u=ot(u,o)}else if(r-=s+(2===i&&o>s),u=st(u,o,"0"),o+1>h){if(--r>0)for(u+=".";r--;u+="0");}else if((r+=o-h)>0)for(o+1==h&&(u+=".");r--;u+="0");return t.s<0&&n?"-"+u:u}function N(t,r){for(var e,i,n=1,o=new E(t[0]);n<t.length;n++)(!(i=new E(t[n])).s||(e=et(o,i))===r||0===e&&o.s===r)&&(o=i);return o}function O(t,r,e){for(var i=1,n=r.length;!r[--n];r.pop());for(n=r[0];n>=10;n/=10,i++);return(e=i+e*$-1)>w?t.c=t.e=null:e<v?t.c=[t.e=0]:(t.e=e,t.c=r),t}function I(t,r,e,i){var n,o,s,h,u,a,f,l=t.c,c=J;if(l){t:{for(n=1,h=l[0];h>=10;h/=10,n++);if((o=r-n)<0)o+=$,s=r,u=l[a=0],f=Z(u/c[n-s-1]%10);else if((a=H((o+1)/$))>=l.length){if(!i)break t;for(;l.length<=a;l.push(0));u=f=0,n=1,s=(o%=$)-$+1}else{for(u=h=l[a],n=1;h>=10;h/=10,n++);f=(s=(o%=$)-$+n)<0?0:Z(u/c[n-s-1]%10)}if(i=i||r<0||null!=l[a+1]||(s<0?u:u%c[n-s-1]),i=e<4?(f||i)&&(0==e||e==(t.s<0?3:2)):f>5||5==f&&(4==e||i||6==e&&(o>0?s>0?u/c[n-s]:0:l[a-1])%10&1||e==(t.s<0?8:7)),r<1||!l[0])return l.length=0,i?(r-=t.e+1,l[0]=c[($-r%$)%$],t.e=-r||0):l[0]=t.e=0,t;if(0==o?(l.length=a,h=1,a--):(l.length=a+1,h=c[$-o],l[a]=s>0?Z(u/c[n-s]%c[s])*h:0),i)for(;;){if(0==a){for(o=1,s=l[0];s>=10;s/=10,o++);for(s=l[0]+=h,h=1;s>=10;s/=10,h++);o!=h&&(t.e++,l[0]==Y&&(l[0]=1));break}if(l[a]+=h,l[a]!=Y)break;l[a--]=0,h=1}for(o=l.length;0===l[--o];l.pop());}t.e>w?t.c=t.e=null:t.e<v&&(t.c=[t.e=0])}return t}function x(t){var r,e=t.e;return null===e?t.toString():(r=rt(t.c),r=e<=g||e>=y?ot(r,e):st(r,e,"0"),t.s<0?"-"+r:r)}return E.clone=t,E.ROUND_UP=0,E.ROUND_DOWN=1,E.ROUND_CEIL=2,E.ROUND_FLOOR=3,E.ROUND_HALF_UP=4,E.ROUND_HALF_DOWN=5,E.ROUND_HALF_EVEN=6,E.ROUND_HALF_CEIL=7,E.ROUND_HALF_FLOOR=8,E.EUCLID=9,E.config=E.set=function(t){var r,e;if(null!=t){if("object"!=typeof t)throw Error(K+"Object expected: "+t);if(t.hasOwnProperty(r="DECIMAL_PLACES")&&(it(e=t[r],0,Q,r),m=e),t.hasOwnProperty(r="ROUNDING_MODE")&&(it(e=t[r],0,8,r),d=e),t.hasOwnProperty(r="EXPONENTIAL_AT")&&((e=t[r])&&e.pop?(it(e[0],-Q,0,r),it(e[1],0,Q,r),g=e[0],y=e[1]):(it(e,-Q,Q,r),g=-(y=e<0?-e:e))),t.hasOwnProperty(r="RANGE"))if((e=t[r])&&e.pop)it(e[0],-Q,-1,r),it(e[1],1,Q,r),v=e[0],w=e[1];else{if(it(e,-Q,Q,r),!e)throw Error(K+r+" cannot be zero: "+e);v=-(w=e<0?-e:e)}if(t.hasOwnProperty(r="CRYPTO")){if((e=t[r])!==!!e)throw Error(K+r+" not true or false: "+e);if(e){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw M=!e,Error(K+"crypto unavailable");M=e}else M=e}if(t.hasOwnProperty(r="MODULO_MODE")&&(it(e=t[r],0,9,r),b=e),t.hasOwnProperty(r="POW_PRECISION")&&(it(e=t[r],0,Q,r),_=e),t.hasOwnProperty(r="FORMAT")){if("object"!=typeof(e=t[r]))throw Error(K+r+" not an object: "+e);T=e}if(t.hasOwnProperty(r="ALPHABET")){if("string"!=typeof(e=t[r])||/^.?$|[+\-.\s]|(.).*\1/.test(e))throw Error(K+r+" invalid: "+e);A="0123456789"==e.slice(0,10),S=e}}return{DECIMAL_PLACES:m,ROUNDING_MODE:d,EXPONENTIAL_AT:[g,y],RANGE:[v,w],CRYPTO:M,MODULO_MODE:b,POW_PRECISION:_,FORMAT:T,ALPHABET:S}},E.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!E.DEBUG)return!0;var r,e,i=t.c,n=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(i)){if((1===o||-1===o)&&n>=-Q&&n<=Q&&n===Z(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break t}if((r=(n+1)%$)<1&&(r+=$),String(i[0]).length==r){for(r=0;r<i.length;r++)if((e=i[r])<0||e>=Y||e!==Z(e))break t;if(0!==e)return!0}}}else if(null===i&&null===n&&(null===o||1===o||-1===o))return!0;throw Error(K+"Invalid BigNumber: "+t)},E.maximum=E.max=function(){return N(arguments,-1)},E.minimum=E.min=function(){return N(arguments,1)},E.random=(o=9007199254740992,s=Math.random()*o&2097151?function(){return Z(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var r,e,i,n,o,h=0,u=[],a=new E(p);if(null==t?t=m:it(t,0,Q),n=H(t/$),M)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(n*=2));h<n;)(o=131072*r[h]+(r[h+1]>>>11))>=9e15?(e=crypto.getRandomValues(new Uint32Array(2)),r[h]=e[0],r[h+1]=e[1]):(u.push(o%1e14),h+=2);h=n/2}else{if(!crypto.randomBytes)throw M=!1,Error(K+"crypto unavailable");for(r=crypto.randomBytes(n*=7);h<n;)(o=281474976710656*(31&r[h])+1099511627776*r[h+1]+4294967296*r[h+2]+16777216*r[h+3]+(r[h+4]<<16)+(r[h+5]<<8)+r[h+6])>=9e15?crypto.randomBytes(7).copy(r,h):(u.push(o%1e14),h+=7);h=n/7}if(!M)for(;h<n;)(o=s())<9e15&&(u[h++]=o%1e14);for(n=u[--h],t%=$,n&&t&&(o=J[$-t],u[h]=Z(n/o)*o);0===u[h];u.pop(),h--);if(h<0)u=[i=0];else{for(i=-1;0===u[0];u.splice(0,1),i-=$);for(h=1,o=u[0];o>=10;o/=10,h++);h<$&&(i-=$-h)}return a.e=i,a.c=u,a}),E.sum=function(){for(var t=1,r=arguments,e=new E(r[0]);t<r.length;)e=e.plus(r[t++]);return e},i=function(){var t="0123456789";function r(t,r,e,i){for(var n,o,s=[0],h=0,u=t.length;h<u;){for(o=s.length;o--;s[o]*=r);for(s[0]+=i.indexOf(t.charAt(h++)),n=0;n<s.length;n++)s[n]>e-1&&(null==s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/e|0,s[n]%=e)}return s.reverse()}return function(i,n,o,s,h){var u,a,f,l,c,p,g,y,v=i.indexOf("."),w=m,M=d;for(v>=0&&(l=_,_=0,i=i.replace(".",""),p=(y=new E(n)).pow(i.length-v),_=l,y.c=r(st(rt(p.c),p.e,"0"),10,o,t),y.e=y.c.length),f=l=(g=r(i,n,o,h?(u=S,t):(u=t,S))).length;0==g[--l];g.pop());if(!g[0])return u.charAt(0);if(v<0?--f:(p.c=g,p.e=f,p.s=s,g=(p=e(p,y,w,M,o)).c,c=p.r,f=p.e),v=g[a=f+w+1],l=o/2,c=c||a<0||null!=g[a+1],c=M<4?(null!=v||c)&&(0==M||M==(p.s<0?3:2)):v>l||v==l&&(4==M||c||6==M&&1&g[a-1]||M==(p.s<0?8:7)),a<1||!g[0])i=c?st(u.charAt(1),-w,u.charAt(0)):u.charAt(0);else{if(g.length=a,c)for(--o;++g[--a]>o;)g[a]=0,a||(++f,g=[1].concat(g));for(l=g.length;!g[--l];);for(v=0,i="";v<=l;i+=u.charAt(g[v++]));i=st(i,f,u.charAt(0))}return i}}(),e=function(){function t(t,r,e){var i,n,o,s,h=0,u=t.length,a=r%X,f=r/X|0;for(t=t.slice();u--;)h=((n=a*(o=t[u]%X)+(i=f*o+(s=t[u]/X|0)*a)%X*X+h)/e|0)+(i/X|0)+f*s,t[u]=n%e;return h&&(t=[h].concat(t)),t}function r(t,r,e,i){var n,o;if(e!=i)o=e>i?1:-1;else for(n=o=0;n<e;n++)if(t[n]!=r[n]){o=t[n]>r[n]?1:-1;break}return o}function e(t,r,e,i){for(var n=0;e--;)t[e]-=n,n=t[e]<r[e]?1:0,t[e]=n*i+t[e]-r[e];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(i,n,o,s,h){var u,a,f,l,c,p,m,d,g,y,v,w,M,b,_,T,S,A=i.s==n.s?1:-1,B=i.c,N=n.c;if(!(B&&B[0]&&N&&N[0]))return new E(i.s&&n.s&&(B?!N||B[0]!=N[0]:N)?B&&0==B[0]||!N?0*A:A/0:NaN);for(g=(d=new E(A)).c=[],A=o+(a=i.e-n.e)+1,h||(h=Y,a=tt(i.e/$)-tt(n.e/$),A=A/$|0),f=0;N[f]==(B[f]||0);f++);if(N[f]>(B[f]||0)&&a--,A<0)g.push(1),l=!0;else{for(b=B.length,T=N.length,f=0,A+=2,(c=Z(h/(N[0]+1)))>1&&(N=t(N,c,h),B=t(B,c,h),T=N.length,b=B.length),M=T,v=(y=B.slice(0,T)).length;v<T;y[v++]=0);S=N.slice(),S=[0].concat(S),_=N[0],N[1]>=h/2&&_++;do{if(c=0,(u=r(N,y,T,v))<0){if(w=y[0],T!=v&&(w=w*h+(y[1]||0)),(c=Z(w/_))>1)for(c>=h&&(c=h-1),m=(p=t(N,c,h)).length,v=y.length;1==r(p,y,m,v);)c--,e(p,T<m?S:N,m,h),m=p.length,u=1;else 0==c&&(u=c=1),m=(p=N.slice()).length;if(m<v&&(p=[0].concat(p)),e(y,p,v,h),v=y.length,-1==u)for(;r(N,y,T,v)<1;)c++,e(y,T<v?S:N,v,h),v=y.length}else 0===u&&(c++,y=[0]);g[f++]=c,y[0]?y[v++]=B[M]||0:(y=[B[M]],v=1)}while((M++<b||null!=y[0])&&A--);l=null!=y[0],g[0]||g.splice(0,1)}if(h==Y){for(f=1,A=g[0];A>=10;A/=10,f++);I(d,o+(d.e=f+a*$-1)+1,s,l)}else d.e=a,d.r=+l;return d}}(),h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,a=/^\.([^.]+)$/,f=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(t,r,e,i){var n,o=e?r:r.replace(l,"");if(f.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!e&&(o=o.replace(h,function(t,r,e){return n="x"==(e=e.toLowerCase())?16:"b"==e?2:8,i&&i!=n?t:r}),i&&(n=i,o=o.replace(u,"$1").replace(a,"0.$1")),r!=o))return new E(o,n);if(E.DEBUG)throw Error(K+"Not a"+(i?" base "+i:"")+" number: "+r);t.s=null}t.c=t.e=null},c.absoluteValue=c.abs=function(){var t=new E(this);return t.s<0&&(t.s=1),t},c.comparedTo=function(t,r){return et(this,new E(t,r))},c.decimalPlaces=c.dp=function(t,r){var e,i,n,o=this;if(null!=t)return it(t,0,Q),null==r?r=d:it(r,0,8),I(new E(o),t+o.e+1,r);if(!(e=o.c))return null;if(i=((n=e.length-1)-tt(this.e/$))*$,n=e[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},c.dividedBy=c.div=function(t,r){return e(this,new E(t,r),m,d)},c.dividedToIntegerBy=c.idiv=function(t,r){return e(this,new E(t,r),0,1)},c.exponentiatedBy=c.pow=function(t,r){var e,i,n,o,s,h,u,a,f=this;if((t=new E(t)).c&&!t.isInteger())throw Error(K+"Exponent not an integer: "+x(t));if(null!=r&&(r=new E(r)),s=t.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!t.c||!t.c[0])return a=new E(Math.pow(+x(f),s?t.s*(2-nt(t)):+x(t))),r?a.mod(r):a;if(h=t.s<0,r){if(r.c?!r.c[0]:!r.s)return new E(NaN);(i=!h&&f.isInteger()&&r.isInteger())&&(f=f.mod(r))}else{if(t.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||s&&f.c[1]>=24e7:f.c[0]<8e13||s&&f.c[0]<=9999975e7)))return o=f.s<0&&nt(t)?-0:0,f.e>-1&&(o=1/o),new E(h?1/o:o);_&&(o=H(_/$+2))}for(s?(e=new E(.5),h&&(t.s=1),u=nt(t)):u=(n=Math.abs(+x(t)))%2,a=new E(p);;){if(u){if(!(a=a.times(f)).c)break;o?a.c.length>o&&(a.c.length=o):i&&(a=a.mod(r))}if(n){if(0===(n=Z(n/2)))break;u=n%2}else if(I(t=t.times(e),t.e+1,1),t.e>14)u=nt(t);else{if(0===(n=+x(t)))break;u=n%2}f=f.times(f),o?f.c&&f.c.length>o&&(f.c.length=o):i&&(f=f.mod(r))}return i?a:(h&&(a=p.div(a)),r?a.mod(r):o?I(a,_,d,void 0):a)},c.integerValue=function(t){var r=new E(this);return null==t?t=d:it(t,0,8),I(r,r.e+1,t)},c.isEqualTo=c.eq=function(t,r){return 0===et(this,new E(t,r))},c.isFinite=function(){return!!this.c},c.isGreaterThan=c.gt=function(t,r){return et(this,new E(t,r))>0},c.isGreaterThanOrEqualTo=c.gte=function(t,r){return 1===(r=et(this,new E(t,r)))||0===r},c.isInteger=function(){return!!this.c&&tt(this.e/$)>this.c.length-2},c.isLessThan=c.lt=function(t,r){return et(this,new E(t,r))<0},c.isLessThanOrEqualTo=c.lte=function(t,r){return-1===(r=et(this,new E(t,r)))||0===r},c.isNaN=function(){return!this.s},c.isNegative=function(){return this.s<0},c.isPositive=function(){return this.s>0},c.isZero=function(){return!!this.c&&0==this.c[0]},c.minus=function(t,r){var e,i,n,o,s=this,h=s.s;if(r=(t=new E(t,r)).s,!h||!r)return new E(NaN);if(h!=r)return t.s=-r,s.plus(t);var u=s.e/$,a=t.e/$,f=s.c,l=t.c;if(!u||!a){if(!f||!l)return f?(t.s=-r,t):new E(l?s:NaN);if(!f[0]||!l[0])return l[0]?(t.s=-r,t):new E(f[0]?s:3==d?-0:0)}if(u=tt(u),a=tt(a),f=f.slice(),h=u-a){for((o=h<0)?(h=-h,n=f):(a=u,n=l),n.reverse(),r=h;r--;n.push(0));n.reverse()}else for(i=(o=(h=f.length)<(r=l.length))?h:r,h=r=0;r<i;r++)if(f[r]!=l[r]){o=f[r]<l[r];break}if(o&&(n=f,f=l,l=n,t.s=-t.s),(r=(i=l.length)-(e=f.length))>0)for(;r--;f[e++]=0);for(r=Y-1;i>h;){if(f[--i]<l[i]){for(e=i;e&&!f[--e];f[e]=r);--f[e],f[i]+=Y}f[i]-=l[i]}for(;0==f[0];f.splice(0,1),--a);return f[0]?O(t,f,a):(t.s=3==d?-1:1,t.c=[t.e=0],t)},c.modulo=c.mod=function(t,r){var i,n,o=this;return t=new E(t,r),!o.c||!t.s||t.c&&!t.c[0]?new E(NaN):!t.c||o.c&&!o.c[0]?new E(o):(9==b?(n=t.s,t.s=1,i=e(o,t,0,3),t.s=n,i.s*=n):i=e(o,t,0,b),(t=o.minus(i.times(t))).c[0]||1!=b||(t.s=o.s),t)},c.multipliedBy=c.times=function(t,r){var e,i,n,o,s,h,u,a,f,l,c,p,m,d,g,y=this,v=y.c,w=(t=new E(t,r)).c;if(!(v&&w&&v[0]&&w[0]))return!y.s||!t.s||v&&!v[0]&&!w||w&&!w[0]&&!v?t.c=t.e=t.s=null:(t.s*=y.s,v&&w?(t.c=[0],t.e=0):t.c=t.e=null),t;for(i=tt(y.e/$)+tt(t.e/$),t.s*=y.s,(u=v.length)<(l=w.length)&&(m=v,v=w,w=m,n=u,u=l,l=n),n=u+l,m=[];n--;m.push(0));for(d=Y,g=X,n=l;--n>=0;){for(e=0,c=w[n]%g,p=w[n]/g|0,o=n+(s=u);o>n;)e=((a=c*(a=v[--s]%g)+(h=p*a+(f=v[s]/g|0)*c)%g*g+m[o]+e)/d|0)+(h/g|0)+p*f,m[o--]=a%d;m[o]=e}return e?++i:m.splice(0,1),O(t,m,i)},c.negated=function(){var t=new E(this);return t.s=-t.s||null,t},c.plus=function(t,r){var e,i=this,n=i.s;if(r=(t=new E(t,r)).s,!n||!r)return new E(NaN);if(n!=r)return t.s=-r,i.minus(t);var o=i.e/$,s=t.e/$,h=i.c,u=t.c;if(!o||!s){if(!h||!u)return new E(n/0);if(!h[0]||!u[0])return u[0]?t:new E(h[0]?i:0*n)}if(o=tt(o),s=tt(s),h=h.slice(),n=o-s){for(n>0?(s=o,e=u):(n=-n,e=h),e.reverse();n--;e.push(0));e.reverse()}for((n=h.length)-(r=u.length)<0&&(e=u,u=h,h=e,r=n),n=0;r;)n=(h[--r]=h[r]+u[r]+n)/Y|0,h[r]=Y===h[r]?0:h[r]%Y;return n&&(h=[n].concat(h),++s),O(t,h,s)},c.precision=c.sd=function(t,r){var e,i,n,o=this;if(null!=t&&t!==!!t)return it(t,1,Q),null==r?r=d:it(r,0,8),I(new E(o),t,r);if(!(e=o.c))return null;if(i=(n=e.length-1)*$+1,n=e[n]){for(;n%10==0;n/=10,i--);for(n=e[0];n>=10;n/=10,i++);}return t&&o.e+1>i&&(i=o.e+1),i},c.shiftedBy=function(t){return it(t,-9007199254740991,W),this.times("1e"+t)},c.squareRoot=c.sqrt=function(){var t,r,i,n,o,s=this,h=s.c,u=s.s,a=s.e,f=m+4,l=new E("0.5");if(1!==u||!h||!h[0])return new E(!u||u<0&&(!h||h[0])?NaN:h?s:1/0);if(0==(u=Math.sqrt(+x(s)))||u==1/0?(((r=rt(h)).length+a)%2==0&&(r+="0"),u=Math.sqrt(+r),a=tt((a+1)/2)-(a<0||a%2),i=new E(r=u==1/0?"5e"+a:(r=u.toExponential()).slice(0,r.indexOf("e")+1)+a)):i=new E(u+""),i.c[0])for((u=(a=i.e)+f)<3&&(u=0);;)if(o=i,i=l.times(o.plus(e(s,o,f,1))),rt(o.c).slice(0,u)===(r=rt(i.c)).slice(0,u)){if(i.e<a&&--u,"9999"!=(r=r.slice(u-3,u+1))&&(n||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(I(i,i.e+m+2,1),t=!i.times(i).eq(s));break}if(!n&&(I(o,o.e+m+2,0),o.times(o).eq(s))){i=o;break}f+=4,u+=4,n=1}return I(i,i.e+m+1,d,t)},c.toExponential=function(t,r){return null!=t&&(it(t,0,Q),t++),B(this,t,r,1)},c.toFixed=function(t,r){return null!=t&&(it(t,0,Q),t=t+this.e+1),B(this,t,r)},c.toFormat=function(t,r,e){var i,n=this;if(null==e)null!=t&&r&&"object"==typeof r?(e=r,r=null):t&&"object"==typeof t?(e=t,t=r=null):e=T;else if("object"!=typeof e)throw Error(K+"Argument not an object: "+e);if(i=n.toFixed(t,r),n.c){var o,s=i.split("."),h=+e.groupSize,u=+e.secondaryGroupSize,a=e.groupSeparator||"",f=s[0],l=s[1],c=n.s<0,p=c?f.slice(1):f,m=p.length;if(u&&(o=h,h=u,u=o,m-=o),h>0&&m>0){for(o=m%h||h,f=p.substr(0,o);o<m;o+=h)f+=a+p.substr(o,h);u>0&&(f+=a+p.slice(o)),c&&(f="-"+f)}i=l?f+(e.decimalSeparator||"")+((u=+e.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(e.fractionGroupSeparator||"")):l):f}return(e.prefix||"")+i+(e.suffix||"")},c.toFraction=function(t){var r,i,n,o,s,h,u,a,f,l,c,m,g=this,y=g.c;if(null!=t&&(!(u=new E(t)).isInteger()&&(u.c||1!==u.s)||u.lt(p)))throw Error(K+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+x(u));if(!y)return new E(g);for(r=new E(p),f=i=new E(p),n=a=new E(p),m=rt(y),s=r.e=m.length-g.e-1,r.c[0]=J[(h=s%$)<0?$+h:h],t=!t||u.comparedTo(r)>0?s>0?r:f:u,h=w,w=1/0,u=new E(m),a.c[0]=0;l=e(u,r,0,1),1!=(o=i.plus(l.times(n))).comparedTo(t);)i=n,n=o,f=a.plus(l.times(o=f)),a=o,r=u.minus(l.times(o=r)),u=o;return o=e(t.minus(i),n,0,1),a=a.plus(o.times(f)),i=i.plus(o.times(n)),a.s=f.s=g.s,c=e(f,n,s*=2,d).minus(g).abs().comparedTo(e(a,i,s,d).minus(g).abs())<1?[f,n]:[a,i],w=h,c},c.toNumber=function(){return+x(this)},c.toPrecision=function(t,r){return null!=t&&it(t,1,Q),B(this,t,r,2)},c.toString=function(t){var r,e=this,n=e.s,o=e.e;return null===o?n?(r="Infinity",n<0&&(r="-"+r)):r="NaN":(null==t?r=o<=g||o>=y?ot(rt(e.c),o):st(rt(e.c),o,"0"):10===t&&A?r=st(rt((e=I(new E(e),m+o+1,d)).c),e.e,"0"):(it(t,2,S.length,"Base"),r=i(st(rt(e.c),o,"0"),10,t,n,!0)),n<0&&e.c[0]&&(r="-"+r)),r},c.valueOf=c.toJSON=function(){return x(this)},c._isBigNumber=!0,c[Symbol.toStringTag]="BigNumber",c[Symbol.for("nodejs.util.inspect.custom")]=c.valueOf,null!=r&&E.set(r),E}(),at={exports:{}},ft={},lt={};var ct,pt,mt,dt={}; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function gt(){return ct||(ct=1,dt.read=function(t,r,e,i,n){var o,s,h=8*n-i-1,u=(1<<h)-1,a=u>>1,f=-7,l=e?n-1:0,c=e?-1:1,p=t[r+l];for(l+=c,o=p&(1<<-f)-1,p>>=-f,f+=h;f>0;o=256*o+t[r+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+t[r+l],l+=c,f-=8);if(0===o)o=1-a;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),o-=a}return(p?-1:1)*s*Math.pow(2,o-i)},dt.write=function(t,r,e,i,n,o){var s,h,u,a=8*o-n-1,f=(1<<a)-1,l=f>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,m=i?1:-1,d=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,s=f):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),(r+=s+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(h=0,s=f):s+l>=1?(h=(r*u-1)*Math.pow(2,n),s+=l):(h=r*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;t[e+p]=255&h,p+=m,h/=256,n-=8);for(s=s<<n|h,a+=n;a>0;t[e+p]=255&s,p+=m,s/=256,a-=8);t[e+p-m]|=128*d}),dt} /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */function yt(){return pt||(pt=1,function(t){var r=function(){if(ht)return lt;ht=1,lt.byteLength=function(t){var r=o(t),e=r[0],i=r[1];return 3*(e+i)/4-i},lt.toByteArray=function(t){var i,n,s=o(t),h=s[0],u=s[1],a=new e(function(t,r,e){return 3*(r+e)/4-e}(0,h,u)),f=0,l=u>0?h-4:h;for(n=0;n<l;n+=4)i=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=255&i;return 2===u&&(i=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,a[f++]=255&i),1===u&&(i=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,a[f++]=i>>8&255,a[f++]=255&i),a},lt.fromByteArray=function(r){for(var e,i=r.length,n=i%3,o=[],s=16383,u=0,a=i-n;u<a;u+=s)o.push(h(r,u,u+s>a?a:u+s));return 1===n?(e=r[i-1],o.push(t[e>>2]+t[e<<4&63]+"==")):2===n&&(e=(r[i-2]<<8)+r[i-1],o.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"=")),o.join("")};for(var t=[],r=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)t[n]=i[n],r[i.charCodeAt(n)]=n;function o(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function s(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[63&r]}function h(t,r,e){for(var i,n=[],o=r;o<e;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),n.push(s(i));return n.join("")}return r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63,lt}(),e=gt(),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},t.INSPECT_MAX_BYTES=50;var n=2147483647;function o(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,s.prototype),r}function s(t,r,e){if("number"==typeof t){if("string"==typeof r)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return h(t,r,e)}function h(t,r,e){if("string"==typeof t)return function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=0|p(t,r),i=o(e),n=i.write(t,r);n!==e&&(i=i.slice(0,n));return i}(t,r);if(ArrayBuffer.isView(t))return function(t){if(U(t,Uint8Array)){var r=new Uint8Array(t);return l(r.buffer,r.byteOffset,r.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(U(t,ArrayBuffer)||t&&U(t.buffer,ArrayBuffer))return l(t,r,e);if("undefined"!=typeof SharedArrayBuffer&&(U(t,SharedArrayBuffer)||t&&U(t.buffer,SharedArrayBuffer)))return l(t,r,e);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return s.from(i,r,e);var n=function(t){if(s.isBuffer(t)){var r=0|c(t.length),e=o(r);return 0===e.length||t.copy(e,0,0,r),e}if(void 0!==t.length)return"number"!=typeof t.length||j(t.length)?o(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return u(t),o(t<0?0:0|c(t))}function f(t){for(var r=t.length<0?0:0|c(t.length),e=o(r),i=0;i<r;i+=1)e[i]=255&t[i];return e}function l(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e),Object.setPrototypeOf(i,s.prototype),i}function c(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function p(t,r){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||U(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return z(t).length;default:if(n)return i?-1:C(t).length;r=(""+r).toLowerCase(),n=!0}}function m(t,r,e){var i=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,r,e);case"utf8":case"utf-8":return S(this,r,e);case"ascii":return E(this,r,e);case"latin1":case"binary":return B(this,r,e);case"base64":return T(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function d(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}function g(t,r,e,i,n){if(0===t.length)return-1;if("string"==typeof e?(i=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),j(e=+e)&&(e=n?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(n)return-1;e=t.length-1}else if(e<0){if(!n)return-1;e=0}if("string"==typeof r&&(r=s.from(r,i)),s.isBuffer(r))return 0===r.length?-1:y(t,r,e,i,n);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):y(t,[r],e,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,r,e,i,n){var o,s=1,h=t.length,u=r.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||r.length<2)return-1;s=2,h/=2,u/=2,e/=2}function a(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(n){var f=-1;for(o=e;o<h;o++)if(a(t,o)===a(r,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(e+u>h&&(e=h-u),o=e;o>=0;o--){for(var l=!0,c=0;c<u;c++)if(a(t,o+c)!==a(r,c)){l=!1;break}if(l)return o}return-1}function v(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i))>n&&(i=n):i=n;var o=r.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var h=parseInt(r.substr(2*s,2),16);if(j(h))return s;t[e+s]=h}return s}function w(t,r,e,i){return P(C(r,t.length-e),t,e,i)}function M(t,r,e,i){return P(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,i)}function b(t,r,e,i){return P(z(r),t,e,i)}function _(t,r,e,i){return P(function(t,r){for(var e,i,n,o=[],s=0;s<t.length&&!((r-=2)<0);++s)i=(e=t.charCodeAt(s))>>8,n=e%256,o.push(n),o.push(i);return o}(r,t.length-e),t,e,i)}function T(t,e,i){return 0===e&&i===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,i))}function S(t,r,e){e=Math.min(t.length,e);for(var i=[],n=r;n<e;){var o,s,h,u,a=t[n],f=null,l=a>239?4:a>223?3:a>191?2:1;if(n+l<=e)switch(l){case 1:a<128&&(f=a);break;case 2:128==(192&(o=t[n+1]))&&(u=(31&a)<<6|63&o)>127&&(f=u);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(u=(15&a)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[n+1],s=t[n+2],h=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&h)&&(u=(15&a)<<18|(63&o)<<12|(63&s)<<6|63&h)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var r=t.length;if(r<=A)return String.fromCharCode.apply(String,t);var e="",i=0;for(;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=A));return e}(i)}t.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,r,e){return h(t,r,e)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,r,e){return function(t,r,e){return u(t),t<=0?o(t):void 0!==r?"string"==typeof e?o(t).fill(r,e):o(t).fill(r):o(t)}(t,r,e)},s.allocUnsafe=function(t){return a(t)},s.allocUnsafeSlow=function(t){return a(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,r){if(U(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),U(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var e=t.length,i=r.length,n=0,o=Math.min(e,i);n<o;++n)if(t[n]!==r[n]){e=t[n],i=r[n];break}return e<i?-1:i<e?1:0},s.isEncoding=function(t){switch(String(t).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}},s.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=s.allocUnsafe(r),n=0;for(e=0;e<t.length;++e){var o=t[e];if(U(o,Uint8Array))n+o.length>i.length?s.from(o).copy(i,n):Uint8Array.prototype.set.call(i,o,n);else{if(!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,n)}n+=o.length}return i},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)d(this,r,r+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)d(this,r,r+3),d(this,r+1,r+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)d(this,r,r+7),d(this,r+1,r+6),d(this,r+2,r+5),d(this,r+3,r+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):m.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var r="",e=t.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(t,r,e,i,n){if(U(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),r<0||e>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&r>=e)return 0;if(i>=n)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(n>>>=0)-(i>>>=0),h=(e>>>=0)-(r>>>=0),u=Math.min(o,h),a=this.slice(i,n),f=t.slice(r,e),l=0;l<u;++l)if(a[l]!==f[l]){o=a[l],h=f[l];break}return o<h?-1:h<o?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},s.prototype.write=function(t,r,e,i){if(void 0===r)i="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)i=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(e)?(e>>>=0,void 0===i&&(i="utf8")):(i=e,e=void 0)}var n=this.length-r;if((void 0===e||e>n)&&(e=n),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return v(this,t,r,e);case"utf