varr={messageId:0,toPayload:function(e,o){returne||console.error("jsonrpc method should be specified!"),r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:e,params:o||[]}},isValidResponse:function(r){returnArray.isArray(r)?r.every(e):e(r);functione(r){return!!r&&!r.error&&"2.0"===r.jsonrpc&&"number"==typeofr.id&&void0!==r.result}},toBatchPayload:function(e){returne.map(function(e){returnr.toPayload(e.method,e.params)})}};module.exports=r;
},{}],"FRly":[function(require,module,exports){
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(varr=[],t=[],e="undefined"!=typeofUint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;functionh(r){vart=r.length;if(t%4>0)thrownewError("Invalid string. Length must be a multiple of 4");vare=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}functionu(r){vart=h(r),e=t[0],n=t[1];return3*(e+n)/4-n}functionc(r,t,e){return3*(t+e)/4-e}functioni(r){varn,o,a=h(r),u=a[0],i=a[1],f=newe(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}functionf(t){returnr[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}functionA(r,t,e){for(varn,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));returno.join("")}functiond(t){for(vare,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
vart=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");functioni(){try{vart=newUint8Array(1);returnt.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===t.foo()&&"function"==typeoft.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}functiono(){returnf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functionu(t,r){if(o()<r)thrownewRangeError("Invalid typed array length");returnf.TYPED_ARRAY_SUPPORT?(t=newUint8Array(r)).__proto__=f.prototype:(null===t&&(t=newf(r)),t.length=r),t}functionf(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||thisinstanceoff))returnnewf(t,r,e);if("number"==typeoft){if("string"==typeofr)thrownewError("If encoding is specified then the first argument must be a string");returnc(this,t)}returns(this,t,r,e)}functions(t,r,e,n){if("number"==typeofr)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&rinstanceofArrayBuffer?g(t,r,e,n):"string"==typeofr?l(t,r,e):y(t,r)}functionh(t){if("number"!=typeoft)thrownewTypeError('"size" argument must be a number');if(t<0)thrownewRangeError('"size" argument must not be negative')}functiona(t,r,e,n){returnh(r),r<=0?u(t,r):void0!==e?"string"==typeofn?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}functionc(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(vare=0;e<r;++e)t[e]=0;returnt}functionl(t,r,e){if("string"==typeofe&&""!==e||(e="utf8"),!f.isEncoding(e))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|v(r,e),i=(t=u(t,n)).write(r,e);returni!==n&&(t=t.slice(0,i)),t}functionp(t,r){vare=r.length<0?0:0|w(r.length);t=u(t,e);for(varn=0;n<e;n+=1)t[n]=255&r[n];returnt}functiong(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)thrownewRangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))thrownewRangeError("'length' is out of bounds");returnr=void0===e&&void0===n?newUint8Array(r):void0===n?newUint8Array(r,e):newUint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}functiony(t,r){if(f.isBuffer(r)){vare=0|w(r.length);return0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeofArrayBuffer&&r.bufferinstanceofArrayBuffer||"length"inr)return"number"!=typeofr.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))returnp(t,r.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functionw(t){if(t>=o())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return0|t}functiond(t){return+t!=t&&(t=0),f.alloc(+t)}functionv(t,r){if(f.isBuffer(t))returnt.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(t)||tinstanceofArrayBuffer))returnt.byteLength;"string"!=typeoft&&(t=""+t);vare=t.length;if(0===e)return0;for(varn=!1;;)switch(r){case"ascii":case"latin1":case"binary":returne;case"utf8":case"utf-8":casevoid0:return$(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*e;case"hex":returne>>>1;case"base64":returnK(t).length;default:if(n)return$(t).length;r=(""+r).toLowerCase(),n=!0}}functionE(t,r,e){varn=!1;if((void0===r||r<0)&&(r=0),r>this.length)return"";if((void0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":returnx(this,r,e);case"utf8":case"utf-8":returnY(this,r,e);case"ascii":returnL(this,r,e);case"latin1":case"binary":returnD(this,r,e);case"base64":returnS(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnC(this,r,e);default:if(n)thrownewTypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}functionb(t,r,e){varn=t[r];t[r]=t[e],t[e]=n}functionR(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeofe?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}elseif(e<0){if(!i)return-1;e=0}if("string"==typeofr&&(r=f.from(r,n)),f.isBuffer(r))return0===r.length?-1:_(t,r,e,n,i);if("number"==typeofr)returnr&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeofUint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);thrownewTypeError("val must be string, number or Buffer")}function_(t,r,e,n,i){varo,u=1,f=t.length,s=r.length;if(void0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}functionh(t,r){return1===u?t[r]:t.readUInt16BE(r*u)}if(i){vara=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)returna*u}else-1!==a&&(o-=o-a),a=-1}elsefor(e+s>f&&(e=f-s),o=e;o>=0;o--){for(varc=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)returno}return-1}functionA(t,r,e,n){e=Number(e)||0;vari=t.length-e;n?(n=Number(n))>i&&(n=i):n=iLine truncated
varr=require("buffer"),e=r.Buffer;functiono(r,e){for(varoinr)e[o]=r[o]}functionn(r,o,n){returne(r,o,n)}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?module.exports=r:(o(r,exports),exports.Buffer=n),n.prototype=Object.create(e.prototype),o(e,n),n.from=function(r,o,n){if("number"==typeofr)thrownewTypeError("Argument must not be a number");returne(r,o,n)},n.alloc=function(r,o,n){if("number"!=typeofr)thrownewTypeError("Argument must be a number");vart=e(r);returnvoid0!==o?"string"==typeofn?t.fill(o,n):t.fill(o):t.fill(0),t},n.allocUnsafe=function(r){if("number"!=typeofr)thrownewTypeError("Argument must be a number");returne(r)},n.allocUnsafeSlow=function(e){if("number"!=typeofe)thrownewTypeError("Argument must be a number");returnr.SlowBuffer(e)};
vart,e,n=module.exports={};functionr(){thrownewError("setTimeout has not been defined")}functiono(){thrownewError("clearTimeout has not been defined")}functioni(e){if(t===setTimeout)returnsetTimeout(e,0);if((t===r||!t)&&setTimeout)returnt=setTimeout,setTimeout(e,0);try{returnt(e,0)}catch(n){try{returnt.call(null,e,0)}catch(n){returnt.call(this,e,0)}}}functionu(t){if(e===clearTimeout)returnclearTimeout(t);if((e===o||!e)&&clearTimeout)returne=clearTimeout,clearTimeout(t);try{returne(t)}catch(n){try{returne.call(null,t)}catch(n){returne.call(this,t)}}}!function(){try{t="function"==typeofsetTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeofclearTimeout?clearTimeout:o}catch(n){e=o}}();varc,s=[],l=!1,a=-1;functionf(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}functionh(){if(!l){vart=i(f);l=!0;for(vare=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}functionm(t,e){this.fun=t,this.array=e}functionp(){}n.nextTick=function(t){vare=newArray(arguments.length-1);if(arguments.length>1)for(varn=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(newm(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){thrownewError("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){thrownewError("process.chdir is not supported")},n.umask=function(){return0};
},{}],"pXr2":[function(require,module,exports){
varglobal=arguments[3];
varprocess=require("process");
vare=arguments[3],r=require("process"),o=65536,n=4294967295;functiont(){thrownewError("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}vars=require("safe-buffer").Buffer,u=e.crypto||e.msCrypto;functiona(e,t){if(e>n)thrownewRangeError("requested too many random bytes");vara=s.allocUnsafe(e);if(e>0)if(e>o)for(varf=0;f<e;f+=o)u.getRandomValues(a.slice(f,f+o));elseu.getRandomValues(a);return"function"==typeoft?r.nextTick(function(){t(null,a)}):a}u&&u.getRandomValues?module.exports=a:module.exports=t;
"use strict";vare,t="object"==typeofReflect?Reflect:null,n=t&&"function"==typeoft.apply?t.apply:function(e,t,n){returnFunction.prototype.apply.call(e,t,n)};functionr(e){console&&console.warn&&console.warn(e)}e=t&&"function"==typeoft.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){returnObject.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){returnObject.getOwnPropertyNames(e)};vari=Number.isNaN||function(e){returne!=e};functiono(){o.init.call(this)}module.exports=o,module.exports.once=m,o.EventEmitter=o,o.prototype._events=void0,o.prototype._eventsCount=0,o.prototype._maxListeners=void0;vars=10;functionu(e){if("function"!=typeofe)thrownewTypeError('The "listener" argument must be of type Function. Received type '+typeofe)}functionf(e){returnvoid0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}functionc(e,t,n,i){varo,s,c;if(u(n),void0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),c=s[t]),void0===c)c=s[t]=n,++e._eventsCount;elseif("function"==typeofc?c=s[t]=i?[n,c]:[c,n]:i?c.unshift(n):c.push(n),(o=f(e))>0&&c.length>o&&!c.warned){c.warned=!0;varv=newError("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");v.name="MaxListenersExceededWarning",v.emitter=e,v.type=t,v.count=c.length,r(v)}returne}functionv(){if(!this.fired)returnthis.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}functionl(e,t,n){varr={fired:!1,wrapFn:void0,target:e,type:t,listener:n},i=v.bind(r);returni.listener=n,r.wrapFn=i,i}functionp(e,t,n){varr=e._events;if(void0===r)return[];vari=r[t];returnvoid0===i?[]:"function"==typeofi?n?[i.listener||i]:[i]:n?d(i):h(i,i.length)}functiona(e){vart=this._events;if(void0!==t){varn=t[e];if("function"==typeofn)return1;if(void0!==n)returnn.length}return0}functionh(e,t){for(varn=newArray(t),r=0;r<t;++r)n[r]=e[r];returnn}functiony(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}functiond(e){for(vart=newArray(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];returnt}functionm(e,t){returnnewPromise(function(n,r){functioni(n){e.removeListener(t,o),r(n)}functiono(){"function"==typeofe.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&L(e,i,{once:!0})})}functionL(e,t,n){"function"==typeofe.on&&g(e,"error",t,n)}functiong(e,t,n,r){if("function"==typeofe.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeofe.addEventListener)thrownewTypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeofe);e.addEventListener(t,functioni(o){r.once&&e.removeEventListener(t,i),n(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){returns},set:function(e){if("number"!=typeofe||e<0||i(e))thrownewRangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void0},o.prototype.setMaxListeners=function(e){if("number"!=typeofe||e<0||i(e))thrownewRangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");returnthis._maxListeners=e,this},o.prototype.getMaxListeners=function(){returnf(this)},o.prototype.emit=function(e){for(vart=[],r=1;r<arguments.length;r++)t.push(arguments[r]);vari="error"===e,o=this._events;if(void0!==o)i=i&&void0===o.error;elseif(!i)return!1;if(i){vars;if(t.length>0&&(s=t[0]),sinstanceofError)throws;varu=newError("Unhandled error."+(s?" ("+s.message+")":""));throwu.context=s,u}varf=o[e];if(void0===f)return!1;if("function"==typeoff)n(f,this,t);else{varc=f.length,v=h(f,c);for(r=0;r<c;++r)n(v[r],this,t)}return!0},o.prototype.addListener=function(e,t){returnc(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){returnc(this,e,t,!0)},o.prototype.once=function(e,t){returnu(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){returnu(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){varn,r,i,o,s;if(u(t),void0===(r=this._events))returnthis;if(void0===(n=r[e]))returnthis;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(deleter[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));elseif("function"!=typeofn){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)returnthis;0===i?n.shift():y(n,i),1===n.length&&(r[e]=n[0]),void0!==r.removeListener&&this.emit("removeListener",e,s||t)}returnthiLine truncated
"use strict";functiont(t,e){varn=Object.keys(t);if(Object.getOwnPropertySymbols){vara=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(e){returnObject.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,a)}returnn}functione(e){for(vara=1;a<arguments.length;a++){vari=null!=arguments[a]?arguments[a]:{};a%2?t(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}returne}functionn(t,e,n){returneint?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}functiona(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functioni(t,e){for(varn=0;n<e.length;n++){vara=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"ina&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}functionr(t,e,n){returne&&i(t.prototype,e),n&&i(t,n),t}varh=require("buffer"),l=h.Buffer,s=require("util"),u=s.inspect,o=u&&u.custom||"inspect";functionc(t,e,n){l.prototype.copy.call(t,e,n)}module.exports=function(){functiont(){a(this,t),this.head=null,this.tail=null,this.length=0}returnr(t,[{key:"push",value:function(t){vare={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){vare={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){vart=this.head.data;return1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(vare=this.head,n=""+e.data;e=e.next;)n+=t+e.data;returnn}},{key:"concat",value:function(t){if(0===this.length)returnl.alloc(0);for(vare=l.allocUnsafe(t>>>0),n=this.head,a=0;n;)c(n.data,e,a),a+=n.data.length,n=n.next;returne}},{key:"consume",value:function(t,e){varn;returnt<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){returnthis.head.data}},{key:"_getString",value:function(t){vare=this.head,n=1,a=e.data;for(t-=a.length;e=e.next;){vari=e.data,r=t>i.length?i.length:t;if(r===i.length?a+=i:a+=i.slice(0,t),0===(t-=r)){r===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(r));break}++n}returnthis.length-=n,a}},{key:"_getBuffer",value:function(t){vare=l.allocUnsafe(t),n=this.head,a=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){vari=n.data,r=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,r),0===(t-=r)){r===i.length?(++a,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(r));break}++a}returnthis.length-=a,e}},{key:o,value:function(t,n){returnu(this,e({},n,{depth:0,customInspect:!1}))}}]),t}();
"use strict";functiont(n){return(t="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft})(n)}functionn(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}vare={};functiono(t,o,r){r||(r=Error);varc=function(t){functione(n,e,r){returnt.call(this,function(t,n,e){return"string"==typeofo?o:o(t,n,e)}(n,e,r))||this}returnn(e,t),e}(r);c.prototype.name=r.name,c.prototype.code=t,e[t]=c}functionr(t,n){if(Array.isArray(t)){vare=t.length;returnt=t.map(function(t){returnString(t)}),e>2?"one of ".concat(n," ").concat(t.slice(0,e-1).join(", "),", or ")+t[e-1]:2===e?"one of ".concat(n," ").concat(t[0]," or ").concat(t[1]):"of ".concat(n," ").concat(t[0])}return"of ".concat(n," ").concat(String(t))}functionc(t,n,e){returnt.substr(!e||e<0?0:+e,n.length)===n}functiona(t,n,e){return(void0===e||e>t.length)&&(e=t.length),t.substring(e-n.length,e)===n}functionu(t,n,e){return"number"!=typeofe&&(e=0),!(e+n.length>t.length)&&-1!==t.indexOf(n,e)}o("ERR_INVALID_OPT_VALUE",function(t,n){return'The value "'+n+'" is invalid for option "'+t+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(n,e,o){vari,E;if("string"==typeofe&&c(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",a(n," argument"))E="The ".concat(n," ").concat(i," ").concat(r(e,"type"));else{varf=u(n,".")?"property":"argument";E='The "'.concat(n,'" ').concat(f," ").concat(i," ").concat(r(e,"type"))}returnE+=". Received type ".concat(t(o))},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),module.exports.codes=e;
"use strict";vart=require("safe-buffer").Buffer,e=require("readable-stream").Transform,i=require("inherits");functionr(e,i){if(!t.isBuffer(e)&&"string"!=typeofe)thrownewTypeError(i+" must be a string or a buffer")}functiono(i){e.call(this),this._block=t.allocUnsafe(i),this._blockSize=i,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}i(o,e),o.prototype._transform=function(t,e,i){varr=null;try{this.update(t,e)}catch(o){r=o}i(r)},o.prototype._flush=function(t){vare=null;try{this.push(this.digest())}catch(i){e=i}t(e)},o.prototype.update=function(e,i){if(r(e,"Data"),this._finalized)thrownewError("Digest already called");t.isBuffer(e)||(e=t.from(e,i));for(varo=this._block,s=0;this._blockOffset+e.length-s>=this._blockSize;){for(varf=this._blockOffset;f<this._blockSize;)o[f++]=e[s++];this._update(),this._blockOffset=0}for(;s<e.length;)o[this._blockOffset++]=e[s++];for(varn=0,h=8*e.length;h>0;++n)this._length[n]+=h,(h=this._length[n]/4294967296|0)>0&&(this._length[n]-=4294967296*h);returnthis},o.prototype._update=function(){thrownewError("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)thrownewError("Digest already called");this._finalized=!0;vare=this._digest();void0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(vari=0;i<4;++i)this._length[i]=0;returne},o.prototype._digest=function(){thrownewError("_digest is not implemented")},module.exports=o;
vart=require("safe-buffer").Buffer;functioni(i,e){this._block=t.alloc(i),this._finalSize=e,this._blockSize=i,this._len=0}i.prototype.update=function(i,e){"string"==typeofi&&(e=e||"utf8",i=t.from(i,e));for(vars=this._block,o=this._blockSize,l=i.length,h=this._len,r=0;r<l;){for(var_=h%o,n=Math.min(l-r,o-_),c=0;c<n;c++)s[_+c]=i[r+c];r+=n,(h+=n)%o==0&&this._update(s)}returnthis._len+=l,this},i.prototype.digest=function(t){vari=this._len%this._blockSize;this._block[i]=128,this._block.fill(0,i+1),i>=this._finalSize&&(this._update(this._block),this._block.fill(0));vare=8*this._len;if(e<=4294967295)this._block.writeUInt32BE(e,this._blockSize-4);else{vars=(4294967295&e)>>>0,o=(e-s)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(s,this._blockSize-4)}this._update(this._block);varl=this._hash();returnt?l.toString(t):l},i.prototype._update=function(){thrownewError("_update must be implemented by subclass")},module.exports=i;
vare=module.exports=function(r){r=r.toLowerCase();vars=e[r];if(!s)thrownewError(r+" is not supported (we accept pull requests)");returnnews};e.sha=require("./sha"),e.sha1=require("./sha1"),e.sha224=require("./sha224"),e.sha256=require("./sha256"),e.sha384=require("./sha384"),e.sha512=require("./sha512");
varn=require("process");functione(e,r,t,c){if("function"!=typeofe)thrownewTypeError('"callback" argument must be a function');vari,l,u=arguments.length;switch(u){case0:case1:returnn.nextTick(e);case2:returnn.nextTick(function(){e.call(null,r)});case3:returnn.nextTick(function(){e.call(null,r,t)});case4:returnn.nextTick(function(){e.call(null,r,t,c)});default:for(i=newArray(u-1),l=0;l<i.length;)i[l++]=arguments[l];returnn.nextTick(function(){e.apply(null,i)})}}void0===n||!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?module.exports={nextTick:e}:module.exports=n;
varr=require("buffer"),e=r.Buffer;functionn(r,e){for(varninr)e[n]=r[n]}functiono(r,n,o){returne(r,n,o)}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?module.exports=r:(n(r,exports),exports.Buffer=o),n(e,o),o.from=function(r,n,o){if("number"==typeofr)thrownewTypeError("Argument must not be a number");returne(r,n,o)},o.alloc=function(r,n,o){if("number"!=typeofr)thrownewTypeError("Argument must be a number");varf=e(r);returnvoid0!==n?"string"==typeofo?f.fill(n,o):f.fill(n):f.fill(0),f},o.allocUnsafe=function(r){if("number"!=typeofr)thrownewTypeError("Argument must be a number");returne(r)},o.allocUnsafeSlow=function(e){if("number"!=typeofe)thrownewTypeError("Argument must be a number");returnr.SlowBuffer(e)};
"use strict";functiont(t,n){if(!(tinstanceofn))thrownewTypeError("Cannot call a class as a function")}varn=require("safe-buffer").Buffer,e=require("util");functioni(t,n,e){t.copy(n,e)}module.exports=function(){functione(){t(this,e),this.head=null,this.tail=null,this.length=0}returne.prototype.push=function(t){varn={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},e.prototype.unshift=function(t){varn={data:t,next:this.head};0===this.length&&(this.tail=n),this.head=n,++this.length},e.prototype.shift=function(){if(0!==this.length){vart=this.head.data;return1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(t){if(0===this.length)return"";for(varn=this.head,e=""+n.data;n=n.next;)e+=t+n.data;returne},e.prototype.concat=function(t){if(0===this.length)returnn.alloc(0);if(1===this.length)returnthis.head.data;for(vare=n.allocUnsafe(t>>>0),h=this.head,a=0;h;)i(h.data,e,a),a+=h.data.length,h=h.next;returne},e}(),e&&e.inspect&&e.inspect.custom&&(module.exports.prototype[e.inspect.custom]=function(){vart=e.inspect({length:this.length});returnthis.constructor.name+" "+t});
vare=require("process"),t=arguments[3],n=require("process-nextick-args");functionr(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}functioni(e){vart=this;this.next=null,this.entry=null,this.finish=function(){W(t,e)}}module.exports=g;varo,s=n.nextTick;g.WritableState=y;varf=Object.create(require("core-util-is"));f.inherits=require("inherits");varu={deprecate:require("util-deprecate")},a=require("./internal/streams/stream"),c=require("safe-buffer").Buffer,l=t.Uint8Array||function(){};functiond(e){returnc.from(e)}functionh(e){returnc.isBuffer(e)||einstanceofl}varb,p=require("./internal/streams/destroy");functionw(){}functiony(e,t){o=o||require("./_stream_duplex"),e=e||{};varn=tinstanceofo;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);varr=e.highWaterMark,s=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(s||0===s)?s:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;varu=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){S(t,e)},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=newi(this)}functiong(e){if(o=o||require("./_stream_duplex"),!(b.call(g,this)||thisinstanceofo))returnnewg(e);this._writableState=newy(e,this),this.writable=!0,e&&("function"==typeofe.write&&(this._write=e.write),"function"==typeofe.writev&&(this._writev=e.writev),"function"==typeofe.destroy&&(this._destroy=e.destroy),"function"==typeofe.final&&(this._final=e.final)),a.call(this)}functionk(e,t){varr=newError("write after end");e.emit("error",r),n.nextTick(t,r)}functionv(e,t,r,i){varo=!0,s=!1;returnnull===r?s=newTypeError("May not write null values to stream"):"string"==typeofr||void0===r||t.objectMode||(s=newTypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),n.nextTick(i,s),o=!1),o}functionq(e,t,n){returne.objectMode||!1===e.decodeStrings||"string"!=typeoft||(t=c.from(t,n)),t}function_(e,t,n,r,i,o){if(!n){vars=q(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}varf=t.objectMode?1:r.length;t.length+=f;varu=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){vara=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},a?a.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}elsem(e,t,!1,f,r,i,o);returnu}functionm(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}functionR(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(o(i),e._writableState.errorEmitted=!0,e.emit("error",i),T(e,t))}functionx(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}functionS(e,t){varn=e._writableState,r=n.sync,i=n.writecb;if(x(n),t)R(e,n,r,t,i);else{varo=E(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||B(e,n),r?s(M,e,n,o,i):M(e,n,o,i)}}functionM(e,t,n,r){n||j(e,t),t.pendingcb--,r(),T(e,t)}functionj(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}functionB(e,t){t.bufferProcessing=!0;varn=t.bufferedRequest;if(e._writev&&n&&n.next){varr=t.bufferedRequestCount,o=newArray(r),s=t.corkedRequestsFree;s.entry=n;for(varf=0,u=!0;n;)o[f]=n,n.isBuf||(u=!1),n=n.next,f+=1;o.allBuffers=u,m(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=newi(t),t.bufferedRequestCount=0}else{for(;n;){vara=n.chunk,c=n.encoding,l=n.callback;if(m(e,t,!1,t.objectMode?1:a.length,a,c,l),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}functionE(e){returne.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}functionC(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}functionP(e,t){t.prefinished||t.finalCalled||("function"==typeofe._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(C,e,t)):(t.prefinished=!0,e.emit("prefinish")))}functionT(e,t){varn=E(t);returnn&&(P(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}functionF(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}functionW(e,t,n){varr=e.entry;for(e.entry=null;r;){vari=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}f.inherits(g,a),y.prototype.getBuffer=function(){for(vare=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;returnt},functioLine truncated
vare=arguments[3],t=require("process"),n=require("process-nextick-args");module.exports=_;varr,i=require("isarray");_.ReadableState=w;vara=require("events").EventEmitter,d=function(e,t){returne.listeners(t).length},o=require("./internal/streams/stream"),s=require("safe-buffer").Buffer,u=e.Uint8Array||function(){};functionl(e){returns.from(e)}functionh(e){returns.isBuffer(e)||einstanceofu}varp=Object.create(require("core-util-is"));p.inherits=require("inherits");varf=require("util"),c=void0;c=f&&f.debuglog?f.debuglog("stream"):function(){};varg,b=require("./internal/streams/BufferList"),m=require("./internal/streams/destroy");p.inherits(_,o);varv=["error","close","destroy","pause","resume"];functiony(e,t,n){if("function"==typeofe.prependListener)returne.prependListener(t,n);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}functionw(e,t){e=e||{};varn=tinstanceof(r=r||require("./_stream_duplex"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);vari=e.highWaterMark,a=e.readableHighWaterMark,d=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:d,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=newb,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(g||(g=require("string_decoder/").StringDecoder),this.decoder=newg(e.encoding),this.encoding=e.encoding)}function_(e){if(r=r||require("./_stream_duplex"),!(thisinstanceof_))returnnew_(e);this._readableState=neww(e,this),this.readable=!0,e&&("function"==typeofe.read&&(this._read=e.read),"function"==typeofe.destroy&&(this._destroy=e.destroy)),o.call(this)}functionM(e,t,n,r,i){vara,d=e._readableState;null===t?(d.reading=!1,x(e,d)):(i||(a=k(d,t)),a?e.emit("error",a):d.objectMode||t&&t.length>0?("string"==typeoft||d.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=l(t)),r?d.endEmitted?e.emit("error",newError("stream.unshift() after end event")):S(e,d,t,!0):d.ended?e.emit("error",newError("stream.push() after EOF")):(d.reading=!1,d.decoder&&!n?(t=d.decoder.write(t),d.objectMode||0!==t.length?S(e,d,t,!1):C(e,d)):S(e,d,t,!1))):r||(d.reading=!1));returnj(d)}functionS(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&q(e)),C(e,t)}functionk(e,t){varn;returnh(t)||"string"==typeoft||void0===t||e.objectMode||(n=newTypeError("Invalid non-string/buffer chunk")),n}functionj(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}Object.defineProperty(_.prototype,"destroyed",{get:function(){returnvoid0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){varn,r=this._readableState;returnr.objectMode?n=!0:"string"==typeofe&&((t=t||r.defaultEncoding)!==r.encoding&&(e=s.from(e,t),t=""),n=!0),M(this,e,t,!1,n)},_.prototype.unshift=function(e){returnM(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){returng||(g=require("string_decoder/").StringDecoder),this._readableState.decoder=newg(e),this._readableState.encoding=e,this};varR=8388608;functionE(e){returne>=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}functionL(e,t){returne<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=E(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}functionx(e,t){if(!t.ended){if(t.decoder){varn=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,q(e)}}functionq(e){vart=e._readableState;t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(W,e):W(e))}functionW(e){c("emit readable"),e.emit("readable"),B(e)}functionC(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(D,e,t))}functionD(e,t){for(varn=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(c("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}functionO(e){returnfunction(){vart=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&d(e,"data")&&(t.flowing=!0,B(e))}}functionT(e){c("readable nexttick read 0"),e.read(0)}functionU(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(P,e,t))}functionP(e,t){t.reading||(c("Line truncated
"use strict";module.exports=n;vart=require("./_stream_duplex"),r=Object.create(require("core-util-is"));functione(t,r){vare=this._transformState;e.transforming=!1;varn=e.writecb;if(!n)returnthis.emit("error",newError("write callback called multiple times"));e.writechunk=null,e.writecb=null,null!=r&&this.push(r),n(t);vari=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}functionn(r){if(!(thisinstanceofn))returnnewn(r);t.call(this,r),this._transformState={afterTransform:e.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&("function"==typeofr.transform&&(this._transform=r.transform),"function"==typeofr.flush&&(this._flush=r.flush)),this.on("prefinish",i)}functioni(){vart=this;"function"==typeofthis._flush?this._flush(function(r,e){a(t,r,e)}):a(this,null,null)}functiona(t,r,e){if(r)returnt.emit("error",r);if(null!=e&&t.push(e),t._writableState.length)thrownewError("Calling transform done when ws.length != 0");if(t._transformState.transforming)thrownewError("Calling transform done when still transforming");returnt.push(null)}r.inherits=require("inherits"),r.inherits(n,t),n.prototype.push=function(r,e){returnthis._transformState.needTransform=!1,t.prototype.push.call(this,r,e)},n.prototype._transform=function(t,r,e){thrownewError("_transform() is not implemented")},n.prototype._write=function(t,r,e){varn=this._transformState;if(n.writecb=e,n.writechunk=t,n.writeencoding=r,!n.transforming){vari=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},n.prototype._read=function(t){varr=this._transformState;null!==r.writechunk&&r.writecb&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0},n.prototype._destroy=function(r,e){varn=this;t.prototype._destroy.call(this,r,function(t){e(t),n.emit("close")})};
vart=require("safe-buffer").Buffer,i=require("stream").Transform,r=require("string_decoder").StringDecoder,e=require("inherits");functionn(t){i.call(this),this.hashMode="string"==typeoft,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e(n,i),n.prototype.update=function(i,r,e){"string"==typeofi&&(i=t.from(i,r));varn=this._update(i);returnthis.hashMode?this:(e&&(n=this._toString(n,e)),n)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){thrownewError("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){thrownewError("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){thrownewError("trying to set aad in unsupported state")},n.prototype._transform=function(t,i,r){vare;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(n){e=n}finally{r(e)}},n.prototype._flush=function(t){vari;try{this.push(this.__final())}catch(r){i=r}t(i)},n.prototype._finalOrDigest=function(i){varr=this.__final()||t.alloc(0);returni&&(r=this._toString(r,i,!0)),r},n.prototype._toString=function(t,i,e){if(this._decoder||(this._decoder=newr(i),this._encoding=i),this._encoding!==i)thrownewError("can't switch encodings");varn=this._decoder.write(t);returne&&(n+=this._decoder.end()),n},module.exports=n;
varr=Math.pow(2,30)-1;module.exports=function(e,o){if("number"!=typeofe)thrownewTypeError("Iterations not a number");if(e<0)thrownewTypeError("Bad iterations");if("number"!=typeofo)thrownewTypeError("Key length not a number");if(o<0||o>r||o!=o)thrownewTypeError("Bad key length")};
varr=require("safe-buffer").Buffer;module.exports=function(e,f,u){if(r.isBuffer(e))returne;if("string"==typeofe)returnr.from(e,f);if(ArrayBuffer.isView(e))returnr.from(e.buffer);thrownewTypeError(u+" must be a string, a Buffer, a typed array or a DataView")};
vare,r,t=arguments[3],n=require("safe-buffer").Buffer,o=require("./precondition"),i=require("./default-encoding"),u=require("./sync"),s=require("./to-buffer"),c=t.crypto&&t.crypto.subtle,a={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"},f=[];functionh(r){if(t.process&&!t.process.browser)returnPromise.resolve(!1);if(!c||!c.importKey||!c.deriveBits)returnPromise.resolve(!1);if(void0!==f[r])returnf[r];varo=m(e=e||n.alloc(8),e,10,128,r).then(function(){return!0}).catch(function(){return!1});returnf[r]=o,o}functionl(){returnr||(r=t.process&&t.process.nextTick?t.process.nextTick:t.queueMicrotask?t.queueMicrotask:t.setImmediate?t.setImmediate:t.setTimeout)}functionm(e,r,t,o,i){returnc.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){returnc.deriveBits({name:"PBKDF2",salt:r,iterations:t,hash:{name:i}},e,o<<3)}).then(function(e){returnn.from(e)})}functionp(e,r){e.then(function(e){l()(function(){r(null,e)})},function(e){l()(function(){r(e)})})}module.exports=function(e,r,n,c,f,d){"function"==typeoff&&(d=f,f=void0);varv=a[(f=f||"sha1").toLowerCase()];if(v&&"function"==typeoft.Promise){if(o(n,c),e=s(e,i,"Password"),r=s(r,i,"Salt"),"function"!=typeofd)thrownewError("No callback provided to pbkdf2");p(h(v).then(function(t){returnt?m(e,r,n,c,v):u(e,r,n,c,f)}),d)}elsel()(function(){vart;try{t=u(e,r,n,c,f)}catch(o){returnd(o)}d(null,t)})};
"use strict";vart=require("minimalistic-assert");functionf(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=newArray(this.blockSize),this.bufferOff=0}module.exports=f,f.prototype._init=function(){},f.prototype.update=function(t){return0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},f.prototype._buffer=function(t,f){for(vare=Math.min(this.buffer.length-this.bufferOff,t.length-f),r=0;r<e;r++)this.buffer[this.bufferOff+r]=t[f+r];returnthis.bufferOff+=e,e},f.prototype._flushBuffer=function(t,f){returnthis._update(this.buffer,0,t,f),this.bufferOff=0,this.blockSize},f.prototype._updateEncrypt=function(t){varf=0,e=0,r=(this.bufferOff+t.length)/this.blockSize|0,i=newArray(r*this.blockSize);0!==this.bufferOff&&(f+=this._buffer(t,f),this.bufferOff===this.buffer.length&&(e+=this._flushBuffer(i,e)));for(varh=t.length-(t.length-f)%this.blockSize;f<h;f+=this.blockSize)this._update(t,f,i,e),e+=this.blockSize;for(;f<t.length;f++,this.bufferOff++)this.buffer[this.bufferOff]=t[f];returni},f.prototype._updateDecrypt=function(t){for(varf=0,e=0,r=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=newArray(r*this.blockSize);r>0;r--)f+=this._buffer(t,f),e+=this._flushBuffer(i,e);returnf+=this._buffer(t,f),i},f.prototype.final=function(t){varf,e;returnt&&(f=this.update(t)),e="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),f?f.concat(e):e},f.prototype._pad=function(t,f){if(0===f)return!1;for(;f<t.length;)t[f++]=0;return!0},f.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];vart=newArray(this.blockSize);returnthis._update(this.buffer,0,t,0),t},f.prototype._unpad=function(t){returnt},f.prototype._finalDecrypt=function(){t.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");varf=newArray(this.blockSize);returnthis._flushBuffer(f,0),this._unpad(f)};
"use strict";vart=require("minimalistic-assert"),i=require("inherits"),e={};functionr(i){t.equal(i.length,8,"Invalid IV length"),this.iv=newArray(8);for(vare=0;e<this.iv.length;e++)this.iv[e]=i[e]}functionn(t){functionr(i){t.call(this,i),this._cbcInit()}i(r,t);for(varn=Object.keys(e),s=0;s<n.length;s++){varc=n[s];r.prototype[c]=e[c]}returnr.create=function(t){returnnewr(t)},r}exports.instantiate=n,e._cbcInit=function(){vart=newr(this.options.iv);this._cbcState=t},e._update=function(t,i,e,r){varn=this._cbcState,s=this.constructor.super_.prototype,c=n.iv;if("encrypt"===this.type){for(varo=0;o<this.blockSize;o++)c[o]^=t[i+o];s._update.call(this,c,0,e,r);for(o=0;o<this.blockSize;o++)c[o]=e[r+o]}else{s._update.call(this,t,i,e,r);for(o=0;o<this.blockSize;o++)e[r+o]^=c[o];for(o=0;o<this.blockSize;o++)c[o]=t[i+o]}};
vart=require("./aes"),e=require("safe-buffer").Buffer,r=require("cipher-base"),h=require("inherits"),a=require("./ghash"),i=require("buffer-xor"),n=require("./incr32");functions(t,e){varr=0;t.length!==e.length&&r++;for(varh=Math.min(t.length,e.length),a=0;a<h;++a)r+=t[a]^e[a];returnr}functiono(t,r,h){if(12===r.length)returnt._finID=e.concat([r,e.from([0,0,0,1])]),e.concat([r,e.from([0,0,0,2])]);vari=newa(h),s=r.length,o=s%16;i.update(r),o&&(o=16-o,i.update(e.alloc(o,0))),i.update(e.alloc(8,0));varu=8*s,l=e.alloc(8);l.writeUIntBE(u,0,8),i.update(l),t._finID=i.state;varc=e.from(t._finID);returnn(c),c}functionu(h,i,n,s){r.call(this);varu=e.alloc(4,0);this._cipher=newt.AES(i);varl=this._cipher.encryptBlock(u);this._ghash=newa(l),n=o(this,n,l),this._prev=e.from(n),this._cache=e.allocUnsafe(0),this._secCache=e.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=h,this._authTag=null,this._called=!1}h(u,r),u.prototype._update=function(t){if(!this._called&&this._alen){varr=16-this._alen%16;r<16&&(r=e.alloc(r,0),this._ghash.update(r))}this._called=!0;varh=this._mode.encrypt(this,t);returnthis._decrypt?this._ghash.update(t):this._ghash.update(h),this._len+=t.length,h},u.prototype._final=function(){if(this._decrypt&&!this._authTag)thrownewError("Unsupported state or unable to authenticate data");vart=i(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&s(t,this._authTag))thrownewError("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},u.prototype.getAuthTag=function(){if(this._decrypt||!e.isBuffer(this._authTag))thrownewError("Attempting to get auth tag in unsupported state");returnthis._authTag},u.prototype.setAuthTag=function(t){if(!this._decrypt)thrownewError("Attempting to set auth tag in unsupported state");this._authTag=t},u.prototype.setAAD=function(t){if(this._called)thrownewError("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},module.exports=u;
vare=require("safe-buffer").Buffer,r=require("md5.js");functiont(t,a,f,l){if(e.isBuffer(t)||(t=e.from(t,"binary")),a&&(e.isBuffer(a)||(a=e.from(a,"binary")),8!==a.length))thrownewRangeError("salt should be Buffer with 8 byte length");for(varn=f/8,i=e.alloc(n),o=e.alloc(l||0),u=e.alloc(0);n>0||l>0;){varh=newr;h.update(u),h.update(t),a&&h.update(a),u=h.digest();varg=0;if(n>0){vars=i.length-n;g=Math.min(n,u.length),u.copy(i,s,0,g),n-=g}if(g<u.length&&l>0){vard=o.length-l,v=Math.min(l,u.length-g);u.copy(o,d,g,g+v),l-=v}}returnu.fill(0),{key:i,iv:o}}module.exports=t;
vare=require("./modes"),t=require("./authCipher"),r=require("safe-buffer").Buffer,i=require("./streamCipher"),n=require("cipher-base"),h=require("./aes"),o=require("evp_bytestokey"),a=require("inherits");functionc(e,t,i){n.call(this),this._cache=newu,this._cipher=newh.AES(t),this._prev=r.from(i),this._mode=e,this._autopadding=!0}a(c,n),c.prototype._update=function(e){vart,i;this._cache.add(e);for(varn=[];t=this._cache.get();)i=this._mode.encrypt(this,t),n.push(i);returnr.concat(n)};vars=r.alloc(16,16);functionu(){this.cache=r.allocUnsafe(0)}functionp(n,h,o){vara=e[n.toLowerCase()];if(!a)thrownewTypeError("invalid suite type");if("string"==typeofh&&(h=r.from(h)),h.length!==a.key/8)thrownewTypeError("invalid key length "+h.length);if("string"==typeofo&&(o=r.from(o)),"GCM"!==a.mode&&o.length!==a.iv)thrownewTypeError("invalid iv length "+o.length);return"stream"===a.type?newi(a.module,h,o):"auth"===a.type?newt(a.module,h,o):newc(a.module,h,o)}functionf(t,r){vari=e[t.toLowerCase()];if(!i)thrownewTypeError("invalid suite type");varn=o(r,!1,i.key,i.iv);returnp(t,n.key,n.iv)}c.prototype._final=function(){vare=this._cache.flush();if(this._autopadding)returne=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(s))throwthis._cipher.scrub(),newError("data not multiple of block length")},c.prototype.setAutoPadding=function(e){returnthis._autopadding=!!e,this},u.prototype.add=function(e){this.cache=r.concat([this.cache,e])},u.prototype.get=function(){if(this.cache.length>15){vare=this.cache.slice(0,16);returnthis.cache=this.cache.slice(16),e}returnnull},u.prototype.flush=function(){for(vare=16-this.cache.length,t=r.allocUnsafe(e),i=-1;++i<e;)t.writeUInt8(e,i);returnr.concat([this.cache,t])},exports.createCipheriv=p,exports.createCipher=f;
vare=require("./authCipher"),t=require("safe-buffer").Buffer,r=require("./modes"),i=require("./streamCipher"),h=require("cipher-base"),n=require("./aes"),o=require("evp_bytestokey"),a=require("inherits");functionc(e,r,i){h.call(this),this._cache=news,this._last=void0,this._cipher=newn.AES(r),this._prev=t.from(i),this._mode=e,this._autopadding=!0}functions(){this.cache=t.allocUnsafe(0)}functionu(e){vart=e[15];if(t<1||t>16)thrownewError("unable to decrypt data");for(varr=-1;++r<t;)if(e[r+(16-t)]!==t)thrownewError("unable to decrypt data");if(16!==t)returne.slice(0,16-t)}functionp(h,n,o){vara=r[h.toLowerCase()];if(!a)thrownewTypeError("invalid suite type");if("string"==typeofo&&(o=t.from(o)),"GCM"!==a.mode&&o.length!==a.iv)thrownewTypeError("invalid iv length "+o.length);if("string"==typeofn&&(n=t.from(n)),n.length!==a.key/8)thrownewTypeError("invalid key length "+n.length);return"stream"===a.type?newi(a.module,n,o,!0):"auth"===a.type?newe(a.module,n,o,!0):newc(a.module,n,o)}functionf(e,t){vari=r[e.toLowerCase()];if(!i)thrownewTypeError("invalid suite type");varh=o(t,!1,i.key,i.iv);returnp(e,h.key,h.iv)}a(c,h),c.prototype._update=function(e){varr,i;this._cache.add(e);for(varh=[];r=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,r),h.push(i);returnt.concat(h)},c.prototype._final=function(){vare=this._cache.flush();if(this._autopadding)returnu(this._mode.decrypt(this,e));if(e)thrownewError("data not multiple of block length")},c.prototype.setAutoPadding=function(e){returnthis._autopadding=!!e,this},s.prototype.add=function(e){this.cache=t.concat([this.cache,e])},s.prototype.get=function(e){vart;if(e){if(this.cache.length>16)returnt=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}elseif(this.cache.length>=16)returnt=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;returnnull},s.prototype.flush=function(){if(this.cache.length)returnthis.cache},exports.createDecipher=f,exports.createDecipheriv=p;
vare=require("browserify-des"),r=require("browserify-aes/browser"),i=require("browserify-aes/modes"),t=require("browserify-des/modes"),o=require("evp_bytestokey");functions(e,r){vars,p;if(e=e.toLowerCase(),i[e])s=i[e].key,p=i[e].iv;else{if(!t[e])thrownewTypeError("invalid suite type");s=8*t[e].key,p=t[e].iv}varv=o(r,!1,s,p);returnn(e,v.key,v.iv)}functionp(e,r){vars,p;if(e=e.toLowerCase(),i[e])s=i[e].key,p=i[e].iv;else{if(!t[e])thrownewTypeError("invalid suite type");s=8*t[e].key,p=t[e].iv}varn=o(r,!1,s,p);returnv(e,n.key,n.iv)}functionn(o,s,p){if(o=o.toLowerCase(),i[o])returnr.createCipheriv(o,s,p);if(t[o])returnnewe({key:s,iv:p,mode:o});thrownewTypeError("invalid suite type")}functionv(o,s,p){if(o=o.toLowerCase(),i[o])returnr.createDecipheriv(o,s,p);if(t[o])returnnewe({key:s,iv:p,mode:o,decrypt:!0});thrownewTypeError("invalid suite type")}functiony(){returnObject.keys(t).concat(r.getCiphers())}exports.createCipher=exports.Cipher=s,exports.createCipheriv=exports.Cipheriv=n,exports.createDecipher=exports.Decipher=p,exports.createDecipheriv=exports.Decipheriv=v,exports.listCiphers=exports.getCiphers=y;
vart=require("buffer").Buffer;!function(t,i){"use strict";functionr(t,i){if(!t)thrownewError(i||"Assertion failed")}functionn(t,i){t.super_=i;varr=function(){};r.prototype=i.prototype,t.prototype=newr,t.prototype.constructor=t}functionh(t,i,r){if(h.isBN(t))returnt;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}vare;"object"==typeoft?t.exports=h:i.BN=h,h.BN=h,h.wordSize=26;try{e="undefined"!=typeofwindow&&void0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(B){}functiono(t,i){varn=t.charCodeAt(i);returnn>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:voidr(!1,"Invalid character in "+t)}functions(t,i,r){varn=o(t,r);returnr-1>=i&&(n|=o(t,r-1)<<4),n}functionu(t,i,n,h){for(vare=0,o=0,s=Math.min(t.length,n),u=i;u<s;u++){vara=t.charCodeAt(u)-48;e*=h,o=a>=49?a-49+10:a>=17?a-17+10:a,r(a>=0&&o<h,"Invalid character"),e+=o}returne}functiona(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}if(h.isBN=function(t){returntinstanceofh||null!==t&&"object"==typeoft&&t.constructor.wordSize===h.wordSize&&Array.isArray(t.words)},h.max=function(t,i){returnt.cmp(i)>0?t:i},h.min=function(t,i){returnt.cmp(i)<0?t:i},h.prototype._init=function(t,i,n){if("number"==typeoft)returnthis._initNumber(t,i,n);if("object"==typeoft)returnthis._initArray(t,i,n);"hex"===i&&(i=16),r(i===(0|i)&&i>=2&&i<=36);varh=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(h++,this.negative=1),h<t.length&&(16===i?this._parseHex(t,h,n):(this._parseBase(t,i,h),"le"===n&&this._initArray(this.toArray(),i,n)))},h.prototype._initNumber=function(t,i,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),i,n)},h.prototype._initArray=function(t,i,n){if(r("number"==typeoft.length),t.length<=0)returnthis.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=newArray(this.length);for(varh=0;h<this.length;h++)this.words[h]=0;vare,o,s=0;if("be"===n)for(h=t.length-1,e=0;h>=0;h-=3)o=t[h]|t[h-1]<<8|t[h-2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);elseif("le"===n)for(h=0,e=0;h<t.length;h+=3)o=t[h]|t[h+1]<<8|t[h+2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);returnthis._strip()},h.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=newArray(this.length);for(varn=0;n<this.length;n++)this.words[n]=0;varh,e=0,o=0;if("be"===r)for(n=t.length-1;n>=i;n-=2)h=s(t,i,n)<<e,this.words[o]|=67108863&h,e>=18?(e-=18,o+=1,this.words[o]|=h>>>26):e+=8;elsefor(n=(t.length-i)%2==0?i+1:i;n<t.length;n+=2)h=s(t,i,n)<<e,this.words[o]|=67108863&h,e>=18?(e-=18,o+=1,this.words[o]|=h>>>26):e+=8;this._strip()},h.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(varn=0,h=1;h<=67108863;h*=i)n++;n--,h=h/i|0;for(vare=t.length-r,o=e%n,s=Math.min(e,e-o)+r,a=0,l=r;l<s;l+=n)a=u(t,l,l+n,i),this.imuln(h),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==o){varm=1;for(a=u(t,l,t.length,i),l=0;l<o;l++)m*=i;this.imuln(m),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}this._strip()},h.prototype.copy=function(t){t.words=newArray(this.length);for(vari=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},h.prototype._move=function(t){a(t,this)},h.prototype.clone=function(){vart=newh(null);returnthis.copy(t),t},h.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;returnthis},h.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;returnthis._normSign()},h.prototype._normSign=function(){return1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeofSymbol&&"function"==typeofSymbol.for)try{h.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(B){h.prototype.inspect=l}elseh.prototype.inspect=l;functionl(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}varm=["","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"],f=[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],d=[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,2Line truncated
"use strict";vart=require("bn.js"),r=require("inherits"),e=require("./base"),i=require("../utils");functiono(r){e.call(this,"mont",r),this.a=newt(r.a,16).toRed(this.red),this.b=newt(r.b,16).toRed(this.red),this.i4=newt(4).toRed(this.red).redInvm(),this.two=newt(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}functionn(r,i,o){e.BasePoint.call(this,r,"projective"),null===i&&null===o?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=newt(i,16),this.z=newt(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(o,e),module.exports=o,o.prototype.validate=function(t){varr=t.normalize().x,e=r.redSqr(),i=e.redMul(r).redAdd(e.redMul(this.a)).redAdd(r);return0===i.redSqrt().redSqr().cmp(i)},r(n,e.BasePoint),o.prototype.decodePoint=function(t,r){returnthis.point(i.toArray(t,r),1)},o.prototype.point=function(t,r){returnnewn(this,t,r)},o.prototype.pointFromJSON=function(t){returnn.fromJSON(this,t)},n.prototype.precompute=function(){},n.prototype._encode=function(){returnthis.getX().toArray("be",this.curve.p.byteLength())},n.fromJSON=function(t,r){returnnewn(t,r[0],r[1]||t.one)},n.prototype.inspect=function(){returnthis.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},n.prototype.isInfinity=function(){return0===this.z.cmpn(0)},n.prototype.dbl=function(){vart=this.x.redAdd(this.z).redSqr(),r=this.x.redSub(this.z).redSqr(),e=t.redSub(r),i=t.redMul(r),o=e.redMul(r.redAdd(this.curve.a24.redMul(e)));returnthis.curve.point(i,o)},n.prototype.add=function(){thrownewError("Not supported on Montgomery curve")},n.prototype.diffAdd=function(t,r){vare=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),n=t.x.redSub(t.z).redMul(e),d=o.redMul(i),u=r.z.redMul(n.redAdd(d).redSqr()),s=r.x.redMul(n.redISub(d).redSqr());returnthis.curve.point(u,s)},n.prototype.mul=function(t){for(varr=t.clone(),e=this,i=this.curve.point(null,null),o=[];0!==r.cmpn(0);r.iushrn(1))o.push(r.andln(1));for(varn=o.length-1;n>=0;n--)0===o[n]?(e=e.diffAdd(i,this),i=i.dbl()):(i=e.diffAdd(i,this),e=e.dbl());returni},n.prototype.mulAdd=function(){thrownewError("Not supported on Montgomery curve")},n.prototype.jumlAdd=function(){thrownewError("Not supported on Montgomery curve")},n.prototype.eq=function(t){return0===this.getX().cmp(t.getX())},n.prototype.normalize=function(){returnthis.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},n.prototype.getX=function(){returnthis.normalize(),this.x.fromRed()};
"use strict";vart=require("bn.js"),i=require("../utils"),e=i.assert;functionr(t,i){this.ec=t,this.priv=null,this.pub=null,i.priv&&this._importPrivate(i.priv,i.privEnc),i.pub&&this._importPublic(i.pub,i.pubEnc)}module.exports=r,r.fromPublic=function(t,i,e){returniinstanceofr?i:newr(t,{pub:i,pubEnc:e})},r.fromPrivate=function(t,i,e){returniinstanceofr?i:newr(t,{priv:i,privEnc:e})},r.prototype.validate=function(){vart=this.getPublic();returnt.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},r.prototype.getPublic=function(t,i){return"string"==typeoft&&(i=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),i?this.pub.encode(i,t):this.pub},r.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(i,e){this.priv=newt(i,e||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(t,i){if(t.x||t.y)return"mont"===this.ec.curve.type?e(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||e(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,i)},r.prototype.derive=function(t){returnt.validate()||e(t.validate(),"public point not validated"),t.mul(this.priv).getX()},r.prototype.sign=function(t,i,e){returnthis.ec.sign(t,this,i,e)},r.prototype.verify=function(t,i){returnthis.ec.verify(t,i,this)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};
"use strict";varr=require("bn.js"),e=require("../utils"),t=e.assert;functionn(e,a){if(einstanceofn)returne;this._importDER(e,a)||(t(e.r&&e.s,"Signature without r or s"),this.r=newr(e.r,16),this.s=newr(e.s,16),void0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}functiona(){this.place=0}functioni(r,e){vart=r[e.place++];if(!(128&t))returnt;varn=15&t;if(0===n||n>4)return!1;for(vara=0,i=0,c=e.place;i<n;i++,c++)a<<=8,a|=r[c],a>>>=0;return!(a<=127)&&(e.place=c,a)}functionc(r){for(vare=0,t=r.length-1;!r[e]&&!(128&r[e+1])&&e<t;)e++;return0===e?r:r.slice(e)}functiono(r,e){if(e<128)r.push(e);else{vart=1+(Math.log(e)/Math.LN2>>>3);for(r.push(128|t);--t;)r.push(e>>>(t<<3)&255);r.push(e)}}module.exports=n,n.prototype._importDER=function(t,n){t=e.toArray(t,n);varc=newa;if(48!==t[c.place++])return!1;varo=i(t,c);if(!1===o)return!1;if(o+c.place!==t.length)return!1;if(2!==t[c.place++])return!1;varu=i(t,c);if(!1===u)return!1;vars=t.slice(c.place,u+c.place);if(c.place+=u,2!==t[c.place++])return!1;varl=i(t,c);if(!1===l)return!1;if(t.length!==l+c.place)return!1;varf=t.slice(c.place,l+c.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}returnthis.r=newr(s),this.s=newr(f),this.recoveryParam=null,!0},n.prototype.toDER=function(r){vart=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=c(t),n=c(n);!(n[0]||128&n[1]);)n=n.slice(1);vara=[2];o(a,t.length),(a=a.concat(t)).push(2),o(a,n.length);vari=a.concat(n),u=[48];returno(u,i.length),u=u.concat(i),e.encode(u,r)};
"use strict";vare=require("bn.js"),r=require("hmac-drbg"),t=require("../utils"),n=require("../curves"),i=require("brorand"),s=t.assert,o=require("./key"),u=require("./signature");functionh(e){if(!(thisinstanceofh))returnnewh(e);"string"==typeofe&&(s(Object.prototype.hasOwnProperty.call(n,e),"Unknown curve "+e),e=n[e]),einstanceofn.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}module.exports=h,h.prototype.keyPair=function(e){returnnewo(this,e)},h.prototype.keyFromPrivate=function(e,r){returno.fromPrivate(this,e,r)},h.prototype.keyFromPublic=function(e,r){returno.fromPublic(this,e,r)},h.prototype.genKeyPair=function(t){t||(t={});for(varn=newr({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||i(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),s=this.n.byteLength(),o=this.n.sub(newe(2));;){varu=newe(n.generate(s));if(!(u.cmp(o)>0))returnu.iaddn(1),this.keyFromPrivate(u)}},h.prototype._truncateToN=function(e,r){vart=8*e.byteLength()-this.n.bitLength();returnt>0&&(e=e.ushrn(t)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(t,n,i,s){"object"==typeofi&&(s=i,i=null),s||(s={}),n=this.keyFromPrivate(n,i),t=this._truncateToN(newe(t,16));for(varo=this.n.byteLength(),h=n.getPrivate().toArray("be",o),c=t.toArray("be",o),a=newr({hash:this.hash,entropy:h,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),p=this.n.sub(newe(1)),m=0;;m++){varv=s.k?s.k(m):newe(a.generate(this.n.byteLength()));if(!((v=this._truncateToN(v,!0)).cmpn(1)<=0||v.cmp(p)>=0)){vary=this.g.mul(v);if(!y.isInfinity()){varf=y.getX(),g=f.umod(this.n);if(0!==g.cmpn(0)){vard=v.invm(this.n).mul(g.mul(n.getPrivate()).iadd(t));if(0!==(d=d.umod(this.n)).cmpn(0)){varl=(y.getY().isOdd()?1:0)|(0!==f.cmp(g)?2:0);returns.canonical&&d.cmp(this.nh)>0&&(d=this.n.sub(d),l^=1),newu({r:g,s:d,recoveryParam:l})}}}}}},h.prototype.verify=function(r,t,n,i){r=this._truncateToN(newe(r,16)),n=this.keyFromPublic(n,i);vars=(t=newu(t,"hex")).r,o=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;varh,c=o.invm(this.n),a=c.mul(r).umod(this.n),p=c.mul(s).umod(this.n);returnthis.curve._maxwellTrick?!(h=this.g.jmulAdd(a,n.getPublic(),p)).isInfinity()&&h.eqXToP(s):!(h=this.g.mulAdd(a,n.getPublic(),p)).isInfinity()&&0===h.getX().umod(this.n).cmp(s)},h.prototype.recoverPubKey=function(r,t,n,i){s((3&n)===n,"The recovery param is more than two bits"),t=newu(t,i);varo=this.n,h=newe(r),c=t.r,a=t.s,p=1&n,m=n>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&m)thrownewError("Unable to find sencond key candinate");c=m?this.curve.pointFromX(c.add(this.curve.n),p):this.curve.pointFromX(c,p);varv=t.r.invm(o),y=o.sub(h).mul(v).umod(o),f=a.mul(v).umod(o);returnthis.g.mulAdd(y,c,f)},h.prototype.getKeyRecoveryParam=function(e,r,t,n){if(null!==(r=newu(r,n)).recoveryParam)returnr.recoveryParam;for(vari=0;i<4;i++){vars;try{s=this.recoverPubKey(e,r,i)}catch(e){continue}if(s.eq(t))returni}thrownewError("Unable to find valid recovery factor")};
"use strict";vart=require("../utils"),e=t.assert,s=t.parseBytes,i=t.cachedProperty;functionn(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}n.fromPublic=function(t,e){returneinstanceofn?e:newn(t,{pub:e})},n.fromSecret=function(t,e){returneinstanceofn?e:newn(t,{secret:e})},n.prototype.secret=function(){returnthis._secret},i(n,"pubBytes",function(){returnthis.eddsa.encodePoint(this.pub())}),i(n,"pub",function(){returnthis._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(n,"privBytes",function(){vart=this.eddsa,e=this.hash(),s=t.encodingLength-1,i=e.slice(0,t.encodingLength);returni[0]&=248,i[s]&=127,i[s]|=64,i}),i(n,"priv",function(){returnthis.eddsa.decodeInt(this.privBytes())}),i(n,"hash",function(){returnthis.eddsa.hash().update(this.secret()).digest()}),i(n,"messagePrefix",function(){returnthis.hash().slice(this.eddsa.encodingLength)}),n.prototype.sign=function(t){returne(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},n.prototype.verify=function(t,e){returnthis.eddsa.verify(t,e,this)},n.prototype.getSecret=function(s){returne(this._secret,"KeyPair is public only"),t.encode(this.secret(),s)},n.prototype.getPublic=function(e){returnt.encode(this.pubBytes(),e)},module.exports=n;
"use strict";vare=require("bn.js"),t=require("../utils"),n=t.assert,o=t.cachedProperty,d=t.parseBytes;functioni(t,o){this.eddsa=t,"object"!=typeofo&&(o=d(o)),Array.isArray(o)&&(o={R:o.slice(0,t.encodingLength),S:o.slice(t.encodingLength)}),n(o.R&&o.S,"Signature without R or S"),t.isPoint(o.R)&&(this._R=o.R),o.Sinstanceofe&&(this._S=o.S),this._Rencoded=Array.isArray(o.R)?o.R:o.Rencoded,this._Sencoded=Array.isArray(o.S)?o.S:o.Sencoded}o(i,"S",function(){returnthis.eddsa.decodeInt(this.Sencoded())}),o(i,"R",function(){returnthis.eddsa.decodePoint(this.Rencoded())}),o(i,"Rencoded",function(){returnthis.eddsa.encodePoint(this.R())}),o(i,"Sencoded",function(){returnthis.eddsa.encodeInt(this.S())}),i.prototype.toBytes=function(){returnthis.Rencoded().concat(this.Sencoded())},i.prototype.toHex=function(){returnt.encode(this.toBytes(),"hex").toUpperCase()},module.exports=i;
"use strict";vart=require("hash.js"),e=require("../curves"),n=require("../utils"),r=n.assert,i=n.parseBytes,o=require("./key"),s=require("./signature");functionu(n){if(r("ed25519"===n,"only tested with ed25519 so far"),!(thisinstanceofu))returnnewu(n);n=e[n].curve,this.curve=n,this.g=n.g,this.g.precompute(n.n.bitLength()+1),this.pointClass=n.point().constructor,this.encodingLength=Math.ceil(n.n.bitLength()/8),this.hash=t.sha512}module.exports=u,u.prototype.sign=function(t,e){t=i(t);varn=this.keyFromSecret(e),r=this.hashInt(n.messagePrefix(),t),o=this.g.mul(r),s=this.encodePoint(o),u=this.hashInt(s,n.pubBytes(),t).mul(n.priv()),h=r.add(u).umod(this.curve.n);returnthis.makeSignature({R:o,S:h,Rencoded:s})},u.prototype.verify=function(t,e,n){t=i(t),e=this.makeSignature(e);varr=this.keyFromPublic(n),o=this.hashInt(e.Rencoded(),r.pubBytes(),t),s=this.g.mul(e.S());returne.R().add(r.pub().mul(o)).eq(s)},u.prototype.hashInt=function(){for(vart=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);returnn.intFromLE(t.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(t){returno.fromPublic(this,t)},u.prototype.keyFromSecret=function(t){returno.fromSecret(this,t)},u.prototype.makeSignature=function(t){returntinstanceofs?t:news(this,t)},u.prototype.encodePoint=function(t){vare=t.getY().toArray("le",this.encodingLength);returne[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},u.prototype.decodePoint=function(t){vare=(t=n.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),i=0!=(128&t[e]),o=n.intFromLE(r);returnthis.curve.pointFromY(o,i)},u.prototype.encodeInt=function(t){returnt.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(t){returnn.intFromLE(t)},u.prototype.isPoint=function(t){returntinstanceofthis.pointClass};
vare,r=require("process"),t=require("buffer"),n=t.Buffer,o={};for(eint)t.hasOwnProperty(e)&&"SlowBuffer"!==e&&"Buffer"!==e&&(o[e]=t[e]);varf=o.Buffer={};for(einn)n.hasOwnProperty(e)&&"allocUnsafe"!==e&&"allocUnsafeSlow"!==e&&(f[e]=n[e]);if(o.Buffer.prototype=n.prototype,f.from&&f.from!==Uint8Array.from||(f.from=function(e,r,t){if("number"==typeofe)thrownewTypeError('The "value" argument must not be of type number. Received type '+typeofe);if(e&&void0===e.length)thrownewTypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeofe);returnn(e,r,t)}),f.alloc||(f.alloc=function(e,r,t){if("number"!=typeofe)thrownewTypeError('The "size" argument must be of type number. Received type '+typeofe);if(e<0||e>=2*(1<<30))thrownewRangeError('The value "'+e+'" is invalid for option "size"');varo=n(e);returnr&&0!==r.length?"string"==typeoft?o.fill(r,t):o.fill(r):o.fill(0),o}),!o.kStringMaxLength)try{o.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(i){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),module.exports=o;
"use strict";conste=require("../base/reporter").Reporter,t=require("../base/buffer").EncoderBuffer,n=require("../base/buffer").DecoderBuffer,i=require("minimalistic-assert"),o=["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"],r=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o),s=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];functionc(e,t,n){consti={};this._baseState=i,i.name=n,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}module.exports=c;constl=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){conste=this._baseState,t={};l.forEach(function(n){t[n]=e[n]});constn=newthis.constructor(t.parent);returnn._baseState=t,n},c.prototype._wrap=function(){conste=this._baseState;r.forEach(function(t){this[t]=function(){constn=newthis.constructor(this);returne.children.push(n),n[t].apply(n,arguments)}},this)},c.prototype._init=function(e){constt=this._baseState;i(null===t.parent),e.call(this),t.children=t.children.filter(function(e){returne._baseState.parent===this},this),i.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){constt=this._baseState,n=e.filter(function(e){returneinstanceofthis.constructor},this);e=e.filter(function(e){return!(einstanceofthis.constructor)},this),0!==n.length&&(i(null===t.children),t.children=n,n.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(i(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeofe||e.constructor!==Object)returne;constt={};returnObject.keys(e).forEach(function(n){n==(0|n)&&(n|=0);consti=e[n];t[i]=n}),t}))},s.forEach(function(e){c.prototype[e]=function(){constt=this._baseState;thrownewError(e+" not implemented for encoding: "+t.enc)}}),o.forEach(function(e){c.prototype[e]=function(){constt=this._baseState,n=Array.prototype.slice.call(arguments);returni(null===t.tag),t.tag=e,this._useArgs(n),this}}),c.prototype.use=function(e){i(e);constt=this._baseState;returni(null===t.use),t.use=e,this},c.prototype.optional=function(){returnthis._baseState.optional=!0,this},c.prototype.def=function(e){constt=this._baseState;returni(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){constt=this._baseState;returni(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){constt=this._baseState;returni(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){conste=this._baseState,t=Array.prototype.slice.call(arguments);returne.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){constt=this._baseState;returni(null===t.key),t.key=e,this},c.prototype.any=function(){returnthis._baseState.any=!0,this},c.prototype.choice=function(e){constt=this._baseState;returni(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){returne[t]})),this},c.prototype.contains=function(e){constt=this._baseState;returni(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){consti=this._baseState;if(null===i.parent)returne.wrapResult(i.children[0]._decode(e,t));leto,r=i.default,s=!0,c=null;if(null!==i.key&&(c=e.enterKey(i.key)),i.optional){letn=null;if(null!==i.explicit?n=i.explicit:null!==i.implicit?n=i.implicit:null!==i.tag&&(n=i.tag),null!==n||i.any){if(s=this._peekTag(e,n,i.any),e.isError(s))returns}else{constn=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),s=!0}catch(l){s=!1}e.restore(n)}}if(i.obj&&s&&(o=e.enterObject()),s){if(null!==i.explicit){constt=this._decodeTag(e,i.explicit);if(e.isError(t))returnt;e=t}consto=e.offset;if(null===i.use&&null===i.choice){lett;i.any&&(t=e.save());constn=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(n))returnn;i.any?r=e.raw(t):e=n}if(t&&t.track&&null!==i.tag&&t.track(e.path(),o,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(r=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(r))returnr;if(i.any||null!==i.choice||null===i.children||i.children.forEach(function(n){n._decode(e,t)}),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){consto=newn(r);r=this._getUse(i.contains,e._reporterState.objLine truncated
"use strict";conste=require("inherits"),t=require("safer-buffer").Buffer,r=require("../base/node"),n=require("../constants/der");functiono(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=newi,this.tree._init(e.body)}functioni(e){r.call(this,"der",e)}functions(e){returne<10?"0"+e:e}functionf(e,t,r,o){leti;if("seqof"===e?e="seq":"setof"===e&&(e="set"),n.tagByName.hasOwnProperty(e))i=n.tagByName[e];else{if("number"!=typeofe||(0|e)!==e)returno.error("Unknown tag: "+e);i=e}returni>=31?o.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=n.tagClassByName[r||"universal"]<<6)}module.exports=o,o.prototype.encode=function(e,t){returnthis.tree._encode(e,t).join()},e(i,r),i.prototype._encodeComposite=function(e,r,n,o){consti=f(e,r,n,this.reporter);if(o.length<128){conste=t.alloc(2);returne[0]=i,e[1]=o.length,this._createEncoderBuffer([e,o])}lets=1;for(lett=o.length;t>=256;t>>=8)s++;constu=t.alloc(2+s);u[0]=i,u[1]=128|s;for(lett=1+s,f=o.length;f>0;t--,f>>=8)u[t]=255&f;returnthis._createEncoderBuffer([u,o])},i.prototype._encodeStr=function(e,r){if("bitstr"===r)returnthis._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===r){constr=t.alloc(2*e.length);for(lett=0;t<e.length;t++)r.writeUInt16BE(e.charCodeAt(t),2*t);returnthis._createEncoderBuffer(r)}return"numstr"===r?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===r?this._isPrintstr(e)?this._createEncoderBuffer(e):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(r)?this._createEncoderBuffer(e):"objDesc"===r?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")},i.prototype._encodeObjid=function(e,r,n){if("string"==typeofe){if(!r)returnthis.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))returnthis.reporter.error("objid not found in values map");e=r[e].split(/[\s.]+/g);for(lett=0;t<e.length;t++)e[t]|=0}elseif(Array.isArray(e)){e=e.slice();for(lett=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))returnthis.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)returnthis.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}leto=0;for(lett=0;t<e.length;t++){letr=e[t];for(o++;r>=128;r>>=7)o++}consti=t.alloc(o);lets=i.length-1;for(lett=e.length-1;t>=0;t--){letr=e[t];for(i[s--]=127&r;(r>>=7)>0;)i[s--]=128|127&r}returnthis._createEncoderBuffer(i)},i.prototype._encodeTime=function(e,t){letr;constn=newDate(e);return"gentime"===t?r=[s(n.getUTCFullYear()),s(n.getUTCMonth()+1),s(n.getUTCDate()),s(n.getUTCHours()),s(n.getUTCMinutes()),s(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[s(n.getUTCFullYear()%100),s(n.getUTCMonth()+1),s(n.getUTCDate()),s(n.getUTCHours()),s(n.getUTCMinutes()),s(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},i.prototype._encodeNull=function(){returnthis._createEncoderBuffer("")},i.prototype._encodeInt=function(e,r){if("string"==typeofe){if(!r)returnthis.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))returnthis.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if("number"!=typeofe&&!t.isBuffer(e)){constr=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=t.from(r)}if(t.isBuffer(e)){letr=e.length;0===e.length&&r++;constn=t.alloc(r);returne.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)returnthis._createEncoderBuffer(e);if(e<256)returnthis._createEncoderBuffer([0,e]);letn=1;for(lett=e;t>=256;t>>=8)n++;consto=newArray(n);for(lett=o.length-1;t>=0;t--)o[t]=255&e,e>>=8;return128&o[0]&&o.unshift(0),this._createEncoderBuffer(t.from(o))},i.prototype._encodeBool=function(e){returnthis._createEncoderBuffer(e?255:0)},i.prototype._use=function(e,t){return"function"==typeofe&&(e=e(t)),e._getEncoder("der").tree},i.prototype._skipDefault=function(e,t,r){constn=this._baseState;leto;if(null===n.default)return!1;consti=e.join();if(void0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),i.length!==n.defaultBuffer.length)return!1;for(o=0;o<i.length;o++)if(i[o]!==n.defaultBuffer[o])return!1;return!0};
"use strict";constt=require("inherits"),r=require("bn.js"),e=require("../base/buffer").DecoderBuffer,i=require("../base/node"),o=require("../constants/der");functionn(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=news,this.tree._init(t.body)}functions(t){i.call(this,"der",t)}functionc(t,r){lete=t.readUInt8(r);if(t.isError(e))returne;consti=o.tagClass[e>>6],n=0==(32&e);if(31==(31&e)){leti=e;for(e=0;128==(128&i);){if(i=t.readUInt8(r),t.isError(i))returni;e<<=7,e|=127&i}}elsee&=31;return{cls:i,primitive:n,tag:e,tagStr:o.tag[e]}}functionu(t,r,e){leti=t.readUInt8(e);if(t.isError(i))returni;if(!r&&128===i)returnnull;if(0==(128&i))returni;consto=127&i;if(o>4)returnt.error("length octect is too long");i=0;for(letn=0;n<o;n++){i<<=8;constr=t.readUInt8(e);if(t.isError(r))returnr;i|=r}returni}module.exports=n,n.prototype.decode=function(t,r){returne.isDecoderBuffer(t)||(t=newe(t,r)),this.tree._decode(t,r)},t(s,i),s.prototype._peekTag=function(t,r,e){if(t.isEmpty())return!1;consti=t.save(),o=c(t,'Failed to peek tag: "'+r+'"');returnt.isError(o)?o:(t.restore(i),o.tag===r||o.tagStr===r||o.tagStr+"of"===r||e)},s.prototype._decodeTag=function(t,r,e){consti=c(t,'Failed to decode tag of "'+r+'"');if(t.isError(i))returni;leto=u(t,i.primitive,'Failed to get length of "'+r+'"');if(t.isError(o))returno;if(!e&&i.tag!==r&&i.tagStr!==r&&i.tagStr+"of"!==r)returnt.error('Failed to match tag: "'+r+'"');if(i.primitive||null!==o)returnt.skip(o,'Failed to match body of: "'+r+'"');constn=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');returnt.isError(s)?s:(o=t.offset-n.offset,t.restore(n),t.skip(o,'Failed to match body of: "'+r+'"'))},s.prototype._skipUntilEnd=function(t,r){for(;;){conste=c(t,r);if(t.isError(e))returne;consti=u(t,e.primitive,r);if(t.isError(i))returni;leto;if(o=e.primitive||null!==i?t.skip(i):this._skipUntilEnd(t,r),t.isError(o))returno;if("end"===e.tagStr)break}},s.prototype._decodeList=function(t,r,e,i){consto=[];for(;!t.isEmpty();){constr=this._peekTag(t,"end");if(t.isError(r))returnr;constn=e.decode(t,"der",i);if(t.isError(n)&&r)break;o.push(n)}returno},s.prototype._decodeStr=function(t,r){if("bitstr"===r){constr=t.readUInt8();returnt.isError(r)?r:{unused:r,data:t.raw()}}if("bmpstr"===r){constr=t.raw();if(r.length%2==1)returnt.error("Decoding of string type: bmpstr length mismatch");lete="";for(lett=0;t<r.length/2;t++)e+=String.fromCharCode(r.readUInt16BE(2*t));returne}if("numstr"===r){constr=t.raw().toString("ascii");returnthis._isNumstr(r)?r:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===r)returnt.raw();if("objDesc"===r)returnt.raw();if("printstr"===r){constr=t.raw().toString("ascii");returnthis._isPrintstr(r)?r:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(r)?t.raw().toString():t.error("Decoding of string type: "+r+" unsupported")},s.prototype._decodeObjid=function(t,r,e){leti;consto=[];letn=0,s=0;for(;!t.isEmpty();)n<<=7,n|=127&(s=t.readUInt8()),0==(128&s)&&(o.push(n),n=0);128&s&&o.push(n);constc=o[0]/40|0,u=o[0]%40;if(i=e?o:[c,u].concat(o.slice(1)),r){lett=r[i.join(" ")];void0===t&&(t=r[i.join(".")]),void0!==t&&(i=t)}returni},s.prototype._decodeTime=function(t,r){conste=t.raw().toString();leti,o,n,s,c,u;if("gentime"===r)i=0|e.slice(0,4),o=0|e.slice(4,6),n=0|e.slice(6,8),s=0|e.slice(8,10),c=0|e.slice(10,12),u=0|e.slice(12,14);else{if("utctime"!==r)returnt.error("Decoding "+r+" time is not supported yet");i=0|e.slice(0,2),o=0|e.slice(2,4),n=0|e.slice(4,6),s=0|e.slice(6,8),c=0|e.slice(8,10),u=0|e.slice(10,12),i=i<70?2e3+i:1900+i}returnDate.UTC(i,o-1,n,s,c,u,0)},s.prototype._decodeNull=function(){returnnull},s.prototype._decodeBool=function(t){constr=t.readUInt8();returnt.isError(r)?r:0!==r},s.prototype._decodeInt=function(t,e){consti=t.raw();leto=newr(i);returne&&(o=e[o.toString(10)]||o),o},s.prototype._use=function(t,r){return"function"==typeoft&&(t=t(r)),t._getDecoder("der").tree};
"use strict";conste=require("inherits"),r=require("safer-buffer").Buffer,t=require("./der");functiono(e){t.call(this,e),this.enc="pem"}e(o,t),module.exports=o,o.prototype.decode=function(e,o){consti=e.toString().split(/[\r\n]+/g),n=o.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;letc=-1,f=-1;for(letr=0;r<i.length;r++){conste=i[r].match(s);if(null!==e&&e[2]===n){if(-1!==c){if("END"!==e[1])break;f=r;break}if("BEGIN"!==e[1])break;c=r}}if(-1===c||-1===f)thrownewError("PEM section not found for: "+n);constl=i.slice(c+1,f).join("");l.replace(/[^a-z0-9+/=]+/gi,"");consta=r.from(l,"base64");returnt.prototype.decode.call(this,a,o)};
varr=require("safe-buffer").Buffer,e=require("bn.js"),n=require("elliptic").ec,o=require("parse-asn1"),t=require("./curves.json");functiona(n,t,a,d,f){varc=o(a);if("ec"===c.type){if("ecdsa"!==d&&"ecdsa/rsa"!==d)thrownewError("wrong public key type");returnu(n,t,c)}if("dsa"===c.type){if("dsa"!==d)thrownewError("wrong public key type");returni(n,t,c)}if("rsa"!==d&&"ecdsa/rsa"!==d)thrownewError("wrong public key type");t=r.concat([f,t]);for(vars=c.modulus.byteLength(),m=[1],l=0;t.length+m.length+2<s;)m.push(255),l++;m.push(0);for(varw=-1;++w<t.length;)m.push(t[w]);m=r.from(m);varp=e.mont(c.modulus);n=(n=newe(n).toRed(p)).redPow(newe(c.publicExponent)),n=r.from(n.fromRed().toArray());varh=l<8?1:0;for(s=Math.min(n.length,m.length),n.length!==m.length&&(h=1),w=-1;++w<s;)h|=n[w]^m[w];return0===h}functionu(r,e,o){vara=t[o.data.algorithm.curve.join(".")];if(!a)thrownewError("unknown curve "+o.data.algorithm.curve.join("."));varu=newn(a),i=o.data.subjectPrivateKey.data;returnu.verify(e,r,i)}functioni(r,n,t){vara=t.data.p,u=t.data.q,i=t.data.g,f=t.data.pub_key,c=o.signature.decode(r,"der"),s=c.s,m=c.r;d(s,u),d(m,u);varl=e.mont(a),w=s.invm(u);return0===i.toRed(l).redPow(newe(n).mul(w).mod(u)).fromRed().mul(f.toRed(l).redPow(m.mul(w).mod(u)).fromRed()).mod(a).mod(u).cmp(m)}functiond(r,e){if(r.cmpn(0)<=0)thrownewError("invalid sig");if(r.cmp(e)>=e)thrownewError("invalid sig")}module.exports=a;
varr=require("parse-asn1"),e=require("randombytes"),o=require("create-hash"),n=require("./mgf"),a=require("./xor"),t=require("bn.js"),u=require("./withPublic"),l=require("browserify-rsa"),i=require("safe-buffer").Buffer;functions(r,u){varl=r.modulus.byteLength(),s=u.length,f=o("sha1").update(i.alloc(0)).digest(),c=f.length,g=2*c;if(s>l-g-2)thrownewError("message too long");vard=i.alloc(l-s-g-2),h=l-c-1,w=e(c),m=a(i.concat([f,d,i.alloc(1,1),u],h),n(w,h)),q=a(w,n(m,c));returnnewt(i.concat([i.alloc(1),q,m],l))}functionf(r,e,o){varn,a=e.length,u=r.modulus.byteLength();if(a>u-11)thrownewError("message too long");returnn=o?i.alloc(u-a-3,255):c(u-a-3),newt(i.concat([i.from([0,o?1:2]),n,i.alloc(1),e],u))}functionc(r){for(varo,n=i.allocUnsafe(r),a=0,t=e(2*r),u=0;a<r;)u===t.length&&(t=e(2*r),u=0),(o=t[u++])&&(n[a++]=o);returnn}module.exports=function(e,o,n){vara;a=e.padding?e.padding:n?1:4;vari,c=r(e);if(4===a)i=s(c,o);elseif(1===a)i=f(c,o,n);else{if(3!==a)thrownewError("unknown padding");if((i=newt(o)).cmp(c.modulus)>=0)thrownewError("data too long for modulus")}returnn?l(i,c):u(i,c)};
varr=arguments[3],e=require("process");functionn(){thrownewError("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}vart=require("safe-buffer"),o=require("randombytes"),f=t.Buffer,u=t.kMaxLength,i=r.crypto||r.msCrypto,a=Math.pow(2,32)-1;functions(r,e){if("number"!=typeofr||r!=r)thrownewTypeError("offset must be a number");if(r>a||r<0)thrownewTypeError("offset must be a uint32");if(r>u||r>e)thrownewRangeError("offset out of range")}functionm(r,e,n){if("number"!=typeofr||r!=r)thrownewTypeError("size must be a number");if(r>a||r<0)thrownewTypeError("size must be a uint32");if(r+e>n||r>u)thrownewRangeError("buffer too small")}functionl(e,n,t,o){if(!(f.isBuffer(e)||einstanceofr.Uint8Array))thrownewTypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeofn)o=n,n=0,t=e.length;elseif("function"==typeoft)o=t,t=e.length-n;elseif("function"!=typeofo)thrownewTypeError('"cb" argument must be a function');returns(n,e.length),m(t,n,e.length),p(e,n,t,o)}functionp(r,n,t,o){varf=r.buffer,u=newUint8Array(f,n,t);returni.getRandomValues(u),o?voide.nextTick(function(){o(null,r)}):r}functionw(e,n,t){if(void0===n&&(n=0),!(f.isBuffer(e)||einstanceofr.Uint8Array))thrownewTypeError('"buf" argument must be a Buffer or Uint8Array');returns(n,e.length),void0===t&&(t=e.length-n),m(t,n,e.length),p(e,n,t)}i&&i.getRandomValues?(exports.randomFill=l,exports.randomFillSync=w):(exports.randomFill=n,exports.randomFillSync=n);
"use strict";exports.randomBytes=exports.rng=exports.pseudoRandomBytes=exports.prng=require("randombytes"),exports.createHash=exports.Hash=require("create-hash"),exports.createHmac=exports.Hmac=require("create-hmac");vare=require("browserify-sign/algos"),r=Object.keys(e),t=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);exports.getHashes=function(){returnt};vari=require("pbkdf2");exports.pbkdf2=i.pbkdf2,exports.pbkdf2Sync=i.pbkdf2Sync;varp=require("browserify-cipher");exports.Cipher=p.Cipher,exports.createCipher=p.createCipher,exports.Cipheriv=p.Cipheriv,exports.createCipheriv=p.createCipheriv,exports.Decipher=p.Decipher,exports.createDecipher=p.createDecipher,exports.Decipheriv=p.Decipheriv,exports.createDecipheriv=p.createDecipheriv,exports.getCiphers=p.getCiphers,exports.listCiphers=p.listCiphers;vars=require("diffie-hellman");exports.DiffieHellmanGroup=s.DiffieHellmanGroup,exports.createDiffieHellmanGroup=s.createDiffieHellmanGroup,exports.getDiffieHellman=s.getDiffieHellman,exports.createDiffieHellman=s.createDiffieHellman,exports.DiffieHellman=s.DiffieHellman;vara=require("browserify-sign");exports.createSign=a.createSign,exports.Sign=a.Sign,exports.createVerify=a.createVerify,exports.Verify=a.Verify,exports.createECDH=require("create-ecdh");varo=require("public-encrypt");exports.publicEncrypt=o.publicEncrypt,exports.privateEncrypt=o.privateEncrypt,exports.publicDecrypt=o.publicDecrypt,exports.privateDecrypt=o.privateDecrypt;varc=require("randomfill");exports.randomFill=c.randomFill,exports.randomFillSync=c.randomFillSync,exports.createCredentials=function(){thrownewError(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},exports.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};
vare,n=arguments[3];!function(n){"use strict";vart,r,i,o=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,u=Math.ceil,s=Math.floor,f=" not a boolean or binary digit",l="rounding mode",c="number type has more than 15 significant digits",a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",h=1e14,g=14,p=9007199254740991,m=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,w=1e9;functionv(e){varn=0|e;returne>0||e===n?n:n-1}functionN(e){for(varn,t,r=1,i=e.length,o=e[0]+"";r<i;){for(n=e[r++]+"",t=g-n.length;t--;n="0"+n);o+=n}for(i=o.length;48===o.charCodeAt(--i););returno.slice(0,i+1||1)}functionb(e,n){vart,r,i=e.c,o=n.c,u=e.s,s=n.s,f=e.e,l=n.e;if(!u||!s)returnnull;if(t=i&&!i[0],r=o&&!o[0],t||r)returnt?r?0:-s:u;if(u!=s)returnu;if(t=u<0,r=f==l,!i||!o)returnr?0:!i^t?1:-1;if(!r)returnf>l^t?1:-1;for(s=(f=i.length)<(l=o.length)?f:l,u=0;u<s;u++)if(i[u]!=o[u])returni[u]>o[u]^t?1:-1;returnf==l?0:f>l^t?1:-1}functionO(e,n,t){return(e=E(e))>=n&&e<=t}functiony(e){return"[object Array]"==Object.prototype.toString.call(e)}functionS(e,n,t){for(varr,i,o=[0],u=0,s=e.length;u<s;){for(i=o.length;i--;o[i]*=n);for(o[r=0]+=a.indexOf(e.charAt(u++));r<o.length;r++)o[r]>t-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}returno.reverse()}functionR(e,n){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(n<0?"e":"e+")+n}functionA(e,n){vart,r;if(n<0){for(r="0.";++n;r+="0");e=r+e}elseif(++n>(t=e.length)){for(r="0",n-=t;--n;r+="0");e+=r}elsen<t&&(e=e.slice(0,n)+"."+e.slice(n));returne}functionE(e){return(e=parseFloat(e))<0?u(e):s(e)}if(t=functione(n){vart,D,_,x,F,I,L,U=0,C=J.prototype,M=newJ(1),T=20,q=4,P=-7,k=21,B=-1e7,$=1e7,G=!0,z=K,j=!1,H=1,V=100,W={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:"",fractionGroupSize:0};functionJ(e,n){vart,r,u,s,f,l,h=this;if(!(hinstanceofJ))returnG&&ee(26,"constructor call without new",e),newJ(e,n);if(null!=n&&z(n,2,64,U,"base")){if(l=e+"",10==(n|=0))returnne(h=newJ(einstanceofJ?e:l),T+h.e+1,q);if((s="number"==typeofe)&&0*e!=0||!newRegExp("^-?"+(t="["+a.slice(0,n)+"]+")+"(?:\\."+t+")?$",n<37?"i":"").test(l))returni(h,l,s,n);s?(h.s=1/e<0?(l=l.slice(1),-1):1,G&&l.replace(/^0\.0*|\./,"").length>15&&ee(U,c,e),s=!1):h.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1,l=X(l,10,n,h.s)}else{if(einstanceofJ)returnh.s=e.s,h.e=e.e,h.c=(e=e.c)?e.slice():e,void(U=0);if((s="number"==typeofe)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(r=0,u=e;u>=10;u/=10,r++);returnh.e=r,h.c=[e],void(U=0)}l=e+""}else{if(!o.test(l=e+""))returni(h,l,s);h.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1}}for((r=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(r<0&&(r=u),r+=+l.slice(u+1),l=l.substring(0,u)):r<0&&(r=l.length),u=0;48===l.charCodeAt(u);u++);for(f=l.length;48===l.charCodeAt(--f););if(l=l.slice(u,f+1))if(f=l.length,s&&G&&f>15&&ee(U,c,h.s*e),(r=r-u-1)>$)h.c=h.e=null;elseif(r<B)h.c=[h.e=0];else{if(h.e=r,h.c=[],u=(r+1)%g,r<0&&(u+=g),u<f){for(u&&h.c.push(+l.slice(0,u)),f-=g;u<f;)h.c.push(+l.slice(u,u+=g));l=l.slice(u),u=g-l.length}elseu-=f;for(;u--;l+="0");h.c.push(+l)}elseh.c=[h.e=0];U=0}functionX(e,n,r,i){varo,u,s,f,l,c,h,g=e.indexOf("."),p=T,m=q;for(r<37&&(e=e.toLowerCase()),g>=0&&(s=V,V=0,e=e.replace(".",""),l=(h=newJ(r)).pow(e.length-g),V=s,h.c=S(A(N(l.c),l.e),10,n),h.e=h.c.length),u=s=(c=S(e,r,n)).length;0==c[--s];c.pop());if(!c[0])return"0";if(g<0?--u:(l.c=c,l.e=u,l.s=i,c=(l=t(l,h,p,m,n)).c,f=l.r,u=l.e),g=c[o=u+p+1],s=n/2,f=f||o<0||null!=c[o+1],f=m<4?(null!=g||f)&&(0==m||m==(l.s<0?3:2)):g>s||g==s&&(4==m||f||6==m&&1&c[o-1]||m==(l.s<0?8:7)),o<1||!c[0])e=f?A("1",-p):"0";else{if(c.length=o,f)for(--n;++c[--o]>n;)c[o]=0,o||(++u,c.unshift(1));for(s=c.length;!c[--s];);for(g=0,e="";g<=s;e+=a.charAt(c[g++]));e=A(e,u)}returne}functionY(e,n,t,r){vari,o,u,s,f;if(t=null!=t&&z(t,0,8,r,l)?0|t:q,!e.c)returne.toString();if(i=e.c[0],u=e.e,null==n)f=N(e.c),f=19==r||24==r&&u<=P?R(f,u):A(f,u);elseif(o=(e=ne(newJ(e),n,t)).e,s=(f=N(e.c)).length,19==r||24==r&&(n<=o||o<=P)){for(;s<n;f+="0",s++);f=R(f,o)}elseif(n-=u,f=A(f,o),o+1>s){if(--n>0)for(f+=".";n--;f+="0");}elseif((n+=o-s)>0)for(o+1==s&&(f+=".");n--;f+="0");returne.s<0&&i?"-"+f:f}functionZ(e,n){vart,r,i=0;for(y(e[0])&&(e=e[0]),t=newJ(e[0]);++i<e.length;){if(!(r=newJ(e[i])).s){t=r;break}n.call(t,r)&&(t=r)}returnt}functionK(e,n,t,r,i){return(e<n||e>t||e!=E(e))&&ee(r,(i||"decimal places")+(e<n||e>t?" out of range":" not an integer"),e),!0}functionQ(e,n,t){for(varr=1,i=n.length;!n[--i];n.pop());for(i=n[0];i>=10;i/=10,r++);return(t=r+t*g-1)>$?e.c=e.e=null:t<B?e.c=[e.e=0]:(e.e=t,e.c=n),e}functionee(e,n,t){varr=newError(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][e]+"() "+n+": "+t);throwr.name="BigNumber Error",U=0,r}functionne(e,n,t,r){vari,o,Line truncated
varr,t=arguments[3];!function(n){varo="object"==typeofexports&&exports,e="object"==typeofmodule&&module&&module.exports==o&&module,i="object"==typeoft&&t;i.global!==i&&i.window!==i||(n=i);varu,f,a,c=String.fromCharCode;functiond(r){for(vart,n,o=[],e=0,i=r.length;e<i;)(t=r.charCodeAt(e++))>=55296&&t<=56319&&e<i?56320==(64512&(n=r.charCodeAt(e++)))?o.push(((1023&t)<<10)+(1023&n)+65536):(o.push(t),e--):o.push(t);returno}functionl(r){if(r>=55296&&r<=57343)throwError("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value")}functionv(r,t){returnc(r>>t&63|128)}functionh(r){if(0==(4294967168&r))returnc(r);vart="";return0==(4294965248&r)?t=c(r>>6&31|192):0==(4294901760&r)?(l(r),t=c(r>>12&15|224),t+=v(r,6)):0==(4292870144&r)&&(t=c(r>>18&7|240),t+=v(r,12),t+=v(r,6)),t+=c(63&r|128)}functions(){if(a>=f)throwError("Invalid byte index");varr=255&u[a];if(a++,128==(192&r))return63&r;throwError("Invalid continuation byte")}functionp(){varr,t;if(a>f)throwError("Invalid byte index");if(a==f)return!1;if(r=255&u[a],a++,0==(128&r))returnr;if(192==(224&r)){if((t=(31&r)<<6|s())>=128)returnt;throwError("Invalid continuation byte")}if(224==(240&r)){if((t=(15&r)<<12|s()<<6|s())>=2048)returnl(t),t;throwError("Invalid continuation byte")}if(240==(248&r)&&(t=(7&r)<<18|s()<<12|s()<<6|s())>=65536&&t<=1114111)returnt;throwError("Invalid UTF-8 detected")}vary={version:"2.1.2",encode:function(r){for(vart=d(r),n=t.length,o=-1,e="";++o<n;)e+=h(t[o]);returne},decode:function(r){u=d(r),f=u.length,a=0;for(vart,n=[];!1!==(t=p());)n.push(t);returnfunction(r){for(vart,n=r.length,o=-1,e="";++o<n;)(t=r[o])>65535&&(e+=c((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=c(t);returne}(n)}};if("function"==typeofr&&"object"==typeofr.amd&&r.amd)r(function(){returny});elseif(o&&!o.nodeType)if(e)e.exports=y;else{varb={}.hasOwnProperty;for(varwiny)b.call(y,w)&&(o[w]=y[w])}elsen.utf8=y}(this);
},{}],"Fh47":[function(require,module,exports){
varr=require("bignumber.js"),e=require("./sha3.js"),t=require("utf8"),n={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},f=function(r,e,t){returnnewArray(e-r.length+1).join(t||"0")+r},i=function(r,e,t){returnr+newArray(e-r.length+1).join(t||"0")},o=function(r){vare="",n=0,f=r.length;for("0x"===r.substring(0,2)&&(n=2);n<f;n+=2){vari=parseInt(r.substr(n,2),16);if(0===i)break;e+=String.fromCharCode(i)}returnt.decode(e)},u=function(r){vare="",t=0,n=r.length;for("0x"===r.substring(0,2)&&(t=2);t<n;t+=2){varf=parseInt(r.substr(t,2),16);e+=String.fromCharCode(f)}returne},s=function(r,e){r=t.encode(r);for(varn="",f=0;f<r.length;f++){vari=r.charCodeAt(f);if(0===i){if(!e)break;n+="00"}else{varo=i.toString(16);n+=o.length<2?"0"+o:o}}return"0x"+n},a=function(r,e){for(vart="",n=0;n<r.length;n++){varf=r.charCodeAt(n).toString(16);t+=f.length<2?"0"+f:f}return"0x"+t.padEnd(e,"0")},c=function(r){if(-1!==r.name.indexOf("("))returnr.name;vare=r.inputs.map(function(r){returnr.type}).join();returnr.name+"("+e+")"},l=function(r){vare=r.indexOf("("),t=r.indexOf(")");return-1!==e&&-1!==t?r.substr(0,e):r},x=function(r){vare=r.indexOf("("),t=r.indexOf(")");return-1!==e&&-1!==t?r.substr(e+1,t-e-1).replace(" ",""):""},d=function(r){returnv(r).toNumber()},h=function(r){vare=v(r),t=e.toString(16);returne.lessThan(0)?"-0x"+t.substr(1):"0x"+t},m=function(r){if(k(r))returnh(+r);if($(r))returnh(r);if("object"==typeofr)returns(JSON.stringify(r));if(N(r)){if(0===r.indexOf("-0x"))returnh(r);if(0===r.indexOf("0x"))returnr;if(!isFinite(r))returns(r,1)}returnh(r)},g=function(e){e=e?e.toLowerCase():"ether";vart=n[e];if(void0===t)thrownewError("This unit doesn't exists, please use the one of the following units"+JSON.stringify(n,null,2));returnnewr(t,10)},p=function(r,e){vart=v(r).dividedBy(g(e));return$(r)?t:t.toString(10)},b=function(r,e){vart=v(r).times(g(e));return$(r)?t:t.toString(10)},v=function(e){return$(e=e||0)?e:!N(e)||0!==e.indexOf("0x")&&0!==e.indexOf("-0x")?newr(e.toString(10),10):newr(e.replace("0x",""),16)},w=function(e){vart=v(e).round();returnt.lessThan(0)?newr("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(t).plus(1):t},y=function(r){return/^0x[0-9a-f]{40}$/i.test(r)},A=function(r){return!!/^(0x)?[0-9a-f]{40}$/i.test(r)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(r)&&!/^(0x)?[0-9A-F]{40}$/.test(r))||C(r))},C=function(r){r=r.replace("0x","");for(vart=e(r.toLowerCase()),n=0;n<40;n++)if(parseInt(t[n],16)>7&&r[n].toUpperCase()!==r[n]||parseInt(t[n],16)<=7&&r[n].toLowerCase()!==r[n])return!1;return!0},S=function(r){if(void0===r)return"";r=r.toLowerCase().replace("0x","");for(vart=e(r),n="0x",f=0;f<r.length;f++)parseInt(t[f],16)>7?n+=r[f].toUpperCase():n+=r[f];returnn},O=function(r){returny(r)?r:/^[0-9a-f]{40}$/.test(r)?"0x"+r:"0x"+f(m(r).substr(2),40)},$=function(e){returneinstanceofr||e&&e.constructor&&"BigNumber"===e.constructor.name},N=function(r){return"string"==typeofr||r&&r.constructor&&"String"===r.constructor.name},j=function(r){return"function"==typeofr},T=function(r){returnnull!==r&&!Array.isArray(r)&&"object"==typeofr},k=function(r){return"boolean"==typeofr},B=function(r){returnArray.isArray(r)},F=function(r){try{return!!JSON.parse(r)}catch(e){return!1}},I=function(r){return!!/^(0x)?[0-9a-f]{512}$/i.test(r)&&!(!/^(0x)?[0-9a-f]{512}$/.test(r)&&!/^(0x)?[0-9A-F]{512}$/.test(r))},L=function(r){return!!/^(0x)?[0-9a-f]{64}$/i.test(r)&&!(!/^(0x)?[0-9a-f]{64}$/.test(r)&&!/^(0x)?[0-9A-F]{64}$/.test(r))};module.exports={padLeft:f,padRight:i,toHex:m,toDecimal:d,fromDecimal:h,toUtf8:o,toAscii:u,fromUtf8:s,fromAscii:a,transformToFullName:c,extractDisplayName:l,extractTypeName:x,toWei:b,fromWei:p,toBigNumber:v,toTwosComplement:w,toAddress:O,isBigNumber:$,isStrictAddress:y,isAddress:A,isChecksumAddress:C,toChecksumAddress:S,isFunction:j,isString:N,isObject:T,isBoolean:k,isArray:B,isJson:F,isBloom:I,isTopic:L};
module.exports={InvalidNumberOfSolidityArgs:function(){returnnewError("Invalid number of arguments to Solidity function")},InvalidNumberOfRPCParams:function(){returnnewError("Invalid number of input parameters to RPC method")},InvalidConnection:function(r){returnnewError("CONNECTION ERROR: Couldn't connect to node "+r+".")},InvalidProvider:function(){returnnewError("Provider not set or invalid")},InvalidResponse:function(r){varn=r&&r.error&&r.error.message?r.error.message:"Invalid JSON RPC response: "+JSON.stringify(r);returnnewError(n)},ConnectionTimeout:function(r){returnnewError("CONNECTION TIMEOUT: timeout of "+r+" ms achived")}};
vart=require("./formatters"),r=require("./param"),e=function(t){this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};e.prototype.isType=function(t){throw"this method should be overrwritten for type "+t},e.prototype.staticPartLength=function(t){return(this.nestedTypes(t)||["[1]"]).map(function(t){returnparseInt(t.slice(1,-1),10)||1}).reduce(function(t,r){returnt*r},32)},e.prototype.isDynamicArray=function(t){varr=this.nestedTypes(t);return!!r&&!r[r.length-1].match(/[0-9]{1,}/g)},e.prototype.isStaticArray=function(t){varr=this.nestedTypes(t);return!!r&&!!r[r.length-1].match(/[0-9]{1,}/g)},e.prototype.staticArrayLength=function(t){varr=this.nestedTypes(t);returnr?parseInt(r[r.length-1].match(/[0-9]{1,}/g)||1):1},e.prototype.nestedName=function(t){varr=this.nestedTypes(t);returnr?t.substr(0,t.length-r[r.length-1].length):t},e.prototype.isDynamicType=function(){return!1},e.prototype.nestedTypes=function(t){returnt.match(/(\[[0-9]*\])/g)},e.prototype.encode=function(r,e){varn,s,o,a=this;returnthis.isDynamicArray(e)?(n=r.length,s=a.nestedName(e),(o=[]).push(t.formatInputInt(n).encode()),r.forEach(function(t){o.push(a.encode(t,s))}),o):this.isStaticArray(e)?function(){for(vart=a.staticArrayLength(e),n=a.nestedName(e),s=[],o=0;o<t;o++)s.push(a.encode(r[o],n));returns}():this._inputFormatter(r,e).encode()},e.prototype.decode=function(t,e,n){vars=this;if(this.isDynamicArray(n))returnfunction(){for(varr=parseInt("0x"+t.substr(2*e,64)),o=parseInt("0x"+t.substr(2*r,64)),a=r+32,i=s.nestedName(n),u=s.staticPartLength(i),p=32*Math.floor((u+31)/32),c=[],h=0;h<o*p;h+=p)c.push(s.decode(t,a+h,i));returnc}();if(this.isStaticArray(n))returnfunction(){for(varr=s.staticArrayLength(n),o=e,a=s.nestedName(n),i=s.staticPartLength(a),u=32*Math.floor((i+31)/32),p=[],c=0;c<r*u;c+=u)p.push(s.decode(t,o+c,a));returnp}();if(this.isDynamicType(n))returnfunction(){varo=parseInt("0x"+t.substr(2*e,64)),a=parseInt("0x"+t.substr(2*o,64)),i=Math.floor((a+31)/32),u=newr(t.substr(2*o,64*(1+i)),0);returns._outputFormatter(u,n)}();varo=this.staticPartLength(n),a=newr(t.substr(2*e,2*o));returnthis._outputFormatter(a,n)},module.exports=e;
vart=require("./formatters"),i=require("../utils/utils"),r=function(t){returnnull==t?null:0===(t=String(t)).indexOf("0x")?t:i.fromUtf8(t)},n=function(n,e){if(i.isString(n))returnn;switch(n=n||{},e){case"eth":returnn.topics=n.topics||[],n.topics=n.topics.map(function(t){returni.isArray(t)?t.map(r):r(t)}),{topics:n.topics,from:n.from,to:n.to,address:n.address,fromBlock:t.inputBlockNumberFormatter(n.fromBlock),toBlock:t.inputBlockNumberFormatter(n.toBlock)};case"shh":returnn}},e=function(t,r){i.isString(t.options)||t.get(function(t,n){t&&r(t),i.isArray(n)&&n.forEach(function(t){r(null,t)})})},o=function(t){t.requestManager.startPolling({method:t.implementation.poll.call,params:[t.filterId]},t.filterId,function(r,n){if(r)returnt.callbacks.forEach(function(t){t(r)});i.isArray(n)&&n.forEach(function(i){i=t.formatter?t.formatter(i):i,t.callbacks.forEach(function(t){t(null,i)})})},t.stopWatching.bind(t))},s=function(t,i,r,s,l,a,c){varf=this,u={};returns.forEach(function(t){t.setRequestManager(r),t.attachToObject(u)}),this.requestManager=r,this.options=n(t,i),this.implementation=u,this.filterId=null,this.callbacks=[],this.getLogsCallbacks=[],this.pollFilters=[],this.formatter=l,this.implementation.newFilter(this.options,function(t,i){if(t)f.callbacks.forEach(function(i){i(t)}),"function"==typeofc&&c(t);elseif(f.filterId=i,f.getLogsCallbacks.forEach(function(t){f.get(t)}),f.getLogsCallbacks=[],f.callbacks.forEach(function(t){e(f,t)}),f.callbacks.length>0&&o(f),"function"==typeofa)returnf.watch(a)}),this};s.prototype.watch=function(t){returnthis.callbacks.push(t),this.filterId&&(e(this,t),o(this)),this},s.prototype.stopWatching=function(t){if(this.requestManager.stopPolling(this.filterId),this.callbacks=[],!t)returnthis.implementation.uninstallFilter(this.filterId);this.implementation.uninstallFilter(this.filterId,t)},s.prototype.get=function(t){varr=this;if(!i.isFunction(t)){if(null===this.filterId)thrownewError("Filter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.");returnthis.implementation.getLogs(this.filterId).map(function(t){returnr.formatter?r.formatter(t):t})}returnnull===this.filterId?this.getLogsCallbacks.push(t):this.implementation.getLogs(this.filterId,function(i,n){i?t(i):t(null,n.map(function(t){returnr.formatter?r.formatter(t):t}))}),this},module.exports=s;
vart=require("../solidity/coder"),e=require("../utils/utils"),a=require("./errors"),i=require("./formatters"),r=require("../utils/sha3"),n=function(t,a,i){this._eth=t,this._inputTypes=a.inputs.map(function(t){returnt.type}),this._outputTypes=a.outputs.map(function(t){returnt.type}),this._constant="view"===a.stateMutability||"pure"===a.stateMutability||a.constant,this._payable="payable"===a.stateMutability||a.payable,this._name=e.transformToFullName(a),this._address=i};n.prototype.extractCallback=function(t){if(e.isFunction(t[t.length-1]))returnt.pop()},n.prototype.extractDefaultBlock=function(t){if(t.length>this._inputTypes.length&&!e.isObject(t[t.length-1]))returni.inputDefaultBlockNumberFormatter(t.pop())},n.prototype.validateArgs=function(t){if(t.filter(function(t){return!(!0===e.isObject(t)&&!1===e.isArray(t)&&!1===e.isBigNumber(t))}).length!==this._inputTypes.length)throwa.InvalidNumberOfSolidityArgs()},n.prototype.toPayload=function(a){vari={};returna.length>this._inputTypes.length&&e.isObject(a[a.length-1])&&(i=a[a.length-1]),this.validateArgs(a),i.to=this._address,i.data="0x"+this.signature()+t.encodeParams(this._inputTypes,a),i},n.prototype.signature=function(){returnr(this._name).slice(0,8)},n.prototype.unpackOutput=function(e){if(e){e=e.length>=2?e.slice(2):e;vara=t.decodeParams(this._outputTypes,e);return1===a.length?a[0]:a}},n.prototype.call=function(){vart=Array.prototype.slice.call(arguments).filter(function(t){returnvoid0!==t}),e=this.extractCallback(t),a=this.extractDefaultBlock(t),i=this.toPayload(t);if(!e){varr=this._eth.call(i,a);returnthis.unpackOutput(r)}varn=this;this._eth.call(i,a,function(t,a){if(t)returne(t,null);vari=null;try{i=n.unpackOutput(a)}catch(r){t=r}e(t,i)})},n.prototype.sendTransaction=function(){vart=Array.prototype.slice.call(arguments).filter(function(t){returnvoid0!==t}),e=this.extractCallback(t),a=this.toPayload(t);if(a.value>0&&!this._payable)thrownewError("Cannot send value to non-payable function");if(!e)returnthis._eth.sendTransaction(a);this._eth.sendTransaction(a,e)},n.prototype.estimateGas=function(){vart=Array.prototype.slice.call(arguments),e=this.extractCallback(t),a=this.toPayload(t);if(!e)returnthis._eth.estimateGas(a);this._eth.estimateGas(a,e)},n.prototype.getData=function(){vart=Array.prototype.slice.call(arguments);returnthis.toPayload(t).data},n.prototype.displayName=function(){returne.extractDisplayName(this._name)},n.prototype.typeName=function(){returne.extractTypeName(this._name)},n.prototype.request=function(){vart=Array.prototype.slice.call(arguments),e=this.extractCallback(t),a=this.toPayload(t),i=this.unpackOutput.bind(this);return{method:this._constant?"eth_call":"eth_sendTransaction",callback:e,params:[a],format:i}},n.prototype.execute=function(){return!this._constant?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},n.prototype.attachToContract=function(t){vare=this.execute.bind(this);e.request=this.request.bind(this),e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this),e.estimateGas=this.estimateGas.bind(this),e.getData=this.getData.bind(this);vara=this.displayName();t[a]||(t[a]=e),t[a][this.typeName()]=e},module.exports=n;
vart=require("../utils/utils"),n=require("../solidity/coder"),e=require("./event"),r=require("./function"),a=require("./allevents"),o=function(t,e){returnt.filter(function(t){return"constructor"===t.type&&t.inputs.length===e.length}).map(function(t){returnt.inputs.map(function(t){returnt.type})}).map(function(t){returnn.encodeParams(t,e)})[0]||""},i=function(t){t.abi.filter(function(t){return"function"===t.type}).map(function(n){returnnewr(t._eth,n,t.address)}).forEach(function(n){n.attachToContract(t)})},c=function(t){varn=t.abi.filter(function(t){return"event"===t.type});newa(t._eth._requestManager,n,t.address).attachToContract(t),n.map(function(n){returnnewe(t._eth._requestManager,n,t.address)}).forEach(function(n){n.attachToContract(t)})},s=function(t,n){vare=0,r=!1,a=t._eth.filter("latest",function(o){if(!o&&!r)if(++e>50){if(a.stopWatching(function(){}),r=!0,!n)thrownewError("Contract transaction couldn't be found after 50 blocks");n(newError("Contract transaction couldn't be found after 50 blocks"))}elset._eth.getTransactionReceipt(t.transactionHash,function(e,o){o&&o.blockHash&&!r&&t._eth.getCode(o.contractAddress,function(e,s){if(!r&&s)if(a.stopWatching(function(){}),r=!0,s.length>3)t.address=o.contractAddress,i(t),c(t),n&&n(null,t);else{if(!n)thrownewError("The contract code couldn't be stored, please check your gas amount.");n(newError("The contract code couldn't be stored, please check your gas amount."))}})})})},u=function(n,e){this.eth=n,this.abi=e,this.new=function(){varn,r=newh(this.eth,this.abi),a={},i=Array.prototype.slice.call(arguments);t.isFunction(i[i.length-1])&&(n=i.pop());varc=i[i.length-1];if((t.isObject(c)&&!t.isArray(c)&&(a=i.pop()),a.value>0)&&!(e.filter(function(t){return"constructor"===t.type&&t.inputs.length===i.length})[0]||{}).payable)thrownewError("Cannot send value to non-payable constructor");varu=o(this.abi,i);if(a.data+=u,n)this.eth.sendTransaction(a,function(t,e){t?n(t):(r.transactionHash=e,n(null,r),s(r,n))});else{varl=this.eth.sendTransaction(a);r.transactionHash=l,s(r)}returnr},this.new.getData=this.getData.bind(this)};u.prototype.at=function(t,n){vare=newh(this.eth,this.abi,t);returni(e),c(e),n&&n(null,e),e},u.prototype.getData=function(){varn={},e=Array.prototype.slice.call(arguments),r=e[e.length-1];t.isObject(r)&&!t.isArray(r)&&(n=e.pop());vara=o(this.abi,e);returnn.data+=a,n.data};varh=function(t,n,e){this._eth=t,this.transactionHash=null,this.address=e,this.abi=n};module.exports=u;
vare=require("buffer").Buffer;module.exports=function(f){if(finstanceofUint8Array){if(0===f.byteOffset&&f.byteLength===f.buffer.byteLength)returnf.buffer;if("function"==typeoff.buffer.slice)returnf.buffer.slice(f.byteOffset,f.byteOffset+f.byteLength)}if(e.isBuffer(f)){for(varr=newUint8Array(f.length),t=f.length,n=0;n<t;n++)r[n]=f[n];returnr.buffer}thrownewError("Argument must be a Buffer")};
vare=require("buffer").Buffer,t=arguments[3],r=require("process"),o=require("./capability"),n=require("inherits"),i=require("./response"),s=require("readable-stream"),a=require("to-arraybuffer"),c=i.IncomingMessage,u=i.readyStates;functiond(e,t){returno.fetch&&t?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":o.vbArray&&e?"text:vbarray":"text"}varf=module.exports=function(t){varr,n=this;s.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+newe(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(e){n.setHeader(e,t.headers[e])});vari=!0;if("disable-fetch"===t.mode||"requestTimeout"int&&!o.abortController)i=!1,r=!0;elseif("prefer-streaming"===t.mode)r=!1;elseif("allow-wrong-content-type"===t.mode)r=!o.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)thrownewError("Invalid value for opts.mode");r=!0}n._mode=d(r,i),n._fetchTimer=null,n.on("finish",function(){n._onFinish()})};functionh(e){try{vart=e.status;returnnull!==t&&0!==t}catch(r){return!1}}n(f,s.Writable),f.prototype.setHeader=function(e,t){varr=e.toLowerCase();-1===p.indexOf(r)&&(this._headers[r]={name:e,value:t})},f.prototype.getHeader=function(e){vart=this._headers[e.toLowerCase()];returnt?t.value:null},f.prototype.removeHeader=function(e){deletethis._headers[e.toLowerCase()]},f.prototype._onFinish=function(){varn=this;if(!n._destroyed){vari=n._opts,s=n._headers,c=null;"GET"!==i.method&&"HEAD"!==i.method&&(c=o.arraybuffer?a(e.concat(n._body)):o.blobConstructor?newt.Blob(n._body.map(function(e){returna(e)}),{type:(s["content-type"]||{}).value||""}):e.concat(n._body).toString());vard=[];if(Object.keys(s).forEach(function(e){vart=s[e].name,r=s[e].value;Array.isArray(r)?r.forEach(function(e){d.push([t,e])}):d.push([t,r])}),"fetch"===n._mode){varf=null;if(o.abortController){varh=newAbortController;f=h.signal,n._fetchAbortController=h,"requestTimeout"ini&&0!==i.requestTimeout&&(n._fetchTimer=t.setTimeout(function(){n.emit("requestTimeout"),n._fetchAbortController&&n._fetchAbortController.abort()},i.requestTimeout))}t.fetch(n._opts.url,{method:n._opts.method,headers:d,body:c||void0,mode:"cors",credentials:i.withCredentials?"include":"same-origin",signal:f}).then(function(e){n._fetchResponse=e,n._connect()},function(e){t.clearTimeout(n._fetchTimer),n._destroyed||n.emit("error",e)})}else{varp=n._xhr=newt.XMLHttpRequest;try{p.open(n._opts.method,n._opts.url,!0)}catch(l){returnvoidr.nextTick(function(){n.emit("error",l)})}"responseType"inp&&(p.responseType=n._mode.split(":")[0]),"withCredentials"inp&&(p.withCredentials=!!i.withCredentials),"text"===n._mode&&"overrideMimeType"inp&&p.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"ini&&(p.timeout=i.requestTimeout,p.ontimeout=function(){n.emit("requestTimeout")}),d.forEach(function(e){p.setRequestHeader(e[0],e[1])}),n._response=null,p.onreadystatechange=function(){switch(p.readyState){caseu.LOADING:caseu.DONE:n._onXHRProgress()}},"moz-chunked-arraybuffer"===n._mode&&(p.onprogress=function(){n._onXHRProgress()}),p.onerror=function(){n._destroyed||n.emit("error",newError("XHR error"))};try{p.send(c)}catch(l){returnvoidr.nextTick(function(){n.emit("error",l)})}}}},f.prototype._onXHRProgress=function(){h(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},f.prototype._connect=function(){vare=this;e._destroyed||(e._response=newc(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},f.prototype._write=function(e,t,r){this._body.push(e),r()},f.prototype.abort=f.prototype.destroy=function(){this._destroyed=!0,t.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},f.prototype.end=function(e,t,r){"function"==typeofe&&(r=e,e=void0),s.Writable.prototype.end.call(this,e,t,r)},f.prototype.flushHeaders=function(){},f.prototype.setTimeout=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};varp=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];
"use strict";vart=require("punycode"),s=require("./util");functionh(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}exports.parse=b,exports.resolve=O,exports.resolveObject=d,exports.format=q,exports.Url=h;vare=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,r=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r","\n","\t"],n=["{","}","|","\\","^","`"].concat(o),i=["'"].concat(n),l=["%","/","?",";","#"].concat(i),p=["/","?","#"],c=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=require("querystring");functionb(t,e,a){if(t&&s.isObject(t)&&tinstanceofh)returnt;varr=newh;returnr.parse(t,e,a),r}functionq(t){returns.isString(t)&&(t=b(t)),tinstanceofh?t.format():h.prototype.format.call(t)}functionO(t,s){returnb(t,!1,!0).resolve(s)}functiond(t,s){returnt?b(t,!1,!0).resolveObject(s):s}h.prototype.parse=function(h,a,o){if(!s.isString(h))thrownewTypeError("Parameter 'url' must be a string, not "+typeofh);varn=h.indexOf("?"),b=-1!==n&&n<h.indexOf("#")?"?":"#",q=h.split(b);q[0]=q[0].replace(/\\/g,"/");varO=h=q.join(b);if(O=O.trim(),!o&&1===h.split("#").length){vard=r.exec(O);if(d)returnthis.path=O,this.href=O,this.pathname=d[1],d[2]?(this.search=d[2],this.query=a?y.parse(this.search.substr(1)):this.search.substr(1)):a&&(this.search="",this.query={}),this}varj=e.exec(O);if(j){varx=(j=j[0]).toLowerCase();this.protocol=x,O=O.substr(j.length)}if(o||j||O.match(/^\/\/[^@\/]+@[^@\/]+/)){varA="//"===O.substr(0,2);!A||j&&v[j]||(O=O.substr(2),this.slashes=!0)}if(!v[j]&&(A||j&&!g[j])){for(varC,I,w=-1,U=0;U<p.length;U++){-1!==(k=O.indexOf(p[U]))&&(-1===w||k<w)&&(w=k)}-1!==(I=-1===w?O.lastIndexOf("@"):O.lastIndexOf("@",w))&&(C=O.slice(0,I),O=O.slice(I+1),this.auth=decodeURIComponent(C)),w=-1;for(U=0;U<l.length;U++){vark;-1!==(k=O.indexOf(l[U]))&&(-1===w||k<w)&&(w=k)}-1===w&&(w=O.length),this.host=O.slice(0,w),O=O.slice(w),this.parseHost(),this.hostname=this.hostname||"";varN="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(varR=this.hostname.split(/\./),S=(U=0,R.length);U<S;U++){var$=R[U];if($&&!$.match(u)){for(varz="",H=0,L=$.length;H<L;H++)$.charCodeAt(H)>127?z+="x":z+=$[H];if(!z.match(u)){varZ=R.slice(0,U),_=R.slice(U+1),E=$.match(f);E&&(Z.push(E[1]),_.unshift(E[2])),_.length&&(O="/"+_.join(".")+O),this.hostname=Z.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=t.toASCII(this.hostname));varP=this.port?":"+this.port:"",T=this.hostname||"";this.host=T+P,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==O[0]&&(O="/"+O))}if(!m[x])for(U=0,S=i.length;U<S;U++){varB=i[U];if(-1!==O.indexOf(B)){varD=encodeURIComponent(B);D===B&&(D=escape(B)),O=O.split(B).join(D)}}varF=O.indexOf("#");-1!==F&&(this.hash=O.substr(F),O=O.slice(0,F));varG=O.indexOf("?");if(-1!==G?(this.search=O.substr(G),this.query=O.substr(G+1),a&&(this.query=y.parse(this.query)),O=O.slice(0,G)):a&&(this.search="",this.query={}),O&&(this.pathname=O),g[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){P=this.pathname||"";varJ=this.search||"";this.path=P+J}returnthis.href=this.format(),this},h.prototype.format=function(){vart=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");varh=this.protocol||"",e=this.pathname||"",a=this.hash||"",r=!1,o="";this.host?r=t+this.host:this.hostname&&(r=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&s.isObject(this.query)&&Object.keys(this.query).length&&(o=y.stringify(this.query));varn=this.search||o&&"?"+o||"";returnh&&":"!==h.substr(-1)&&(h+=":"),this.slashes||(!h||g[h])&&!1!==r?(r="//"+(r||""),e&&"/"!==e.charAt(0)&&(e="/"+e)):r||(r=""),a&&"#"!==a.charAt(0)&&(a="#"+a),n&&"?"!==n.charAt(0)&&(n="?"+n),h+r+(e=e.replace(/[?#]/g,function(t){returnencodeURIComponent(t)}))+(n=n.replace("#","%23"))+a},h.prototype.resolve=function(t){returnthis.resolveObject(b(t,!1,!0)).format()},h.prototype.resolveObject=function(t){if(s.isString(t)){vare=newh;e.parse(t,!1,!0),t=e}for(vara=newh,r=Object.keys(this),o=0;o<r.length;o++){varn=r[o];a[n]=this[n]}if(a.hash=t.hash,""===t.href)returna.href=a.format(),a;if(t.slashes&&!t.protocol){for(vari=Object.keys(t),l=0;l<i.length;l++){varp=i[l];"protocol"!==p&&(a[p]=t[p])}returng[a.protocol]&&a.hostname&&!a.pathname&&(a.path=a.pathname="/"),a.href=a.format(),a}if(t.protocol&&t.protocol!==a.protocol){if(!g[t.protocol]){for(varc=Object.keys(t),u=0;u<c.length;u++){varf=c[u];a[f]=t[f]}returna.href=a.format(),a}if(a.protocol=t.protocol,t.host||v[t.protocol])a.pathname=t.pathnaLine truncated
vart=require("buffer").Buffer,e=this&&this.__extends||function(){vart=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(t,e){t.__proto__=e}||function(t,e){for(varnine)e.hasOwnProperty(n)&&(t[n]=e[n])};returnfunction(e,n){functionr(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,newr)}}();Object.defineProperty(exports,"__esModule",{value:!0});varn=require("./xml-http-request-event-target"),r=function(n){functionr(){vart=n.call(this)||this;returnt._contentType=null,t._body=null,t._reset(),t}returne(r,n),r.prototype._reset=function(){this._contentType=null,this._body=null},r.prototype._setData=function(e){if(null!=e)if("string"==typeofe)0!==e.length&&(this._contentType="text/plain;charset=UTF-8"),this._body=newt(e,"utf-8");elseif(t.isBuffer(e))this._body=e;elseif(einstanceofArrayBuffer){for(varn=newt(e.byteLength),r=newUint8Array(e),o=0;o<e.byteLength;o++)n[o]=r[o];this._body=n}else{if(!(e.buffer&&e.bufferinstanceofArrayBuffer))thrownewError("Unsupported send() data "+e);n=newt(e.byteLength);vari=e.byteOffset;for(r=newUint8Array(e.buffer),o=0;o<e.byteLength;o++)n[o]=r[o+i];this._body=n}},r.prototype._finalizeHeaders=function(t,e){this._contentType&&!e["content-type"]&&(t["Content-Type"]=this._contentType),this._body&&(t["Content-Length"]=this._body.length.toString())},r.prototype._startUpload=function(t){this._body&&t.write(this._body),t.end()},r}(n.XMLHttpRequestEventTarget);exports.XMLHttpRequestUpload=r;
!function(){"use strict";functiont(i,e,n,r){returnthisinstanceoft?(this.domain=i||void0,this.path=e||"/",this.secure=!!n,this.script=!!r,this):newt(i,e,n,r)}functioni(t,e,n){returntinstanceofi?t:thisinstanceofi?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(n||"/"),this.explicit_path=!1,this.domain=e||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,t&&this.parse(t,e,n),this):newi(t,e,n)}t.All=Object.freeze(Object.create(null)),exports.CookieAccessInfo=t,exports.Cookie=i,i.prototype.toString=function(){vart=[this.name+"="+this.value];returnthis.expiration_date!==1/0&&t.push("expires="+newDate(this.expiration_date).toGMTString()),this.domain&&t.push("domain="+this.domain),this.path&&t.push("path="+this.path),this.secure&&t.push("secure"),this.noscript&&t.push("httponly"),t.join("; ")},i.prototype.toValueString=function(){returnthis.name+"="+this.value};vare=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;functionn(){vart,e;returnthisinstanceofn?(t=Object.create(null),this.setCookie=function(n,r,s){varo,a;if(o=(n=newi(n,r,s)).expiration_date<=Date.now(),void0!==t[n.name]){for(e=t[n.name],a=0;a<e.length;a+=1)if(e[a].collidesWith(n))returno?(e.splice(a,1),0===e.length&&deletet[n.name],!1):(e[a]=n,n);return!o&&(e.push(n),n)}return!o&&(t[n.name]=[n],t[n.name])},this.getCookie=function(i,n){varr,s;if(e=t[i])for(s=0;s<e.length;s+=1)if((r=e[s]).expiration_date<=Date.now())0===e.length&&deletet[r.name];elseif(r.matches(n))returnr},this.getCookies=function(i){vare,n,r=[];for(eint)(n=this.getCookie(e,i))&&r.push(n);returnr.toString=function(){returnr.join(":")},r.toValueString=function(){returnr.map(function(t){returnt.toValueString()}).join("; ")},r},this):newn}i.prototype.parse=function(t,e,n){if(thisinstanceofi){varr,s=t.split(";").filter(function(t){return!!t}),o=s[0].match(/([^=]+)=([\s\S]*)/);if(!o)returnvoidconsole.warn("Invalid cookie header encountered. Header: '"+t+"'");vara=o[1],h=o[2];if("string"!=typeofa||0===a.length||"string"!=typeofh)returnvoidconsole.warn("Unable to extract values from cookie header. Cookie: '"+t+"'");for(this.name=a,this.value=h,r=1;r<s.length;r+=1)switch(a=(o=s[r].match(/([^=]+)(?:=([\s\S]*))?/))[1].trim().toLowerCase(),h=o[2],a){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=h?Number(Date.parse(h)):1/0;break;case"path":this.path=h?h.trim():"",this.explicit_path=!0;break;case"domain":this.domain=h?h.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0}returnthis.explicit_path||(this.path=n||"/"),this.explicit_domain||(this.domain=e),this}return(newi).parse(t,e,n)},i.prototype.matches=function(i){returni===t.All||!(this.noscript&&i.script||this.secure&&!i.secure||!this.collidesWith(i))},i.prototype.collidesWith=function(t){if(this.path&&!t.path||this.domain&&!t.domain)return!1;if(this.path&&0!==t.path.indexOf(this.path))return!1;if(this.explicit_path&&0!==t.path.indexOf(this.path))return!1;vari=t.domain&&t.domain.replace(/^[\.]/,""),e=this.domain&&this.domain.replace(/^[\.]/,"");if(e===i)return!0;if(e){if(!this.explicit_domain)return!1;varn=i.indexOf(e);return-1!==n&&n===i.length-e.length}return!0},exports.CookieJar=n,n.prototype.setCookies=function(t,n,r){vars,o,a=[];for(t=(t=Array.isArray(t)?t:t.split(e)).map(function(t){returnnewi(t,n,r)}),s=0;s<t.length;s+=1)o=t[s],this.setCookie(o,n,r)&&a.push(o);returna}}();
},{}],"hpi2":[function(require,module,exports){
varprocess=require("process");
varBuffer=require("buffer").Buffer;
vare=require("process"),t=require("buffer").Buffer,s=this&&this.__extends||function(){vare=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,t){e.__proto__=t}||function(e,t){for(varsint)t.hasOwnProperty(s)&&(e[s]=t[s])};returnfunction(t,s){functionr(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(r.prototype=s.prototype,newr)}}(),r=this&&this.__assign||Object.assign||function(e){for(vart,s=1,r=arguments.length;s<r;s++)for(varoint=arguments[s])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);returne};Object.defineProperty(exports,"__esModule",{value:!0});varo=require("http"),n=require("https"),i=require("os"),a=require("url"),h=require("./progress-event"),p=require("./errors"),l=require("./xml-http-request-event-target"),d=require("./xml-http-request-upload"),u=require("cookiejar"),_=function(l){function_(t){void0===t&&(t={});vars=l.call(this)||this;returns.UNSENT=_.UNSENT,s.OPENED=_.OPENED,s.HEADERS_RECEIVED=_.HEADERS_RECEIVED,s.LOADING=_.LOADING,s.DONE=_.DONE,s.onreadystatechange=null,s.readyState=_.UNSENT,s.response=null,s.responseText="",s.responseType="",s.status=0,s.statusText="",s.timeout=0,s.upload=newd.XMLHttpRequestUpload,s.responseUrl="",s.withCredentials=!1,s._method=null,s._url=null,s._sync=!1,s._headers={},s._loweredHeaders={},s._mimeOverride=null,s._request=null,s._response=null,s._responseParts=null,s._responseHeaders=null,s._aborting=null,s._error=null,s._loadedBytes=0,s._totalBytes=0,s._lengthComputable=!1,s._restrictedMethods={CONNECT:!0,TRACE:!0,TRACK:!0},s._restrictedHeaders={"accept-charset":!0,"accept-encoding":!0,"access-control-request-headers":!0,"access-control-request-method":!0,connection:!0,"content-length":!0,cookie:!0,cookie2:!0,date:!0,dnt:!0,expect:!0,host:!0,"keep-alive":!0,origin:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,via:!0},s._privateHeaders={"set-cookie":!0,"set-cookie2":!0},s._userAgent="Mozilla/5.0 ("+i.type()+" "+i.arch()+") node.js/"+e.versions.node+" v8/"+e.versions.v8,s._anonymous=t.anon||!1,s}returns(_,l),_.prototype.open=function(e,t,s,r,o){if(void0===s&&(s=!0),e=e.toUpperCase(),this._restrictedMethods[e])thrownew_.SecurityError("HTTP method "+e+" is not allowed in XHR");varn=this._parseUrl(t,r,o);this.readyState===_.HEADERS_RECEIVED||(this.readyState,_.LOADING),this._method=e,this._url=n,this._sync=!s,this._headers={},this._loweredHeaders={},this._mimeOverride=null,this._setReadyState(_.OPENED),this._request=null,this._response=null,this.status=0,this.statusText="",this._responseParts=[],this._responseHeaders=null,this._loadedBytes=0,this._totalBytes=0,this._lengthComputable=!1},_.prototype.setRequestHeader=function(e,t){if(this.readyState!==_.OPENED)thrownew_.InvalidStateError("XHR readyState must be OPENED");vars=e.toLowerCase();this._restrictedHeaders[s]||/^sec-/.test(s)||/^proxy-/.test(s)?console.warn('Refused to set unsafe header "'+e+'"'):(t=t.toString(),null!=this._loweredHeaders[s]?(e=this._loweredHeaders[s],this._headers[e]=this._headers[e]+", "+t):(this._loweredHeaders[s]=e,this._headers[e]=t))},_.prototype.send=function(e){if(this.readyState!==_.OPENED)thrownew_.InvalidStateError("XHR readyState must be OPENED");if(this._request)thrownew_.InvalidStateError("send() already called");switch(this._url.protocol){case"file:":returnthis._sendFile(e);case"http:":case"https:":returnthis._sendHttp(e);default:thrownew_.NetworkError("Unsupported protocol "+this._url.protocol)}},_.prototype.abort=function(){null!=this._request&&(this._request.abort(),this._setError(),this._dispatchProgress("abort"),this._dispatchProgress("loadend"))},_.prototype.getResponseHeader=function(e){if(null==this._responseHeaders||null==e)returnnull;vart=e.toLowerCase();returnthis._responseHeaders.hasOwnProperty(t)?this._responseHeaders[e.toLowerCase()]:null},_.prototype.getAllResponseHeaders=function(){vare=this;returnnull==this._responseHeaders?"":Object.keys(this._responseHeaders).map(function(t){returnt+": "+e._responseHeaders[t]}).join("\r\n")},_.prototype.overrideMimeType=function(e){if(this.readyState===_.LOADING||this.readyState===_.DONE)thrownew_.InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");this._mimeOverride=e.toLowerCase()},_.prototype.nodejsSet=function(e){if(this.nodejsHttpAgent=e.httpAgent||this.nodejsHttpAgent,this.nodejsHttpsAgent=e.httpsAgent||this.nodejsHttpsAgent,e.hasOwnProperty("baseUrl")){if(null!=e.baseUrl)if(!a.parse(e.baseUrl,!1,!0).protocol)thrownew_.SyntaxError("baseUrl must be an absolute URL");this.nodejsBaseUrl=e.baseUrl}},_.nodejsSet=function(e){_.prototype.nodejsSet(e)},_.prototype._setReadyState=function(e){this.readyState=e,this.dispatchEvent(newh.ProgressEvent("readystatechange"))},_.prototype._sendFile=function(e){thrownewError("Protocol file: not implemented")},_.prototype._sendHttp=function(e){if(this._sync)thrownewError("Synchronous XHR processing not implemented");!e||"GET"!==this._method&&"Line truncated
"use strict";vart=require("../utils/utils"),n=require("./errors"),e=function(n,e){varo=this;this.responseCallbacks={},this.path=n,this.connection=e.connect({path:this.path}),this.connection.on("error",function(t){console.error("IPC Connection Error",t),o._timeout()}),this.connection.on("end",function(){o._timeout()}),this.connection.on("data",function(n){o._parseResponse(n.toString()).forEach(function(n){vare=null;t.isArray(n)?n.forEach(function(t){o.responseCallbacks[t.id]&&(e=t.id)}):e=n.id,o.responseCallbacks[e]&&(o.responseCallbacks[e](null,n),deleteo.responseCallbacks[e])})})};e.prototype._parseResponse=function(t){vare=this,o=[];returnt.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(t){e.lastChunk&&(t=e.lastChunk+t);vars=null;try{s=JSON.parse(t)}catch(i){returne.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout(function(){throwe._timeout(),n.InvalidResponse(t)},15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,s&&o.push(s)}),o},e.prototype._addResponseCallback=function(t,n){vare=t.id||t[0].id,o=t.method||t[0].method;this.responseCallbacks[e]=n,this.responseCallbacks[e].method=o},e.prototype._timeout=function(){for(vartinthis.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](n.InvalidConnection("on IPC")),deletethis.responseCallbacks[t])},e.prototype.isConnected=function(){returnthis.connection.writable||this.connection.connect({path:this.path}),!!this.connection.writable},e.prototype.send=function(t){if(this.connection.writeSync){vare;this.connection.writable||this.connection.connect({path:this.path});varo=this.connection.writeSync(JSON.stringify(t));try{e=JSON.parse(o)}catch(s){thrown.InvalidResponse(o)}returne}thrownewError('You tried to send "'+t.method+'" synchronously. Synchronous requests are not supported by the IPC provider.')},e.prototype.sendAsync=function(t,n){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(t)),this._addResponseCallback(t,n)},module.exports=e;
"use strict";functione(e,r){if(!(einstanceofr))thrownewTypeError("Cannot call a class as a function")}functionr(e,r){for(vart=0;t<r.length;t++){varn=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}functiont(e,t,n){returnt&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}varn=function(){functionr(t){e(this,r),this.rpcUrl=t}returnt(r,[{key:"getNonce",value:function(e){returnthis.call({jsonrpc:"2.0",method:"eth_getTransactionCount",params:[e,"pending"]}).then(function(e){returne.result})}},{key:"getBlockNumber",value:function(){returnthis.call({jsonrpc:"2.0",method:"eth_blockNumber",params:[]}).then(function(e){returne.result})}},{key:"getBlockByNumber",value:function(e){returnthis.call({jsonrpc:"2.0",method:"eth_getBlockByNumber",params:[e,!1]}).then(function(e){returne.result})}},{key:"getFilterLogs",value:function(e){returnthis.call({jsonrpc:"2.0",method:"eth_getLogs",params:[e]})}},{key:"call",value:function(e){returnfetch(this.rpcUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)}).then(function(e){returne.json()}).then(function(e){if(!e.result&&e.error)throwconsole.log("<== rpc error",e.error),newError(e.error.message||"rpc error");returne})}}]),r}();module.exports=n;
},{}],"MNFS":[function(require,module,exports){
"use strict";functiont(e){return(t="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft})(e)}functione(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionn(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}functionr(t,e,r){returne&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functiono(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}functionu(t){vare=l();returnfunction(){varn,r=y(t);if(e){varo=y(this).constructor;n=Reflect.construct(r,arguments,o)}elsen=r.apply(this,arguments);returnc(this,n)}}functionc(e,n){if(n&&("object"===t(n)||"function"==typeofn))returnn;if(void0!==n)thrownewTypeError("Derived constructors may only return object or undefined");returni(e)}functioni(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionf(t){vare="function"==typeofMap?newMap:void0;return(f=function(t){if(null===t||!p(t))returnt;if("function"!=typeoft)thrownewTypeError("Super expression must either be null or a function");if(void0!==e){if(e.has(t))returne.get(t);e.set(t,n)}functionn(){returna(t,arguments,y(this).constructor)}returnn.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)})(t)}functiona(t,e,n){return(a=l()?Reflect.construct:function(t,e,n){varr=[null];r.push.apply(r,e);varo=new(Function.bind.apply(t,r));returnn&&s(o,n.prototype),o}).apply(null,arguments)}functionl(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}functionp(t){return-1!==Function.toString.call(t).indexOf("[native code]")}functions(t,e){return(s=Object.setPrototypeOf||function(t,e){returnt.__proto__=e,t})(t,e)}functiony(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){returnt.__proto__||Object.getPrototypeOf(t)})(t)}varb=function(t){o(c,f(Error));varn=u(c);functionc(t,r){varo;returne(this,c),(o=n.call(this)).code=t,o.message=r,o}returnr(c,[{key:"toString",value:function(){return"".concat(this.message," (").concat(this.code,")")}}]),c}();module.exports=b;
},{}],"FOZT":[function(require,module,exports){
"use strict";varr=require("buffer");functione(r){returnu(r)||o(r)||t(r)||n()}functionn(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functiont(r,e){if(r){if("string"==typeofr)returna(r,e);varn=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(r,e):void0}}functiono(r){if("undefined"!=typeofSymbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])returnArray.from(r)}functionu(r){if(Array.isArray(r))returna(r)}functiona(r,e){(null==e||e>r.length)&&(e=r.length);for(varn=0,t=newArray(e);n<e;n++)t[n]=r[n];returnt}functionf(r,e){if(!(rinstanceofe))thrownewTypeError("Cannot call a class as a function")}functioni(r,e){for(varn=0;n<e.length;n++){vart=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"int&&(t.writable=!0),Object.defineProperty(r,t.key,t)}}functionl(r,e,n){returne&&i(r.prototype,e),n&&i(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}varc=function(){functionn(){f(this,n)}returnl(n,null,[{key:"genId",value:function(){return(newDate).getTime()+Math.floor(1e3*Math.random())}},{key:"flatMap",value:function(r,n){vart;return(t=[]).concat.apply(t,e(r.map(n)))}},{key:"intRange",value:function(r,e){returnr>=e?[]:newArray(e-r).fill().map(function(e,n){returnn+r})}},{key:"hexToInt",value:function(r){returnnull==r?r:Number.parseInt(r,16)}},{key:"intToHex",value:function(r){returnnull==r?r:"0x"+r.toString(16)}},{key:"messageToBuffer",value:function(e){varn=r.Buffer.from([]);try{n="string"==typeofe?r.Buffer.from(e.replace("0x",""),"hex"):r.Buffer.from(e)}catch(t){console.log("messageToBuffer error: ".concat(t))}returnn}},{key:"bufferToHex",value:function(e){return"0x"+r.Buffer.from(e).toString("hex")}}]),n}();module.exports=c;
"use strict";vare=t(require("./utils"));functiont(e){returne&&e.__esModule?e:{default:e}}functionn(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functioni(e,t){for(varn=0;n<t.length;n++){vari=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"ini&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}functionr(e,t,n){returnt&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}varu=function(){functiont(){n(this,t),this.intIds=newMap}returnr(t,[{key:"tryIntifyId",value:function(t){if(t.id){if("number"!=typeoft.id){varn=e.default.genId();this.intIds.set(n,t.id),t.id=n}}elset.id=e.default.genId()}},{key:"tryRestoreId",value:function(e){vart=this.tryPopId(e.id);t&&(e.id=t)}},{key:"tryPopId",value:function(e){vart=this.intIds.get(e);returnt&&this.intIds.delete(e),t}}]),t}();module.exports=u;
vart=require("buffer").Buffer;functione(t){return(e="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft})(t)}functionr(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionn(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}functioni(t,e,r){returne&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functiono(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}functionu(t,e){return(u=Object.setPrototypeOf||function(t,e){returnt.__proto__=e,t})(t,e)}functiona(t){vare=c();returnfunction(){varr,n=l(t);if(e){vari=l(this).constructor;r=Reflect.construct(n,arguments,i)}elser=n.apply(this,arguments);returnf(this,r)}}functionf(t,r){if(r&&("object"===e(r)||"function"==typeofr))returnr;if(void0!==r)thrownewTypeError("Derived constructors may only return object or undefined");returns(t)}functions(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionc(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}functionl(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){returnt.__proto__||Object.getPrototypeOf(t)})(t)}varh=require("readable-stream"),y=h.Transform;module.exports=function(e){returnfunction(n){o(f,y);varu=a(f);functionf(t,n,i,o,a){vars;returnr(this,f),(s=u.call(this,a))._rate=t,s._capacity=n,s._delimitedSuffix=i,s._hashBitLength=o,s._options=a,s._state=newe,s._state.initialize(t,n),s._finalized=!1,s}returni(f,[{key:"_transform",value:function(t,e,r){varn=null;try{this.update(t,e)}catch(i){n=i}r(n)}},{key:"_flush",value:function(t){vare=null;try{this.push(this.digest())}catch(r){e=r}t(e)}},{key:"update",value:function(e,r){if(!t.isBuffer(e)&&"string"!=typeofe)thrownewTypeError("Data must be a string or a buffer");if(this._finalized)thrownewError("Digest already called");returnt.isBuffer(e)||(e=t.from(e,r)),this._state.absorb(e),this}},{key:"digest",value:function(t){if(this._finalized)thrownewError("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);vare=this._state.squeeze(this._hashBitLength/8);returnvoid0!==t&&(e=e.toString(t)),this._resetState(),e}},{key:"_resetState",value:function(){returnthis._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){vart=newf(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);returnthis._state.copy(t._state),t._finalized=this._finalized,t}}]),f}()};
vart=require("buffer").Buffer;functione(t){return(e="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft})(t)}functionr(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionn(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}functiono(t,e,r){returne&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functioni(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}functionu(t,e){return(u=Object.setPrototypeOf||function(t,e){returnt.__proto__=e,t})(t,e)}functionf(t){vare=s();returnfunction(){varr,n=l(t);if(e){varo=l(this).constructor;r=Reflect.construct(n,arguments,o)}elser=n.apply(this,arguments);returna(this,r)}}functiona(t,r){if(r&&("object"===e(r)||"function"==typeofr))returnr;if(void0!==r)thrownewTypeError("Derived constructors may only return object or undefined");returnc(t)}functionc(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functions(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}functionl(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){returnt.__proto__||Object.getPrototypeOf(t)})(t)}vary=require("readable-stream"),p=y.Transform;module.exports=function(e){returnfunction(n){i(a,p);varu=f(a);functiona(t,n,o,i){varf;returnr(this,a),(f=u.call(this,i))._rate=t,f._capacity=n,f._delimitedSuffix=o,f._options=i,f._state=newe,f._state.initialize(t,n),f._finalized=!1,f}returno(a,[{key:"_transform",value:function(t,e,r){varn=null;try{this.update(t,e)}catch(o){n=o}r(n)}},{key:"_flush",value:function(){}},{key:"_read",value:function(t){this.push(this.squeeze(t))}},{key:"update",value:function(e,r){if(!t.isBuffer(e)&&"string"!=typeofe)thrownewTypeError("Data must be a string or a buffer");if(this._finalized)thrownewError("Squeeze already called");returnt.isBuffer(e)||(e=t.from(e,r)),this._state.absorb(e),this}},{key:"squeeze",value:function(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));varr=this._state.squeeze(t);returnvoid0!==e&&(r=r.toString(e)),r}},{key:"_resetState",value:function(){returnthis._state.initialize(this._rate,this._capacity),this}},{key:"_clone",value:function(){vart=newa(this._rate,this._capacity,this._delimitedSuffix,this._options);returnthis._state.copy(t._state),t._finalized=this._finalized,t}}]),a}()};
functione(e,t){varn="undefined"!=typeofSymbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeofe.length){n&&(e=n);varo=0,a=function(){};return{s:a,n:function(){returno>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throwe},f:a}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}vari,c=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){vare=n.next();returnc=e.done,e},e:function(e){u=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(u)throwi}}}}functionr(e,r){if(e){if("string"==typeofe)returnt(e,r);varn=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,r):void0}}functiont(e,r){(null==r||r>e.length)&&(r=e.length);for(vart=0,n=newArray(r);t<r;t++)n[t]=e[t];returnn}varn={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};functiono(e,r){if(!e)thrownewError(r)}functiona(e,r,t){if(o(rinstanceofUint8Array,"Expected ".concat(e," to be an Uint8Array")),void0!==t)if(Array.isArray(t)){varn=t.join(", "),a="Expected ".concat(e," to be an Uint8Array with length [").concat(n,"]");o(t.includes(r.length),a)}else{vari="Expected ".concat(e," to be an Uint8Array with length ").concat(t);o(r.length===t,i)}}functioni(e){o("Boolean"===u(e),"Expected compressed to be a Boolean")}functionc(){vare=arguments.length>0&&void0!==arguments[0]?arguments[0]:function(e){returnnewUint8Array(e)},r=arguments.length>1?arguments[1]:void0;return"function"==typeofe&&(e=e(r)),a("output",e,r),e}functionu(e){returnObject.prototype.toString.call(e).slice(8,-1)}module.exports=function(r){return{contextRandomize:function(e){switch(o(null===e||einstanceofUint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&a("seed",e,32),r.contextRandomize(e)){case1:thrownewError(n.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify:function(e){returna("private key",e,32),0===r.privateKeyVerify(e)},privateKeyNegate:function(e){switch(a("private key",e,32),r.privateKeyNegate(e)){case0:returne;case1:thrownewError(n.IMPOSSIBLE_CASE)}},privateKeyTweakAdd:function(e,t){switch(a("private key",e,32),a("tweak",t,32),r.privateKeyTweakAdd(e,t)){case0:returne;case1:thrownewError(n.TWEAK_ADD)}},privateKeyTweakMul:function(e,t){switch(a("private key",e,32),a("tweak",t,32),r.privateKeyTweakMul(e,t)){case0:returne;case1:thrownewError(n.TWEAK_MUL)}},publicKeyVerify:function(e){returna("public key",e,[33,65]),0===r.publicKeyVerify(e)},publicKeyCreate:function(e){vart=!(arguments.length>1&&void0!==arguments[1])||arguments[1],o=arguments.length>2?arguments[2]:void0;switch(a("private key",e,32),i(t),o=c(o,t?33:65),r.publicKeyCreate(o,e)){case0:returno;case1:thrownewError(n.SECKEY_INVALID);case2:thrownewError(n.PUBKEY_SERIALIZE)}},publicKeyConvert:function(e){vart=!(arguments.length>1&&void0!==arguments[1])||arguments[1],o=arguments.length>2?arguments[2]:void0;switch(a("public key",e,[33,65]),i(t),o=c(o,t?33:65),r.publicKeyConvert(o,e)){case0:returno;case1:thrownewError(n.PUBKEY_PARSE);case2:thrownewError(n.PUBKEY_SERIALIZE)}},publicKeyNegate:function(e){vart=!(arguments.length>1&&void0!==arguments[1])||arguments[1],o=arguments.length>2?arguments[2]:void0;switch(a("public key",e,[33,65]),i(t),o=c(o,t?33:65),r.publicKeyNegate(o,e)){case0:returno;case1:thrownewError(n.PUBKEY_PARSE);case2:thrownewError(n.IMPOSSIBLE_CASE);case3:thrownewError(n.PUBKEY_SERIALIZE)}},publicKeyCombine:function(t){varu=!(arguments.length>1&&void0!==arguments[1])||arguments[1],s=arguments.length>2?arguments[2]:void0;o(Array.isArray(t),"Expected public keys to be an Array"),o(t.length>0,"Expected public keys array will have more than zero items");varl,E=e(t);try{for(E.s();!(l=E.n()).done;){a("public key",l.value,[33,65])}}catch(w){E.e(w)}finally{E.f()}switch(i(u),s=c(s,u?33:65),r.publicKeyCombine(s,t)){case0:returns;case1:thrownewError(n.PUBKEY_PARSE);case2:thrownewError(n.PUBKEY_COMBINE);case3:thrownewError(n.PUBKEY_SERIALIZE)}},publicKeyTweakAdd:function(e,t){varo=!(arguments.length>2&&void0!==arguments[2])||arguments[2],u=arguments.length>3?arguments[3]:void0;switch(a(Line truncated
},{}],"IAXI":[function(require,module,exports){
varr=require("elliptic").ec,e=newr("secp256k1"),n=e.curve,t=n.n.constructor;functionu(r,u){vari=newt(u);if(i.cmp(n.p)>=0)returnnull;vara=(i=i.toRed(n.red)).redSqr().redIMul(i).redIAdd(n.b).redSqrt();return3===r!==a.isOdd()&&(a=a.redNeg()),e.keyPair({pub:{x:i,y:a}})}functioni(r,u,i){vara=newt(u),c=newt(i);if(a.cmp(n.p)>=0||c.cmp(n.p)>=0)returnnull;if(a=a.toRed(n.red),c=c.toRed(n.red),(6===r||7===r)&&c.isOdd()!==(7===r))returnnull;varl=a.redSqr().redIMul(a);returnc.redSqr().redISub(l.redIAdd(n.b)).isZero()?e.keyPair({pub:{x:a,y:c}}):null}functiona(r){vare=r[0];switch(e){case2:case3:return33!==r.length?null:u(e,r.subarray(1,33));case4:case6:case7:return65!==r.length?null:i(e,r.subarray(1,33),r.subarray(33,65));default:returnnull}}functionc(r,e){for(varn=e.encode(null,33===r.length),t=0;t<r.length;++t)r[t]=n[t]}module.exports={contextRandomize:function(){return0},privateKeyVerify:function(r){vare=newt(r);returne.cmp(n.n)<0&&!e.isZero()?0:1},privateKeyNegate:function(r){vare=newt(r),u=n.n.sub(e).umod(n.n).toArrayLike(Uint8Array,"be",32);returnr.set(u),0},privateKeyTweakAdd:function(r,e){varu=newt(e);if(u.cmp(n.n)>=0)return1;if(u.iadd(newt(r)),u.cmp(n.n)>=0&&u.isub(n.n),u.isZero())return1;vari=u.toArrayLike(Uint8Array,"be",32);returnr.set(i),0},privateKeyTweakMul:function(r,e){varu=newt(e);if(u.cmp(n.n)>=0||u.isZero())return1;u.imul(newt(r)),u.cmp(n.n)>=0&&(u=u.umod(n.n));vari=u.toArrayLike(Uint8Array,"be",32);returnr.set(i),0},publicKeyVerify:function(r){returnnull===a(r)?1:0},publicKeyCreate:function(r,u){vari=newt(u);returni.cmp(n.n)>=0||i.isZero()?1:(c(r,e.keyFromPrivate(u).getPublic()),0)},publicKeyConvert:function(r,e){varn=a(e);returnnull===n?1:(c(r,n.getPublic()),0)},publicKeyNegate:function(r,e){varn=a(e);if(null===n)return1;vart=n.getPublic();returnt.y=t.y.redNeg(),c(r,t),0},publicKeyCombine:function(r,e){for(varn=newArray(e.length),t=0;t<e.length;++t)if(n[t]=a(e[t]),null===n[t])return1;for(varu=n[0].getPublic(),i=1;i<n.length;++i)u=u.add(n[i].pub);returnu.isInfinity()?2:(c(r,u),0)},publicKeyTweakAdd:function(r,e,u){vari=a(e);if(null===i)return1;if((u=newt(u)).cmp(n.n)>=0)return2;varl=i.getPublic().add(n.g.mul(u));returnl.isInfinity()?2:(c(r,l),0)},publicKeyTweakMul:function(r,e,u){vari=a(e);returnnull===i?1:(u=newt(u)).cmp(n.n)>=0||u.isZero()?2:(c(r,i.getPublic().mul(u)),0)},signatureNormalize:function(r){varu=newt(r.subarray(0,32)),i=newt(r.subarray(32,64));returnu.cmp(n.n)>=0||i.cmp(n.n)>=0?1:(1===i.cmp(e.nh)&&r.set(n.n.sub(i).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport:function(r,e){varu=e.subarray(0,32),i=e.subarray(32,64);if(newt(u).cmp(n.n)>=0)return1;if(newt(i).cmp(n.n)>=0)return1;vara=r.output,c=a.subarray(4,37);c[0]=0,c.set(u,1);for(varl=33,o=0;l>1&&0===c[o]&&!(128&c[o+1]);--l,++o);if(128&(c=c.subarray(o))[0])return1;if(l>1&&0===c[0]&&!(128&c[1]))return1;vars=a.subarray(39,72);s[0]=0,s.set(i,1);for(varf=33,y=0;f>1&&0===s[y]&&!(128&s[y+1]);--f,++y);return128&(s=s.subarray(y))[0]?1:f>1&&0===s[0]&&!(128&s[1])?1:(r.outputlen=6+l+f,a[0]=48,a[1]=r.outputlen-2,a[2]=2,a[3]=c.length,a.set(c,4),a[4+l]=2,a[5+l]=s.length,a.set(s,6+l),0)},signatureImport:function(r,e){if(e.length<8)return1;if(e.length>72)return1;if(48!==e[0])return1;if(e[1]!==e.length-2)return1;if(2!==e[2])return1;varu=e[3];if(0===u)return1;if(5+u>=e.length)return1;if(2!==e[4+u])return1;vari=e[5+u];if(0===i)return1;if(6+u+i!==e.length)return1;if(128&e[4])return1;if(u>1&&0===e[4]&&!(128&e[5]))return1;if(128&e[u+6])return1;if(i>1&&0===e[u+6]&&!(128&e[u+7]))return1;vara=e.subarray(4,4+u);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return1;varc=e.subarray(6+u);if(33===c.length&&0===c[0]&&(c=c.slice(1)),c.length>32)thrownewError("S length is too long");varl=newt(a);l.cmp(n.n)>=0&&(l=newt(0));varo=newt(e.subarray(6+u));returno.cmp(n.n)>=0&&(o=newt(0)),r.set(l.toArrayLike(Uint8Array,"be",32),0),r.set(o.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign:function(r,u,i,a,c){if(c){varl=c;c=function(r){vare=l(u,i,null,a,r);if(!(einstanceofUint8Array&&32===e.length))thrownewError("This is the way");returnnewt(e)}}varo,s=newt(i);if(s.cmp(n.n)>=0||s.isZero())return1;try{o=e.sign(u,i,{canonical:!0,k:c,pers:a})}catch(f){return1}returnr.signature.set(o.r.toArrayLike(Uint8Array,"be",32),0),r.signature.set(o.s.toArrayLike(Uint8Array,"be",32),32),r.recid=o.recoveryParam,0},ecdsaVerify:function(r,u,i){varc={r:r.subarray(0,32),s:r.subarray(32,64)},l=newt(c.r),o=newt(c.s);if(l.cmp(n.n)>=0||o.cmp(n.n)>=0)return1;if(1===o.cmp(e.nh)||l.isZero()||o.isZero())return3;vars=a(i);if(null===s)return2;varf=s.getPublic();returne.verify(u,c,f)?0:3},ecdsaRecover:function(r,u,i,a){varl,o={r:u.slice(0,32),s:u.slice(32,64)},s=newt(o.r),f=newt(o.s);if(s.cmp(n.n)>=0||f.cmp(n.n)>=0)return1;if(s.isZero()||f.isZero())return2;try{l=e.recoverPubKey(a,o,i)}catch(y){return2}returnc(r,l),0},ecdh:function(r,u,i,c,l,o,s){vaLine truncated
"use strict";vare=this&&this.__awaiter||function(e,t,r,n){returnnew(r||(r=Promise))(function(o,i){functiona(e){try{c(n.next(e))}catch(t){i(t)}}functionu(e){try{c(n.throw(e))}catch(t){i(t)}}functionc(e){vart;e.done?o(e.value):(t=e.value,tinstanceofr?t:newr(function(e){e(t)})).then(a,u)}c((n=n.apply(e,t||[])).next())})},t=this&&this.__generator||function(e,t){varr,n,o,i,a={label:0,sent:function(){if(1&o[0])throwo[1];returno[1]},trys:[],ops:[]};returni={next:u(0),throw:u(1),return:u(2)},"function"==typeofSymbol&&(i[Symbol.iterator]=function(){returnthis}),i;functionu(i){returnfunction(u){returnfunction(i){if(r)thrownewTypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)returno;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case0:case1:o=i;break;case4:returna.label++,{value:i[1],done:!1};case5:a.label++,n=i[1],i=[0];continue;case7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(u){i=[6,u],n=0}finally{r=o=0}if(5&i[0])throwi[1];return{value:i[0]?i[1]:void0,done:!0}}([i,u])}}};functionr(e){for(vartine)exports.hasOwnProperty(t)||(exports[t]=e[t])}Object.defineProperty(exports,"__esModule",{value:!0});varn=require("secp256k1"),o=require("./random"),i=32;functiona(){returne(this,void0,void0,function(){vare;returnt(this,function(t){switch(t.label){case0:return[4,o.getRandomBytes(i)];case1:returne=t.sent(),n.privateKeyVerify(e)?[2,e]:[3,0];case2:return[2]}})})}functionu(){for(;;){vare=o.getRandomBytesSync(i);if(n.privateKeyVerify(e))returne}}exports.createPrivateKey=a,exports.createPrivateKeySync=u,r(require("secp256k1"));
varr=require("buffer").Buffer,e=require("bn.js"),n=require("elliptic").ec,o=newn("secp256k1"),t=o.curve;exports.privateKeyExport=function(r,n){vara=newe(r);if(a.ucmp(t.n)>=0)thrownewError("couldn't export to DER format");varu=o.g.mul(a);returni(u.getX(),u.getY(),n)},exports.privateKeyModInverse=function(n){varo=newe(n);if(o.ucmp(t.n)>=0||o.isZero())thrownewError("private key range is invalid");returno.invm(t.n).toArrayLike(r,"be",32)},exports.signatureImport=function(n){varo=newe(n.r);o.ucmp(t.n)>=0&&(o=newe(0));vari=newe(n.s);returni.ucmp(t.n)>=0&&(i=newe(0)),r.concat([o.toArrayLike(r,"be",32),i.toArrayLike(r,"be",32)])},exports.ecdhUnsafe=function(r,n,a){varu=o.keyFromPublic(r),c=newe(n);if(c.ucmp(t.n)>=0||c.isZero())thrownewError("scalar was invalid (zero or overflow)");varp=u.pub.mul(c);returni(p.getX(),p.getY(),a)};vari=function(e,n,o){vart=void0;returno?((t=r.alloc(33))[0]=n.isOdd()?3:2,e.toArrayLike(r,"be",32).copy(t,1)):((t=r.alloc(65))[0]=4,e.toArrayLike(r,"be",32).copy(t,1),n.toArrayLike(r,"be",32).copy(t,33)),t};
varr=require("buffer").Buffer,e=require("ethereum-cryptography/secp256k1"),n=require("./secp256k1-lib/index"),t=require("./secp256k1-lib/der"),i=function(r){return32===r.length&&e.privateKeyVerify(Uint8Array.from(r))},o=function(r,e){if(32!==r.length)thrownewRangeError("private key length is invalid");vari=n.privateKeyExport(r,e);returnt.privateKeyExport(r,i,e)},a=function(r){if(null!==(r=t.privateKeyImport(r))&&32===r.length&&i(r))returnr;thrownewError("couldn't import from DER format")},f=function(n){returnr.from(e.privateKeyNegate(Uint8Array.from(n)))},u=function(e){if(32!==e.length)thrownewError("private key length is invalid");returnr.from(n.privateKeyModInverse(Uint8Array.from(e)))},y=function(n,t){returnr.from(e.privateKeyTweakAdd(Uint8Array.from(n),t))},l=function(n,t){returnr.from(e.privateKeyTweakMul(Uint8Array.from(n),Uint8Array.from(t)))},m=function(n,t){returnr.from(e.publicKeyCreate(Uint8Array.from(n),t))},c=function(n,t){returnr.from(e.publicKeyConvert(Uint8Array.from(n),t))},p=function(r){return(33===r.length||65===r.length)&&e.publicKeyVerify(Uint8Array.from(r))},d=function(n,t,i){returnr.from(e.publicKeyTweakAdd(Uint8Array.from(n),Uint8Array.from(t),i))},g=function(n,t,i){returnr.from(e.publicKeyTweakMul(Uint8Array.from(n),Uint8Array.from(t),i))},s=function(n,t){vari=[];returnn.forEach(function(r){i.push(Uint8Array.from(r))}),r.from(e.publicKeyCombine(i,t))},v=function(n){returnr.from(e.signatureNormalize(Uint8Array.from(n)))},h=function(n){returnr.from(e.signatureExport(Uint8Array.from(n)))},A=function(n){returnr.from(e.signatureImport(Uint8Array.from(n)))},w=function(r){if(0===r.length)thrownewRangeError("signature length is invalid");vare=t.signatureImportLax(r);if(null===e)thrownewError("couldn't parse DER signature");returnn.signatureImport(e)},U=function(n,t,i){if(null===i)thrownewTypeError("options should be an Object");varo=void0;if(i){if(o={},null===i.data)thrownewTypeError("options.data should be a Buffer");if(i.data){if(32!==i.data.length)thrownewRangeError("options.data length is invalid");o.data=newUint8Array(i.data)}if(null===i.noncefn)thrownewTypeError("options.noncefn should be a Function");i.noncefn&&(o.noncefn=function(e,n,t,o,a){varf=null!=t?r.from(t):null,u=null!=o?r.from(o):null,y=r.from("");returni.noncefn&&(y=i.noncefn(r.from(e),r.from(n),f,u,a)),Uint8Array.from(y)})}vara=e.ecdsaSign(Uint8Array.from(n),Uint8Array.from(t),o);return{signature:r.from(a.signature),recovery:a.recid}},K=function(r,n,t){returne.ecdsaVerify(Uint8Array.from(n),Uint8Array.from(r),t)},b=function(n,t,i,o){returnr.from(e.ecdsaRecover(Uint8Array.from(t),i,Uint8Array.from(n),o))},E=function(n,t){returnr.from(e.ecdh(Uint8Array.from(n),Uint8Array.from(t),{}))},k=function(e,t,i){if(33!==e.length&&65!==e.length)thrownewRangeError("public key length is invalid");if(32!==t.length)thrownewRangeError("private key length is invalid");returnr.from(n.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),i))};module.exports={privateKeyVerify:i,privateKeyExport:o,privateKeyImport:a,privateKeyNegate:f,privateKeyModInverse:u,privateKeyTweakAdd:y,privateKeyTweakMul:l,publicKeyCreate:m,publicKeyConvert:c,publicKeyVerify:p,publicKeyTweakAdd:d,publicKeyTweakMul:g,publicKeyCombine:s,signatureNormalize:v,signatureExport:h,signatureImport:A,signatureImportLax:w,sign:U,verify:K,recover:b,ecdh:E,ecdhUnsafe:k};
"use strict";varr=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;functionn(r){if(null==r)thrownewTypeError("Object.assign cannot be called with null or undefined");returnObject(r)}functiono(){try{if(!Object.assign)return!1;varr=newString("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(vart={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(r){returnt[r]}).join(""))return!1;varn={};return"abcdefghijklmnopqrst".split("").forEach(function(r){n[r]=r}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(o){return!1}}module.exports=o()?Object.assign:function(o,c){for(vara,i,s=n(o),f=1;f<arguments.length;f++){for(varuina=Object(arguments[f]))t.call(a,u)&&(s[u]=a[u]);if(r){i=r(a);for(varb=0;b<i.length;b++)e.call(a,i[b])&&(s[i[b]]=a[i[b]])}}returns};
varr=require("buffer").Buffer,e=this&&this.__importDefault||function(r){returnr&&r.__esModule?r:{default:r}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLength=exports.decode=exports.encode=void0;vart=e(require("bn.js"));functionn(e){if(Array.isArray(e)){for(vart=[],i=0;i<e.length;i++)t.push(n(e[i]));vara=r.concat(t);returnr.concat([o(a.length,192),a])}varf=c(e);return1===f.length&&f[0]<128?f:r.concat([o(f.length,128),f])}functioni(r,e){if("0"===r[0]&&"0"===r[1])thrownewError("invalid RLP: extra zeros");returnparseInt(r,e)}functiono(e,t){if(e<56)returnr.from([e+t]);varn=h(e),i=h(t+55+n.length/2);returnr.from(i+n,"hex")}functiona(e,t){if(void0===t&&(t=!1),!e||0===e.length)returnr.from([]);varn=u(c(e));if(t)returnn;if(0!==n.remainder.length)thrownewError("invalid remainder");returnn.data}functionf(e){if(!e||0===e.length)returnr.from([]);vart=c(e),n=t[0];if(n<=127)returnt.length;if(n<=183)returnn-127;if(n<=191)returnn-182;if(n<=247)returnn-191;varo=n-246;returno+i(t.slice(1,o).toString("hex"),16)}functionu(e){vart,n,o,a,f,l=[],s=e[0];if(s<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(s<=183){if(t=s-127,o=128===s?r.from([]):e.slice(1,t),2===t&&o[0]<128)thrownewError("invalid rlp encoding: byte must be less 0x80");return{data:o,remainder:e.slice(t)}}if(s<=191){if(n=s-182,e.length-1<n)thrownewError("invalid RLP: not enough bytes for string length");if((t=i(e.slice(1,n).toString("hex"),16))<=55)thrownewError("invalid RLP: expected string length to be greater than 55");if((o=e.slice(n,t+n)).length<t)thrownewError("invalid RLP: not enough bytes for string");return{data:o,remainder:e.slice(t+n)}}if(s<=247){for(t=s-191,a=e.slice(1,t);a.length;)f=u(a),l.push(f.data),a=f.remainder;return{data:l,remainder:e.slice(t)}}varh=(n=s-246)+(t=i(e.slice(1,n).toString("hex"),16));if(h>e.length)thrownewError("invalid rlp: total length is larger than the data");if(0===(a=e.slice(n,h)).length)thrownewError("invalid rlp, List has a invalid length");for(;a.length;)f=u(a),l.push(f.data),a=f.remainder;return{data:l,remainder:e.slice(h)}}functionl(r){return"0x"===r.slice(0,2)}functions(r){return"string"!=typeofr?r:l(r)?r.slice(2):r}functionh(r){if(r<0)thrownewError("Invalid integer as argument, must be unsigned!");vare=r.toString(16);returne.length%2?"0"+e:e}functiond(r){returnr.length%2?"0"+r:r}functiong(e){vart=h(e);returnr.from(t,"hex")}functionc(e){if(!r.isBuffer(e)){if("string"==typeofe)returnl(e)?r.from(d(s(e)),"hex"):r.from(e);if("number"==typeofe||"bigint"==typeofe)returne?g(e):r.from([]);if(null==e)returnr.from([]);if(einstanceofUint8Array)returnr.from(e);if(t.default.isBN(e))returnr.from(e.toArray());thrownewError("invalid type")}returne}exports.encode=n,exports.decode=a,exports.getLength=f;
functiont(e){return(t="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft})(e)}module.exports=function(e){if("string"!=typeofe)thrownewError("[is-hex-prefixed] value must be type 'string', is currently type "+t(e)+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)};
varr=require("buffer").Buffer;functiont(r){return(t="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(r){returntypeofr}:function(r){returnr&&"function"==typeofSymbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeofr})(r)}vare=require("is-hex-prefixed"),n=require("strip-hex-prefix");functioni(r){vare=r;if("string"!=typeofe)thrownewError("[ethjs-util] while padding to even, value must be string, is currently "+t(e)+", while padToEven.");returne.length%2&&(e="0"+e),e}functiono(r){return"0x"+r.toString(16)}functionu(t){vare=o(t);returnnewr(i(e.slice(2)),"hex")}functionf(e){if("string"!=typeofe)thrownewError("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+t(e)+"'.");returnr.byteLength(e,"utf8")}functiona(r,e,n){if(!0!==Array.isArray(r))thrownewError("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+t(r)+"'");if(!0!==Array.isArray(e))thrownewError("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+t(e)+"'");returne[Boolean(n)?"some":"every"](function(t){returnr.indexOf(t)>=0})}functions(t){returnnewr(i(n(t).replace(/^0+|0+$/g,"")),"hex").toString("utf8")}functiony(r){vart="",e=0,n=r.length;for("0x"===r.substring(0,2)&&(e=2);e<n;e+=2){vari=parseInt(r.substr(e,2),16);t+=String.fromCharCode(i)}returnt}functiong(t){return"0x"+i(newr(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")}functionp(r){for(vart="",e=0;e<r.length;e++){varn=r.charCodeAt(e).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t}functionh(r,e,n){if(!Array.isArray(r))thrownewError("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+t(r)+"'");if("string"!=typeofe)thrownewError("[ethjs-util] method getKeys expecting type String for input 'key' got '"+t(e)+"'.");for(vari=[],o=0;o<r.length;o++){varu=r[o][e];if(n&&!u)u="";elseif("string"!=typeofu)thrownewError("invalid abi");i.push(u)}returni}functionl(r,t){return!("string"!=typeofr||!r.match(/^0x[0-9A-Fa-f]*$/))&&(!t||r.length===2+2*t)}module.exports={arrayContainsArray:a,intToBuffer:u,getBinarySize:f,isHexPrefixed:e,stripHexPrefix:n,padToEven:i,intToHex:o,fromAscii:p,fromUtf8:g,toAscii:y,toUtf8:s,getKeys:h,isHexString:l};
varr=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0});vare=require("bn.js"),o=require("elliptic").ec,n=newo("secp256k1"),t=n.curve;exports.privateKeyExport=function(r,o){void0===o&&(o=!0);vara=newe(r);if(a.ucmp(t.n)>=0)thrownewError("couldn't export to DER format");varu=n.g.mul(a);returni(u.getX(),u.getY(),o)},exports.privateKeyModInverse=function(o){varn=newe(o);if(n.ucmp(t.n)>=0||n.isZero())thrownewError("private key range is invalid");returnn.invm(t.n).toArrayLike(r,"be",32)},exports.signatureImport=function(o){varn=newe(o.r);n.ucmp(t.n)>=0&&(n=newe(0));vari=newe(o.s);returni.ucmp(t.n)>=0&&(i=newe(0)),r.concat([n.toArrayLike(r,"be",32),i.toArrayLike(r,"be",32)])},exports.ecdhUnsafe=function(r,o,a){void0===a&&(a=!0);varu=n.keyFromPublic(r),c=newe(o);if(c.ucmp(t.n)>=0||c.isZero())thrownewError("scalar was invalid (zero or overflow)");varp=u.pub.mul(c);returni(p.getX(),p.getY(),a)};vari=function(e,o,n){vart;returnn?((t=r.alloc(33))[0]=o.isOdd()?3:2,e.toArrayLike(r,"be",32).copy(t,1)):((t=r.alloc(65))[0]=4,e.toArrayLike(r,"be",32).copy(t,1),o.toArrayLike(r,"be",32).copy(t,33)),t};
varr=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ecdhUnsafe=exports.ecdh=exports.recover=exports.verify=exports.sign=exports.signatureImportLax=exports.signatureImport=exports.signatureExport=exports.signatureNormalize=exports.publicKeyCombine=exports.publicKeyTweakMul=exports.publicKeyTweakAdd=exports.publicKeyVerify=exports.publicKeyConvert=exports.publicKeyCreate=exports.privateKeyTweakMul=exports.privateKeyTweakAdd=exports.privateKeyModInverse=exports.privateKeyNegate=exports.privateKeyImport=exports.privateKeyExport=exports.privateKeyVerify=void0;vare=require("ethereum-cryptography/secp256k1"),t=require("./secp256k1v3-lib/index"),n=require("./secp256k1v3-lib/der");exports.privateKeyVerify=function(r){return32===r.length&&e.privateKeyVerify(Uint8Array.from(r))},exports.privateKeyExport=function(r,e){if(32!==r.length)thrownewRangeError("private key length is invalid");varo=t.privateKeyExport(r,e);returnn.privateKeyExport(r,o,e)},exports.privateKeyImport=function(r){if(null!==(r=n.privateKeyImport(r))&&32===r.length&&exports.privateKeyVerify(r))returnr;thrownewError("couldn't import from DER format")},exports.privateKeyNegate=function(t){returnr.from(e.privateKeyNegate(Uint8Array.from(t)))},exports.privateKeyModInverse=function(e){if(32!==e.length)thrownewError("private key length is invalid");returnr.from(t.privateKeyModInverse(Uint8Array.from(e)))},exports.privateKeyTweakAdd=function(t,n){returnr.from(e.privateKeyTweakAdd(Uint8Array.from(t),n))},exports.privateKeyTweakMul=function(t,n){returnr.from(e.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(n)))},exports.publicKeyCreate=function(t,n){returnr.from(e.publicKeyCreate(Uint8Array.from(t),n))},exports.publicKeyConvert=function(t,n){returnr.from(e.publicKeyConvert(Uint8Array.from(t),n))},exports.publicKeyVerify=function(r){return(33===r.length||65===r.length)&&e.publicKeyVerify(Uint8Array.from(r))},exports.publicKeyTweakAdd=function(t,n,o){returnr.from(e.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(n),o))},exports.publicKeyTweakMul=function(t,n,o){returnr.from(e.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(n),o))},exports.publicKeyCombine=function(t,n){varo=[];returnt.forEach(function(r){o.push(Uint8Array.from(r))}),r.from(e.publicKeyCombine(o,n))},exports.signatureNormalize=function(t){returnr.from(e.signatureNormalize(Uint8Array.from(t)))},exports.signatureExport=function(t){returnr.from(e.signatureExport(Uint8Array.from(t)))},exports.signatureImport=function(t){returnr.from(e.signatureImport(Uint8Array.from(t)))},exports.signatureImportLax=function(r){if(0===r.length)thrownewRangeError("signature length is invalid");vare=n.signatureImportLax(r);if(null===e)thrownewError("couldn't parse DER signature");returnt.signatureImport(e)},exports.sign=function(t,n,o){if(null===o)thrownewTypeError("options should be an Object");vari=void0;if(o){if(i={},null===o.data)thrownewTypeError("options.data should be a Buffer");if(o.data){if(32!=o.data.length)thrownewRangeError("options.data length is invalid");i.data=newUint8Array(o.data)}if(null===o.noncefn)thrownewTypeError("options.noncefn should be a Function");o.noncefn&&(i.noncefn=function(e,t,n,i,a){varp=null!=n?r.from(n):null,u=null!=i?r.from(i):null,f=r.from("");returno.noncefn&&(f=o.noncefn(r.from(e),r.from(t),p,u,a)),newUint8Array(f)})}vara=e.ecdsaSign(Uint8Array.from(t),Uint8Array.from(n),i);return{signature:r.from(a.signature),recovery:a.recid}},exports.verify=function(r,t,n){returne.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(r),n)},exports.recover=function(t,n,o,i){returnr.from(e.ecdsaRecover(Uint8Array.from(n),o,Uint8Array.from(t),i))},exports.ecdh=function(t,n){returnr.from(e.ecdh(Uint8Array.from(t),Uint8Array.from(n),{}))},exports.ecdhUnsafe=function(e,n,o){if(33!==e.length&&65!==e.length)thrownewRangeError("public key length is invalid");if(32!==n.length)thrownewRangeError("private key length is invalid");returnr.from(t.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(n),o))};
vare=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0}),exports.baToJSON=exports.addHexPrefix=exports.toUnsigned=exports.fromSigned=exports.bufferToHex=exports.bufferToInt=exports.toBuffer=exports.stripZeros=exports.unpad=exports.setLengthRight=exports.setLength=exports.setLengthLeft=exports.zeros=void0;varr=require("ethjs-util"),t=require("bn.js");exports.zeros=function(r){returne.allocUnsafe(r).fill(0)},exports.setLengthLeft=function(e,r,t){void0===t&&(t=!1);varo=exports.zeros(r);returne=exports.toBuffer(e),t?e.length<r?(e.copy(o),o):e.slice(0,r):e.length<r?(e.copy(o,r-e.length),o):e.slice(-r)},exports.setLength=exports.setLengthLeft,exports.setLengthRight=function(e,r){returnexports.setLength(e,r,!0)},exports.unpad=function(e){for(vart=(e=r.stripHexPrefix(e))[0];e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];returne},exports.stripZeros=exports.unpad,exports.toBuffer=function(o){if(!e.isBuffer(o))if(Array.isArray(o))o=e.from(o);elseif("string"==typeofo){if(!r.isHexString(o))thrownewError("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+o);o=e.from(r.padToEven(r.stripHexPrefix(o)),"hex")}elseif("number"==typeofo)o=r.intToBuffer(o);elseif(null==o)o=e.allocUnsafe(0);elseif(t.isBN(o))o=o.toArrayLike(e);else{if(!o.toArray)thrownewError("invalid type");o=e.from(o.toArray())}returno},exports.bufferToInt=function(e){returnnewt(exports.toBuffer(e)).toNumber()},exports.bufferToHex=function(e){return"0x"+(e=exports.toBuffer(e)).toString("hex")},exports.fromSigned=function(e){returnnewt(e).fromTwos(256)},exports.toUnsigned=function(r){returne.from(r.toTwos(256).toArray())},exports.addHexPrefix=function(e){return"string"!=typeofe?e:r.isHexPrefixed(e)?e:"0x"+e},exports.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(rinstanceofArray){for(vart=[],o=0;o<r.length;o++)t.push(exports.baToJSON(r[o]));returnt}};
vare=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0}),exports.hashPersonalMessage=exports.isValidSignature=exports.fromRpcSig=exports.toRpcSig=exports.ecrecover=exports.ecsign=void0;varr=require("./secp256k1v3-adapter"),f=require("bn.js"),t=require("./bytes"),n=require("./hash");functioni(e,r){returnr?e-(2*r+35):e-27}functiono(e){return0===e||1===e}exports.ecsign=function(e,f,t){varn=r.sign(e,f),i=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:t?i+(2*t+35):i+27}},exports.ecrecover=function(f,n,s,a,u){varc=e.concat([t.setLength(s,32),t.setLength(a,32)],64),g=i(n,u);if(!o(g))thrownewError("Invalid signature v value");varv=r.recover(f,c,g);returnr.publicKeyConvert(v,!1).slice(1)},exports.toRpcSig=function(r,f,n,s){if(!o(i(r,s)))thrownewError("Invalid signature v value");returnt.bufferToHex(e.concat([t.setLengthLeft(f,32),t.setLengthLeft(n,32),t.toBuffer(r)]))},exports.fromRpcSig=function(e){varr=t.toBuffer(e);if(65!==r.length)thrownewError("Invalid signature length");varf=r[64];returnf<27&&(f+=27),{v:f,r:r.slice(0,32),s:r.slice(32,64)}},exports.isValidSignature=function(e,r,t,n,s){void0===n&&(n=!0);vara=newf("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),u=newf("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==r.length||32!==t.length)return!1;if(!o(i(e,s)))return!1;varc=newf(r),g=newf(t);return!(c.isZero()||c.gt(u)||g.isZero()||g.gt(u))&&(!n||1!==g.cmp(a))},exports.hashPersonalMessage=function(r){varf=e.from("Ethereum Signed Message:\n"+r.length.toString(),"utf-8");returnn.keccak(e.concat([f,r]))};
vare=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0}),exports.defineProperties=void0;varr=require("assert"),t=require("ethjs-util"),n=require("rlp"),i=require("./bytes");exports.defineProperties=function(a,f,o){if(a.raw=[],a._fields=[],a.toJSON=function(e){if(void0===e&&(e=!1),e){varr={};returna._fields.forEach(function(e){r[e]="0x"+a[e].toString("hex")}),r}returni.baToJSON(a.raw)},a.serialize=function(){returnn.encode(a.raw)},f.forEach(function(t,n){functionf(){returna.raw[n]}functiono(f){"00"!==(f=i.toBuffer(f)).toString("hex")||t.allowZero||(f=e.allocUnsafe(0)),t.allowLess&&t.length?(f=i.stripZeros(f),r(t.length>=f.length,"The field "+t.name+" must not have more "+t.length+" bytes")):t.allowZero&&0===f.length||!t.length||r(t.length===f.length,"The field "+t.name+" must have byte length of "+t.length),a.raw[n]=f}a._fields.push(t.name),Object.defineProperty(a,t.name,{enumerable:!0,configurable:!0,get:f,set:o}),t.default&&(a[t.name]=t.default),t.alias&&Object.defineProperty(a,t.alias,{enumerable:!1,configurable:!0,set:o,get:f})}),o)if("string"==typeofo&&(o=e.from(t.stripHexPrefix(o),"hex")),e.isBuffer(o)&&(o=n.decode(o)),Array.isArray(o)){if(o.length>a._fields.length)thrownewError("wrong number of fields in data");o.forEach(function(e,r){a[a._fields[r]]=i.toBuffer(e)})}else{if("object"!=typeofo)thrownewError("invalid data");varl=Object.keys(o);f.forEach(function(e){-1!==l.indexOf(e.name)&&(a[e.name]=o[e.name]),-1!==l.indexOf(e.alias)&&(a[e.alias]=o[e.alias])})}};
vart=require("buffer").Buffer;constr=require("ethereumjs-util"),e=require("bn.js");vari=function(){};functionn(t){returnt.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}functions(t){returnparseInt(/^\D+(\d+)$/.exec(t)[1],10)}functiono(t){varr=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(r[1],10),parseInt(r[2],10)]}functiona(t){varr=t.match(/(.*)\[(.*?)\]$/);returnr?""===r[2]?"dynamic":parseInt(r[2],10):null}functionu(t){vari=typeoft;if("string"===i)returnr.isHexPrefixed(t)?newe(r.stripHexPrefix(t),16):newe(t,10);if("number"===i)returnnewe(t);if(t.toArray)returnt;thrownewError("Argument is not a number")}functionf(t){varr=/^(\w+)\((.*)\)$/.exec(t);if(3!==r.length)thrownewError("Invalid method signature");vare=/^(.+)\):\((.+)$/.exec(r[2]);if(null!==e&&3===e.length)return{method:r[1],args:e[1].split(","),retargs:e[2].split(",")};vari=r[2].split(",");return1===i.length&&""===i[0]&&(i=[]),{method:r[1],args:i}}functionh(i,n){varf,d,c,w;if("address"===i)returnh("uint160",u(n));if("bool"===i)returnh("uint8",n?1:0);if("string"===i)returnh("bytes",t.from(n,"utf8"));if(l(i)){if(void0===n.length)thrownewError("Not an array?");if("dynamic"!==(f=a(i))&&0!==f&&n.length>f)thrownewError("Elements exceed array size: "+f);for(winc=[],i=i.slice(0,i.lastIndexOf("[")),"string"==typeofn&&(n=JSON.parse(n)),n)c.push(h(i,n[w]));if("dynamic"===f){varp=h("uint256",n.length);c.unshift(p)}returnt.concat(c)}if("bytes"===i)returnn=t.from(n),c=t.concat([h("uint256",n.length),n]),n.length%32!=0&&(c=t.concat([c,r.zeros(32-n.length%32)])),c;if(i.startsWith("bytes")){if((f=s(i))<1||f>32)thrownewError("Invalid bytes<N> width: "+f);returnr.setLengthRight(n,32)}if(i.startsWith("uint")){if((f=s(i))%8||f<8||f>256)thrownewError("Invalid uint<N> width: "+f);if((d=u(n)).bitLength()>f)thrownewError("Supplied uint exceeds width: "+f+" vs "+d.bitLength());if(d<0)thrownewError("Supplied uint is negative");returnd.toArrayLike(t,"be",32)}if(i.startsWith("int")){if((f=s(i))%8||f<8||f>256)thrownewError("Invalid int<N> width: "+f);if((d=u(n)).bitLength()>f)thrownewError("Supplied int exceeds width: "+f+" vs "+d.bitLength());returnd.toTwos(256).toArrayLike(t,"be",32)}if(i.startsWith("ufixed")){if(f=o(i),(d=u(n))<0)thrownewError("Supplied ufixed is negative");returnh("uint256",d.mul(newe(2).pow(newe(f[1]))))}if(i.startsWith("fixed"))returnf=o(i),h("int256",u(n).mul(newe(2).pow(newe(f[1]))));thrownewError("Unsupported or invalid type: "+i)}functiond(r,i,n){vars,o,a,u;if("string"==typeofr&&(r=c(r)),"address"===r.name)returnd(r.rawType,i,n).toArrayLike(t,"be",20).toString("hex");if("bool"===r.name)returnd(r.rawType,i,n).toString()===newe(1).toString();if("string"===r.name){varf=d(r.rawType,i,n);returnt.from(f,"utf8").toString()}if(r.isArray){for(a=[],s=r.size,"dynamic"===r.size&&(n=d("uint256",i,n).toNumber(),s=d("uint256",i,n).toNumber(),n+=32),u=0;u<s;u++){varh=d(r.subArray,i,n);a.push(h),n+=r.subArray.memoryUsage}returna}if("bytes"===r.name)returnn=d("uint256",i,n).toNumber(),s=d("uint256",i,n).toNumber(),i.slice(n+32,n+32+s);if(r.name.startsWith("bytes"))returni.slice(n,n+r.size);if(r.name.startsWith("uint")){if((o=newe(i.slice(n,n+32),16,"be")).bitLength()>r.size)thrownewError("Decoded int exceeds width: "+r.size+" vs "+o.bitLength());returno}if(r.name.startsWith("int")){if((o=newe(i.slice(n,n+32),16,"be").fromTwos(256)).bitLength()>r.size)thrownewError("Decoded uint exceeds width: "+r.size+" vs "+o.bitLength());returno}if(r.name.startsWith("ufixed")){if(s=newe(2).pow(newe(r.size[1])),!(o=d("uint256",i,n)).mod(s).isZero())thrownewError("Decimals not supported yet");returno.div(s)}if(r.name.startsWith("fixed")){if(s=newe(2).pow(newe(r.size[1])),!(o=d("int256",i,n)).mod(s).isZero())thrownewError("Decimals not supported yet");returno.div(s)}thrownewError("Unsupported or invalid type: "+r.name)}functionc(t){varr,e,i;if(l(t)){r=a(t);varn=t.slice(0,t.lastIndexOf("["));returnn=c(n),e={isArray:!0,name:t,size:r,memoryUsage:"dynamic"===r?32:n.memoryUsage*r,subArray:n}}switch(t){case"address":i="uint160";break;case"bool":i="uint8";break;case"string":i="bytes"}if(e={rawType:i,name:t,memoryUsage:32},t.startsWith("bytes")&&"bytes"!==t||t.startsWith("uint")||t.startsWith("int")?e.size=s(t):(t.startsWith("ufixed")||t.startsWith("fixed"))&&(e.size=o(t)),t.startsWith("bytes")&&"bytes"!==t&&(e.size<1||e.size>32))thrownewError("Invalid bytes<N> width: "+e.size);if((t.startsWith("uint")||t.startsWith("int"))&&(e.size%8||e.size<8||e.size>256))thrownewError("Invalid int/uint<N> width: "+e.size);returne}functionw(t){return"string"===t||"bytes"===t||"dynamic"===a(t)}functionl(t){returnt.lastIndexOf("]")===t.length-1}functionp(t,r){returnt.staLine truncated
vare=require("buffer").Buffer,t=this&&this.__createBinding||(Object.create?function(e,t,r,n){void0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){returnt[r]}})}:function(e,t,r,n){void0===n&&(n=r),e[n]=t[r]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)returne;varn={};if(null!=e)for(varoine)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&t(n,e,o);returnr(n,e),n};Object.defineProperty(exports,"__esModule",{value:!0}),exports.recoverTypedSignature_v4=exports.recoverTypedSignature=exports.signTypedData_v4=exports.signTypedData=exports.recoverTypedMessage=exports.signTypedMessage=exports.getEncryptionPublicKey=exports.decryptSafely=exports.decrypt=exports.encryptSafely=exports.encrypt=exports.recoverTypedSignatureLegacy=exports.signTypedDataLegacy=exports.typedSignatureHash=exports.extractPublicKey=exports.recoverPersonalSignature=exports.personalSign=exports.normalize=exports.concatSig=exports.TypedDataUtils=exports.TYPED_MESSAGE_SCHEMA=void0;consto=n(require("ethereumjs-util")),s=n(require("ethereumjs-abi")),i=n(require("tweetnacl")),a=n(require("tweetnacl-util")),c={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]};exports.TYPED_MESSAGE_SCHEMA=c;constp={encodeData(t,r,n,i=!0){consta=["bytes32"],c=[this.hashType(t,n)];if(i){constp=(t,r,a)=>{if(void0!==n[r])return["bytes32",null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":o.keccak(this.encodeData(r,a,n,i))];if(void0===a)thrownewError(`missing value for field ${t} of type ${r}`);if("bytes"===r)return["bytes32",o.keccak(a)];if("string"===r)return"string"==typeofa&&(a=e.from(a,"utf8")),["bytes32",o.keccak(a)];if(r.lastIndexOf("]")===r.length-1){conste=r.slice(0,r.lastIndexOf("[")),n=a.map(r=>p(t,e,r));return["bytes32",o.keccak(s.rawEncode(n.map(([e])=>e),n.map(([,e])=>e)))]}return[r,a]};for(consteofn[t]){const[t,n]=p(e.name,e.type,r[e.name]);a.push(t),c.push(n)}}elsefor(constsofn[t]){lett=r[s.name];if(void0!==t)if("bytes"===s.type)a.push("bytes32"),t=o.keccak(t),c.push(t);elseif("string"===s.type)a.push("bytes32"),"string"==typeoft&&(t=e.from(t,"utf8")),t=o.keccak(t),c.push(t);elseif(void0!==n[s.type])a.push("bytes32"),t=o.keccak(this.encodeData(s.type,t,n,i)),c.push(t);else{if(s.type.lastIndexOf("]")===s.type.length-1)thrownewError("Arrays are unimplemented in encodeData; use V4 extension");a.push(s.type),c.push(t)}}returns.rawEncode(a,c)},encodeType(e,t){letr="",n=this.findTypeDependencies(e,t).filter(t=>t!==e);n=[e].concat(n.sort());for(constoofn){if(!t[o])thrownewError(`No type definition specified: ${o}`);r+=`${o}(${t[o].map(({name:e,type:t})=>`${t}${e}`).join(",")})`}returnr},findTypeDependencies(e,t,r=[]){if([e]=e.match(/^\w*/u),r.includes(e)||void0===t[e])returnr;r.push(e);for(constnoft[e])for(consteofthis.findTypeDependencies(n.type,t,r))!r.includes(e)&&r.push(e);returnr},hashStruct(e,t,r,n=!0){returno.keccak(this.encodeData(e,t,r,n))},hashType(e,t){returno.keccak(this.encodeType(e,t))},sanitizeData(e){constt={};for(constrinc.properties)e[r]&&(t[r]=e[r]);return"types"int&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},sign(t,r=!0){constn=this.sanitizeData(t),s=[e.from("1901","hex")];returns.push(this.hashStruct("EIP712Domain",n.domain,n.types,r)),"EIP712Domain"!==n.primaryType&&s.push(this.hashStruct(n.primaryType,n.message,n.types,r)),o.keccak(e.concat(s))}};functionu(e,t,r){constn=o.fromSigned(t),s=o.fromSigned(r),i=o.bufferToInt(e),a=O(o.toUnsigned(n).toString("hex"),64),c=O(o.toUnsigned(s).toString("hex"),64),p=o.stripHexPrefix(o.intToHex(i));returno.addHexPrefix(a.concat(c,p)).toString("hex")}functionf(e){if(e){if("number"==typeofe){constt=o.toBuffer(e);e=o.bufferToHex(t)}if("string"!=typeofe){lett="eth-sig-util.normalize() requires hex string or integer input.";thrownewError(t+=` received ${typeofe}: ${e}`)}returno.addHexPrefix(e.toLowerCase())}}functiony(e,t){constr=o.toBuffer(t.data),n=o.hashPersonalMessage(r),s=o.ecsign(n,e);returno.bufferToHex(u(s.v,s.r,s.s))}functiond(e){constt=j(e),r=o.publicToAddress(t);returno.bufferToHex(r)}functionl(e){return`0x${j(e).toString("hex")}`}functiong(e){constt=B(e);returno.bufferToHex(t)}functionh(e,t){constr=B(t.data),n=o.ecsign(r,e);returno.bufferToHex(u(n.v,n.r,n.s))}functionx(e){constt=_(B(e.data),e.sig),r=o.publicToAddress(t);returno.bufferToHex(r)}functionb(e,t,r){switch(r){case"x25519-xsalsa20-poly1305":{if("string"!=typeoft.data)thrownewError('Cannotdetectsecretmessage,messageparamsshouldbeoftheform{data:"secretLine truncated
"use strict";vare=c(require("web3")),t=c(require("./rpc")),n=c(require("./error")),s=c(require("./utils")),r=c(require("./id_mapping")),a=require("events"),o=c(require("isutf8")),i=require("eth-sig-util");functionc(e){returne&&e.__esModule?e:{default:e}}functionu(e){return(u="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe})(e)}functionl(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functiond(e,t){for(varn=0;n<t.length;n++){vars=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"ins&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}functionh(e,t,n){returnt&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}functionf(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}functionp(e,t){return(p=Object.setPrototypeOf||function(e,t){returne.__proto__=t,e})(e,t)}functiony(e){vart=v();returnfunction(){varn,s=b(e);if(t){varr=b(this).constructor;n=Reflect.construct(s,arguments,r)}elsen=s.apply(this,arguments);returng(this,n)}}functiong(e,t){if(t&&("object"===u(t)||"function"==typeoft))returnt;if(void0!==t)thrownewTypeError("Derived constructors may only return object or undefined");returnw(e)}functionw(e){if(void0===e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returne}functionv(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}functionb(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){returne.__proto__||Object.getPrototypeOf(e)})(e)}varm=function(e){f(d,a.EventEmitter);varc=y(d);functiond(e){vart;returnl(this,d),(t=c.call(this)).setConfig(e),t.idMapping=newr.default,t.callbacks=newMap,t.wrapResults=newMap,t.isNovaWallet=!0,t.isMetaMask=!0,t.isDebug=!!e.isDebug,t}returnh(d,[{key:"setAddress",value:function(e){vart=(e||"").toLowerCase();if(this.address!=t){this.address=t,this.ready=!!e;for(varn=0;n<window.frames.length;n++){vars=window.frames[n];s.ethereum&&s.ethereum.isNovaWallet&&(s.ethereum.address=t,s.ethereum.ready=!!e)}}}},{key:"setChainId",value:function(e){this.chainId=e}},{key:"setRpcUrl",value:function(e){this.rpc=newt.default(e)}},{key:"setConfig",value:function(e){this.setAddress(e.address),this.chainId=e.chainId,this.chainId||(this.chainId=null),e.rpcUrl?this.rpc=newt.default(e.rpcUrl):this.rpc=null,this.isDebug=!!e.isDebug}},{key:"isConnected",value:function(){returnnull!=this.rpc}},{key:"request",value:function(e){vart=this;returnthisinstanceofd||(t=window.ethereum),t._request(e,!1)}},{key:"enable",value:function(){returnconsole.log('enable() is deprecated, please use window.ethereum.request({method: "eth_requestAccounts"}) instead.'),this.request({method:"eth_requestAccounts",params:[]})}},{key:"send",value:function(e){vart={jsonrpc:"2.0",id:e.id};switch(e.method){case"eth_accounts":t.result=this.eth_accounts();break;case"eth_coinbase":t.result=this.eth_coinbase();break;case"net_version":t.result=this.net_version();break;case"eth_chainId":t.result=this.eth_chainId();break;default:thrownewn.default(4200,"Nova does not support calling ".concat(e.method," synchronously without a callback. Please provide a callback parameter to call ").concat(e.method," asynchronously."))}returnt}},{key:"sendAsync",value:function(e,t){console.log("sendAsync(data, callback) is deprecated, please use window.ethereum.request(data) instead.");varn=this;thisinstanceofd||(n=window.ethereum),Array.isArray(e)?Promise.all(e.map(n._request.bind(n))).then(function(e){returnt(null,e)}).catch(function(e){returnt(e,null)}):n._request(e).then(function(e){returnt(null,e)}).catch(function(e){returnt(e,null)})}},{key:"_request",value:function(e){vart=this,r=!(arguments.length>1&&void0!==arguments[1])||arguments[1];returnthis.idMapping.tryIntifyId(e),this.isDebug&&console.log("==> _request payload ".concat(JSON.stringify(e))),newPromise(function(a,o){switch(e.id||(e.id=s.default.genId()),t.callbacks.set(e.id,function(e,t){e?o(e):a(t)}),t.wrapResults.set(e.id,r),e.method){case"eth_accounts":returnt.eth_requestAccounts(e);case"eth_coinbase":returnt.sendResponse(e.id,t.eth_coinbase());case"net_version":returnt.sendResponse(e.id,t.net_version());case"eth_chainId":returnt.sendResponse(e.id,t.chainId);case"eth_sign":returnt.eth_sign(e);case"personal_sign":returnt.personal_sign(e);case"personal_ecRecover":returnt.personal_ecRecover(e);case"eth_signTypedData_v3":returnt.eth_signTypedData(Line truncated
"use strict";functione(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))thrownewTypeError("attempted to use private field on non-instance");returne}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
"use strict";vare=Object.prototype.hasOwnProperty,t="~";functionn(){}functionr(e,t,n){this.fn=e,this.context=t,this.once=n||!1}functiono(e,n,o,s,i){if("function"!=typeofo)thrownewTypeError("The listener must be a function");varc=newr(o,s||e,i),f=t?t+n:n;returne._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}functions(e,t){0==--e._eventsCount?e._events=newn:deletee._events[t]}functioni(){this._events=newn,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(newn).__proto__||(t=!1)),i.prototype.eventNames=function(){varn,r,o=[];if(0===this._eventsCount)returno;for(rinn=this._events)e.call(n,r)&&o.push(t?r.slice(1):r);returnObject.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(n)):o},i.prototype.listeners=function(e){varn=t?t+e:e,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(varo=0,s=r.length,i=newArray(s);o<s;o++)i[o]=r[o].fn;returni},i.prototype.listenerCount=function(e){varn=t?t+e:e,r=this._events[n];returnr?r.fn?1:r.length:0},i.prototype.emit=function(e,n,r,o,s,i){varc=t?t+e:e;if(!this._events[c])return!1;varf,u,a=this._events[c],l=arguments.length;if(a.fn){switch(a.once&&this.removeListener(e,a.fn,void0,!0),l){case1:returna.fn.call(a.context),!0;case2:returna.fn.call(a.context,n),!0;case3:returna.fn.call(a.context,n,r),!0;case4:returna.fn.call(a.context,n,r,o),!0;case5:returna.fn.call(a.context,n,r,o,s),!0;case6:returna.fn.call(a.context,n,r,o,s,i),!0}for(u=1,f=newArray(l-1);u<l;u++)f[u-1]=arguments[u];a.fn.apply(a.context,f)}else{varv,h=a.length;for(u=0;u<h;u++)switch(a[u].once&&this.removeListener(e,a[u].fn,void0,!0),l){case1:a[u].fn.call(a[u].context);break;case2:a[u].fn.call(a[u].context,n);break;case3:a[u].fn.call(a[u].context,n,r);break;case4:a[u].fn.call(a[u].context,n,r,o);break;default:if(!f)for(v=1,f=newArray(l-1);v<l;v++)f[v-1]=arguments[v];a[u].fn.apply(a[u].context,f)}}return!0},i.prototype.on=function(e,t,n){returno(this,e,t,n,!1)},i.prototype.once=function(e,t,n){returno(this,e,t,n,!0)},i.prototype.removeListener=function(e,n,r,o){vari=t?t+e:e;if(!this._events[i])returnthis;if(!n)returns(this,i),this;varc=this._events[i];if(c.fn)c.fn!==n||o&&!c.once||r&&c.context!==r||s(this,i);else{for(varf=0,u=[],a=c.length;f<a;f++)(c[f].fn!==n||o&&!c[f].once||r&&c[f].context!==r)&&u.push(c[f]);u.length?this._events[i]=1===u.length?u[0]:u:s(this,i)}returnthis},i.prototype.removeAllListeners=function(e){varr;returne?(r=t?t+e:e,this._events[r]&&s(this,r)):(this._events=newn,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=t,i.EventEmitter=i,"undefined"!=typeofmodule&&(module.exports=i);
"use strict";functione(e,r){if(!(einstanceofr))thrownewTypeError("Cannot call a class as a function")}functionr(e,r){for(vart=0;t<r.length;t++){varn=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}functiont(e,t,n){returnt&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextDecoder=void0;varn=function(){functionr(t){e(this,r)}returnt(r,[{key:"decode",value:function(e){returne.reduce(function(e,r){returne+String.fromCharCode(r)},"")}}]),r}();exports.TextDecoder=n;
"use strict";functione(e,r){if(!(einstanceofr))thrownewTypeError("Cannot call a class as a function")}functionr(e,r){for(vart=0;t<r.length;t++){varn=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}functiont(e,t,n){returnt&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextEncoder=void0;varn=function(){functionr(){e(this,r)}returnt(r,[{key:"encode",value:function(e){for(varr=newUint8Array(e.length),t=0;t<e.length;t++)r[t]=e.charCodeAt(t);returnr}}]),r}();exports.TextEncoder=n;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.detectPackage=l;varn=require("@polkadot/x-global"),t=require("./is/function.js"),e=require("./is/string.js"),r=require("./assert.js"),o="Either remove and explicitly install matching versions or dedupe using your package manager.\nThe following conflicting packages were found:";functiona(t){vare=n.xglobal;returne.__polkadotjs||(e.__polkadotjs={}),e.__polkadotjs[t]||(e.__polkadotjs[t]=[]),e.__polkadotjs[t]}functioni(n){returnn.reduce(function(n,t){vare=t.version;returnMath.max(n,e.length)},0)}functionc(n){vart=i(n);returnn.map(function(n){vare=n.name,r=n.version;return"\t".concat(r.padEnd(t),"\t").concat(e)}).join("\n")}functions(n){vart=n.map(function(n){return(0,e.isString)(n)?{version:n}:n}),r=i(t);returnt.map(function(n){vart=n.path,e=n.version;return"\t".concat(e.padEnd(r),"\t").concat(!t||t.length<5?"<unknown>":t)}).join("\n")}functionu(n){if((0,t.isFunction)(n))try{returnn()||""}catch(e){return""}returnn||""}functionl(n,t){vare=n.name,i=n.version,l=arguments.length>2&&void0!==arguments[2]?arguments[2]:[];(0,r.assert)(e.startsWith("@polkadot"),function(){return"Invalid package descriptor ".concat(e)});vard=a(e);if(d.push({path:u(t),version:i}),1!==d.length)console.warn("".concat(e," has multiple versions, ensure that there is only one installed.\n").concat(o,"\n").concat(s(d)));else{varp=l.filter(function(n){returnn&&n.version!==i});p.length&&console.warn("".concat(e," requires direct dependencies exactly matching version ").concat(i,".\n").concat(o,"\n").concat(c(p)))}}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.arrayRange=r;vare=require("../assert.js");functionr(r){vart=arguments.length>1&&void0!==arguments[1]?arguments[1]:0;return(0,e.assert)(r>0,"Expected non-zero, positive number as a range size"),newArray(r).fill(0).map(function(e,r){returnr+t})}
"use strict";functionr(r){returno(r)||n(r)||e(r)||t()}functiont(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functione(r,t){if(r){if("string"==typeofr)returna(r,t);vare=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(r,t):void0}}functionn(r){if("undefined"!=typeofSymbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])returnArray.from(r)}functiono(r){if(Array.isArray(r))returna(r)}functiona(r,t){(null==t||t>r.length)&&(t=r.length);for(vare=0,n=newArray(t);e<t;e++)n[e]=r[e];returnn}functioni(t){vare=r(t),n=e.length;if(1===n)returne;for(;0!==n;){varo=Math.floor(Math.random()*n);n--;vara=[e[o],e[n]];e[n]=a[0],e[o]=a[1]}returne}Object.defineProperty(exports,"__esModule",{value:!0}),exports.arrayShuffle=i;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkMaxMin=t;vare=require("../assert.js"),r=require("./bn.js");functiont(t,s){return(0,e.assert)(s.length>=1,"Must provide one or more BN arguments"),s.reduce(function(e,s){returnr.BN[t](e,s)},s[0])}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bnSqrt=o;vare=require("../assert.js"),r=require("./bn.js"),t=require("./consts.js"),s=require("./toBn.js"),n=newr.BN(94906265);functiono(o){varu=(0,s.bnToBn)(o);if((0,e.assert)(u.gte(t.BN_ZERO),"square root of negative numbers is not supported"),u.lte(t.BN_MAX_INTEGER))returnnewr.BN(Math.floor(Math.sqrt(u.toNumber())));for(vari=n.clone();;){vara=u.div(i).iadd(i).ishrn(1);if(i.eq(a)||i.eq(a.sub(t.BN_ONE)))returni;i=a}}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.hexToU8a=i;vare=require("../assert.js"),r=require("../is/hex.js"),t=require("./stripPrefix.js");functioni(i){varn=arguments.length>1&&void0!==arguments[1]?arguments[1]:-1;if(!i)returnnewUint8Array;(0,e.assert)((0,r.isHex)(i),function(){return"Expected hex value to convert, found '".concat(i,"'")});for(vars=(0,t.hexStripPrefix)(i),a=s.length/2,u=Math.ceil(-1===n?a:n/8),o=newUint8Array(u),x=Math.max(0,u-a),c=0;c<u;c++)o[c+x]=parseInt(s.substr(2*c,2),16);returno}
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(varr=[],t=[],e="undefined"!=typeofUint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;functionh(r){vart=r.length;if(t%4>0)thrownewError("Invalid string. Length must be a multiple of 4");vare=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}functionu(r){vart=h(r),e=t[0],n=t[1];return3*(e+n)/4-n}functionc(r,t,e){return3*(t+e)/4-e}functioni(r){varn,o,a=h(r),u=a[0],i=a[1],f=newe(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}functionf(t){returnr[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}functionA(r,t,e){for(varn,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));returno.join("")}functiond(t){for(vare,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
vart=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");functioni(){try{vart=newUint8Array(1);returnt.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===t.foo()&&"function"==typeoft.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}functiono(){returnf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functionu(t,r){if(o()<r)thrownewRangeError("Invalid typed array length");returnf.TYPED_ARRAY_SUPPORT?(t=newUint8Array(r)).__proto__=f.prototype:(null===t&&(t=newf(r)),t.length=r),t}functionf(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||thisinstanceoff))returnnewf(t,r,e);if("number"==typeoft){if("string"==typeofr)thrownewError("If encoding is specified then the first argument must be a string");returnc(this,t)}returns(this,t,r,e)}functions(t,r,e,n){if("number"==typeofr)thrownewTypeError('"value" argument must not be a number');return"undefined"!=typeofArrayBuffer&&rinstanceofArrayBuffer?g(t,r,e,n):"string"==typeofr?l(t,r,e):y(t,r)}functionh(t){if("number"!=typeoft)thrownewTypeError('"size" argument must be a number');if(t<0)thrownewRangeError('"size" argument must not be negative')}functiona(t,r,e,n){returnh(r),r<=0?u(t,r):void0!==e?"string"==typeofn?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}functionc(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(vare=0;e<r;++e)t[e]=0;returnt}functionl(t,r,e){if("string"==typeofe&&""!==e||(e="utf8"),!f.isEncoding(e))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|v(r,e),i=(t=u(t,n)).write(r,e);returni!==n&&(t=t.slice(0,i)),t}functionp(t,r){vare=r.length<0?0:0|w(r.length);t=u(t,e);for(varn=0;n<e;n+=1)t[n]=255&r[n];returnt}functiong(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)thrownewRangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))thrownewRangeError("'length' is out of bounds");returnr=void0===e&&void0===n?newUint8Array(r):void0===n?newUint8Array(r,e):newUint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}functiony(t,r){if(f.isBuffer(r)){vare=0|w(r.length);return0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeofArrayBuffer&&r.bufferinstanceofArrayBuffer||"length"inr)return"number"!=typeofr.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))returnp(t,r.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functionw(t){if(t>=o())thrownewRangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return0|t}functiond(t){return+t!=t&&(t=0),f.alloc(+t)}functionv(t,r){if(f.isBuffer(t))returnt.length;if("undefined"!=typeofArrayBuffer&&"function"==typeofArrayBuffer.isView&&(ArrayBuffer.isView(t)||tinstanceofArrayBuffer))returnt.byteLength;"string"!=typeoft&&(t=""+t);vare=t.length;if(0===e)return0;for(varn=!1;;)switch(r){case"ascii":case"latin1":case"binary":returne;case"utf8":case"utf-8":casevoid0:return$(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return2*e;case"hex":returne>>>1;case"base64":returnK(t).length;default:if(n)return$(t).length;r=(""+r).toLowerCase(),n=!0}}functionE(t,r,e){varn=!1;if((void0===r||r<0)&&(r=0),r>this.length)return"";if((void0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":returnx(this,r,e);case"utf8":case"utf-8":returnY(this,r,e);case"ascii":returnL(this,r,e);case"latin1":case"binary":returnD(this,r,e);case"base64":returnS(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":returnC(this,r,e);default:if(n)thrownewTypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}functionb(t,r,e){varn=t[r];t[r]=t[e],t[e]=n}functionR(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeofe?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}elseif(e<0){if(!i)return-1;e=0}if("string"==typeofr&&(r=f.from(r,n)),f.isBuffer(r))return0===r.length?-1:_(t,r,e,n,i);if("number"==typeofr)returnr&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeofUint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);thrownewTypeError("val must be string, number or Buffer")}function_(t,r,e,n,i){varo,u=1,f=t.length,s=r.length;if(void0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}functionh(t,r){return1===u?t[r]:t.readUInt16BE(r*u)}if(i){vara=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)returna*u}else-1!==a&&(o-=o-a),a=-1}elsefor(e+s>f&&(e=f-s),o=e;o>=0;o--){for(varc=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)returno}return-1}functionA(t,r,e,n){e=Number(e)||0;vari=t.length-e;n?(n=Number(n))>i&&(n=i):n=iLine truncated
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.u8aToU8a=a;varr=require("../assert.js"),e=require("../hex/toU8a.js"),t=require("../is/buffer.js"),o=require("../is/hex.js"),n=require("../is/string.js"),i=require("../is/u8a.js"),s=require("../string/toU8a.js");functionu(r){return(u="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(r){returntypeofr}:function(r){returnr&&"function"==typeofSymbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeofr})(r)}functiona(a){returna?(0,o.isHex)(a)?(0,e.hexToU8a)(a):(0,n.isString)(a)?(0,s.stringToU8a)(a):Array.isArray(a)||(0,t.isBuffer)(a)?newUint8Array(a):((0,r.assert)((0,i.isU8a)(a),function(){return"Unable to convert ".concat(a.toString()," (typeof ").concat(u(a),") to a Uint8Array")}),a):newUint8Array}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compactToU8a=u;vare=require("../assert.js"),n=require("../bn/index.js"),r=require("../u8a/index.js"),t=newn.BN(2).pow(newn.BN(6)).subn(1),a=newn.BN(2).pow(newn.BN(14)).subn(1),s=newn.BN(2).pow(newn.BN(30)).subn(1);functionu(u){varo=(0,n.bnToBn)(u);if(o.lte(t))returnnewUint8Array([o.toNumber()<<2]);if(o.lte(a))return(0,n.bnToU8a)(o.shln(2).iadd(n.BN_ONE),16,!0);if(o.lte(s))return(0,n.bnToU8a)(o.shln(2).iadd(n.BN_TWO),32,!0);for(vari=(0,n.bnToU8a)(o),b=i.length;0===i[b-1];)b--;return(0,e.assert)(b>=4,"Invalid length, previous checks match anything less than 2^30"),(0,r.u8aConcat)([3+(b-4<<2)],i.subarray(0,b))}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compactStripLength=i;varr=require("./fromU8a.js");functiont(r,t){returnu(r)||a(r,t)||n(r,t)||e()}functione(){thrownewTypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functionn(r,t){if(r){if("string"==typeofr)returno(r,t);vare=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(r,t):void0}}functiono(r,t){(null==t||t>r.length)&&(t=r.length);for(vare=0,n=newArray(t);e<t;e++)n[e]=r[e];returnn}functiona(r,t){vare=null==r?null:"undefined"!=typeofSymbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){varn,o,a=[],u=!0,i=!1;try{for(e=e.call(r);!(u=(n=e.next()).done)&&(a.push(n.value),!t||a.length!==t);u=!0);}catch(l){i=!0,o=l}finally{try{u||null==e.return||e.return()}finally{if(i)throwo}}returna}}functionu(r){if(Array.isArray(r))returnr}functioni(e){varn=t((0,r.compactFromU8a)(e),2),o=n[0],a=o+n[1].toNumber();return[a,e.subarray(o,a)]}
vart,e,n=module.exports={};functionr(){thrownewError("setTimeout has not been defined")}functiono(){thrownewError("clearTimeout has not been defined")}functioni(e){if(t===setTimeout)returnsetTimeout(e,0);if((t===r||!t)&&setTimeout)returnt=setTimeout,setTimeout(e,0);try{returnt(e,0)}catch(n){try{returnt.call(null,e,0)}catch(n){returnt.call(this,e,0)}}}functionu(t){if(e===clearTimeout)returnclearTimeout(t);if((e===o||!e)&&clearTimeout)returne=clearTimeout,clearTimeout(t);try{returne(t)}catch(n){try{returne.call(null,t)}catch(n){returne.call(this,t)}}}!function(){try{t="function"==typeofsetTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeofclearTimeout?clearTimeout:o}catch(n){e=o}}();varc,s=[],l=!1,a=-1;functionf(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}functionh(){if(!l){vart=i(f);l=!0;for(vare=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}functionm(t,e){this.fun=t,this.array=e}functionp(){}n.nextTick=function(t){vare=newArray(arguments.length-1);if(arguments.length>1)for(varn=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(newm(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){thrownewError("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){thrownewError("process.chdir is not supported")},n.umask=function(){return0};
},{}],"v4Ne":[function(require,module,exports){
varprocess=require("process");
varr=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.logger=x,exports.loggerFormat=w;vart=require("./format/formatDate.js"),e=require("./is/bn.js"),n=require("./is/buffer.js"),o=require("./is/function.js"),a=require("./is/object.js"),i=require("./is/u8a.js"),u=require("./u8a/toHex.js"),c=require("./u8a/toU8a.js");functionl(r,t){returny(r)||s(r,t)||d(r,t)||f()}functionf(){thrownewTypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functions(r,t){vare=null==r?null:"undefined"!=typeofSymbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){varn,o,a=[],i=!0,u=!1;try{for(e=e.call(r);!(i=(n=e.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(c){u=!0,o=c}finally{try{i||null==e.return||e.return()}finally{if(u)throwo}}returna}}functiony(r){if(Array.isArray(r))returnr}functionp(r){return(p="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(r){returntypeofr}:function(r){returnr&&"function"==typeofSymbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeofr})(r)}functionb(r){returnv(r)||g(r)||d(r)||m()}functionm(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functiond(r,t){if(r){if("string"==typeofr)returnh(r,t);vare=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(r):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?h(r,t):void0}}functiong(r){if("undefined"!=typeofSymbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])returnArray.from(r)}functionv(r){if(Array.isArray(r))returnh(r)}functionh(r,t){(null==t||t>r.length)&&(t=r.length);for(vare=0,n=newArray(t);e<t;e++)n[e]=r[e];returnn}varj={debug:"log",error:"error",log:"log",warn:"warn"};functionA(r){returnr&&(0,a.isObject)(r)&&r.constructor===Object?Object.keys(r).reduce(function(t,e){returnt[e]=w(r[e]),t},{}):r}functionw(r){returnArray.isArray(r)?r.map(w):(0,e.isBn)(r)?r.toString():(0,i.isU8a)(r)||(0,n.isBuffer)(r)?(0,u.u8aToHex)((0,c.u8aToU8a)(r)):A(r)}functionS(r,e,n){vara,i=arguments.length>3&&void0!==arguments[3]?arguments[3]:-1;if(1===n.length&&(0,o.isFunction)(n[0])){varu=n[0]();returnS(r,e,Array.isArray(u)?u:[u],i)}(a=console)[j[r]].apply(a,[(0,t.formatDate)(newDate),e].concat(b(n.map(w).map(function(r){if(i<=0)returnr;vart="".concat(r);returnt.length<i?r:"".concat(t.substr(0,i)," ...")}))))}functionq(){}functionU(t){vare=("object"===(void0===r?"undefined":p(r))?r:{}).env||{},n=parseInt(e.DEBUG_MAX||"-1",10),o=!1;return(e.DEBUG||"").toLowerCase().split(",").forEach(function(r){r&&("*"===r||t===r||r.endsWith("*")&&t.startsWith(r.slice(0,-1)))&&(o=!0),r&&r.startsWith("-")&&(t===r.slice(1)||r.endsWith("*")&&t.startsWith(r.slice(1,-1)))&&(o=!1)}),[o,isNaN(n)?-1:n]}functionx(r){vart="".concat(r.toUpperCase(),":").padStart(16),e=l(U(r.toLowerCase()),2),n=e[0],o=e[1];return{debug:n?function(){for(varr=arguments.length,e=newArray(r),n=0;n<r;n++)e[n]=arguments[n];returnS("debug",t,e,o)}:q,error:function(){for(varr=arguments.length,e=newArray(r),n=0;n<r;n++)e[n]=arguments[n];returnS("error",t,e)},log:function(){for(varr=arguments.length,e=newArray(r),n=0;n<r;n++)e[n]=arguments[n];returnS("log",t,e)},noop:q,warn:function(){for(varr=arguments.length,e=newArray(r),n=0;n<r;n++)e[n]=arguments[n];returnS("warn",t,e)}}}
"use strict";vare=function(e){for(varr=!1,t=!1,a=!1,s=0;s<e.length;s++){varo=e[s];r&&/[a-zA-Z]/.test(o)&&o.toUpperCase()===o?(e=e.slice(0,s)+"-"+e.slice(s),r=!1,a=t,t=!0,s++):t&&a&&/[a-zA-Z]/.test(o)&&o.toLowerCase()===o?(e=e.slice(0,s-1)+"-"+e.slice(s-1),a=t,t=!1,r=!0):(r=o.toLowerCase()===o&&o.toUpperCase()!==o,a=t,t=o.toUpperCase()===o&&o.toLowerCase()!==o)}returne},r=function(r,t){if("string"!=typeofr&&!Array.isArray(r))thrownewTypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);vara;return0===(r=Array.isArray(r)?r.map(function(e){returne.trim()}).filter(function(e){returne.length}).join("-"):r.trim()).length?"":1===r.length?t.pascalCase?r.toUpperCase():r.toLowerCase():(r!==r.toLowerCase()&&(r=e(r)),r=r.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,function(e,r){returnr.toUpperCase()}).replace(/\d+(\w|$)/g,function(e){returne.toUpperCase()}),a=r,t.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a)};module.exports=r,module.exports.default=r;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void0;vare=i(require("@babel/runtime/helpers/esm/classPrivateFieldLooseBase")),t=i(require("@babel/runtime/helpers/esm/classPrivateFieldLooseKey")),s=i(require("eventemitter3")),r=require("@polkadot/util");functioni(e){returne&&e.__esModule?e:{default:e}}constn=(0,r.logger)("PostMessageProvider");leta;varo=(0,t.default)("eventemitter"),d=(0,t.default)("isConnected"),u=(0,t.default)("subscriptions");classl{constructor(t){Object.defineProperty(this,o,{writable:!0,value:void0}),Object.defineProperty(this,d,{writable:!0,value:!1}),Object.defineProperty(this,u,{writable:!0,value:{}}),(0,e.default)(this,o)[o]=news.default,a=t}clone(){returnnewl(a)}asyncconnect(){console.error("PostMessageProvider.disconnect() is not implemented.")}asyncdisconnect(){console.error("PostMessageProvider.disconnect() is not implemented.")}gethasSubscriptions(){return!0}getisConnected(){return(0,e.default)(this,d)[d]}listProviders(){returna("pub(rpc.listProviders)",void0)}on(t,s){return(0,e.default)(this,o)[o].on(t,s),()=>{(0,e.default)(this,o)[o].removeListener(t,s)}}asyncsend(t,s,r){if(r){const{callback:i,type:n}=r,o=awaita("pub(rpc.subscribe)",{method:t,params:s,type:n},e=>{r.callback(null,e)});return(0,e.default)(this,u)[u][`${n}::${o}`]=i,o}returna("pub(rpc.send)",{method:t,params:s})}asyncstartProvider(t){(0,e.default)(this,d)[d]=!1,(0,e.default)(this,o)[o].emit("disconnected");consts=awaita("pub(rpc.startProvider)",t);returna("pub(rpc.subscribeConnected)",null,t=>((0,e.default)(this,d)[d]=t,t?(0,e.default)(this,o)[o].emit("connected"):(0,e.default)(this,o)[o].emit("disconnected"),!0)),s}subscribe(e,t,s,r){returnthis.send(t,s,{callback:r,type:e})}asyncunsubscribe(t,s,i){consta=`${t}::${i}`;return(0,r.isUndefined)((0,e.default)(this,u)[u][a])?(n.debug(()=>`Unable to find active subscription=${a}`),!1):(delete(0,e.default)(this,u)[u][a],this.send(s,[i]))}}exports.default=l;
"use strict";vare=this&&this.__assign||function(){return(e=Object.assign||function(e){for(vart,n=1,s=arguments.length;n<s;n++)for(varoint=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);returne}).apply(this,arguments)},t=this&&this.__awaiter||function(e,t,n,s){returnnew(n||(n=Promise))(function(o,r){functioni(e){try{u(s.next(e))}catch(t){r(t)}}functiona(e){try{u(s.throw(e))}catch(t){r(t)}}functionu(e){vart;e.done?o(e.value):(t=e.value,tinstanceofn?t:newn(function(e){e(t)})).then(i,a)}u((s=s.apply(e,t||[])).next())})},n=this&&this.__generator||function(e,t){varn,s,o,r,i={label:0,sent:function(){if(1&o[0])throwo[1];returno[1]},trys:[],ops:[]};returnr={next:a(0),throw:a(1),return:a(2)},"function"==typeofSymbol&&(r[Symbol.iterator]=function(){returnthis}),r;functiona(r){returnfunction(a){returnfunction(r){if(n)thrownewTypeError("Generator is already executing.");for(;i;)try{if(n=1,s&&(o=2&r[0]?s.return:r[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,r[1])).done)returno;switch(s=0,o&&(r=[2&r[0],o.value]),r[0]){case0:case1:o=r;break;case4:returni.label++,{value:r[1],done:!1};case5:i.label++,s=r[1],r=[0];continue;case7:r=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){i=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(6===r[0]&&i.label<o[1]){i.label=o[1],o=r;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(r);break}o[2]&&i.ops.pop(),i.trys.pop();continue}r=t.call(e,i)}catch(a){r=[6,a],s=0}finally{n=o=0}if(5&r[0])throwr[1];return{value:r[0]?r[1]:void0,done:!0}}([r,a])}}},s=this&&this.__importDefault||function(e){returne&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});varo=require("@polkadot/extension-base/page"),r=require("@polkadot/extension-inject"),i=s(require("./handlers")),a=s(require("../package.json"));functionu(){(0,r.injectExtension)(o.enable,{name:"polkadot-js",version:a.default.version}),window.injectedWeb3["pezkuwi-wallet"]=window.injectedWeb3["polkadot-js"],window.injectedWeb3["pezkuwi-js"]=window.injectedWeb3["polkadot-js"]}varc=function(){functions(){vare=this;this.handlers=newi.default,window.send=this.sendRequest,window.addEventListener("message",function(t){varn=t.data;t.source===window&&("content"===n.origin?n.id?(0,o.handleResponse)(n):console.error("Missing id for response."):"page"===n.origin&&e.handleMessage(n))}),u(),window.walletExtension={onAppResponse:this.onAppResponse.bind(this),onAppSubscription:this.onAppSubscription.bind(this),isPezkuwiWallet:!0}}returns.prototype.postResponse=function(e){this._postMessage("content",e)},s.prototype.sendRequest=function(e){this._postMessage("dapp-request",e)},s.prototype._postMessage=function(t,n){window.postMessage(e(e({},n),{origin:t}),"*")},s.prototype.sendAppRequest=function(e){vars=e.id,o=e.message,r=e.request;returnt(this,void0,void0,function(){vare=this;returnn(this,function(t){return[2,newPromise(function(t,n){e.handlers.addHandler(s,t,n),console.log("Saved handler for id: {id}"),e.sendRequest({id:s,msgType:o,request:r,url:window.location.href})})]})})},s.prototype.onAppResponse=function(e,t,n){vars=this.handlers.getHandler(e);console.log("Got handler for id: {id}"),s&&(n?s.reject(n):s.resolve(t))},s.prototype.onAppSubscription=function(e,t){this.postResponse({id:e,subscription:t})},s.prototype.handleMessage=function(e){returnt(this,void0,void0,function(){vart,s;returnn(this,function(n){switch(n.label){case0:switch(e.message){case"pub(authorize.tab)":case"pub(metadata.list)":case"pub(metadata.provide)":case"pub(accounts.list)":case"pub(accounts.subscribe)":case"pub(bytes.sign)":case"pub(extrinsic.sign)":return[3,1]}return[3,4];case1:returnn.trys.push([1,3,,4]),[4,this.sendAppRequest(e)];case2:returnt=n.sent(),[2,this.postResponse({id:e.id,response:t})];case3:returns=n.sent(),[2,this.postResponse({id:e.id,error:s.message})];case4:thrownewError("Unable to handle message: ".concat(e.message))}})})},s}(),p=newc;exports.default=p;
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.