var IpfsApi=function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=407)}([function(module,exports,__webpack_require__){"use strict";(function(global){function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function SlowBuffer(length){return+length!=length&&(length=0),Buffer.alloc(+length)}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function slowToString(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if(end>>>=0,start>>>=0,end<=start)return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}var indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}var i;if(dir){var foundIndex=-1;for(i=byteOffset;iarrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;jremaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){var secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:secondByte=buf[i+1],128==(192&secondByte)&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return decodeCodePointsArray(res)}function decodeCodePointsArray(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);for(var res="",i=0;ilen)&&(end=len);for(var out="",i=start;ilength)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}function base64clean(str){if(str=stringtrim(str).replace(INVALID_BASE64_RE,""),str.length<2)return"";for(;str.length%4!=0;)str+="=";return str}function stringtrim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){units=units||1/0;for(var codePoint,length=string.length,leadSurrogate=null,bytes=[],i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function asciiToBytes(str){for(var byteArray=[],i=0;i>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}function isnan(val){return val!==val}var base64=__webpack_require__(157),ieee754=__webpack_require__(181),isArray=__webpack_require__(94);exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return alloc(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),""},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;iremaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return mul*=128,val>=mul&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?(255-this[offset]+1)*-1:this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,byteLength|=0,!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0)}var mul=1,i=0;for(this[offset]=255&value;++i=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,end=void 0===end?this.length:end>>>0,val||(val=0);var i;if("number"==typeof val)for(i=start;i0?args[lastIndex]:null;return("function"==typeof lastArg?lastArg:null)?method.apply(context,args):new Promise(function(resolve,reject){args.push(function(err,val){if(err)return reject(err);resolve(val)}),method.apply(context,args)})}};module.exports=function(methods,options){options=options||{};var type=Object.prototype.toString.call(methods);if("[object Object]"===type||"[object Array]"===type){var obj=options.replace?methods:{};for(var key in methods)methods.hasOwnProperty(key)&&(obj[key]=createCallback(methods[key]));return obj} return createCallback(methods,options.context||methods)}},function(module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},function(module,exports,__webpack_require__){"use strict";const getConfig=__webpack_require__(133),requestAPI=__webpack_require__(134),multiaddr=__webpack_require__(20);module.exports=(arg=>{const config=getConfig();if("function"==typeof arg)return arg;if("object"==typeof arg)return requestAPI(arg);if("string"==typeof arg){const maddr=multiaddr(arg).nodeAddress();return config.host=maddr.address,config.port=maddr.port,requestAPI(config)}throw new Error("Argument must be a send function or a config object.")})},function(module,exports,__webpack_require__){function copyProps(src,dst){for(var key in src)dst[key]=src[key]}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}var buffer=__webpack_require__(0),Buffer=buffer.Buffer;Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(arg,encodingOrOffset,length){if("number"==typeof arg)throw new TypeError("Argument must not be a number");return Buffer(arg,encodingOrOffset,length)},SafeBuffer.alloc=function(size,fill,encoding){if("number"!=typeof size)throw new TypeError("Argument must be a number");var buf=Buffer(size);return void 0!==fill?"string"==typeof encoding?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf},SafeBuffer.allocUnsafe=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return Buffer(size)},SafeBuffer.allocUnsafeSlow=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports){function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex1)for(var i=1;i 3 bytes.");let code=varint.decode(buf);if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);buf=buf.slice(varint.decode.bytes);let len=varint.decode(buf);if(len<1)throw new Error(`multihash invalid length: 0x${len.toString(16)}`);if(buf=buf.slice(varint.decode.bytes),buf.length!==len)throw new Error(`multihash length inconsistent: 0x${buf.toString("hex")}`);return{code:code,name:cs.codes[code],length:len,digest:buf}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");return Buffer.concat([new Buffer(varint.encode(hashfn)),new Buffer(varint.encode(length)),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function streamToValue(res,callback){pump(res,concat(data=>callback(null,data)),err=>{err&&callback(err)})}const pump=__webpack_require__(33),concat=__webpack_require__(169);module.exports=streamToValue},function(module,exports,__webpack_require__){var basex=__webpack_require__(156);module.exports=basex("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(module,exports,__webpack_require__){(function(global,process){function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(ctx.depth=arguments[2]),arguments.length>=4&&(ctx.colors=arguments[3]),isBoolean(opts)?ctx.showHidden=opts:opts&&exports._extend(ctx,opts),isUndefined(ctx.showHidden)&&(ctx.showHidden=!1),isUndefined(ctx.depth)&&(ctx.depth=2),isUndefined(ctx.colors)&&(ctx.colors=!1),isUndefined(ctx.customInspect)&&(ctx.customInspect=!0),ctx.colors&&(ctx.stylize=stylizeWithColor),formatValue(ctx,obj,ctx.depth)}function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];return style?"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m":str}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};return array.forEach(function(val,idx){hash[val]=!0}),hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&(!value.constructor||value.constructor.prototype!==value)){var ret=value.inspect(recurseTimes,ctx);return isString(ret)||(ret=formatValue(ctx,ret,recurseTimes)),ret}var primitive=formatPrimitive(ctx,value);if(primitive)return primitive;var keys=Object.keys(value),visibleKeys=arrayToHash(keys);if(ctx.showHidden&&(keys=Object.getOwnPropertyNames(value)),isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0))return formatError(value);if(0===keys.length){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value))return ctx.stylize(RegExp.prototype.toString.call(value),"regexp");if(isDate(value))return ctx.stylize(Date.prototype.toString.call(value),"date");if(isError(value))return formatError(value)}var base="",array=!1,braces=["{","}"];if(isArray(value)&&(array=!0,braces=["[","]"]),isFunction(value)){base=" [Function"+(value.name?": "+value.name:"")+"]"}if(isRegExp(value)&&(base=" "+RegExp.prototype.toString.call(value)),isDate(value)&&(base=" "+Date.prototype.toUTCString.call(value)),isError(value)&&(base=" "+formatError(value)),0===keys.length&&(!array||0==value.length))return braces[0]+base+braces[1];if(recurseTimes<0)return isRegExp(value)?ctx.stylize(RegExp.prototype.toString.call(value),"regexp"):ctx.stylize("[Object]","special");ctx.seen.push(value);var output;return output=array?formatArray(ctx,value,recurseTimes,visibleKeys,keys):keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}),ctx.seen.pop(),reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}return isNumber(value)?ctx.stylize(""+value,"number"):isBoolean(value)?ctx.stylize(""+value,"boolean"):isNull(value)?ctx.stylize("null","null"):void 0}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){for(var output=[],i=0,l=value.length;i-1&&(str=array?str.split("\n").map(function(line){return" "+line}).join("\n").substr(2):"\n"+str.split("\n").map(function(line){return" "+line}).join("\n"))):str=ctx.stylize("[Circular]","special")),isUndefined(name)){if(array&&key.match(/^\d+$/))return str;name=JSON.stringify(""+key),name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(name=name.substr(1,name.length-2),name=ctx.stylize(name,"name")):(name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),name=ctx.stylize(name,"string"))}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;return output.reduce(function(prev,cur){return numLinesEst++,cur.indexOf("\n")>=0&&numLinesEst++,prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?braces[0]+(""===base?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]:braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}function isBoolean(arg){return"boolean"==typeof arg}function isNull(arg){return null===arg}function isNullOrUndefined(arg){return null==arg}function isNumber(arg){return"number"==typeof arg}function isString(arg){return"string"==typeof arg}function isSymbol(arg){return"symbol"==typeof arg}function isUndefined(arg){return void 0===arg}function isRegExp(re){return isObject(re)&&"[object RegExp]"===objectToString(re)}function isObject(arg){return"object"==typeof arg&&null!==arg}function isDate(d){return isObject(d)&&"[object Date]"===objectToString(d)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(arg){return"function"==typeof arg}function isPrimitive(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg}function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}function timestamp(){var d=new Date,time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}exports.format=function(f){if(!isString(f)){for(var objects=[],i=0;i=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}),x=args[i];i`}toJSON(){return{name:this.name,size:this.size,multihash:mh.toB58String(this._multihash)}}get name(){return this._name}set name(name){throw new Error("Can't set property: 'name' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGLink,exports.create=__webpack_require__(188)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Multiaddr(addr){if(!(this instanceof Multiaddr))return new Multiaddr(addr);if((addr=addr||"")instanceof Buffer)this.buffer=codec.fromBuffer(addr);else if("string"==typeof addr||addr instanceof String)this.buffer=codec.fromString(addr);else{if(!(addr.buffer&&addr.protos&&addr.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=codec.fromBuffer(addr.buffer)}}const map=__webpack_require__(62),extend=__webpack_require__(51),codec=__webpack_require__(240),protocols=__webpack_require__(65),varint=__webpack_require__(12),bs58=__webpack_require__(10),NotImplemented=new Error("Sorry, Not Implemented Yet.");exports=module.exports=Multiaddr,Multiaddr.prototype.toString=function(){return codec.bufferToString(this.buffer)},Multiaddr.prototype.toOptions=function(){const opts={},parsed=this.toString().split("/");return opts.family="ip4"===parsed[1]?"ipv4":"ipv6",opts.host=parsed[2],opts.transport=parsed[3],opts.port=parsed[4],opts},Multiaddr.prototype.inspect=function(){return""},Multiaddr.prototype.protos=function(){return map(this.protoCodes(),function(code){return extend(protocols(code))})},Multiaddr.prototype.protoCodes=function(){const codes=[],buf=this.buffer;let i=0;for(;i{if(tuple[0]===protocols.names.ipfs.code)return!0})[0][1],bs58.decode(b58str)}catch(e){b58str=null}return b58str},Multiaddr.prototype.equals=function(addr){return this.buffer.equals(addr.buffer)},Multiaddr.prototype.nodeAddress=function(){if(!this.isThinWaistAddress())throw new Error('Multiaddr must be "thin waist" address for nodeAddress.');const codes=this.protoCodes(),parts=this.toString().split("/").slice(1);return{family:41===codes[0]?"IPv6":"IPv4",address:parts[1],port:parts[3]}},Multiaddr.fromNodeAddress=function(addr,transport){if(!addr)throw new Error("requires node address object");if(!transport)throw new Error("requires transport protocol");return Multiaddr("/"+["IPv6"===addr.family?"ip6":"ip4",addr.address,transport,addr.port].join("/"))},Multiaddr.prototype.isThinWaistAddress=function(addr){const protos=(addr||this).protos();return 2===protos.length&&((4===protos[0].code||41===protos[0].code)&&(6===protos[1].code||17===protos[1].code))},Multiaddr.prototype.fromStupidString=function(str){throw NotImplemented},Multiaddr.protocols=protocols,Multiaddr.isMultiaddr=function(addr){return addr.constructor&&addr.constructor.name?"Multiaddr"===addr.constructor.name:Boolean(addr.fromStupidString&&addr.protos)},Multiaddr.isName=function(addr){return!!Multiaddr.isMultiaddr(addr)&&addr.protos().some(proto=>proto.resolvable)},Multiaddr.resolve=function(addr,callback){return callback(Multiaddr.isMultiaddr(addr)&&Multiaddr.isName(addr)?new Error("not implemented yet"):new Error("not a valid name"))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Hash(blockSize,finalSize){this._block=new Buffer(blockSize),this._finalSize=finalSize,this._blockSize=blockSize,this._len=0,this._s=0}Hash.prototype.update=function(data,enc){"string"==typeof data&&(enc=enc||"utf8",data=new Buffer(data,enc));for(var l=this._len+=data.length,s=this._s||0,f=0,buffer=this._block;s=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(l,this._blockSize-4);var hash=this._update(this._block)||this._hash();return enc?hash.toString(enc):hash},Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")},module.exports=Hash}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var base=exports;base.Reporter=__webpack_require__(139).Reporter,base.DecoderBuffer=__webpack_require__(73).DecoderBuffer,base.EncoderBuffer=__webpack_require__(73).EncoderBuffer,base.Node=__webpack_require__(138)},function(module,exports,__webpack_require__){"use strict";function slice(arrayLike,start){start|=0;for(var newLen=Math.max(arrayLike.length-start,0),newArr=Array(newLen),idx=0;idx{if(err)return callback(err);callback(null,multihash.encode(digest,func,length))})}const multihash=__webpack_require__(8),crypto=__webpack_require__(250);module.exports=Multihashing,Multihashing.Buffer=Buffer,Multihashing.multihash=multihash,Multihashing.digest=function(buf,func,length,callback){if("function"==typeof length&&(callback=length,length=void 0),!callback)throw new Error("Missing callback");let cb=callback;length&&(cb=((err,digest)=>{if(err)return callback(err);callback(null,digest.slice(0,length))}));let hash;try{hash=Multihashing.createHash(func)}catch(err){return cb(err)}hash(buf,cb)},Multihashing.createHash=function(func){if(func=multihash.coerceCode(func),!Multihashing.functions[func])throw new Error("multihash function "+func+" not yet supported");return Multihashing.functions[func]},Multihashing.functions={17:crypto.sha1,18:crypto.sha2256,19:crypto.sha2512,20:crypto.sha3512,21:crypto.sha3384,22:crypto.sha3256,23:crypto.sha3224,24:crypto.shake128,25:crypto.shake256,26:crypto.keccak224,27:crypto.keccak256,28:crypto.keccak384,29:crypto.keccak512,34:crypto.murmur3128,35:crypto.murmur332},crypto.addBlake(Multihashing.functions)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding))throw new Error("Unknown encoding: "+encoding)}function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2,this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3,this.charLength=this.charReceived?3:0}var Buffer=__webpack_require__(0).Buffer,isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},StringDecoder=exports.StringDecoder=function(encoding){switch(this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,""),assertEncoding(encoding),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=base64DetectIncompleteChar;break;default:return void(this.write=passThroughWrite)}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0};StringDecoder.prototype.write=function(buffer){for(var charStr="";this.charLength;){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;if(buffer.copy(this.charBuffer,this.charReceived,0,available),this.charReceived+=available,this.charReceived=55296&&charCode<=56319)){if(this.charReceived=this.charLength=0,0===buffer.length)return charStr;break}this.charLength+=this.surrogateSize,charStr=""}this.detectIncompleteChar(buffer);var end=buffer.length;this.charLength&&(buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end),end-=this.charReceived),charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1,charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;return this.charLength+=size,this.charReceived+=size,this.charBuffer.copy(this.charBuffer,size,0,size),buffer.copy(this.charBuffer,0,0,size),charStr.substring(0,end)}return charStr},StringDecoder.prototype.detectIncompleteChar=function(buffer){for(var i=buffer.length>=3?3:buffer.length;i>0;i--){var c=buffer[buffer.length-i];if(1==i&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i},StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length&&(res=this.write(buffer)),this.charReceived){var cr=this.charReceived,buf=this.charBuffer,enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res}},function(module,exports,__webpack_require__){(function(Buffer){var schema=__webpack_require__(258),compile=__webpack_require__(262),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result};module.exports=function(proto,opts){if(opts||(opts={}),!proto)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var sch="object"!=typeof proto||Buffer.isBuffer(proto)?schema.parse(proto):proto,Messages=function(){var self=this;compile(sch,opts.encodings||{}).forEach(function(m){self[m.name]=flatten(m.values)||m})};return Messages.prototype.toString=function(){return schema.stringify(sch)},Messages.prototype.toJSON=function(){return sch},new Messages}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var once=__webpack_require__(48),eos=__webpack_require__(56),fs=__webpack_require__(402),noop=function(){},isFn=function(fn){return"function"==typeof fn},isFS=function(stream){return!!fs&&((stream instanceof(fs.ReadStream||noop)||stream instanceof(fs.WriteStream||noop))&&isFn(stream.close))},isRequest=function(stream){return stream.setHeader&&isFn(stream.abort)},destroyer=function(stream,reading,writing,callback){callback=once(callback);var closed=!1;stream.on("close",function(){closed=!0}),eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=!0,callback()});var destroyed=!1;return function(err){if(!closed&&!destroyed)return destroyed=!0,isFS(stream)?stream.close():isRequest(stream)?stream.abort():isFn(stream.destroy)?stream.destroy():void callback(err||new Error("stream was destroyed"))}},call=function(fn){fn()},pipe=function(from,to){return from.pipe(to)},pump=function(){var streams=Array.prototype.slice.call(arguments),callback=isFn(streams[streams.length-1]||noop)&&streams.pop()||noop;if(Array.isArray(streams[0])&&(streams=streams[0]),streams.length<2)throw new Error("pump requires two streams per minimum");var error,destroys=streams.map(function(stream,i){var reading=i0,function(err){error||(error=err),err&&destroys.forEach(call),reading||(destroys.forEach(call),callback(error))})});return streams.reduce(pipe)};module.exports=pump},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(1),dagPB=__webpack_require__(27),DAGNode=dagPB.DAGNode,DAGLink=dagPB.DAGLink,bs58=__webpack_require__(10),cleanMultihash=__webpack_require__(13),LRU=__webpack_require__(45),lruOptions={max:128},cache=LRU(lruOptions);module.exports=(send=>{return promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options||(options={});try{multihash=cleanMultihash(multihash,options)}catch(err){return callback(err)}const node=cache.get(multihash);if(node)return callback(null,node);send({path:"object/get",args:multihash},(err,result)=>{if(err)return callback(err);const links=result.Links.map(l=>{return new DAGLink(l.Name,l.Size,new Buffer(bs58.decode(l.Hash)))});DAGNode.create(result.Data,links,(err,node)=>{if(err)return callback(err);cache.set(multihash,node),callback(null,node)})})})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(global){function compare(a,b){if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i=0;i--)if(ka[i]!==kb[i])return!1;for(i=ka.length-1;i>=0;i--)if(key=ka[i],!_deepEqual(a[key],b[key],strict,actualVisitedObjects))return!1;return!0}function notDeepStrictEqual(actual,expected,message){_deepEqual(actual,expected,!0)&&fail(actual,expected,message,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(actual,expected){if(!actual||!expected)return!1;if("[object RegExp]"==Object.prototype.toString.call(expected))return expected.test(actual);try{if(actual instanceof expected)return!0}catch(e){}return!Error.isPrototypeOf(expected)&&expected.call({},actual)===!0}function _tryBlock(block){var error;try{block()}catch(e){error=e}return error}function _throws(shouldThrow,block,expected,message){var actual;if("function"!=typeof block)throw new TypeError('"block" argument must be a function');"string"==typeof expected&&(message=expected,expected=null),actual=_tryBlock(block),message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:"."),shouldThrow&&!actual&&fail(actual,expected,"Missing expected exception"+message);var userProvidedMessage="string"==typeof message,isUnwantedException=!shouldThrow&&util.isError(actual),isUnexpectedException=!shouldThrow&&actual&&!expected;if((isUnwantedException&&userProvidedMessage&&expectedException(actual,expected)||isUnexpectedException)&&fail(actual,expected,"Got unwanted exception"+message),shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual)throw actual}var util=__webpack_require__(11),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames=function(){return"foo"===function(){}.name}(),assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;assert.AssertionError=function(options){this.name="AssertionError",this.actual=options.actual,this.expected=options.expected,this.operator=options.operator,options.message?(this.message=options.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,stackStartFunction);else{var err=new Error;if(err.stack){var out=err.stack,fn_name=getName(stackStartFunction),idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(actual,expected,message){actual!=expected&&fail(actual,expected,message,"==",assert.equal)},assert.notEqual=function(actual,expected,message){actual==expected&&fail(actual,expected,message,"!=",assert.notEqual)},assert.deepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)||fail(actual,expected,message,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(actual,expected,message){_deepEqual(actual,expected,!0)||fail(actual,expected,message,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(actual,expected,message){_deepEqual(actual,expected,!1)&&fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(actual,expected,message){actual!==expected&&fail(actual,expected,message,"===",assert.strictEqual)},assert.notStrictEqual=function(actual,expected,message){actual===expected&&fail(actual,expected,message,"!==",assert.notStrictEqual)},assert.throws=function(block,error,message){_throws(!0,block,error,message)},assert.doesNotThrow=function(block,error,message){_throws(!1,block,error,message)},assert.ifError=function(err){if(err)throw err};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)hasOwn.call(obj,key)&&keys.push(key);return keys}}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";function onlyOnce(fn){return function(){if(null===fn)throw new Error("Callback was already called.");var callFn=fn;fn=null,callFn.apply(this,arguments)}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=onlyOnce,module.exports=exports.default},function(module,exports,__webpack_require__){(function(Buffer){function fixup_uint32(x){var x_pos;return x>uint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function scrub_vec(v){for(;0>>8^255&sx^99,this.SBOX[x]=sx,this.INV_SBOX[sx]=x,x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx,this.SUB_MIX[0][x]=t<<24|t>>>8,this.SUB_MIX[1][x]=t<<16|t>>>16,this.SUB_MIX[2][x]=t<<8|t>>>24,this.SUB_MIX[3][x]=t,t=16843009*x8^65537*x4^257*x2^16843008*x,this.INV_SUB_MIX[0][sx]=t<<24|t>>>8,this.INV_SUB_MIX[1][sx]=t<<16|t>>>16,this.INV_SUB_MIX[2][sx]=t<<8|t>>>24,this.INV_SUB_MIX[3][sx]=t,0===x?x=xi=1:(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]);return!0};var G=new Global;AES.blockSize=16,AES.prototype.blockSize=AES.blockSize,AES.keySize=32,AES.prototype.keySize=AES.keySize,AES.prototype._doReset=function(){var invKsRow,keySize,keyWords,ksRow,ksRows,t;for(keyWords=this._key,keySize=keyWords.length,this._nRounds=keySize+6,ksRows=4*(this._nRounds+1),this._keySchedule=[],ksRow=0;ksRow>>24,t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t],t^=G.RCON[ksRow/keySize|0]<<24):keySize>6&&ksRow%keySize==4&&(t=G.SBOX[t>>>24]<<24|G.SBOX[t>>>16&255]<<16|G.SBOX[t>>>8&255]<<8|G.SBOX[255&t]),this._keySchedule[ksRow-keySize]^t);for(this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^G.INV_SUB_MIX[1][G.SBOX[t>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[t>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&t]];return!0},AES.prototype.encryptBlock=function(M){M=bufferToArray(new Buffer(M));var out=this._doCryptBlock(M,this._keySchedule,G.SUB_MIX,G.SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[1],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[3],12),buf},AES.prototype.decryptBlock=function(M){M=bufferToArray(new Buffer(M));var temp=[M[3],M[1]];M[1]=temp[0],M[3]=temp[1];var out=this._doCryptBlock(M,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX),buf=new Buffer(16);return buf.writeUInt32BE(out[0],0),buf.writeUInt32BE(out[3],4),buf.writeUInt32BE(out[2],8),buf.writeUInt32BE(out[1],12),buf},AES.prototype.scrub=function(){scrub_vec(this._keySchedule),scrub_vec(this._invKeySchedule),scrub_vec(this._key)},AES.prototype._doCryptBlock=function(M,keySchedule,SUB_MIX,SBOX){var ksRow,s0,s1,s2,s3,t0,t1,t2,t3;s0=M[0]^keySchedule[0],s1=M[1]^keySchedule[1],s2=M[2]^keySchedule[2],s3=M[3]^keySchedule[3],ksRow=4;for(var round=1;round>>24]^SUB_MIX[1][s1>>>16&255]^SUB_MIX[2][s2>>>8&255]^SUB_MIX[3][255&s3]^keySchedule[ksRow++],t1=SUB_MIX[0][s1>>>24]^SUB_MIX[1][s2>>>16&255]^SUB_MIX[2][s3>>>8&255]^SUB_MIX[3][255&s0]^keySchedule[ksRow++],t2=SUB_MIX[0][s2>>>24]^SUB_MIX[1][s3>>>16&255]^SUB_MIX[2][s0>>>8&255]^SUB_MIX[3][255&s1]^keySchedule[ksRow++],t3=SUB_MIX[0][s3>>>24]^SUB_MIX[1][s0>>>16&255]^SUB_MIX[2][s1>>>8&255]^SUB_MIX[3][255&s2]^keySchedule[ksRow++],s0=t0,s1=t1,s2=t2,s3=t3;return t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++],[fixup_uint32(t0),fixup_uint32(t1),fixup_uint32(t2),fixup_uint32(t3)]},exports.AES=AES}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function incr32(iv){for(var item,len=iv.length;len--;){if(255!==(item=iv.readUInt8(len))){item++,iv.writeUInt8(item,len);break}iv.writeUInt8(0,len)}}function getBlock(self){var out=self._cipher.encryptBlock(self._prev);return incr32(self._prev),out}var xor=__webpack_require__(25);exports.encrypt=function(self,chunk){for(;self._cache.length0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-- >0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(position<0)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else if(listeners)for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){return this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.prototype.listenerCount=function(type){if(this._events){var evlistener=this._events[type];if(isFunction(evlistener))return 1;if(evlistener)return evlistener.length}return 0},EventEmitter.listenerCount=function(emitter,type){return emitter.listenerCount(type)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function create(data,dagLinks,hashAlg,callback){if("function"==typeof data?(callback=data,data=void 0):"string"==typeof data&&(data=new Buffer(data)),"function"==typeof dagLinks&&(callback=dagLinks,dagLinks=[]),"function"==typeof hashAlg&&(callback=hashAlg,hashAlg=void 0),!Buffer.isBuffer(data))return callback("Passed 'data' is not a buffer or a string!");hashAlg||(hashAlg="sha2-256");const links=dagLinks.map(l=>{return l.constructor&&"DAGLink"===l.constructor.name?l:new DAGLink(l.name?l.name:l.Name,l.size?l.size:l.Size,l.hash||l.Hash||l.multihash)}),sortedLinks=sort(links,linkSort);serialize({data:data,links:sortedLinks},(err,serialized)=>{if(err)return callback(err);multihashing(serialized,hashAlg,(err,multihash)=>{if(err)return callback(err);callback(null,new DAGNode(data,sortedLinks,serialized,multihash))})})} const multihashing=__webpack_require__(30),sort=__webpack_require__(292),dagPBUtil=__webpack_require__(58),serialize=dagPBUtil.serialize,dagNodeUtil=__webpack_require__(43),linkSort=dagNodeUtil.linkSort,DAGNode=__webpack_require__(57),DAGLink=__webpack_require__(19);module.exports=create}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cloneData(dagNode){let data;return dagNode.data&&dagNode.data.length>0?(data=new Buffer(dagNode.data.length),dagNode.data.copy(data)):data=new Buffer(0),data}function cloneLinks(dagNode){return dagNode.links.slice()}function linkSort(a,b){const aBuf=new Buffer(a.name||"","ascii"),bBuf=new Buffer(b.name||"","ascii");return aBuf.compare(bBuf)}function toDAGLink(node){return new DAGLink("",node.size,node.multihash)}const DAGLink=__webpack_require__(19);exports=module.exports,exports.cloneData=cloneData,exports.cloneLinks=cloneLinks,exports.linkSort=linkSort,exports.toDAGLink=toDAGLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}var isFunction=__webpack_require__(233),isLength=__webpack_require__(104);module.exports=isArrayLike},function(module,exports,__webpack_require__){"use strict";function naiveLength(){return 1}function LRUCache(options){if(!(this instanceof LRUCache))return new LRUCache(options);"number"==typeof options&&(options={max:options}),options||(options={});var max=this[MAX]=options.max;(!max||"number"!=typeof max||max<=0)&&(this[MAX]=1/0);var lc=options.length||naiveLength;"function"!=typeof lc&&(lc=naiveLength),this[LENGTH_CALCULATOR]=lc,this[ALLOW_STALE]=options.stale||!1,this[MAX_AGE]=options.maxAge||0,this[DISPOSE]=options.dispose,this[NO_DISPOSE_ON_SET]=options.noDisposeOnSet||!1,this.reset()}function forEachStep(self,fn,node,thisp){var hit=node.value;isStale(self,hit)&&(del(self,node),self[ALLOW_STALE]||(hit=void 0)),hit&&fn.call(thisp,hit.value,hit.key,self)}function get(self,key,doUse){var node=self[CACHE].get(key);if(node){var hit=node.value;isStale(self,hit)?(del(self,node),self[ALLOW_STALE]||(hit=void 0)):doUse&&self[LRU_LIST].unshiftNode(node),hit&&(hit=hit.value)}return hit}function isStale(self,hit){if(!hit||!hit.maxAge&&!self[MAX_AGE])return!1;var diff=Date.now()-hit.now;return hit.maxAge?diff>hit.maxAge:self[MAX_AGE]&&diff>self[MAX_AGE]}function trim(self){if(self[LENGTH]>self[MAX])for(var walker=self[LRU_LIST].tail;self[LENGTH]>self[MAX]&&null!==walker;){var prev=walker.prev;del(self,walker),walker=prev}}function del(self,node){if(node){var hit=node.value;self[DISPOSE]&&self[DISPOSE](hit.key,hit.value),self[LENGTH]-=hit.length,self[CACHE].delete(hit.key),self[LRU_LIST].removeNode(node)}}function Entry(key,value,length,now,maxAge){this.key=key,this.value=value,this.length=length,this.now=now,this.maxAge=maxAge||0}module.exports=LRUCache;var makeSymbol,Map=__webpack_require__(264),util=__webpack_require__(11),Yallist=__webpack_require__(312),hasSymbol="function"==typeof Symbol;makeSymbol=hasSymbol?function(key){return Symbol.for(key)}:function(key){return"_"+key};var MAX=makeSymbol("max"),LENGTH=makeSymbol("length"),LENGTH_CALCULATOR=makeSymbol("lengthCalculator"),ALLOW_STALE=makeSymbol("allowStale"),MAX_AGE=makeSymbol("maxAge"),DISPOSE=makeSymbol("dispose"),NO_DISPOSE_ON_SET=makeSymbol("noDisposeOnSet"),LRU_LIST=makeSymbol("lruList"),CACHE=makeSymbol("cache");Object.defineProperty(LRUCache.prototype,"max",{set:function(mL){(!mL||"number"!=typeof mL||mL<=0)&&(mL=1/0),this[MAX]=mL,trim(this)},get:function(){return this[MAX]},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"allowStale",{set:function(allowStale){this[ALLOW_STALE]=!!allowStale},get:function(){return this[ALLOW_STALE]},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"maxAge",{set:function(mA){(!mA||"number"!=typeof mA||mA<0)&&(mA=0),this[MAX_AGE]=mA,trim(this)},get:function(){return this[MAX_AGE]},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"lengthCalculator",{set:function(lC){"function"!=typeof lC&&(lC=naiveLength),lC!==this[LENGTH_CALCULATOR]&&(this[LENGTH_CALCULATOR]=lC,this[LENGTH]=0,this[LRU_LIST].forEach(function(hit){hit.length=this[LENGTH_CALCULATOR](hit.value,hit.key),this[LENGTH]+=hit.length},this)),trim(this)},get:function(){return this[LENGTH_CALCULATOR]},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"length",{get:function(){return this[LENGTH]},enumerable:!0}),Object.defineProperty(LRUCache.prototype,"itemCount",{get:function(){return this[LRU_LIST].length},enumerable:!0}),LRUCache.prototype.rforEach=function(fn,thisp){thisp=thisp||this;for(var walker=this[LRU_LIST].tail;null!==walker;){var prev=walker.prev;forEachStep(this,fn,walker,thisp),walker=prev}},LRUCache.prototype.forEach=function(fn,thisp){thisp=thisp||this;for(var walker=this[LRU_LIST].head;null!==walker;){var next=walker.next;forEachStep(this,fn,walker,thisp),walker=next}},LRUCache.prototype.keys=function(){return this[LRU_LIST].toArray().map(function(k){return k.key},this)},LRUCache.prototype.values=function(){return this[LRU_LIST].toArray().map(function(k){return k.value},this)},LRUCache.prototype.reset=function(){this[DISPOSE]&&this[LRU_LIST]&&this[LRU_LIST].length&&this[LRU_LIST].forEach(function(hit){this[DISPOSE](hit.key,hit.value)},this),this[CACHE]=new Map,this[LRU_LIST]=new Yallist,this[LENGTH]=0},LRUCache.prototype.dump=function(){return this[LRU_LIST].map(function(hit){if(!isStale(this,hit))return{k:hit.key,v:hit.value,e:hit.now+(hit.maxAge||0)}},this).toArray().filter(function(h){return h})},LRUCache.prototype.dumpLru=function(){return this[LRU_LIST]},LRUCache.prototype.inspect=function(n,opts){var str="LRUCache {",extras=!1;this[ALLOW_STALE]&&(str+="\n allowStale: true",extras=!0);var max=this[MAX];max&&max!==1/0&&(extras&&(str+=","),str+="\n max: "+util.inspect(max,opts),extras=!0);var maxAge=this[MAX_AGE];maxAge&&(extras&&(str+=","),str+="\n maxAge: "+util.inspect(maxAge,opts),extras=!0);var lc=this[LENGTH_CALCULATOR];lc&&lc!==naiveLength&&(extras&&(str+=","),str+="\n length: "+util.inspect(this[LENGTH],opts),extras=!0);var didFirst=!1;return this[LRU_LIST].forEach(function(item){didFirst?str+=",\n ":(extras&&(str+=",\n"),didFirst=!0,str+="\n ");var key=util.inspect(item.key).split("\n").join("\n "),val={value:item.value};item.maxAge!==maxAge&&(val.maxAge=item.maxAge),lc!==naiveLength&&(val.length=item.length),isStale(this,item)&&(val.stale=!0),val=util.inspect(val,opts).split("\n").join("\n "),str+=key+" => "+val}),(didFirst||extras)&&(str+="\n"),str+="}"},LRUCache.prototype.set=function(key,value,maxAge){maxAge=maxAge||this[MAX_AGE];var now=maxAge?Date.now():0,len=this[LENGTH_CALCULATOR](value,key);if(this[CACHE].has(key)){if(len>this[MAX])return del(this,this[CACHE].get(key)),!1;var node=this[CACHE].get(key),item=node.value;return this[DISPOSE]&&(this[NO_DISPOSE_ON_SET]||this[DISPOSE](key,item.value)),item.now=now,item.maxAge=maxAge,item.value=value,this[LENGTH]+=len-item.length,item.length=len,this.get(key),trim(this),!0}var hit=new Entry(key,value,len,now,maxAge);return hit.length>this[MAX]?(this[DISPOSE]&&this[DISPOSE](key,value),!1):(this[LENGTH]+=hit.length,this[LRU_LIST].unshift(hit),this[CACHE].set(key,this[LRU_LIST].head),trim(this),!0)},LRUCache.prototype.has=function(key){return!!this[CACHE].has(key)&&!isStale(this,this[CACHE].get(key).value)},LRUCache.prototype.get=function(key){return get(this,key,!0)},LRUCache.prototype.peek=function(key){return get(this,key,!1)},LRUCache.prototype.pop=function(){var node=this[LRU_LIST].tail;return node?(del(this,node),node.value):null},LRUCache.prototype.del=function(key){del(this,this[CACHE].get(key))},LRUCache.prototype.load=function(arr){this.reset();for(var now=Date.now(),l=arr.length-1;l>=0;l--){var hit=arr[l],expiresAt=hit.e||0;if(0===expiresAt)this.set(hit.k,hit.v);else{var maxAge=expiresAt-now;maxAge>0&&this.set(hit.k,hit.v,maxAge)}}},LRUCache.prototype.prune=function(){var self=this;this[CACHE].forEach(function(value,key){get(self,key,!1)})}},function(module,exports,__webpack_require__){"use strict";const baseTable=__webpack_require__(29),varintBufferEncode=__webpack_require__(106).varintBufferEncode,varintTable={};module.exports=varintTable;for(let encodingName in baseTable){let code=baseTable[encodingName];varintTable[encodingName]=varintBufferEncode(code)}},function(module,exports,__webpack_require__){(function(setImmediate,process){function nodeify(promise,cb){return"function"!=typeof cb?promise:promise.then(function(res){nextTick(function(){cb(null,res)})},function(err){nextTick(function(){cb(err)})})}function nodeifyThis(cb){return nodeify(this,cb)}function extend(prom){if(prom&&isPromise(prom)){prom.nodeify=nodeifyThis;var then=prom.then;return prom.then=function(){return extend(then.apply(this,arguments))},prom}"function"==typeof prom?prom.prototype.nodeify=nodeifyThis:Promise.prototype.nodeify=nodeifyThis}function NodeifyPromise(fn){if(!(this instanceof NodeifyPromise))return new NodeifyPromise(fn);Promise.call(this,fn),extend(this)}var nextTick,Promise=__webpack_require__(257),isPromise=__webpack_require__(92);nextTick="function"==typeof setImmediate?setImmediate:"object"==typeof process&&process&&process.nextTick?process.nextTick:function(cb){setTimeout(cb,0)},module.exports=nodeify,nodeify.extend=extend,nodeify.Promise=NodeifyPromise,NodeifyPromise.prototype=Object.create(Promise.prototype),NodeifyPromise.prototype.constructor=NodeifyPromise}).call(exports,__webpack_require__(71).setImmediate,__webpack_require__(6))},function(module,exports,__webpack_require__){function once(fn){var f=function(){return f.called?f.value:(f.called=!0,f.value=fn.apply(this,arguments))};return f.called=!1,f}function onceStrict(fn){var f=function(){if(f.called)throw new Error(f.onceError);return f.called=!0,f.value=fn.apply(this,arguments)},name=fn.name||"Function wrapped with `once`";return f.onceError=name+" shouldn't be called more than once",f.called=!1,f}var wrappy=__webpack_require__(311);module.exports=wrappy(once),module.exports.strict=wrappy(onceStrict),once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:!0})})},function(module,exports,__webpack_require__){"use strict";(function(process){function nextTick(fn,arg1,arg2,arg3){if("function"!=typeof fn)throw new TypeError('"callback" argument must be a function');var args,i,len=arguments.length;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i=0;i>>2,bn.words[2]=(63&b32[22])<<20|b32[23]<<12|b32[24]<<4|b32[25]>>>4,bn.words[3]=(255&b32[19])<<18|b32[20]<<10|b32[21]<<2|b32[22]>>>6,bn.words[4]=(3&b32[15])<<24|b32[16]<<16|b32[17]<<8|b32[18],bn.words[5]=(15&b32[12])<<22|b32[13]<<14|b32[14]<<6|b32[15]>>>2,bn.words[6]=(63&b32[9])<<20|b32[10]<<12|b32[11]<<4|b32[12]>>>4,bn.words[7]=(255&b32[6])<<18|b32[7]<<10|b32[8]<<2|b32[9]>>>6,bn.words[8]=(3&b32[2])<<24|b32[3]<<16|b32[4]<<8|b32[5],bn.words[9]=b32[0]<<14|b32[1]<<6|b32[2]>>>2,bn.length=10,bn.strip()},BN.prototype.toBuffer=function(){for(var w=this.words,i=this.length;i<10;++i)w[i]=0;return Buffer.from([w[9]>>>14&255,w[9]>>>6&255,(63&w[9])<<2|w[8]>>>24&3,w[8]>>>16&255,w[8]>>>8&255,255&w[8],w[7]>>>18&255,w[7]>>>10&255,w[7]>>>2&255,(3&w[7])<<6|w[6]>>>20&63,w[6]>>>12&255,w[6]>>>4&255,(15&w[6])<<4|w[5]>>>22&15,w[5]>>>14&255,w[5]>>>6&255,(63&w[5])<<2|w[4]>>>24&3,w[4]>>>16&255,w[4]>>>8&255,255&w[4],w[3]>>>18&255,w[3]>>>10&255,w[3]>>>2&255,(3&w[3])<<6|w[2]>>>20&63,w[2]>>>12&255,w[2]>>>4&255,(15&w[2])<<4|w[1]>>>22&15,w[1]>>>14&255,w[1]>>>6&255,(63&w[1])<<2|w[0]>>>24&3,w[0]>>>16&255,w[0]>>>8&255,255&w[0]])},BN.prototype.clone=function(){var r=new BN;r.words=new Array(this.length);for(var i=0;i1&&0==(0|this.words[this.length-1]);)this.length--;return this},BN.prototype.normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.ucmp=function(num){if(this.length!==num.length)return this.length>num.length?1:-1;for(var i=this.length-1;i>=0;--i)if(this.words[i]!==num.words[i])return this.words[i]>num.words[i]?1:-1;return 0},BN.prototype.gtOne=function(){return this.length>1||this.words[0]>1},BN.prototype.isOverflow=function(){return this.ucmp(BN.n)>=0},BN.prototype.isHigh=function(){return 1===this.ucmp(BN.nh)},BN.prototype.bitLengthGT256=function(){return this.length>10||10===this.length&&this.words[9]>4194303},BN.prototype.iuaddn=function(num){this.words[0]+=num;for(var i=0;this.words[i]>67108863&&inum.length?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>>26}for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length++]=carry;else if(a!==this)for(;i0?(a=this,b=num):(a=num,b=this);for(var i=0,carry=0;i>26,this.words[i]=67108863&word}for(;0!==carry&&i>26,this.words[i]=67108863&word;if(0===carry&&i>>26,rword=67108863&carry,j=Math.max(0,k-num1.length+1),maxJ=Math.min(k,num2.length-1);j<=maxJ;j++){var i=k-j,a=num1.words[i],b=num2.words[j],r=a*b+rword;ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=rword,carry=ncarry}return 0!==carry&&(out.words[out.length++]=carry),out.strip()},BN.umulTo10x10=Math.imul?optimized.umulTo10x10:BN.umulTo,BN.umulnTo=function(num,k,out){if(0===k)return out.words=[0],out.length=1,out;for(var i=0,carry=0;i0?(out.words[i]=carry,out.length=num.length+1):out.length=num.length,out},BN.prototype.umul=function(num){var out=new BN;return out.words=new Array(this.length+num.length),10===this.length&&10===num.length?BN.umulTo10x10(this,num,out):1===this.length?BN.umulnTo(num,this.words[0],out):1===num.length?BN.umulnTo(this,num.words[0],out):BN.umulTo(this,num,out)},BN.prototype.isplit=function(output){output.length=Math.min(this.length,9);for(var i=0;i>>22,prev=word}return prev>>>=22,this.words[i-10]=prev,0===prev&&this.length>10?this.length-=10:this.length-=9,this},BN.prototype.fireduce=function(){return this.isOverflow()&&this.isub(BN.n),this},BN.prototype.ureduce=function(){var num=this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp);return num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp),num.bitLengthGT256()&&(num=num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp))),num.fireduce()},BN.prototype.ishrn=function(n){for(var mask=(1<=0;--i){var word=this.words[i];this.words[i]=carry<>>n,carry=word&mask}return this.length>1&&0===this.words[this.length-1]&&(this.length-=1),this},BN.prototype.uinvm=function(){for(var x=this.clone(),y=BN.n.clone(),A=BN.fromNumber(1),B=BN.fromNumber(0),C=BN.fromNumber(0),D=BN.fromNumber(1);x.isEven()&&y.isEven();){for(var k=1,m=1;0==(x.words[0]&m)&&0==(y.words[0]&m)&&k<26;++k,m<<=1);x.ishrn(k),y.ishrn(k)}for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.ishrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.ishrn(1),B.ishrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.ishrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.ishrn(1),D.ishrn(1);x.ucmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}if(1===C.negative){C.negative=0;var result=C.ureduce();return result.negative^=1,result.normSign().iadd(BN.n)}return C.ureduce()},BN.prototype.imulK=function(){this.words[this.length]=0,this.words[this.length+1]=0,this.length+=2;for(var i=0,lo=0;i0?this.isub(BN.p):this.strip(),this},BN.prototype.redNeg=function(){return this.isZero()?BN.fromNumber(0):BN.p.sub(this)},BN.prototype.redAdd=function(num){return this.clone().redIAdd(num)},BN.prototype.redIAdd=function(num){return this.iadd(num),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redIAdd7=function(){return this.iuaddn(7),this.ucmp(BN.p)>=0&&this.isub(BN.p),this},BN.prototype.redSub=function(num){return this.clone().redISub(num)},BN.prototype.redISub=function(num){return this.isub(num),0!==this.negative&&this.iadd(BN.p),this},BN.prototype.redMul=function(num){return this.umul(num).redIReduce()},BN.prototype.redSqr=function(){return this.umul(this).redIReduce()},BN.prototype.redSqrt=function(){if(this.isZero())return this.clone();for(var wv2=this.redSqr(),wv4=wv2.redSqr(),wv12=wv4.redSqr().redMul(wv4),wv14=wv12.redMul(wv2),wv15=wv14.redMul(this),out=wv15,i=0;i<54;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);for(out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv14),i=0;i<5;++i)out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv15);return out=out.redSqr().redSqr().redSqr().redSqr().redMul(wv12),out=out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12),0===out.redSqr().ucmp(this)?out:null},BN.prototype.redInvm=function(){for(var a=this.clone(),b=BN.p.clone(),x1=BN.fromNumber(1),x2=BN.fromNumber(0);a.gtOne()&&b.gtOne();){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.ishrn(i);i-- >0;)x1.isOdd()&&x1.iadd(BN.p),x1.ishrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.ishrn(j);j-- >0;)x2.isOdd()&&x2.iadd(BN.p),x2.ishrn(1);a.ucmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=1===a.length&&1===a.words[0]?x1:x2,0!==res.negative&&res.iadd(BN.p),0!==res.negative?(res.negative=0,res.redIReduce().redNeg()):res.redIReduce()},BN.prototype.getNAF=function(w){for(var naf=[],ws=1<>1,k=this.clone();!k.isZero();){for(var i=0,m=1;0==(k.words[0]&m)&&i<26;++i,m<<=1)naf.push(0);if(0!==i)k.ishrn(i);else{var mod=k.words[0]&wsm1;if(mod>=ws2)naf.push(ws2-mod),k.iuaddn(mod-ws2).ishrn(1);else if(naf.push(mod),k.words[0]-=mod,!k.isZero()){for(i=w-1;i>0;--i)naf.push(0);k.ishrn(w)}}}return naf},BN.prototype.inspect=function(){if(this.isZero())return"0";for(var buffer=this.toBuffer().toString("hex"),i=0;"0"===buffer[i];++i);return buffer.slice(i)},BN.n=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex")),BN.nh=BN.n.clone().ishrn(1),BN.nc=BN.fromBuffer(Buffer.from("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF","hex")),BN.p=BN.fromBuffer(Buffer.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex")),BN.psn=BN.p.sub(BN.n),BN.tmp=new BN,BN.tmp.words=new Array(10),function(){BN.fromNumber(1).words[3]=0}(),module.exports=BN},function(module,exports){function extend(){for(var target={},i=0;i{return promisify((files,callback)=>{if(!(Buffer.isBuffer(files)||isStream.readable(files)||Array.isArray(files)))return callback(new Error('"files" must be a buffer, readable stream, or array of objects'));const request={path:"add",files:files},transform=(res,callback)=>DAGNodeStream.streamToValue(send,res,callback);send.andTransform(request,transform,callback)})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function once(fn){return function(){if(null!==fn){var callFn=fn;fn=null,callFn.apply(this,arguments)}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=once,module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _setImmediate=__webpack_require__(78),_setImmediate2=function(obj){return obj&&obj.__esModule?obj:{default:obj}}(_setImmediate);exports.default=_setImmediate2.default,module.exports=exports.default},function(module,exports){exports["aes-128-ecb"]={cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},exports["aes-192-ecb"]={cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},exports["aes-256-ecb"]={cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},exports["aes-128-cbc"]={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},exports["aes-192-cbc"]={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},exports["aes-256-cbc"]={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},exports.aes128=exports["aes-128-cbc"],exports.aes192=exports["aes-192-cbc"],exports.aes256=exports["aes-256-cbc"],exports["aes-128-cfb"]={cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},exports["aes-192-cfb"]={cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},exports["aes-256-cfb"]={cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},exports["aes-128-cfb8"]={cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},exports["aes-192-cfb8"]={cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},exports["aes-256-cfb8"]={cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},exports["aes-128-cfb1"]={cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},exports["aes-192-cfb1"]={cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},exports["aes-256-cfb1"]={cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},exports["aes-128-ofb"]={cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},exports["aes-192-ofb"]={cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},exports["aes-256-ofb"]={cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},exports["aes-128-ctr"]={cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},exports["aes-192-ctr"]={cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},exports["aes-256-ctr"]={cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},exports["aes-128-gcm"]={cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},exports["aes-192-gcm"]={cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},exports["aes-256-gcm"]={cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},function(module,exports,__webpack_require__){var once=__webpack_require__(48),noop=function(){},isRequest=function(stream){return stream.setHeader&&"function"==typeof stream.abort},isChildProcess=function(stream){return stream.stdio&&Array.isArray(stream.stdio)&&3===stream.stdio.length},eos=function(stream,opts,callback){if("function"==typeof opts)return eos(stream,null,opts);opts||(opts={}),callback=once(callback||noop);var ws=stream._writableState,rs=stream._readableState,readable=opts.readable||opts.readable!==!1&&stream.readable,writable=opts.writable||opts.writable!==!1&&stream.writable,onlegacyfinish=function(){stream.writable||onfinish()},onfinish=function(){writable=!1,readable||callback.call(stream)},onend=function(){readable=!1,writable||callback.call(stream)},onexit=function(exitCode){callback.call(stream,exitCode?new Error("exited with error code: "+exitCode):null)},onclose=function(){return(!readable||rs&&rs.ended)&&(!writable||ws&&ws.ended)?void 0:callback.call(stream,new Error("premature close"))},onrequest=function(){stream.req.on("finish",onfinish)};return isRequest(stream)?(stream.on("complete",onfinish),stream.on("abort",onclose),stream.req?onrequest():stream.on("request",onrequest)):writable&&!ws&&(stream.on("end",onlegacyfinish),stream.on("close",onlegacyfinish)),isChildProcess(stream)&&stream.on("exit",onexit),stream.on("end",onend),stream.on("finish",onfinish),opts.error!==!1&&stream.on("error",callback),stream.on("close",onclose),function(){stream.removeListener("complete",onfinish),stream.removeListener("abort",onclose),stream.removeListener("request",onrequest),stream.req&&stream.req.removeListener("finish",onfinish),stream.removeListener("end",onlegacyfinish),stream.removeListener("close",onlegacyfinish),stream.removeListener("finish",onfinish),stream.removeListener("exit",onexit),stream.removeListener("end",onend),stream.removeListener("error",callback),stream.removeListener("close",onclose)}};module.exports=eos},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(8),assert=__webpack_require__(35);class DAGNode{constructor(data,links,serialized,multihash){assert(serialized,"DAGNode needs its serialized format"),assert(multihash,"DAGNode needs its multihash"),"string"==typeof multihash&&(multihash=mh.fromB58String(multihash)),this._data=data||new Buffer(0),this._links=links||[],this._serialized=serialized,this._multihash=multihash,this._size=this.links.reduce((sum,l)=>sum+l.size,this.serialized.length),this._json={data:this.data,links:this.links.map(l=>l.toJSON()),multihash:mh.toB58String(this.multihash),size:this.size}}toJSON(){return this._json}toString(){return`DAGNode <${mh.toB58String(this.multihash)} - data: "${this.data.toString()}", links: ${this.links.length}, size: ${this.size}>`}get data(){return this._data}set data(data){throw new Error("Can't set property: 'data' is immutable")}get links(){return this._links}set links(links){throw new Error("Can't set property: 'links' is immutable")}get serialized(){return this._serialized}set serialized(serialized){throw new Error("Can't set property: 'serialized' is immutable")}get size(){return this._size}set size(size){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(multihash){throw new Error("Can't set property: 'multihash' is immutable")}}exports=module.exports=DAGNode,exports.create=__webpack_require__(42),exports.clone=__webpack_require__(190),exports.addLink=__webpack_require__(189),exports.rmLink=__webpack_require__(191)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function cid(node,callback){if(node.multihash)return callback(null,new CID(node.multihash));callback(new Error("not valid dagPB node"))}function serialize(node,callback){let serialized;try{const pb=toProtoBuf(node);serialized=proto.PBNode.encode(pb)}catch(err){return callback(err)}callback(null,serialized)}function deserialize(data,callback){const pbn=proto.PBNode.decode(data),links=pbn.Links.map(link=>{return new DAGLink(link.Name,link.Tsize,link.Hash)}),buf=pbn.Data||new Buffer(0);DAGNode.create(buf,links,callback)}function toProtoBuf(node){const pbn={};return node.data&&node.data.length>0?pbn.Data=node.data:pbn.Data=null,node.links&&node.links.length>0?pbn.Links=node.links.map(link=>{return{Hash:link.multihash,Name:link.name,Tsize:link.size}}):pbn.Links=null,pbn}const CID=__webpack_require__(187),protobuf=__webpack_require__(32),proto=protobuf(__webpack_require__(192)),DAGLink=__webpack_require__(19),DAGNode=__webpack_require__(57);exports=module.exports,exports.serialize=serialize,exports.deserialize=deserialize,exports.cid=cid}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function isMultihash(hash){const formatted=convertToString(hash);try{const buffer=new Buffer(base58.decode(formatted));return multihash.decode(buffer),!0}catch(e){return!1}}function isIpfs(input,pattern){const formatted=convertToString(input);if(!formatted)return!1;const match=formatted.match(pattern);return!!match&&("ipfs"===match[1]&&isMultihash(match[4]))}function isIpns(input,pattern){const formatted=convertToString(input);if(!formatted)return!1;const match=formatted.match(pattern);return!!match&&"ipns"===match[1]}function convertToString(input){return Buffer.isBuffer(input)?base58.encode(input):"string"==typeof input&&input}const base58=__webpack_require__(10),multihash=__webpack_require__(195),urlPattern=/^https?:\/\/[^\/]+\/(ip(f|n)s)\/((\w+).*)/,pathPattern=/^\/(ip(f|n)s)\/((\w+).*)/;module.exports={multihash:isMultihash,ipfsUrl:url=>isIpfs(url,urlPattern),ipnsUrl:url=>isIpns(url,urlPattern),url:url=>isIpfs(url,urlPattern)||isIpns(url,urlPattern),urlPattern:urlPattern,ipfsPath:path=>isIpfs(path,pathPattern),ipnsPath:path=>isIpns(path,pathPattern),path:path=>isIpfs(path,pathPattern)||isIpns(path,pathPattern),pathPattern:pathPattern,urlOrPath:x=>isIpfs(x,urlPattern)||isIpns(x,urlPattern)||isIpfs(x,pathPattern)||isIpns(x,pathPattern)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=`enum KeyType { RSA = 0; Ed25519 = 1; Secp256k1 = 2; } message PublicKey { required KeyType Type = 1; required bytes Data = 2; } message PrivateKey { required KeyType Type = 1; required bytes Data = 2; }`},function(module,exports,__webpack_require__){"use strict";module.exports=(()=>{if("undefined"!=typeof self&&(__webpack_require__(310)(self),self.crypto))return self.crypto;throw new Error("Please use an environment with crypto support")})},function(module,exports,__webpack_require__){(function(global,module){function arrayMap(array,iteratee){for(var index=-1,length=array?array.length:0,result=Array(length);++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index{let prefix;if(Buffer.isBuffer(multicodecStrOrCode))prefix=util.varintBufferEncode(multicodecStrOrCode);else{if(!codecNameToCodeVarint[multicodecStrOrCode])throw new Error("multicodec not recognized");prefix=codecNameToCodeVarint[multicodecStrOrCode]}return Buffer.concat([prefix,data])}),exports.rmPrefix=(data=>{return varint.decode(data),data.slice(varint.decode.bytes)}),exports.getCodec=(prefixedData=>{return codeToCodecName[util.varintBufferDecode(prefixedData).toString("hex")]})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function toB64Opt(val){if(val)return val.toString("base64")}const mh=__webpack_require__(8),crypto=__webpack_require__(207),assert=__webpack_require__(35),waterfall=__webpack_require__(79),Buffer=__webpack_require__(4).Buffer;class PeerId{constructor(id,privKey,pubKey){assert(Buffer.isBuffer(id),"invalid id provided"),privKey&&pubKey&&assert(privKey.public.bytes.equals(pubKey.bytes),"inconsistent arguments"),this._id=id,this._idB58String=mh.toB58String(this.id),this._privKey=privKey,this._pubKey=pubKey}get id(){return this._id}set id(val){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(privKey){this._privKey=privKey}get pubKey(){return this._pubKey?this._pubKey:this._privKey?this._privKey.public:void 0}set pubKey(pubKey){this._pubKey=pubKey}marshalPubKey(){if(this.pubKey)return crypto.keys.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return crypto.keys.marshalPrivateKey(this.privKey)}toPrint(){return this.toJSON()}toJSON(){return{id:this.toB58String(),privKey:toB64Opt(this.marshalPrivKey()),pubKey:toB64Opt(this.marshalPubKey())}}toHexString(){return mh.toHexString(this.id)}toBytes(){return this.id}toB58String(){return this._idB58String}isEqual(id){if(Buffer.isBuffer(id))return this.id.equals(id);if(id.id)return this.id.equals(id.id);throw new Error("not valid Id")}isValid(callback){this.privKey&&this.privKey.public&&this.privKey.public.bytes&&Buffer.isBuffer(this.pubKey.bytes)&&this.privKey.public.bytes.equals(this.pubKey.bytes)?callback():callback(new Error("Keys not match"))}}exports=module.exports=PeerId,exports.create=function(opts,callback){"function"==typeof opts&&(callback=opts,opts={}),opts=opts||{},opts.bits=opts.bits||2048,waterfall([cb=>crypto.keys.generateKeyPair("RSA",opts.bits,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromHexString=function(str){return new PeerId(mh.fromHexString(str))},exports.createFromBytes=function(buf){return new PeerId(buf)},exports.createFromB58String=function(str){return new PeerId(mh.fromB58String(str))},exports.createFromPubKey=function(key,callback){if("function"!=typeof callback)throw new Error("callback is required");let buf=key;"string"==typeof buf&&(buf=Buffer.from(key,"base64"));const pubKey=crypto.keys.unmarshalPublicKey(buf);pubKey.hash((err,digest)=>{if(err)return callback(err);callback(null,new PeerId(digest,null,pubKey))})},exports.createFromPrivKey=function(key,callback){let buf=key;if("string"==typeof buf&&(buf=Buffer.from(key,"base64")),"function"!=typeof callback)throw new Error("callback is required");waterfall([cb=>crypto.keys.unmarshalPrivateKey(buf,cb),(privKey,cb)=>privKey.public.hash((err,digest)=>{cb(err,digest,privKey)})],(err,digest,privKey)=>{if(err)return callback(err);callback(null,new PeerId(digest,privKey))})},exports.createFromJSON=function(obj,callback){if("function"!=typeof callback)throw new Error("callback is required");const id=mh.fromB58String(obj.id),rawPrivKey=obj.privKey&&Buffer.from(obj.privKey,"base64"),rawPubKey=obj.pubKey&&Buffer.from(obj.pubKey,"base64"),pub=rawPubKey&&crypto.keys.unmarshalPublicKey(rawPubKey);rawPrivKey?waterfall([cb=>crypto.keys.unmarshalPrivateKey(rawPrivKey,cb),(priv,cb)=>priv.public.hash((err,digest)=>{cb(err,digest,priv)}),(privDigest,priv,cb)=>{pub?pub.hash((err,pubDigest)=>{cb(err,privDigest,priv,pubDigest)}):cb(null,privDigest,priv)}],(err,privDigest,priv,pubDigest)=>{return err?callback(err):pub&&!privDigest.equals(pubDigest)?callback(new Error("Public and private key do not match")):id&&!privDigest.equals(id)?callback(new Error("Id and private key do not match")):void callback(null,new PeerId(id,priv,pub))}):callback(null,new PeerId(id,null,pub))},exports.isPeerId=function(peerId){return Boolean("object"==typeof peerId&&peerId._id&&peerId._idB58String)}},function(module,exports,__webpack_require__){"use strict";var has=Object.prototype.hasOwnProperty,hexTable=function(){for(var array=[],i=0;i<256;++i)array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase());return array}();exports.arrayToObject=function(source,options){for(var obj=options&&options.plainObjects?Object.create(null):{},i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122?out+=string.charAt(i):c<128?out+=hexTable[c]:c<2048?out+=hexTable[192|c>>6]+hexTable[128|63&c]:c<55296||c>=57344?out+=hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|63&c]:(i+=1,c=65536+((1023&c)<<10|1023&string.charCodeAt(i)),out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|63&c])}return out},exports.compact=function(obj,references){if("object"!=typeof obj||null===obj)return obj;var refs=references||[],lookup=refs.indexOf(obj);if(lookup!==-1)return refs[lookup];if(refs.push(obj),Array.isArray(obj)){for(var compacted=[],i=0;i-1?setImmediate:processNextTick;Writable.WritableState=WritableState;var util=__webpack_require__(26);util.inherits=__webpack_require__(2);var internalUtil={deprecate:__webpack_require__(303)},Stream=__webpack_require__(116),Buffer=__webpack_require__(4).Buffer,OurUint8Array=global.Uint8Array||function(){},destroyImpl=__webpack_require__(115);util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}();var realHasInstance;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||object&&object._writableState instanceof WritableState}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=_isUint8Array(chunk)&&!state.objectMode;return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=_uint8ArrayToBuffer(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?writeAfterEnd(this,cb):(isBuf||validChunk(this,state,chunk,cb))&&(state.pendingcb++,ret=writeOrBuffer(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||endWritable(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(exports,__webpack_require__(6),__webpack_require__(71).setImmediate,__webpack_require__(5))},function(module,exports,__webpack_require__){function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}var apply=Function.prototype.apply;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(window,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(285),exports.setImmediate=setImmediate,exports.clearImmediate=clearImmediate},function(module,exports,__webpack_require__){"use strict";const pump=__webpack_require__(33),TransformStream=__webpack_require__(7).Transform,streamToValue=__webpack_require__(9),getDagNode=__webpack_require__(392);class DAGNodeStream extends TransformStream{constructor(options){const opts=Object.assign(options||{},{objectMode:!0});super(opts),this._send=opts.send}static streamToValue(send,inputStream,callback){streamToValue(pump(inputStream,new DAGNodeStream({send:send}),err=>{err&&callback(err)}),callback)}_transform(obj,enc,callback){getDagNode(this._send,obj.Hash,(err,node)=>{if(err)return callback(err);const result={path:obj.Name,hash:obj.Hash,size:node.size};this.push(result),callback(null)})}}module.exports=DAGNodeStream},function(module,exports,__webpack_require__){function DecoderBuffer(base,options){if(Reporter.call(this,options),!Buffer.isBuffer(base))return void this.error("Input not Buffer");this.base=base,this.offset=0,this.length=base.length}function EncoderBuffer(value,reporter){if(Array.isArray(value))this.length=0,this.value=value.map(function(item){return item instanceof EncoderBuffer||(item=new EncoderBuffer(item,reporter)),this.length+=item.length,item},this);else if("number"==typeof value){if(!(0<=value&&value<=255))return reporter.error("non-byte EncoderBuffer value");this.value=value,this.length=1}else if("string"==typeof value)this.value=value,this.length=Buffer.byteLength(value);else{if(!Buffer.isBuffer(value))return reporter.error("Unsupported type: "+typeof value);this.value=value,this.length=value.length}}var inherits=__webpack_require__(2),Reporter=__webpack_require__(22).Reporter,Buffer=__webpack_require__(0).Buffer;inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function(save){var res=new DecoderBuffer(this.base);return res.offset=save.offset,res.length=this.offset,this.offset=save.offset,Reporter.prototype.restore.call(this,save.reporter),res},DecoderBuffer.prototype.isEmpty=function(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function(fail){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(fail||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function(bytes,fail){if(!(this.offset+bytes<=this.length))return this.error(fail||"DecoderBuffer overrun");var res=new DecoderBuffer(this.base);return res._reporterState=this._reporterState,res.offset=this.offset,res.length=this.offset+bytes,this.offset+=bytes,res},DecoderBuffer.prototype.raw=function(save){return this.base.slice(save?save.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function(out,offset){return out||(out=new Buffer(this.length)),offset||(offset=0),0===this.length?out:(Array.isArray(this.value)?this.value.forEach(function(item){item.join(out,offset),offset+=item.length}):("number"==typeof this.value?out[offset]=this.value:"string"==typeof this.value?out.write(this.value,offset):Buffer.isBuffer(this.value)&&this.value.copy(out,offset),offset+=this.length),out)}},function(module,exports,__webpack_require__){var constants=exports;constants._reverse=function(map){var res={};return Object.keys(map).forEach(function(key){(0|key)==key&&(key|=0),res[map[key]]=key}),res},constants.der=__webpack_require__(140)},function(module,exports,__webpack_require__){function DERDecoder(entity){this.enc="der",this.name=entity.name,this.entity=entity,this.tree=new DERNode,this.tree._init(entity.body)}function DERNode(parent){base.Node.call(this,"der",parent)}function derDecodeTag(buf,fail){var tag=buf.readUInt8(fail);if(buf.isError(tag))return tag;var cls=der.tagClass[tag>>6],primitive=0==(32&tag);if(31==(31&tag)){var oct=tag;for(tag=0;128==(128&oct);){if(oct=buf.readUInt8(fail),buf.isError(oct))return oct;tag<<=7,tag|=127&oct}}else tag&=31;return{cls:cls,primitive:primitive,tag:tag,tagStr:der.tag[tag]}}function derDecodeLen(buf,primitive,fail){var len=buf.readUInt8(fail);if(buf.isError(len))return len;if(!primitive&&128===len)return null;if(0==(128&len))return len;var num=127&len;if(num>4)return buf.error("length octect is too long");len=0;for(var i=0;i=31?reporter.error("Multi-octet tag encoding unsupported"):(primitive||(res|=32),res|=der.tagClassByName[cls||"universal"]<<6)}var inherits=__webpack_require__(2),Buffer=__webpack_require__(0).Buffer,asn1=__webpack_require__(18),base=asn1.base,der=asn1.constants.der;module.exports=DEREncoder,DEREncoder.prototype.encode=function(data,reporter){return this.tree._encode(data,reporter).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function(tag,primitive,cls,content){var encodedTag=encodeTag(tag,primitive,cls,this.reporter);if(content.length<128){var header=new Buffer(2);return header[0]=encodedTag,header[1]=content.length,this._createEncoderBuffer([header,content])}for(var lenOctets=1,i=content.length;i>=256;i>>=8)lenOctets++;var header=new Buffer(2+lenOctets);header[0]=encodedTag,header[1]=128|lenOctets;for(var i=1+lenOctets,j=content.length;j>0;i--,j>>=8)header[i]=255&j;return this._createEncoderBuffer([header,content])},DERNode.prototype._encodeStr=function(str,tag){if("bitstr"===tag)return this._createEncoderBuffer([0|str.unused,str.data]);if("bmpstr"===tag){for(var buf=new Buffer(2*str.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");id.splice(0,2,40*id[0]+id[1])}for(var size=0,i=0;i=128;ident>>=7)size++}for(var objid=new Buffer(size),offset=objid.length-1,i=id.length-1;i>=0;i--){var ident=id[i];for(objid[offset--]=127&ident;(ident>>=7)>0;)objid[offset--]=128|127&ident}return this._createEncoderBuffer(objid)},DERNode.prototype._encodeTime=function(time,tag){var str,date=new Date(time);return"gentime"===tag?str=[two(date.getFullYear()),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):"utctime"===tag?str=[two(date.getFullYear()%100),two(date.getUTCMonth()+1),two(date.getUTCDate()),two(date.getUTCHours()),two(date.getUTCMinutes()),two(date.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+tag+" time is not supported yet"),this._encodeStr(str,"octstr")},DERNode.prototype._encodeNull=function(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function(num,values){if("string"==typeof num){if(!values)return this.reporter.error("String int or enum given, but no values map");if(!values.hasOwnProperty(num))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(num));num=values[num]}if("number"!=typeof num&&!Buffer.isBuffer(num)){var numArray=num.toArray();!num.sign&&128&numArray[0]&&numArray.unshift(0),num=new Buffer(numArray)}if(Buffer.isBuffer(num)){var size=num.length;0===num.length&&size++;var out=new Buffer(size);return num.copy(out),0===num.length&&(out[0]=0),this._createEncoderBuffer(out)}if(num<128)return this._createEncoderBuffer(num);if(num<256)return this._createEncoderBuffer([0,num]);for(var size=1,i=num;i>=256;i>>=8)size++;for(var out=new Array(size),i=out.length-1;i>=0;i--)out[i]=255&num,num>>=8;return 128&out[0]&&out.unshift(0),this._createEncoderBuffer(new Buffer(out))},DERNode.prototype._encodeBool=function(value){return this._createEncoderBuffer(value?255:0)},DERNode.prototype._use=function(entity,obj){return"function"==typeof entity&&(entity=entity(obj)),entity._getEncoder("der").tree},DERNode.prototype._skipDefault=function(dataBuffer,reporter,parent){var i,state=this._baseState;if(null===state.default)return!1;var data=dataBuffer.join();if(void 0===state.defaultBuffer&&(state.defaultBuffer=this._encodeValue(state.default,reporter,parent).join()),data.length!==state.defaultBuffer.length)return!1;for(i=0;i>i%8,self._prev=shiftIn(self._prev,decrypt?bit:value);return out}function shiftIn(buffer,value){var len=buffer.length,i=-1,out=new Buffer(buffer.length);for(buffer=Buffer.concat([buffer,new Buffer([value])]);++i>7;return out}exports.encrypt=function(self,chunk,decrypt){for(var len=chunk.length,out=new Buffer(len),i=-1;++i>5]|=128<>>9<<4)]=len;for(var a=1732584193,b=-271733879,c=-1732584194,d=271733878,i=0;i>16)+(y>>16)+(lsw>>16)<<16|65535&lsw}function bit_rol(num,cnt){return num<>>32-cnt}var makeHash=__webpack_require__(171);module.exports=function(buf){return makeHash(buf,core_md5)}},function(module,exports,__webpack_require__){function EVP_BytesToKey(password,salt,keyLen,ivLen){if(Buffer.isBuffer(password)||(password=Buffer.from(password,"binary")),salt&&(Buffer.isBuffer(salt)||(salt=Buffer.from(salt,"binary")),8!==salt.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var key=Buffer.alloc(keyLen),iv=Buffer.alloc(ivLen),tmp=Buffer.alloc(0);keyLen>0||ivLen>0;){var hash=new MD5;hash.update(tmp),hash.update(password),salt&&hash.update(salt),tmp=hash.digest();var used=0;if(keyLen>0){var keyStart=key.length-keyLen;used=Math.min(keyLen,tmp.length),tmp.copy(key,keyStart,0,used),keyLen-=used}if(used0){var ivStart=iv.length-ivLen,length=Math.min(ivLen,tmp.length-used);tmp.copy(iv,ivStart,used,used+length),ivLen-=length}}return tmp.fill(0),{key:key,iv:iv}}var Buffer=__webpack_require__(4).Buffer,MD5=__webpack_require__(237);module.exports=EVP_BytesToKey},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const CID=__webpack_require__(184);class Block{constructor(data,cid){if(!data||!Buffer.isBuffer(data))throw new Error("first argument must be a buffer");if(!cid||!CID.isCID(cid))throw new Error("second argument must be a CID");this._data=data,this._cid=cid}get data(){return this._data}set data(val){throw new Error("Tried to change an immutable block")}get cid(){return this._cid}set cid(val){throw new Error("Tried to change an immutable block")}static isBlock(other){return other&&"Block"===other.constructor.name}}module.exports=Block}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){function isPromise(obj){return obj&&"function"==typeof obj.then}module.exports=isPromise},function(module,exports,__webpack_require__){"use strict";var isStream=module.exports=function(stream){return null!==stream&&"object"==typeof stream&&"function"==typeof stream.pipe};isStream.writable=function(stream){return isStream(stream)&&stream.writable!==!1&&"function"==typeof stream._write&&"object"==typeof stream._writableState},isStream.readable=function(stream){return isStream(stream)&&stream.readable!==!1&&"function"==typeof stream._read&&"object"==typeof stream._readableState},isStream.duplex=function(stream){return isStream.writable(stream)&&isStream.readable(stream)},isStream.transform=function(stream){return isStream.duplex(stream)&&"function"==typeof stream._transform&&"object"==typeof stream._transformState}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports){module.exports={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:"scalar was invalid (zero or overflow)",ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer",ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid",ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature",ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature",ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:"couldn't serialize signature to DER format",ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid",ECDSA_RECOVER_FAIL:"couldn't recover public key from signature",MSG32_TYPE_INVALID:"message should be a Buffer",MSG32_LENGTH_INVALID:"message length is invalid",OPTIONS_TYPE_INVALID:"options should be an Object",OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer",OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid",OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function",RECOVERY_ID_TYPE_INVALID:"recovery should be a Number",RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4",TWEAK_TYPE_INVALID:"tweak should be a Buffer",TWEAK_LENGTH_INVALID:"tweak length is invalid"}},function(module,exports,__webpack_require__){"use strict";const nodeify=__webpack_require__(47),Buffer=__webpack_require__(4).Buffer,crypto=__webpack_require__(61)(),lengths=__webpack_require__(206),hashTypes={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};exports.create=function(hashType,secret,callback){const hash=hashTypes[hashType];nodeify(crypto.subtle.importKey("raw",secret,{name:"HMAC",hash:{name:hash}},!1,["sign"]).then(key=>{return{digest(data,cb){nodeify(crypto.subtle.sign({name:"HMAC"},key,data).then(raw=>Buffer.from(raw)),cb)},length:lengths[hashType]}}),callback)}},function(module,exports,__webpack_require__){"use strict";function exportKey(pair){return Promise.all([webcrypto.subtle.exportKey("jwk",pair.privateKey),webcrypto.subtle.exportKey("jwk",pair.publicKey)])}function derivePublicFromPrivate(jwKey){return webcrypto.subtle.importKey("jwk",{kty:jwKey.kty,n:jwKey.n,e:jwKey.e,alg:jwKey.alg,kid:jwKey.kid},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"])}const nodeify=__webpack_require__(47),Buffer=__webpack_require__(4).Buffer,webcrypto=__webpack_require__(61)();exports.utils=__webpack_require__(215),exports.generateKey=function(bits,callback){nodeify(webcrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:bits,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(exportKey).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.unmarshalPrivateKey=function(key,callback){const privateKey=webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]);nodeify(Promise.all([privateKey,derivePublicFromPrivate(key)]).then(keys=>exportKey({privateKey:keys[0],publicKey:keys[1]})).then(keys=>({privateKey:keys[0],publicKey:keys[1]})),callback)},exports.getRandomValues=function(arr){return Buffer.from(webcrypto.getRandomValues(arr))},exports.hashAndSign=function(key,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]).then(privateKey=>{return webcrypto.subtle.sign({name:"RSASSA-PKCS1-v1_5"},privateKey,Uint8Array.from(msg))}).then(sig=>Buffer.from(sig)),callback)},exports.hashAndVerify=function(key,sig,msg,callback){nodeify(webcrypto.subtle.importKey("jwk",key,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]).then(publicKey=>{return webcrypto.subtle.verify({name:"RSASSA-PKCS1-v1_5"},publicKey,sig,msg)}),callback)}},function(module,exports,__webpack_require__){"use strict";function randomBytes(number){if(!number||"number"!=typeof number)throw new Error("first argument must be a Number bigger than 0");return rsa.getRandomValues(new Uint8Array(number))}const rsa=__webpack_require__(97);module.exports=randomBytes},function(module,exports,__webpack_require__){"use strict";const BN=__webpack_require__(18).bignum,Buffer=__webpack_require__(4).Buffer;exports.toBase64=function(bn,len){return bn.toArrayLike(Buffer,"be",len).toString("base64").replace(/(=*)$/,"").replace(/\+/g,"-").replace(/\//g,"_")},exports.toBn=function(str){return new BN(Buffer.from(str,"base64"))}},function(module,exports,__webpack_require__){var root=__webpack_require__(102),Symbol=root.Symbol;module.exports=Symbol},function(module,exports,__webpack_require__){(function(global){var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global;module.exports=freeGlobal}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){var freeGlobal=__webpack_require__(101),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root},function(module,exports){var isArray=Array.isArray;module.exports=isArray},function(module,exports){function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}var MAX_SAFE_INTEGER=9007199254740991;module.exports=isLength},function(module,exports){function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}module.exports=isObject},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function bufferToNumber(buf){return parseInt(buf.toString("hex"),16)}function numberToBuffer(num){let hexString=num.toString(16);return hexString.length%2==1&&(hexString="0"+hexString),new Buffer(hexString,"hex")}function varintBufferEncode(input){return new Buffer(varint.encode(bufferToNumber(input)))}function varintBufferDecode(input){return numberToBuffer(varint.decode(input))}const varint=__webpack_require__(12);module.exports={numberToBuffer:numberToBuffer,bufferToNumber:bufferToNumber,varintBufferEncode:varintBufferEncode,varintBufferDecode:varintBufferDecode}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const setImmediate=__webpack_require__(54);exports.toCallback=(doWork=>{return function(input,callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let res;try{res=doWork(input)}catch(err){return void done(err)}done(null,res)}}),exports.toBuf=((doWork,other)=>input=>{return new Buffer(doWork(input,other),"hex")}),exports.fromString=((doWork,other)=>_input=>{return doWork(Buffer.isBuffer(_input)?_input.toString():_input,other)}),exports.fromNumberTo32BitBuf=((doWork,other)=>input=>{let number=doWork(input,other);const bytes=new Array(4);for(let i=0;i<4;i++)bytes[i]=255&number,number>>=8;return Buffer.from(bytes)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function parse(opts){function parseRow(row){try{if(row)return JSON.parse(row)}catch(e){opts.strict&&this.emit("error",new Error("Could not parse row "+row.slice(0,50)+"..."))}}return opts=opts||{},opts.strict=opts.strict!==!1,split(parseRow,opts)}function serialize(opts){return through.obj(opts,function(obj,enc,cb){cb(null,stringify(obj)+EOL)})}var through=__webpack_require__(127),split=__webpack_require__(291),EOL=__webpack_require__(109).EOL,stringify=__webpack_require__(201);module.exports=parse,module.exports.serialize=module.exports.stringify=serialize,module.exports.parse=parse},function(module,exports){exports.endianness=function(){return"LE"},exports.hostname=function(){return"undefined"!=typeof location?location.hostname:""},exports.loadavg=function(){return[]},exports.uptime=function(){return 0},exports.freemem=function(){return Number.MAX_VALUE},exports.totalmem=function(){return Number.MAX_VALUE},exports.cpus=function(){return[]},exports.type=function(){return"Browser"},exports.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}},exports.arch=function(){return"javascript"},exports.platform=function(){return"browser"},exports.tmpdir=exports.tmpDir=function(){return"/tmp"},exports.EOL="\n"},function(module,exports,__webpack_require__){"use strict";function ensureMultiaddr(ma){return multiaddr.isMultiaddr(ma)?ma:multiaddr(ma)}const multiaddr=__webpack_require__(20);module.exports={ensureMultiaddr:ensureMultiaddr}},function(module,exports,__webpack_require__){"use strict";var replace=String.prototype.replace;module.exports={default:"RFC3986",formatters:{RFC1738:function(value){return replace.call(value,/%20/g,"+")},RFC3986:function(value){return value}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(15)},function(module,exports,__webpack_require__){"use strict";(function(global,process){function _uint8ArrayToBuffer(chunk){return Buffer.from(chunk)}function _isUint8Array(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}function prependListener(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(15),options=options||{},this.objectMode=!!options.objectMode,stream instanceof Duplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,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=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(31).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(15),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&("function"==typeof options.read&&(this._read=options.read),"function"==typeof options.destroy&&(this._destroy=options.destroy)),Stream.call(this)}function readableAddChunk(stream,chunk,encoding,addToFront,skipChunkCheck){var state=stream._readableState;if(null===chunk)state.reading=!1,onEofChunk(stream,state);else{var er;skipChunkCheck||(er=chunkInvalid(state,chunk)),er?stream.emit("error",er):state.objectMode||chunk&&chunk.length>0?("string"==typeof chunk||state.objectMode||Object.getPrototypeOf(chunk)===Buffer.prototype||(chunk=_uint8ArrayToBuffer(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1)}return needMoreData(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}function chunkInvalid(state,chunk){var er;return _isUint8Array(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er}function needMoreData(state){return!state.ended&&(state.needReadable||state.length=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!==n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=computeNewHighWaterMark(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function onEofChunk(stream,state){if(!state.ended){if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?processNextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,processNextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=fromListPartial(n,state.buffer,state.decoder),ret}function fromListPartial(n,list,hasStrings){var ret;return nstr.length?str.length:n;if(ret+=nb===str.length?str:str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}function copyFromBuffer(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;for(p.data.copy(ret),n-=p.data.length;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,processNextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var doRead=state.needReadable;debug("need readable",doRead),(0===state.length||state.length-n0?fromList(n,state):null,null===ret?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&unpipeInfo.hasUnpiped===!1&&(unpipeInfo.hasUnpiped=!0,cleanup())}function onend(){debug("onend"),dest.end()}function cleanup(){debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain()}function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1, !1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&indexOf(state.pipes,dest)!==-1)&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var doEnd=(!pipeOpts||pipeOpts.end!==!1)&&dest!==process.stdout&&dest!==process.stderr,endFn=doEnd?onend:unpipe;state.endEmitted?processNextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);var cleanedUp=!1,increasedAwaitDrain=!1;return src.on("data",ondata),prependListener(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i>>32-n}function fn1(a,b,c,d,e,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+e|0}function fn2(a,b,c,d,e,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+e|0}function fn3(a,b,c,d,e,m,k,s){return rotl(a+((b|~c)^d)+m+k|0,s)+e|0}function fn4(a,b,c,d,e,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+e|0}function fn5(a,b,c,d,e,m,k,s){return rotl(a+(b^(c|~d))+m+k|0,s)+e|0}var inherits=__webpack_require__(2),HashBase=__webpack_require__(179);inherits(RIPEMD160,HashBase),RIPEMD160.prototype._update=function(){for(var m=new Array(16),i=0;i<16;++i)m[i]=this._block.readInt32LE(4*i);var al=this._a,bl=this._b,cl=this._c,dl=this._d,el=this._e;al=fn1(al,bl,cl,dl,el,m[0],0,11),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[1],0,14),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[2],0,15),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[3],0,12),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[4],0,5),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[5],0,8),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[6],0,7),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[7],0,9),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[8],0,11),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[9],0,13),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[10],0,14),cl=rotl(cl,10),el=fn1(el,al,bl,cl,dl,m[11],0,15),bl=rotl(bl,10),dl=fn1(dl,el,al,bl,cl,m[12],0,6),al=rotl(al,10),cl=fn1(cl,dl,el,al,bl,m[13],0,7),el=rotl(el,10),bl=fn1(bl,cl,dl,el,al,m[14],0,9),dl=rotl(dl,10),al=fn1(al,bl,cl,dl,el,m[15],0,8),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[7],1518500249,7),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[4],1518500249,6),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[13],1518500249,8),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[1],1518500249,13),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[10],1518500249,11),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[6],1518500249,9),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[15],1518500249,7),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[3],1518500249,15),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[12],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[0],1518500249,12),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[9],1518500249,15),bl=rotl(bl,10),dl=fn2(dl,el,al,bl,cl,m[5],1518500249,9),al=rotl(al,10),cl=fn2(cl,dl,el,al,bl,m[2],1518500249,11),el=rotl(el,10),bl=fn2(bl,cl,dl,el,al,m[14],1518500249,7),dl=rotl(dl,10),al=fn2(al,bl,cl,dl,el,m[11],1518500249,13),cl=rotl(cl,10),el=fn2(el,al,bl,cl,dl,m[8],1518500249,12),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[3],1859775393,11),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[10],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[14],1859775393,6),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[4],1859775393,7),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[9],1859775393,14),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[15],1859775393,9),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[8],1859775393,13),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[1],1859775393,15),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[2],1859775393,14),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[7],1859775393,8),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[0],1859775393,13),al=rotl(al,10),cl=fn3(cl,dl,el,al,bl,m[6],1859775393,6),el=rotl(el,10),bl=fn3(bl,cl,dl,el,al,m[13],1859775393,5),dl=rotl(dl,10),al=fn3(al,bl,cl,dl,el,m[11],1859775393,12),cl=rotl(cl,10),el=fn3(el,al,bl,cl,dl,m[5],1859775393,7),bl=rotl(bl,10),dl=fn3(dl,el,al,bl,cl,m[12],1859775393,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[1],2400959708,11),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[9],2400959708,12),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[11],2400959708,14),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[10],2400959708,15),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[0],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[8],2400959708,15),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[12],2400959708,9),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[4],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[13],2400959708,9),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[3],2400959708,14),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[7],2400959708,5),el=rotl(el,10),bl=fn4(bl,cl,dl,el,al,m[15],2400959708,6),dl=rotl(dl,10),al=fn4(al,bl,cl,dl,el,m[14],2400959708,8),cl=rotl(cl,10),el=fn4(el,al,bl,cl,dl,m[5],2400959708,6),bl=rotl(bl,10),dl=fn4(dl,el,al,bl,cl,m[6],2400959708,5),al=rotl(al,10),cl=fn4(cl,dl,el,al,bl,m[2],2400959708,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[4],2840853838,9),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[0],2840853838,15),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[5],2840853838,5),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[9],2840853838,11),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[7],2840853838,6),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[12],2840853838,8),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[2],2840853838,13),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[10],2840853838,12),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[14],2840853838,5),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[1],2840853838,12),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[3],2840853838,13),dl=rotl(dl,10),al=fn5(al,bl,cl,dl,el,m[8],2840853838,14),cl=rotl(cl,10),el=fn5(el,al,bl,cl,dl,m[11],2840853838,11),bl=rotl(bl,10),dl=fn5(dl,el,al,bl,cl,m[6],2840853838,8),al=rotl(al,10),cl=fn5(cl,dl,el,al,bl,m[15],2840853838,5),el=rotl(el,10),bl=fn5(bl,cl,dl,el,al,m[13],2840853838,6),dl=rotl(dl,10);var ar=this._a,br=this._b,cr=this._c,dr=this._d,er=this._e;ar=fn5(ar,br,cr,dr,er,m[5],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[14],1352829926,9),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[7],1352829926,9),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[0],1352829926,11),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[9],1352829926,13),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[2],1352829926,15),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[11],1352829926,15),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[4],1352829926,5),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[13],1352829926,7),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[6],1352829926,7),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[15],1352829926,8),cr=rotl(cr,10),er=fn5(er,ar,br,cr,dr,m[8],1352829926,11),br=rotl(br,10),dr=fn5(dr,er,ar,br,cr,m[1],1352829926,14),ar=rotl(ar,10),cr=fn5(cr,dr,er,ar,br,m[10],1352829926,14),er=rotl(er,10),br=fn5(br,cr,dr,er,ar,m[3],1352829926,12),dr=rotl(dr,10),ar=fn5(ar,br,cr,dr,er,m[12],1352829926,6),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[6],1548603684,9),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[11],1548603684,13),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[3],1548603684,15),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[7],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[0],1548603684,12),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[13],1548603684,8),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[5],1548603684,9),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[10],1548603684,11),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[14],1548603684,7),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[15],1548603684,7),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[8],1548603684,12),br=rotl(br,10),dr=fn4(dr,er,ar,br,cr,m[12],1548603684,7),ar=rotl(ar,10),cr=fn4(cr,dr,er,ar,br,m[4],1548603684,6),er=rotl(er,10),br=fn4(br,cr,dr,er,ar,m[9],1548603684,15),dr=rotl(dr,10),ar=fn4(ar,br,cr,dr,er,m[1],1548603684,13),cr=rotl(cr,10),er=fn4(er,ar,br,cr,dr,m[2],1548603684,11),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[15],1836072691,9),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[5],1836072691,7),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[1],1836072691,15),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[3],1836072691,11),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[7],1836072691,8),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[14],1836072691,6),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[6],1836072691,6),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[9],1836072691,14),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[11],1836072691,12),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[8],1836072691,13),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[12],1836072691,5),ar=rotl(ar,10),cr=fn3(cr,dr,er,ar,br,m[2],1836072691,14),er=rotl(er,10),br=fn3(br,cr,dr,er,ar,m[10],1836072691,13),dr=rotl(dr,10),ar=fn3(ar,br,cr,dr,er,m[0],1836072691,13),cr=rotl(cr,10),er=fn3(er,ar,br,cr,dr,m[4],1836072691,7),br=rotl(br,10),dr=fn3(dr,er,ar,br,cr,m[13],1836072691,5),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[8],2053994217,15),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[6],2053994217,5),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[4],2053994217,8),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[1],2053994217,11),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[3],2053994217,14),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[11],2053994217,14),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[15],2053994217,6),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[0],2053994217,14),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[5],2053994217,6),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[12],2053994217,9),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[2],2053994217,12),er=rotl(er,10),br=fn2(br,cr,dr,er,ar,m[13],2053994217,9),dr=rotl(dr,10),ar=fn2(ar,br,cr,dr,er,m[9],2053994217,12),cr=rotl(cr,10),er=fn2(er,ar,br,cr,dr,m[7],2053994217,5),br=rotl(br,10),dr=fn2(dr,er,ar,br,cr,m[10],2053994217,15),ar=rotl(ar,10),cr=fn2(cr,dr,er,ar,br,m[14],2053994217,8),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[12],0,8),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[15],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[10],0,12),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[4],0,9),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[1],0,12),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[5],0,5),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[8],0,14),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[7],0,6),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[6],0,8),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[2],0,13),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[13],0,6),dr=rotl(dr,10),ar=fn1(ar,br,cr,dr,er,m[14],0,5),cr=rotl(cr,10),er=fn1(er,ar,br,cr,dr,m[0],0,15),br=rotl(br,10),dr=fn1(dr,er,ar,br,cr,m[3],0,13),ar=rotl(ar,10),cr=fn1(cr,dr,er,ar,br,m[9],0,11),er=rotl(er,10),br=fn1(br,cr,dr,er,ar,m[11],0,11),dr=rotl(dr,10);var t=this._b+cl+dr|0;this._b=this._c+dl+er|0,this._c=this._d+el+ar|0,this._d=this._e+al+br|0,this._e=this._a+bl+cr|0,this._a=t},RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(20);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer.writeInt32LE(this._e,16),buffer},module.exports=RIPEMD160}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function ECJPoint(x,y,z){null===x&&null===y&&null===z?(this.x=ECJPoint.one,this.y=ECJPoint.one,this.z=ECJPoint.zero):(this.x=x,this.y=y,this.z=z),this.zOne=this.z===ECJPoint.one}var BN=__webpack_require__(50);ECJPoint.zero=BN.fromNumber(0),ECJPoint.one=BN.fromNumber(1),ECJPoint.prototype.neg=function(){return this.inf?this:new ECJPoint(this.x,this.y.redNeg(),this.z)},ECJPoint.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;var pz2=p.z.redSqr(),z2=this.z.redSqr(),u1=this.x.redMul(pz2),u2=p.x.redMul(z2),s1=this.y.redMul(pz2).redMul(p.z),s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(h.isZero())return r.isZero()?this.dbl():new ECJPoint(null,null,null);var h2=h.redSqr(),v=u1.redMul(h2),h3=h2.redMul(h),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v);return new ECJPoint(nx,r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),this.z.redMul(p.z).redMul(h))},ECJPoint.prototype.mixedAdd=function(p){if(this.inf)return p.toECJPoint();if(p.inf)return this;var z2=this.z.redSqr(),u1=this.x,u2=p.x.redMul(z2),s1=this.y,s2=p.y.redMul(z2).redMul(this.z),h=u1.redSub(u2),r=s1.redSub(s2);if(h.isZero())return r.isZero()?this.dbl():new ECJPoint(null,null,null);var h2=h.redSqr(),v=u1.redMul(h2),h3=h2.redMul(h),nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v);return new ECJPoint(nx,r.redMul(v.redISub(nx)).redISub(s1.redMul(h3)),this.z.redMul(h))},ECJPoint.prototype.dbl=function(){if(this.inf)return this;var nx,ny,nz;if(this.zOne){var xx=this.x.redSqr(),yy=this.y.redSqr(),yyyy=yy.redSqr(),s=this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);s=s.redIAdd(s);var m=xx.redAdd(xx).redIAdd(xx),t=m.redSqr().redISub(s).redISub(s),yyyy8=yyyy.redIAdd(yyyy).redIAdd(yyyy).redIAdd(yyyy);nx=t,ny=m.redMul(s.redISub(t)).redISub(yyyy8),nz=this.y.redAdd(this.y)}else{var a=this.x.redSqr(),b=this.y.redSqr(),c=b.redSqr(),d=this.x.redAdd(b).redSqr().redISub(a).redISub(c);d=d.redIAdd(d);var e=a.redAdd(a).redIAdd(a),f=e.redSqr(),c8=c.redIAdd(c).redIAdd(c).redIAdd(c);nx=f.redISub(d).redISub(d),ny=e.redMul(d.redISub(nx)).redISub(c8),nz=this.y.redMul(this.z),nz=nz.redIAdd(nz)}return new ECJPoint(nx,ny,nz)},ECJPoint.prototype.dblp=function(pow){if(0===pow||this.inf)return this;for(var point=this,i=0;i=0||y.ucmp(BN.p)>=0?null:6!==first&&7!==first||y.isOdd()===(7===first)?0!==x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr())?null:new ECPoint(x,y):null):(x=BN.fromBuffer(publicKey.slice(1,33)),x.ucmp(BN.p)>=0?null:null===(y=x.redSqr().redMul(x).redIAdd7().redSqrt())?null:(3===first!==y.isOdd()&&(y=y.redNeg()),new ECPoint(x,y)))},ECPoint.prototype.toPublicKey=function(compressed){var publicKey,x=this.x,y=this.y;return compressed?(publicKey=Buffer.alloc(33),publicKey[0]=y.isOdd()?3:2,x.toBuffer().copy(publicKey,1)):(publicKey=Buffer.alloc(65),publicKey[0]=4,x.toBuffer().copy(publicKey,1),y.toBuffer().copy(publicKey,33)),publicKey},ECPoint.fromECJPoint=function(p){if(p.inf)return new ECPoint(null,null);var zinv=p.z.redInvm(),zinv2=zinv.redSqr();return new ECPoint(p.x.redMul(zinv2),p.y.redMul(zinv2).redMul(zinv))},ECPoint.prototype.toECJPoint=function(){return this.inf?new ECJPoint(null,null,null):new ECJPoint(this.x,this.y,ECJPoint.one)},ECPoint.prototype.neg=function(){return this.inf?this:new ECPoint(this.x,this.y.redNeg())},ECPoint.prototype.add=function(p){if(this.inf)return p;if(p.inf)return this;if(0===this.x.ucmp(p.x))return 0===this.y.ucmp(p.y)?this.dbl():new ECPoint(null,null);var s=this.y.redSub(p.y);s.isZero()||(s=s.redMul(this.x.redSub(p.x).redInvm()));var nx=s.redSqr().redISub(this.x).redISub(p.x);return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.dbl=function(){if(this.inf)return this;var yy=this.y.redAdd(this.y);if(yy.isZero())return new ECPoint(null,null);var x2=this.x.redSqr(),s=x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm()),nx=s.redSqr().redISub(this.x.redAdd(this.x));return new ECPoint(nx,s.redMul(this.x.redSub(nx)).redISub(this.y))},ECPoint.prototype.mul=function(num){for(var nafPoints=this._getNAFPoints(4),points=nafPoints.points,naf=num.getNAF(nafPoints.wnd),acc=new ECJPoint(null,null,null),i=naf.length-1;i>=0;i--){for(var k=0;i>=0&&0===naf[i];i--,++k);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;var z=naf[i];acc=z>0?acc.mixedAdd(points[z-1>>1]):acc.mixedAdd(points[-z-1>>1].neg())}return ECPoint.fromECJPoint(acc)},ECPoint.prototype._getNAFPoints1=function(){return{wnd:1,points:[this]}},ECPoint.prototype._getNAFPoints=function(wnd){var points=new Array((1<>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function gamma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function gamma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}var inherits=__webpack_require__(2),Hash=__webpack_require__(21),K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],W=new Array(64);inherits(Sha256,Hash),Sha256.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Sha256.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,f=0|this._f,g=0|this._g,h=0|this._h,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<64;++i)W[i]=gamma1(W[i-2])+W[i-7]+gamma0(W[i-15])+W[i-16]|0;for(var j=0;j<64;++j){var T1=h+sigma1(e)+ch(e,f,g)+K[j]+W[j]|0,T2=sigma0(a)+maj(a,b,c)|0;h=g,g=f,f=e,e=d+T1|0,d=c,c=b,b=a,a=T1+T2|0}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0,this._f=f+this._f|0,this._g=g+this._g|0,this._h=h+this._h|0},Sha256.prototype._hash=function(){var H=new Buffer(32);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H.writeInt32BE(this._h,28),H},module.exports=Sha256}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha512(){this.init(),this._w=W,Hash.call(this,128,112)}function Ch(x,y,z){return z^x&(y^z)}function maj(x,y,z){return x&y|z&(x|y)}function sigma0(x,xl){return(x>>>28|xl<<4)^(xl>>>2|x<<30)^(xl>>>7|x<<25)}function sigma1(x,xl){return(x>>>14|xl<<18)^(x>>>18|xl<<14)^(xl>>>9|x<<23)}function Gamma0(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^x>>>7}function Gamma0l(x,xl){return(x>>>1|xl<<31)^(x>>>8|xl<<24)^(x>>>7|xl<<25)}function Gamma1(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^x>>>6}function Gamma1l(x,xl){return(x>>>19|xl<<13)^(xl>>>29|x<<3)^(x>>>6|xl<<26)}function getCarry(a,b){return a>>>0>>0?1:0}var inherits=__webpack_require__(2),Hash=__webpack_require__(21),K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],W=new Array(160);inherits(Sha512,Hash),Sha512.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Sha512.prototype._update=function(M){for(var W=this._w,ah=0|this._ah,bh=0|this._bh,ch=0|this._ch,dh=0|this._dh,eh=0|this._eh,fh=0|this._fh,gh=0|this._gh,hh=0|this._hh,al=0|this._al,bl=0|this._bl,cl=0|this._cl,dl=0|this._dl,el=0|this._el,fl=0|this._fl,gl=0|this._gl,hl=0|this._hl,i=0;i<32;i+=2)W[i]=M.readInt32BE(4*i),W[i+1]=M.readInt32BE(4*i+4);for(;i<160;i+=2){var xh=W[i-30],xl=W[i-30+1],gamma0=Gamma0(xh,xl),gamma0l=Gamma0l(xl,xh);xh=W[i-4],xl=W[i-4+1];var gamma1=Gamma1(xh,xl),gamma1l=Gamma1l(xl,xh),Wi7h=W[i-14],Wi7l=W[i-14+1],Wi16h=W[i-32],Wi16l=W[i-32+1],Wil=gamma0l+Wi7l|0,Wih=gamma0+Wi7h+getCarry(Wil,gamma0l)|0;Wil=Wil+gamma1l|0,Wih=Wih+gamma1+getCarry(Wil,gamma1l)|0,Wil=Wil+Wi16l|0,Wih=Wih+Wi16h+getCarry(Wil,Wi16l)|0,W[i]=Wih,W[i+1]=Wil}for(var j=0;j<160;j+=2){Wih=W[j],Wil=W[j+1];var majh=maj(ah,bh,ch),majl=maj(al,bl,cl),sigma0h=sigma0(ah,al),sigma0l=sigma0(al,ah),sigma1h=sigma1(eh,el),sigma1l=sigma1(el,eh),Kih=K[j],Kil=K[j+1],chh=Ch(eh,fh,gh),chl=Ch(el,fl,gl),t1l=hl+sigma1l|0,t1h=hh+sigma1h+getCarry(t1l,hl)|0;t1l=t1l+chl|0,t1h=t1h+chh+getCarry(t1l,chl)|0,t1l=t1l+Kil|0,t1h=t1h+Kih+getCarry(t1l,Kil)|0,t1l=t1l+Wil|0,t1h=t1h+Wih+getCarry(t1l,Wil)|0;var t2l=sigma0l+majl|0,t2h=sigma0h+majh+getCarry(t2l,sigma0l)|0;hh=gh,hl=gl,gh=fh,gl=fl,fh=eh,fl=el,el=dl+t1l|0,eh=dh+t1h+getCarry(el,dl)|0,dh=ch,dl=cl,ch=bh,cl=bl,bh=ah,bl=al,al=t1l+t2l|0,ah=t1h+t2h+getCarry(al,t1l)|0}this._al=this._al+al|0,this._bl=this._bl+bl|0,this._cl=this._cl+cl|0,this._dl=this._dl+dl|0,this._el=this._el+el|0,this._fl=this._fl+fl|0,this._gl=this._gl+gl|0,this._hl=this._hl+hl|0,this._ah=this._ah+ah+getCarry(this._al,al)|0,this._bh=this._bh+bh+getCarry(this._bl,bl)|0,this._ch=this._ch+ch+getCarry(this._cl,cl)|0,this._dh=this._dh+dh+getCarry(this._dl,dl)|0,this._eh=this._eh+eh+getCarry(this._el,el)|0,this._fh=this._fh+fh+getCarry(this._fl,fl)|0,this._gh=this._gh+gh+getCarry(this._gl,gl)|0,this._hh=this._hh+hh+getCarry(this._hl,hl)|0},Sha512.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(64);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),writeInt64BE(this._gh,this._gl,48),writeInt64BE(this._hh,this._hl,56),H},module.exports=Sha512}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(global){ var ClientRequest=__webpack_require__(293),extend=__webpack_require__(51),statusCodes=__webpack_require__(168),url=__webpack_require__(128),http=exports;http.request=function(opts,cb){opts="string"==typeof opts?url.parse(opts):extend(opts);var defaultProtocol=global.location.protocol.search(/^https?:$/)===-1?"http:":"",protocol=opts.protocol||defaultProtocol,host=opts.hostname||opts.host,port=opts.port,path=opts.path||"/";host&&host.indexOf(":")!==-1&&(host="["+host+"]"),opts.url=(host?protocol+"//"+host:"")+(port?":"+port:"")+path,opts.method=(opts.method||"GET").toUpperCase(),opts.headers=opts.headers||{};var req=new ClientRequest(opts);return cb&&req.on("response",cb),req},http.get=function(opts,cb){var req=http.request(opts,cb);return req.end(),req},http.Agent=function(){},http.Agent.defaultMaxSockets=4,http.STATUS_CODES=statusCodes,http.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(global){function getXHR(){if(void 0!==xhr)return xhr;if(global.XMLHttpRequest){xhr=new global.XMLHttpRequest;try{xhr.open("GET",global.XDomainRequest?"/":"https://example.com")}catch(e){xhr=null}}else xhr=null;return xhr}function checkTypeSupport(type){var xhr=getXHR();if(!xhr)return!1;try{return xhr.responseType=type,xhr.responseType===type}catch(e){}return!1}function isFunction(value){return"function"==typeof value}exports.fetch=isFunction(global.fetch)&&isFunction(global.ReadableStream),exports.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),exports.blobConstructor=!0}catch(e){}var xhr,haveArrayBuffer=void 0!==global.ArrayBuffer,haveSlice=haveArrayBuffer&&isFunction(global.ArrayBuffer.prototype.slice);exports.arraybuffer=exports.fetch||haveArrayBuffer&&checkTypeSupport("arraybuffer"),exports.msstream=!exports.fetch&&haveSlice&&checkTypeSupport("ms-stream"),exports.mozchunkedarraybuffer=!exports.fetch&&haveArrayBuffer&&checkTypeSupport("moz-chunked-arraybuffer"),exports.overrideMimeType=exports.fetch||!!getXHR()&&isFunction(getXHR().overrideMimeType),exports.vbArray=isFunction(global.VBArray),xhr=null}).call(exports,__webpack_require__(5))},function(module,exports,__webpack_require__){(function(Buffer){function parse256(buf){var positive;if(128===buf[0])positive=!0;else{if(255!==buf[0])return null;positive=!1}for(var zero=!1,tuple=[],i=buf.length-1;i>0;i--){var byte=buf[i];positive?tuple.push(byte):zero&&0===byte?tuple.push(0):zero?(zero=!1,tuple.push(256-byte)):tuple.push(255-byte)}var sum=0,l=tuple.length;for(i=0;i=len?len:index>=0?index:(index+=len,index>=0?index:0)},toType=function(flag){switch(flag){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},toTypeflag=function(flag){switch(flag){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},alloc=function(size){var buf=new Buffer(size);return buf.fill(0),buf},indexOf=function(block,num,offset,end){for(;offsetn?SEVENS.slice(0,n)+" ":ZEROS.slice(0,n-val.length)+val+" "},decodeOct=function(val,offset,length){if(val=val.slice(offset,offset+length),offset=0,128&val[offset])return parse256(val);for(;offsetMath.pow(10,digits)&&digits++,len+digits+str};exports.decodeLongPath=function(buf){return decodeStr(buf,0,buf.length)},exports.encodePax=function(opts){var result="";opts.name&&(result+=addLength(" path="+opts.name+"\n")),opts.linkname&&(result+=addLength(" linkpath="+opts.linkname+"\n"));var pax=opts.pax;if(pax)for(var key in pax)result+=addLength(" "+key+"="+pax[key]+"\n");return new Buffer(result)},exports.decodePax=function(buf){for(var result={};buf.length;){for(var i=0;i100;){var i=name.indexOf("/");if(i===-1)return null;prefix+=prefix?"/"+name.slice(0,i):name.slice(0,i),name=name.slice(i+1)}return Buffer.byteLength(name)>100||Buffer.byteLength(prefix)>155?null:opts.linkname&&Buffer.byteLength(opts.linkname)>100?null:(buf.write(name),buf.write(encodeOct(opts.mode&MASK,6),100),buf.write(encodeOct(opts.uid,6),108),buf.write(encodeOct(opts.gid,6),116),buf.write(encodeOct(opts.size,11),124),buf.write(encodeOct(opts.mtime.getTime()/1e3|0,11),136),buf[156]=ZERO_OFFSET+toTypeflag(opts.type),opts.linkname&&buf.write(opts.linkname,157),buf.write("ustar\x0000",257),opts.uname&&buf.write(opts.uname,265),opts.gname&&buf.write(opts.gname,297),buf.write(encodeOct(opts.devmajor||0,6),329),buf.write(encodeOct(opts.devminor||0,6),337),prefix&&buf.write(prefix,345),buf.write(encodeOct(cksum(buf),6),148),buf)},exports.decode=function(buf){var typeflag=0===buf[156]?0:buf[156]-ZERO_OFFSET,name=decodeStr(buf,0,100),mode=decodeOct(buf,100,8),uid=decodeOct(buf,108,8),gid=decodeOct(buf,116,8),size=decodeOct(buf,124,12),mtime=decodeOct(buf,136,12),type=toType(typeflag),linkname=0===buf[157]?null:decodeStr(buf,157,100),uname=decodeStr(buf,265,32),gname=decodeStr(buf,297,32),devmajor=decodeOct(buf,329,8),devminor=decodeOct(buf,337,8);buf[345]&&(name=decodeStr(buf,345,155)+"/"+name),0===typeflag&&name&&"/"===name[name.length-1]&&(typeflag=5);var c=cksum(buf);if(256===c)return null;if(c!==decodeOct(buf,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:name,mode:mode,uid:uid,gid:gid,size:size,mtime:new Date(1e3*mtime),type:type,linkname:linkname,uname:uname,gname:gname,devmajor:devmajor,devminor:devminor}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(process){function DestroyableTransform(opts){Transform.call(this,opts),this._destroyed=!1}function noop(chunk,enc,callback){callback(null,chunk)}function through2(construct){return function(options,transform,flush){return"function"==typeof options&&(flush=transform,transform=options,options={}),"function"!=typeof transform&&(transform=noop),"function"!=typeof flush&&(flush=null),construct(options,transform,flush)}}var Transform=__webpack_require__(117),inherits=__webpack_require__(11).inherits,xtend=__webpack_require__(51);inherits(DestroyableTransform,Transform),DestroyableTransform.prototype.destroy=function(err){if(!this._destroyed){this._destroyed=!0;var self=this;process.nextTick(function(){err&&self.emit("error",err),self.emit("close")})}},module.exports=through2(function(options,transform,flush){var t2=new DestroyableTransform(options);return t2._transform=transform,flush&&(t2._flush=flush),t2}),module.exports.ctor=through2(function(options,transform,flush){function Through2(override){if(!(this instanceof Through2))return new Through2(override);this.options=xtend(options,override),DestroyableTransform.call(this,this.options)}return inherits(Through2,DestroyableTransform),Through2.prototype._transform=transform,flush&&(Through2.prototype._flush=flush),Through2}),module.exports.obj=through2(function(options,transform,flush){var t2=new DestroyableTransform(xtend({objectMode:!0,highWaterMark:16},options));return t2._transform=transform,flush&&(t2._flush=flush),t2})}).call(exports,__webpack_require__(6))},function(module,exports,__webpack_require__){"use strict";function Url(){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}function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;return u.parse(url,parseQueryString,slashesDenoteHost),u}function urlFormat(obj){return util.isString(obj)&&(obj=urlParse(obj)),obj instanceof Url?obj.format():Url.prototype.format.call(obj)}function urlResolve(source,relative){return urlParse(source,!1,!0).resolve(relative)}function urlResolveObject(source,relative){return source?urlParse(source,!1,!0).resolveObject(relative):relative}var punycode=__webpack_require__(266),util=__webpack_require__(302);exports.parse=urlParse,exports.resolve=urlResolve,exports.resolveObject=urlResolveObject,exports.format=urlFormat,exports.Url=Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=__webpack_require__(272);Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127?"x":part[j];if(!newpart.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;i0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@");authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),cleanCID=__webpack_require__(132),v=__webpack_require__(59);module.exports=(send=>{return promisify((hash,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});try{hash=cleanCID(hash)}catch(err){if(!v.ipfsPath(hash))return callback(err)}send({path:"cat",args:hash,buffer:opts.buffer},callback)})})},function(module,exports,__webpack_require__){"use strict";const addCmd=__webpack_require__(52),Duplex=__webpack_require__(7).Duplex,promisify=__webpack_require__(1);module.exports=(send=>{const add=addCmd(send);return promisify((options,callback)=>{"function"==typeof options&&(callback=options,options=void 0);const tuples=[],ds=new Duplex({objectMode:!0});ds._read=(n=>{}),ds._write=((file,enc,next)=>{tuples.push(file),next()}),ds.end=(()=>{add(tuples,(err,res)=>{if(err)return ds.emit("error",err);res.forEach(tuple=>{ds.push(tuple)}),ds.push(null)})}),callback(null,ds)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),cleanCID=__webpack_require__(132),TarStreamToObjects=__webpack_require__(399),v=__webpack_require__(59);module.exports=(send=>{return promisify((path,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={});try{path=cleanCID(path)}catch(err){if(!v.ipfsPath(path))return callback(err)}const request={path:"get",args:path,qs:opts};send.andTransform(request,TarStreamToObjects,callback)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const bs58=__webpack_require__(10),CID=__webpack_require__(39);module.exports=function(cid){if(Buffer.isBuffer(cid)&&(cid=bs58.encode(cid)),"string"!=typeof cid)throw new Error("unexpected cid type: "+typeof cid);return CID.validateCID(new CID(cid.split("/")[0])),cid}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const pkg=__webpack_require__(200);module.exports=(()=>{return{"api-path":"/api/v0/","user-agent":`/node-${pkg.name}/${pkg.version}/`,host:"localhost",port:"5001",protocol:"http"}})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function parseError(res,cb){const error=new Error(`Server responded with ${res.statusCode}`);streamToJsonValue(res,(err,payload)=>{if(err)return cb(err);payload&&(error.code=payload.Code,error.message=payload.Message||payload.toString()),cb(error)})}function onRes(buffer,cb){return res=>{const stream=Boolean(res.headers["x-stream-output"]),chunkedObjects=Boolean(res.headers["x-chunked-output"]),isJson=res.headers["content-type"]&&0===res.headers["content-type"].indexOf("application/json");if(res.statusCode>=400||!res.statusCode)return parseError(res,cb);if(stream&&!buffer)return cb(null,res);if(chunkedObjects&&isJson){const outputStream=pump(res,ndjson.parse());return cb(null,outputStream)}return isJson?streamToJsonValue(res,cb):streamToValue(res,cb)}}function requestAPI(config,options,callback){options.qs=options.qs||{},callback=once(callback),Array.isArray(options.files)&&(options.qs.recursive=!0),Array.isArray(options.path)&&(options.path=options.path.join("/")),options.args&&!Array.isArray(options.args)&&(options.args=[options.args]),options.args&&(options.qs.arg=options.args),options.files&&!Array.isArray(options.files)&&(options.files=[options.files]),options.qs.r&&(options.qs.recursive=options.qs.r,delete options.qs.r),options.qs["stream-channels"]=!0;let stream;options.files&&(stream=getFilesStream(options.files,options.qs)),delete options.qs.followSymlinks;const headers={};if(isNode&&(headers["User-Agent"]=config["user-agent"]),options.files){if(!stream.boundary)return callback(new Error("No boundary in multipart stream"));headers["Content-Type"]=`multipart/form-data; boundary=${stream.boundary}`}const qs=Qs.stringify(options.qs,{arrayFormat:"repeat",encoder:data=>{if(Buffer.isBuffer(data)){let uriEncoded="";for(const byte of data)if(byte>=65&&byte<=90||byte>=97&&byte<=122||byte>=48&&byte<=57||45===byte||46===byte||95===byte||126===byte)uriEncoded+=String.fromCharCode(byte);else{const hex=byte.toString(16),padded=1===hex.length?`0${hex}`:hex;uriEncoded+=`%${padded}`}return uriEncoded}return qsDefaultEncoder(data)}}),req=request(config.protocol)({protocol:config.protocol+":",hostname:config.host,path:`${config["api-path"]}${options.path}?${qs}`,port:config.port,method:"POST",headers:headers},onRes(options.buffer,callback));return req.on("error",err=>{callback(err)}),options.files?stream.pipe(req):req.end(),req}const Qs=__webpack_require__(267),qsDefaultEncoder=__webpack_require__(69).encode,isNode=__webpack_require__(40),ndjson=__webpack_require__(108),pump=__webpack_require__(33),once=__webpack_require__(48),getFilesStream=__webpack_require__(393),streamToValue=__webpack_require__(9),streamToJsonValue=__webpack_require__(397),request=__webpack_require__(135);exports=module.exports=(config=>{const send=(options,callback)=>{return"object"!=typeof options?callback(new Error("no options were passed")):requestAPI(config,options,callback)};return send.andTransform=((options,transform,callback)=>{return send(options,(err,res)=>{if(err)return callback(err);transform(res,callback)})}),send})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const httpRequest=__webpack_require__(124).request,httpsRequest=__webpack_require__(180).request;module.exports=(protocol=>{return 0===protocol.indexOf("https")?httpsRequest:httpRequest})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function IpfsAPI(hostOrMultiaddr,port,opts){const config=getConfig();try{const maddr=multiaddr(hostOrMultiaddr).nodeAddress();config.host=maddr.address,config.port=maddr.port}catch(e){"string"==typeof hostOrMultiaddr&&(config.host=hostOrMultiaddr,config.port=port&&"object"!=typeof port?port:config.port)}let lastIndex=arguments.length;for(;!opts&&lastIndex-- >0&&!(opts=arguments[lastIndex]););if(Object.assign(config,opts),!config.host&&"undefined"!=typeof self){const split=self.location.host.split(":");config.host=split[0],config.port=split[1]}const requestAPI=getRequestAPI(config),cmds=loadCommands(requestAPI);return cmds.send=requestAPI,cmds.Buffer=Buffer,cmds}const multiaddr=__webpack_require__(20),loadCommands=__webpack_require__(394),getConfig=__webpack_require__(133),getRequestAPI=__webpack_require__(134);exports=module.exports=IpfsAPI}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){function Entity(name,body){this.name=name,this.body=body,this.decoders={},this.encoders={}}var asn1=__webpack_require__(18),inherits=__webpack_require__(2);exports.define=function(name,body){return new Entity(name,body)},Entity.prototype._createNamed=function(base){var named;try{named=__webpack_require__(309).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){named=function(entity){this._initNamed(entity)}}return inherits(named,base),named.prototype._initNamed=function(entity){base.call(this,entity)},new named(this)},Entity.prototype._getDecoder=function(enc){return enc=enc||"der",this.decoders.hasOwnProperty(enc)||(this.decoders[enc]=this._createNamed(asn1.decoders[enc])),this.decoders[enc]},Entity.prototype.decode=function(data,enc,options){return this._getDecoder(enc).decode(data,options)},Entity.prototype._getEncoder=function(enc){return enc=enc||"der",this.encoders.hasOwnProperty(enc)||(this.encoders[enc]=this._createNamed(asn1.encoders[enc])),this.encoders[enc]},Entity.prototype.encode=function(data,enc,reporter){return this._getEncoder(enc).encode(data,reporter)}},function(module,exports,__webpack_require__){function Node(enc,parent){var state={};this._baseState=state,state.enc=enc,state.parent=parent||null,state.children=null,state.tag=null,state.args=null,state.reverseArgs=null,state.choice=null,state.optional=!1,state.any=!1,state.obj=!1,state.use=null,state.useDecoder=null,state.key=null,state.default=null,state.explicit=null,state.implicit=null,state.contains=null,state.parent||(state.children=[],this._wrap())}var Reporter=__webpack_require__(22).Reporter,EncoderBuffer=__webpack_require__(22).EncoderBuffer,DecoderBuffer=__webpack_require__(22).DecoderBuffer,assert=__webpack_require__(239),tags=["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"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];module.exports=Node;var stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function(){var state=this._baseState,cstate={};stateProps.forEach(function(prop){cstate[prop]=state[prop]});var res=new this.constructor(cstate.parent);return res._baseState=cstate,res},Node.prototype._wrap=function(){var state=this._baseState;methods.forEach(function(method){this[method]=function(){var clone=new this.constructor(this);return state.children.push(clone),clone[method].apply(clone,arguments)}},this)},Node.prototype._init=function(body){var state=this._baseState;assert(null===state.parent),body.call(this),state.children=state.children.filter(function(child){return child._baseState.parent===this},this),assert.equal(state.children.length,1,"Root node can have only one child")},Node.prototype._useArgs=function(args){var state=this._baseState,children=args.filter(function(arg){return arg instanceof this.constructor},this);args=args.filter(function(arg){return!(arg instanceof this.constructor)},this),0!==children.length&&(assert(null===state.children),state.children=children,children.forEach(function(child){child._baseState.parent=this},this)),0!==args.length&&(assert(null===state.args),state.args=args,state.reverseArgs=args.map(function(arg){if("object"!=typeof arg||arg.constructor!==Object)return arg;var res={};return Object.keys(arg).forEach(function(key){key==(0|key)&&(key|=0),res[arg[key]]=key}),res}))},overrided.forEach(function(method){Node.prototype[method]=function(){var state=this._baseState;throw new Error(method+" not implemented for encoding: "+state.enc)}}),tags.forEach(function(tag){Node.prototype[tag]=function(){var state=this._baseState,args=Array.prototype.slice.call(arguments);return assert(null===state.tag),state.tag=tag,this._useArgs(args),this}}),Node.prototype.use=function(item){assert(item);var state=this._baseState;return assert(null===state.use),state.use=item,this},Node.prototype.optional=function(){return this._baseState.optional=!0,this},Node.prototype.def=function(val){var state=this._baseState;return assert(null===state.default),state.default=val,state.optional=!0,this},Node.prototype.explicit=function(num){var state=this._baseState;return assert(null===state.explicit&&null===state.implicit),state.explicit=num,this},Node.prototype.implicit=function(num){var state=this._baseState;return assert(null===state.explicit&&null===state.implicit),state.implicit=num,this},Node.prototype.obj=function(){var state=this._baseState,args=Array.prototype.slice.call(arguments);return state.obj=!0, 0!==args.length&&this._useArgs(args),this},Node.prototype.key=function(newKey){var state=this._baseState;return assert(null===state.key),state.key=newKey,this},Node.prototype.any=function(){return this._baseState.any=!0,this},Node.prototype.choice=function(obj){var state=this._baseState;return assert(null===state.choice),state.choice=obj,this._useArgs(Object.keys(obj).map(function(key){return obj[key]})),this},Node.prototype.contains=function(item){var state=this._baseState;return assert(null===state.use),state.contains=item,this},Node.prototype._decode=function(input,options){var state=this._baseState;if(null===state.parent)return input.wrapResult(state.children[0]._decode(input,options));var result=state.default,present=!0,prevKey=null;if(null!==state.key&&(prevKey=input.enterKey(state.key)),state.optional){var tag=null;if(null!==state.explicit?tag=state.explicit:null!==state.implicit?tag=state.implicit:null!==state.tag&&(tag=state.tag),null!==tag||state.any){if(present=this._peekTag(input,tag,state.any),input.isError(present))return present}else{var save=input.save();try{null===state.choice?this._decodeGeneric(state.tag,input,options):this._decodeChoice(input,options),present=!0}catch(e){present=!1}input.restore(save)}}var prevObj;if(state.obj&&present&&(prevObj=input.enterObject()),present){if(null!==state.explicit){var explicit=this._decodeTag(input,state.explicit);if(input.isError(explicit))return explicit;input=explicit}var start=input.offset;if(null===state.use&&null===state.choice){if(state.any)var save=input.save();var body=this._decodeTag(input,null!==state.implicit?state.implicit:state.tag,state.any);if(input.isError(body))return body;state.any?result=input.raw(save):input=body}if(options&&options.track&&null!==state.tag&&options.track(input.path(),start,input.length,"tagged"),options&&options.track&&null!==state.tag&&options.track(input.path(),input.offset,input.length,"content"),result=state.any?result:null===state.choice?this._decodeGeneric(state.tag,input,options):this._decodeChoice(input,options),input.isError(result))return result;if(state.any||null!==state.choice||null===state.children||state.children.forEach(function(child){child._decode(input,options)}),state.contains&&("octstr"===state.tag||"bitstr"===state.tag)){var data=new DecoderBuffer(result);result=this._getUse(state.contains,input._reporterState.obj)._decode(data,options)}}return state.obj&&present&&(result=input.leaveObject(prevObj)),null===state.key||null===result&&present!==!0?null!==prevKey&&input.exitKey(prevKey):input.leaveKey(prevKey,state.key,result),result},Node.prototype._decodeGeneric=function(tag,input,options){var state=this._baseState;return"seq"===tag||"set"===tag?null:"seqof"===tag||"setof"===tag?this._decodeList(input,tag,state.args[0],options):/str$/.test(tag)?this._decodeStr(input,tag,options):"objid"===tag&&state.args?this._decodeObjid(input,state.args[0],state.args[1],options):"objid"===tag?this._decodeObjid(input,null,null,options):"gentime"===tag||"utctime"===tag?this._decodeTime(input,tag,options):"null_"===tag?this._decodeNull(input,options):"bool"===tag?this._decodeBool(input,options):"objDesc"===tag?this._decodeStr(input,tag,options):"int"===tag||"enum"===tag?this._decodeInt(input,state.args&&state.args[0],options):null!==state.use?this._getUse(state.use,input._reporterState.obj)._decode(input,options):input.error("unknown tag: "+tag)},Node.prototype._getUse=function(entity,obj){var state=this._baseState;return state.useDecoder=this._use(entity,obj),assert(null===state.useDecoder._baseState.parent),state.useDecoder=state.useDecoder._baseState.children[0],state.implicit!==state.useDecoder._baseState.implicit&&(state.useDecoder=state.useDecoder.clone(),state.useDecoder._baseState.implicit=state.implicit),state.useDecoder},Node.prototype._decodeChoice=function(input,options){var state=this._baseState,result=null,match=!1;return Object.keys(state.choice).some(function(key){var save=input.save(),node=state.choice[key];try{var value=node._decode(input,options);if(input.isError(value))return!1;result={type:key,value:value},match=!0}catch(e){return input.restore(save),!1}return!0},this),match?result:input.error("Choice not matched")},Node.prototype._createEncoderBuffer=function(data){return new EncoderBuffer(data,this.reporter)},Node.prototype._encode=function(data,reporter,parent){var state=this._baseState;if(null===state.default||state.default!==data){var result=this._encodeValue(data,reporter,parent);if(void 0!==result&&!this._skipDefault(result,reporter,parent))return result}},Node.prototype._encodeValue=function(data,reporter,parent){var state=this._baseState;if(null===state.parent)return state.children[0]._encode(data,reporter||new Reporter);var result=null;if(this.reporter=reporter,state.optional&&void 0===data){if(null===state.default)return;data=state.default}var content=null,primitive=!1;if(state.any)result=this._createEncoderBuffer(data);else if(state.choice)result=this._encodeChoice(data,reporter);else if(state.contains)content=this._getUse(state.contains,parent)._encode(data,reporter),primitive=!0;else if(state.children)content=state.children.map(function(child){if("null_"===child._baseState.tag)return child._encode(null,reporter,data);if(null===child._baseState.key)return reporter.error("Child should have a key");var prevKey=reporter.enterKey(child._baseState.key);if("object"!=typeof data)return reporter.error("Child expected, but input is not object");var res=child._encode(data[child._baseState.key],reporter,data);return reporter.leaveKey(prevKey),res},this).filter(function(child){return child}),content=this._createEncoderBuffer(content);else if("seqof"===state.tag||"setof"===state.tag){if(!state.args||1!==state.args.length)return reporter.error("Too many args for : "+state.tag);if(!Array.isArray(data))return reporter.error("seqof/setof, but data is not Array");var child=this.clone();child._baseState.implicit=null,content=this._createEncoderBuffer(data.map(function(item){var state=this._baseState;return this._getUse(state.args[0],data)._encode(item,reporter)},child))}else null!==state.use?result=this._getUse(state.use,parent)._encode(data,reporter):(content=this._encodePrimitive(state.tag,data),primitive=!0);var result;if(!state.any&&null===state.choice){var tag=null!==state.implicit?state.implicit:state.tag,cls=null===state.implicit?"universal":"context";null===tag?null===state.use&&reporter.error("Tag could be ommited only for .use()"):null===state.use&&(result=this._encodeComposite(tag,primitive,cls,content))}return null!==state.explicit&&(result=this._encodeComposite(state.explicit,!1,"context",result)),result},Node.prototype._encodeChoice=function(data,reporter){var state=this._baseState,node=state.choice[data.type];return node||assert(!1,data.type+" not found in "+JSON.stringify(Object.keys(state.choice))),node._encode(data.value,reporter)},Node.prototype._encodePrimitive=function(tag,data){var state=this._baseState;if(/str$/.test(tag))return this._encodeStr(data,tag);if("objid"===tag&&state.args)return this._encodeObjid(data,state.reverseArgs[0],state.args[1]);if("objid"===tag)return this._encodeObjid(data,null,null);if("gentime"===tag||"utctime"===tag)return this._encodeTime(data,tag);if("null_"===tag)return this._encodeNull();if("int"===tag||"enum"===tag)return this._encodeInt(data,state.args&&state.reverseArgs[0]);if("bool"===tag)return this._encodeBool(data);if("objDesc"===tag)return this._encodeStr(data,tag);throw new Error("Unsupported tag: "+tag)},Node.prototype._isNumstr=function(str){return/^[0-9 ]*$/.test(str)},Node.prototype._isPrintstr=function(str){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str)}},function(module,exports,__webpack_require__){function Reporter(options){this._reporterState={obj:null,path:[],options:options||{},errors:[]}}function ReporterError(path,msg){this.path=path,this.rethrow(msg)}var inherits=__webpack_require__(2);exports.Reporter=Reporter,Reporter.prototype.isError=function(obj){return obj instanceof ReporterError},Reporter.prototype.save=function(){var state=this._reporterState;return{obj:state.obj,pathLen:state.path.length}},Reporter.prototype.restore=function(data){var state=this._reporterState;state.obj=data.obj,state.path=state.path.slice(0,data.pathLen)},Reporter.prototype.enterKey=function(key){return this._reporterState.path.push(key)},Reporter.prototype.exitKey=function(index){var state=this._reporterState;state.path=state.path.slice(0,index-1)},Reporter.prototype.leaveKey=function(index,key,value){var state=this._reporterState;this.exitKey(index),null!==state.obj&&(state.obj[key]=value)},Reporter.prototype.path=function(){return this._reporterState.path.join("/")},Reporter.prototype.enterObject=function(){var state=this._reporterState,prev=state.obj;return state.obj={},prev},Reporter.prototype.leaveObject=function(prev){var state=this._reporterState,now=state.obj;return state.obj=prev,now},Reporter.prototype.error=function(msg){var err,state=this._reporterState,inherited=msg instanceof ReporterError;if(err=inherited?msg:new ReporterError(state.path.map(function(elem){return"["+JSON.stringify(elem)+"]"}).join(""),msg.message||msg,msg.stack),!state.options.partial)throw err;return inherited||state.errors.push(err),err},Reporter.prototype.wrapResult=function(result){var state=this._reporterState;return state.options.partial?{result:this.isError(result)?null:result,errors:state.errors}:result},inherits(ReporterError,Error),ReporterError.prototype.rethrow=function(msg){if(this.message=msg+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(module,exports,__webpack_require__){var constants=__webpack_require__(74);exports.tagClass={0:"universal",1:"application",2:"context",3:"private"},exports.tagClassByName=constants._reverse(exports.tagClass),exports.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},exports.tagByName=constants._reverse(exports.tag)},function(module,exports,__webpack_require__){var decoders=exports;decoders.der=__webpack_require__(75),decoders.pem=__webpack_require__(142)},function(module,exports,__webpack_require__){function PEMDecoder(entity){DERDecoder.call(this,entity),this.enc="pem"}var inherits=__webpack_require__(2),Buffer=__webpack_require__(0).Buffer,DERDecoder=__webpack_require__(75);inherits(PEMDecoder,DERDecoder),module.exports=PEMDecoder,PEMDecoder.prototype.decode=function(data,options){for(var lines=data.toString().split(/[\r\n]+/g),label=options.label.toUpperCase(),start=-1,end=-1,i=0;i2&&(result=(0,_slice2.default)(arguments,1)),results[key]=result,callback(err)})},function(err){callback(err,results)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=_parallel;var _noop=__webpack_require__(28),_noop2=_interopRequireDefault(_noop),_isArrayLike=__webpack_require__(44),_isArrayLike2=_interopRequireDefault(_isArrayLike),_slice=__webpack_require__(23),_slice2=_interopRequireDefault(_slice),_wrapAsync=__webpack_require__(24),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function parallelLimit(tasks,callback){(0,_parallel2.default)(_eachOf2.default,tasks,callback)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=parallelLimit;var _eachOf=__webpack_require__(146),_eachOf2=_interopRequireDefault(_eachOf),_parallel=__webpack_require__(153),_parallel2=_interopRequireDefault(_parallel);module.exports=exports.default},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function whilst(test,iteratee,callback){callback=(0,_onlyOnce2.default)(callback||_noop2.default);var _iteratee=(0,_wrapAsync2.default)(iteratee);if(!test())return callback(null);var next=function(err){if(err)return callback(err);if(test())return _iteratee(next);var args=(0,_slice2.default)(arguments,1);callback.apply(null,[null].concat(args))};_iteratee(next)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=whilst;var _noop=__webpack_require__(28),_noop2=_interopRequireDefault(_noop),_slice=__webpack_require__(23),_slice2=_interopRequireDefault(_slice),_onlyOnce=__webpack_require__(36),_onlyOnce2=_interopRequireDefault(_onlyOnce),_wrapAsync=__webpack_require__(24),_wrapAsync2=_interopRequireDefault(_wrapAsync);module.exports=exports.default},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(4).Buffer;module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===b64[len-2]?2:"="===b64[len-1]?1:0}function byteLength(b64){return 3*b64.length/4-placeHoldersCount(b64)}function toByteArray(b64){var i,l,tmp,placeHolders,arr,len=b64.length;placeHolders=placeHoldersCount(b64),arr=new Arr(3*len/4-placeHolders),l=placeHolders>0?len-4:len;var L=0;for(i=0;i>16&255,arr[L++]=tmp>>8&255,arr[L++]=255&tmp;return 2===placeHolders?(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[L++]=255&tmp):1===placeHolders&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[L++]=tmp>>8&255,arr[L++]=255&tmp),arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;ilen2?len2:i+16383));return 1===extraBytes?(tmp=uint8[len-1],output+=lookup[tmp>>2],output+=lookup[tmp<<4&63],output+="=="):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],output+=lookup[tmp>>10],output+=lookup[tmp>>4&63],output+=lookup[tmp<<2&63],output+="="),parts.push(output),parts.join("")}exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i72)return!1;if(48!==buffer[0])return!1;if(buffer[1]!==buffer.length-2)return!1;if(2!==buffer[2])return!1;var lenR=buffer[3];if(0===lenR)return!1;if(5+lenR>=buffer.length)return!1;if(2!==buffer[4+lenR])return!1;var lenS=buffer[5+lenR];return 0!==lenS&&(6+lenR+lenS===buffer.length&&(!(128&buffer[4])&&(!(lenR>1&&0===buffer[4]&&!(128&buffer[5]))&&(!(128&buffer[lenR+6])&&!(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))))))}function decode(buffer){if(buffer.length<8)throw new Error("DER sequence length is too short");if(buffer.length>72)throw new Error("DER sequence length is too long");if(48!==buffer[0])throw new Error("Expected DER sequence");if(buffer[1]!==buffer.length-2)throw new Error("DER sequence length is invalid");if(2!==buffer[2])throw new Error("Expected DER integer");var lenR=buffer[3];if(0===lenR)throw new Error("R length is zero");if(5+lenR>=buffer.length)throw new Error("R length is too long");if(2!==buffer[4+lenR])throw new Error("Expected DER integer (2)");var lenS=buffer[5+lenR];if(0===lenS)throw new Error("S length is zero");if(6+lenR+lenS!==buffer.length)throw new Error("S length is invalid");if(128&buffer[4])throw new Error("R value is negative");if(lenR>1&&0===buffer[4]&&!(128&buffer[5]))throw new Error("R value excessively padded");if(128&buffer[lenR+6])throw new Error("S value is negative");if(lenS>1&&0===buffer[lenR+6]&&!(128&buffer[lenR+7]))throw new Error("S value excessively padded");return{r:buffer.slice(4,4+lenR),s:buffer.slice(6+lenR)}}function encode(r,s){var lenR=r.length,lenS=s.length;if(0===lenR)throw new Error("R length is zero");if(0===lenS)throw new Error("S length is zero");if(lenR>33)throw new Error("R length is too long");if(lenS>33)throw new Error("S length is too long");if(128&r[0])throw new Error("R value is negative");if(128&s[0])throw new Error("S value is negative");if(lenR>1&&0===r[0]&&!(128&r[1]))throw new Error("R value excessively padded");if(lenS>1&&0===s[0]&&!(128&s[1]))throw new Error("S value excessively padded");var signature=Buffer.allocUnsafe(6+lenR+lenS);return signature[0]=48,signature[1]=signature.length-2,signature[2]=2,signature[3]=r.length,r.copy(signature,4),signature[4+lenR]=2,signature[5+lenR]=s.length,s.copy(signature,6+lenR),signature}var Buffer=__webpack_require__(4).Buffer;module.exports={check:check,decode:decode,encode:encode}},function(module,exports,__webpack_require__){(function(Buffer){function BufferList(callback){if(!(this instanceof BufferList))return new BufferList(callback);if(this._bufs=[],this.length=0,"function"==typeof callback){this._callback=callback;var piper=function(err){this._callback&&(this._callback(err),this._callback=null)}.bind(this);this.on("pipe",function(src){src.on("error",piper)}),this.on("unpipe",function(src){src.removeListener("error",piper)})}else this.append(callback);DuplexStream.call(this)}var DuplexStream=__webpack_require__(112);__webpack_require__(11).inherits(BufferList,DuplexStream),BufferList.prototype._offset=function(offset){var _t,tot=0,i=0;if(0===offset)return[0,0];for(;ithis.length)&&(srcEnd=this.length),srcStart>=this.length)return dst||new Buffer(0);if(srcEnd<=0)return dst||new Buffer(0);var l,i,copy=!!dst,off=this._offset(srcStart),len=srcEnd-srcStart,bytes=len,bufoff=copy&&dstStart||0,start=off[1];if(0===srcStart&&srcEnd==this.length){if(!copy)return 1===this._bufs.length?this._bufs[0]:Buffer.concat(this._bufs,this.length);for(i=0;il)){this._bufs[i].copy(dst,bufoff,start,start+bytes);break}this._bufs[i].copy(dst,bufoff,start),bufoff+=l,bytes-=l,start&&(start=0)}return dst},BufferList.prototype.shallowSlice=function(start,end){start=start||0,end=end||this.length,start<0&&(start+=this.length),end<0&&(end+=this.length);var startOffset=this._offset(start),endOffset=this._offset(end),buffers=this._bufs.slice(startOffset[0],endOffset[0]+1);return 0==endOffset[1]?buffers.pop():buffers[buffers.length-1]=buffers[buffers.length-1].slice(0,endOffset[1]),0!=startOffset[1]&&(buffers[0]=buffers[0].slice(startOffset[1])),new BufferList(buffers)},BufferList.prototype.toString=function(encoding,start,end){return this.slice(start,end).toString(encoding)},BufferList.prototype.consume=function(bytes){for(;this._bufs.length;){if(!(bytes>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(bytes),this.length-=bytes;break}bytes-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},BufferList.prototype.duplicate=function(){for(var i=0,copy=new BufferList;i=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function ADD64AC(v,a,b0,b1){var o0=v[a]+b0;b0<0&&(o0+=4294967296);var o1=v[a+1]+b1;o0>=4294967296&&o1++,v[a]=o0,v[a+1]=o1}function B2B_GET32(arr,i){return arr[i]^arr[i+1]<<8^arr[i+2]<<16^arr[i+3]<<24}function B2B_G(a,b,c,d,ix,iy){var x0=m[ix],x1=m[ix+1],y0=m[iy],y1=m[iy+1];ADD64AA(v,a,b),ADD64AC(v,a,x0,x1);var xor0=v[d]^v[a],xor1=v[d+1]^v[a+1];v[d]=xor1,v[d+1]=xor0,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor0>>>24^xor1<<8,v[b+1]=xor1>>>24^xor0<<8,ADD64AA(v,a,b),ADD64AC(v,a,y0,y1), xor0=v[d]^v[a],xor1=v[d+1]^v[a+1],v[d]=xor0>>>16^xor1<<16,v[d+1]=xor1>>>16^xor0<<16,ADD64AA(v,c,d),xor0=v[b]^v[c],xor1=v[b+1]^v[c+1],v[b]=xor1>>>31^xor0<<1,v[b+1]=xor0>>>31^xor1<<1}function blake2bCompress(ctx,last){var i=0;for(i=0;i<16;i++)v[i]=ctx.h[i],v[i+16]=BLAKE2B_IV32[i];for(v[24]=v[24]^ctx.t,v[25]=v[25]^ctx.t/4294967296,last&&(v[28]=~v[28],v[29]=~v[29]),i=0;i<32;i++)m[i]=B2B_GET32(ctx.b,4*i);for(i=0;i<12;i++)B2B_G(0,8,16,24,SIGMA82[16*i+0],SIGMA82[16*i+1]),B2B_G(2,10,18,26,SIGMA82[16*i+2],SIGMA82[16*i+3]),B2B_G(4,12,20,28,SIGMA82[16*i+4],SIGMA82[16*i+5]),B2B_G(6,14,22,30,SIGMA82[16*i+6],SIGMA82[16*i+7]),B2B_G(0,10,20,30,SIGMA82[16*i+8],SIGMA82[16*i+9]),B2B_G(2,12,22,24,SIGMA82[16*i+10],SIGMA82[16*i+11]),B2B_G(4,14,16,26,SIGMA82[16*i+12],SIGMA82[16*i+13]),B2B_G(6,8,18,28,SIGMA82[16*i+14],SIGMA82[16*i+15]);for(i=0;i<16;i++)ctx.h[i]=ctx.h[i]^v[i]^v[i+16]}function blake2bInit(outlen,key){if(0===outlen||outlen>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(key&&key.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var ctx={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:outlen},i=0;i<16;i++)ctx.h[i]=BLAKE2B_IV32[i];var keylen=key?key.length:0;return ctx.h[0]^=16842752^keylen<<8^outlen,key&&(blake2bUpdate(ctx,key),ctx.c=128),ctx}function blake2bUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i);return out}function blake2b(input,key,outlen){outlen=outlen||64,input=util.normalizeInput(input);var ctx=blake2bInit(outlen,key);return blake2bUpdate(ctx,input),blake2bFinal(ctx)}function blake2bHex(input,key,outlen){var output=blake2b(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(80),BLAKE2B_IV32=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),SIGMA8=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],SIGMA82=new Uint8Array(SIGMA8.map(function(x){return 2*x})),v=new Uint32Array(32),m=new Uint32Array(32);module.exports={blake2b:blake2b,blake2bHex:blake2bHex,blake2bInit:blake2bInit,blake2bUpdate:blake2bUpdate,blake2bFinal:blake2bFinal}},function(module,exports,__webpack_require__){function B2S_GET32(v,i){return v[i]^v[i+1]<<8^v[i+2]<<16^v[i+3]<<24}function B2S_G(a,b,c,d,x,y){v[a]=v[a]+v[b]+x,v[d]=ROTR32(v[d]^v[a],16),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],12),v[a]=v[a]+v[b]+y,v[d]=ROTR32(v[d]^v[a],8),v[c]=v[c]+v[d],v[b]=ROTR32(v[b]^v[c],7)}function ROTR32(x,y){return x>>>y^x<<32-y}function blake2sCompress(ctx,last){var i=0;for(i=0;i<8;i++)v[i]=ctx.h[i],v[i+8]=BLAKE2S_IV[i];for(v[12]^=ctx.t,v[13]^=ctx.t/4294967296,last&&(v[14]=~v[14]),i=0;i<16;i++)m[i]=B2S_GET32(ctx.b,4*i);for(i=0;i<10;i++)B2S_G(0,4,8,12,m[SIGMA[16*i+0]],m[SIGMA[16*i+1]]),B2S_G(1,5,9,13,m[SIGMA[16*i+2]],m[SIGMA[16*i+3]]),B2S_G(2,6,10,14,m[SIGMA[16*i+4]],m[SIGMA[16*i+5]]),B2S_G(3,7,11,15,m[SIGMA[16*i+6]],m[SIGMA[16*i+7]]),B2S_G(0,5,10,15,m[SIGMA[16*i+8]],m[SIGMA[16*i+9]]),B2S_G(1,6,11,12,m[SIGMA[16*i+10]],m[SIGMA[16*i+11]]),B2S_G(2,7,8,13,m[SIGMA[16*i+12]],m[SIGMA[16*i+13]]),B2S_G(3,4,9,14,m[SIGMA[16*i+14]],m[SIGMA[16*i+15]]);for(i=0;i<8;i++)ctx.h[i]^=v[i]^v[i+8]}function blake2sInit(outlen,key){if(!(outlen>0&&outlen<=32))throw new Error("Incorrect output length, should be in [1, 32]");var keylen=key?key.length:0;if(key&&!(keylen>0&&keylen<=32))throw new Error("Incorrect key length, should be in [1, 32]");var ctx={h:new Uint32Array(BLAKE2S_IV),b:new Uint32Array(64),c:0,t:0,outlen:outlen};return ctx.h[0]^=16842752^keylen<<8^outlen,keylen>0&&(blake2sUpdate(ctx,key),ctx.c=64),ctx}function blake2sUpdate(ctx,input){for(var i=0;i>2]>>8*(3&i)&255;return out}function blake2s(input,key,outlen){outlen=outlen||32,input=util.normalizeInput(input);var ctx=blake2sInit(outlen,key);return blake2sUpdate(ctx,input),blake2sFinal(ctx)}function blake2sHex(input,key,outlen){var output=blake2s(input,key,outlen);return util.toHex(output)}var util=__webpack_require__(80),BLAKE2S_IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),v=new Uint32Array(16),m=new Uint32Array(16);module.exports={blake2s:blake2s,blake2sHex:blake2sHex,blake2sInit:blake2sInit,blake2sUpdate:blake2sUpdate,blake2sFinal:blake2sFinal}},function(module,exports,__webpack_require__){var b2b=__webpack_require__(160),b2s=__webpack_require__(161);module.exports={blake2b:b2b.blake2b,blake2bHex:b2b.blake2bHex,blake2bInit:b2b.blake2bInit,blake2bUpdate:b2b.blake2bUpdate,blake2bFinal:b2b.blake2bFinal,blake2s:b2s.blake2s,blake2sHex:b2s.blake2sHex,blake2sInit:b2s.blake2sInit,blake2sUpdate:b2s.blake2sUpdate,blake2sFinal:b2s.blake2sFinal}},function(module,exports,__webpack_require__){(function(module){!function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number))return number;this.negative=0,this.words=null,this.length=0,this.red=null,null!==number&&("le"!==base&&"be"!==base||(endian=base,base=10),this._init(number||0,base||10,endian||"be"))}function parseHex(str,start,end){for(var r=0,len=Math.min(str.length,end),i=start;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function parseBase(str,start,end,mul){for(var r=0,len=Math.min(str.length,end),i=start;i=49?c-49+10:c>=17?c-17+10:c}return r}function toBitArray(num){for(var w=new Array(num.bitLength()),bit=0;bit>>wbit}return w}function smallMulTo(self,num,out){out.negative=num.negative^self.negative;var len=self.length+num.length|0;out.length=len,len=len-1|0;var a=0|self.words[0],b=0|num.words[0],r=a*b,lo=67108863&r,carry=r/67108864|0;out.words[0]=lo;for(var k=1;k>>26,rword=67108863&carry,maxJ=Math.min(k,num.length-1),j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=0|self.words[i],b=0|num.words[j],r=a*b+rword,ncarry+=r/67108864|0,rword=67108863&r}out.words[k]=0|rword,carry=0|ncarry}return 0!==carry?out.words[k]=0|carry:out.length--,out.strip()}function bigMulTo(self,num,out){out.negative=num.negative^self.negative,out.length=self.length+num.length;for(var carry=0,hncarry=0,k=0;k>>26)|0,hncarry+=ncarry>>>26,ncarry&=67108863}out.words[k]=rword,carry=ncarry,ncarry=hncarry}return 0!==carry?out.words[k]=carry:out.length--,out.strip()}function jumboMulTo(self,num,out){return(new FFTM).mulp(self,num,out)}function FFTM(x,y){this.x=x,this.y=y}function MPrime(name,p){this.name=name,this.p=new BN(p,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(m){if("string"==typeof m){var prime=BN._prime(m);this.m=prime.p,this.prime=prime}else assert(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}function Mont(m){Red.call(this,m),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof module?module.exports=BN:exports.BN=BN,BN.BN=BN,BN.wordSize=26;var Buffer;try{Buffer=__webpack_require__(401).Buffer}catch(e){}BN.isBN=function(num){return num instanceof BN||null!==num&&"object"==typeof num&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)},BN.max=function(left,right){return left.cmp(right)>0?left:right},BN.min=function(left,right){return left.cmp(right)<0?left:right},BN.prototype._init=function(number,base,endian){if("number"==typeof number)return this._initNumber(number,base,endian);if("object"==typeof number)return this._initArray(number,base,endian);"hex"===base&&(base=16),assert(base===(0|base)&&base>=2&&base<=36),number=number.toString().replace(/\s+/g,"");var start=0;"-"===number[0]&&start++,16===base?this._parseHex(number,start):this._parseBase(number,base,start),"-"===number[0]&&(this.negative=1),this.strip(),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initNumber=function(number,base,endian){number<0&&(this.negative=1,number=-number),number<67108864?(this.words=[67108863&number],this.length=1):number<4503599627370496?(this.words=[67108863&number,number/67108864&67108863],this.length=2):(assert(number<9007199254740992),this.words=[67108863&number,number/67108864&67108863,1],this.length=3),"le"===endian&&this._initArray(this.toArray(),base,endian)},BN.prototype._initArray=function(number,base,endian){if(assert("number"==typeof number.length),number.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(number.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)w=number[i]|number[i-1]<<8|number[i-2]<<16,this.words[j]|=w<>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);else if("le"===endian)for(i=0,j=0;i>>26-off&67108863,(off+=24)>=26&&(off-=26,j++);return this.strip()},BN.prototype._parseHex=function(number,start){this.length=Math.ceil((number.length-start)/6),this.words=new Array(this.length);for(var i=0;i=start;i-=6)w=parseHex(number,i,i+6),this.words[j]|=w<>>26-off&4194303,(off+=24)>=26&&(off-=26,j++);i+6!==start&&(w=parseHex(number,start,i+6),this.words[j]|=w<>>26-off&4194303),this.strip()},BN.prototype._parseBase=function(number,base,start){this.words=[0],this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base)limbLen++;limbLen--,limbPow=limbPow/base|0;for(var total=number.length-start,mod=total%limbLen,end=Math.min(total,total-mod)+start,word=0,i=start;i1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function(){return(this.red?""};var zeros=["","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"],groupSizes=[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],groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function(base,padding){base=base||10,padding=0|padding||1;var out;if(16===base||"hex"===base){out="";for(var off=0,carry=0,i=0;i>>24-off&16777215,out=0!==carry||i!==this.length-1?zeros[6-word.length]+word+out:word+out,off+=2,off>=26&&(off-=26,i--)}for(0!==carry&&(out=carry.toString(16)+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}if(base===(0|base)&&base>=2&&base<=36){var groupSize=groupSizes[base],groupBase=groupBases[base];out="";var c=this.clone();for(c.negative=0;!c.isZero();){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase),out=c.isZero()?r+out:zeros[groupSize-r.length]+r+out}for(this.isZero()&&(out="0"+out);out.length%padding!=0;)out="0"+out;return 0!==this.negative&&(out="-"+out),out}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function(){var ret=this.words[0];return 2===this.length?ret+=67108864*this.words[1]:3===this.length&&1===this.words[2]?ret+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-ret:ret},BN.prototype.toJSON=function(){return this.toString(16)},BN.prototype.toBuffer=function(endian,length){return assert(void 0!==Buffer),this.toArrayLike(Buffer,endian,length)},BN.prototype.toArray=function(endian,length){return this.toArrayLike(Array,endian,length)},BN.prototype.toArrayLike=function(ArrayType,endian,length){var byteLength=this.byteLength(),reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length"),assert(reqLength>0,"Requested array length <= 0"),this.strip();var b,i,littleEndian="le"===endian,res=new ArrayType(reqLength),q=this.clone();if(littleEndian){for(i=0;!q.isZero();i++)b=q.andln(255),q.iushrn(8),res[i]=b;for(;i=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},BN.prototype._zeroBits=function(w){if(0===w)return 26;var t=w,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},BN.prototype.bitLength=function(){var w=this.words[this.length-1],hi=this._countBits(w);return 26*(this.length-1)+hi},BN.prototype.zeroBits=function(){if(this.isZero())return 0;for(var r=0,i=0;inum.length?this.clone().ior(num):num.clone().ior(this)},BN.prototype.uor=function(num){return this.length>num.length?this.clone().iuor(num):num.clone().iuor(this)},BN.prototype.iuand=function(num){var b;b=this.length>num.length?num:this;for(var i=0;inum.length?this.clone().iand(num):num.clone().iand(this)},BN.prototype.uand=function(num){return this.length>num.length?this.clone().iuand(num):num.clone().iuand(this)},BN.prototype.iuxor=function(num){var a,b;this.length>num.length?(a=this,b=num):(a=num,b=this);for(var i=0;inum.length?this.clone().ixor(num):num.clone().ixor(this)},BN.prototype.uxor=function(num){return this.length>num.length?this.clone().iuxor(num):num.clone().iuxor(this)},BN.prototype.inotn=function(width){assert("number"==typeof width&&width>=0);var bytesNeeded=0|Math.ceil(width/26),bitsLeft=width%26;this._expand(bytesNeeded),bitsLeft>0&&bytesNeeded--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-bitsLeft),this.strip()},BN.prototype.notn=function(width){return this.clone().inotn(width)},BN.prototype.setn=function(bit,val){assert("number"==typeof bit&&bit>=0);var off=bit/26|0,wbit=bit%26;return this._expand(off+1),this.words[off]=val?this.words[off]|1<num.length?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>>26;for(;0!==carry&&i>>26;if(this.length=a.length,0!==carry)this.words[this.length]=carry,this.length++;else if(a!==this)for(;inum.length?this.clone().iadd(num):num.clone().iadd(this)},BN.prototype.isub=function(num){if(0!==num.negative){num.negative=0;var r=this.iadd(num);return num.negative=1,r._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(num),this.negative=1,this._normSign();var cmp=this.cmp(num);if(0===cmp)return this.negative=0,this.length=1,this.words[0]=0,this;var a,b;cmp>0?(a=this,b=num):(a=num,b=this);for(var carry=0,i=0;i>26,this.words[i]=67108863&r;for(;0!==carry&&i>26,this.words[i]=67108863&r;if(0===carry&&i>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.negative=self.negative^num.negative,out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid=mid+Math.imul(ah0,bl0)|0,hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0,w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid=mid+Math.imul(ah1,bl0)|0,hi=Math.imul(ah1,bh0),lo=lo+Math.imul(al0,bl1)|0,mid=mid+Math.imul(al0,bh1)|0,mid=mid+Math.imul(ah0,bl1)|0,hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0,w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid=mid+Math.imul(ah2,bl0)|0,hi=Math.imul(ah2,bh0),lo=lo+Math.imul(al1,bl1)|0,mid=mid+Math.imul(al1,bh1)|0,mid=mid+Math.imul(ah1,bl1)|0,hi=hi+Math.imul(ah1,bh1)|0,lo=lo+Math.imul(al0,bl2)|0,mid=mid+Math.imul(al0,bh2)|0,mid=mid+Math.imul(ah0,bl2)|0,hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0,w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid=mid+Math.imul(ah3,bl0)|0,hi=Math.imul(ah3,bh0),lo=lo+Math.imul(al2,bl1)|0,mid=mid+Math.imul(al2,bh1)|0,mid=mid+Math.imul(ah2,bl1)|0,hi=hi+Math.imul(ah2,bh1)|0,lo=lo+Math.imul(al1,bl2)|0,mid=mid+Math.imul(al1,bh2)|0,mid=mid+Math.imul(ah1,bl2)|0,hi=hi+Math.imul(ah1,bh2)|0,lo=lo+Math.imul(al0,bl3)|0,mid=mid+Math.imul(al0,bh3)|0,mid=mid+Math.imul(ah0,bl3)|0,hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0,w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid=mid+Math.imul(ah4,bl0)|0,hi=Math.imul(ah4,bh0),lo=lo+Math.imul(al3,bl1)|0,mid=mid+Math.imul(al3,bh1)|0,mid=mid+Math.imul(ah3,bl1)|0,hi=hi+Math.imul(ah3,bh1)|0,lo=lo+Math.imul(al2,bl2)|0,mid=mid+Math.imul(al2,bh2)|0,mid=mid+Math.imul(ah2,bl2)|0,hi=hi+Math.imul(ah2,bh2)|0,lo=lo+Math.imul(al1,bl3)|0,mid=mid+Math.imul(al1,bh3)|0,mid=mid+Math.imul(ah1,bl3)|0,hi=hi+Math.imul(ah1,bh3)|0,lo=lo+Math.imul(al0,bl4)|0,mid=mid+Math.imul(al0,bh4)|0,mid=mid+Math.imul(ah0,bl4)|0,hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0,w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid=mid+Math.imul(ah5,bl0)|0,hi=Math.imul(ah5,bh0),lo=lo+Math.imul(al4,bl1)|0,mid=mid+Math.imul(al4,bh1)|0,mid=mid+Math.imul(ah4,bl1)|0,hi=hi+Math.imul(ah4,bh1)|0,lo=lo+Math.imul(al3,bl2)|0,mid=mid+Math.imul(al3,bh2)|0,mid=mid+Math.imul(ah3,bl2)|0,hi=hi+Math.imul(ah3,bh2)|0,lo=lo+Math.imul(al2,bl3)|0,mid=mid+Math.imul(al2,bh3)|0,mid=mid+Math.imul(ah2,bl3)|0,hi=hi+Math.imul(ah2,bh3)|0,lo=lo+Math.imul(al1,bl4)|0,mid=mid+Math.imul(al1,bh4)|0,mid=mid+Math.imul(ah1,bl4)|0,hi=hi+Math.imul(ah1,bh4)|0,lo=lo+Math.imul(al0,bl5)|0,mid=mid+Math.imul(al0,bh5)|0,mid=mid+Math.imul(ah0,bl5)|0,hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0,w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid=mid+Math.imul(ah6,bl0)|0,hi=Math.imul(ah6,bh0),lo=lo+Math.imul(al5,bl1)|0,mid=mid+Math.imul(al5,bh1)|0,mid=mid+Math.imul(ah5,bl1)|0,hi=hi+Math.imul(ah5,bh1)|0,lo=lo+Math.imul(al4,bl2)|0,mid=mid+Math.imul(al4,bh2)|0,mid=mid+Math.imul(ah4,bl2)|0,hi=hi+Math.imul(ah4,bh2)|0,lo=lo+Math.imul(al3,bl3)|0,mid=mid+Math.imul(al3,bh3)|0,mid=mid+Math.imul(ah3,bl3)|0,hi=hi+Math.imul(ah3,bh3)|0,lo=lo+Math.imul(al2,bl4)|0,mid=mid+Math.imul(al2,bh4)|0,mid=mid+Math.imul(ah2,bl4)|0,hi=hi+Math.imul(ah2,bh4)|0,lo=lo+Math.imul(al1,bl5)|0,mid=mid+Math.imul(al1,bh5)|0,mid=mid+Math.imul(ah1,bl5)|0,hi=hi+Math.imul(ah1,bh5)|0,lo=lo+Math.imul(al0,bl6)|0,mid=mid+Math.imul(al0,bh6)|0,mid=mid+Math.imul(ah0,bl6)|0,hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0,w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid=mid+Math.imul(ah7,bl0)|0,hi=Math.imul(ah7,bh0),lo=lo+Math.imul(al6,bl1)|0,mid=mid+Math.imul(al6,bh1)|0,mid=mid+Math.imul(ah6,bl1)|0,hi=hi+Math.imul(ah6,bh1)|0,lo=lo+Math.imul(al5,bl2)|0,mid=mid+Math.imul(al5,bh2)|0,mid=mid+Math.imul(ah5,bl2)|0,hi=hi+Math.imul(ah5,bh2)|0,lo=lo+Math.imul(al4,bl3)|0,mid=mid+Math.imul(al4,bh3)|0,mid=mid+Math.imul(ah4,bl3)|0,hi=hi+Math.imul(ah4,bh3)|0,lo=lo+Math.imul(al3,bl4)|0,mid=mid+Math.imul(al3,bh4)|0,mid=mid+Math.imul(ah3,bl4)|0,hi=hi+Math.imul(ah3,bh4)|0,lo=lo+Math.imul(al2,bl5)|0,mid=mid+Math.imul(al2,bh5)|0,mid=mid+Math.imul(ah2,bl5)|0,hi=hi+Math.imul(ah2,bh5)|0,lo=lo+Math.imul(al1,bl6)|0,mid=mid+Math.imul(al1,bh6)|0,mid=mid+Math.imul(ah1,bl6)|0,hi=hi+Math.imul(ah1,bh6)|0,lo=lo+Math.imul(al0,bl7)|0,mid=mid+Math.imul(al0,bh7)|0,mid=mid+Math.imul(ah0,bl7)|0,hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0,w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid=mid+Math.imul(ah8,bl0)|0,hi=Math.imul(ah8,bh0),lo=lo+Math.imul(al7,bl1)|0,mid=mid+Math.imul(al7,bh1)|0,mid=mid+Math.imul(ah7,bl1)|0,hi=hi+Math.imul(ah7,bh1)|0,lo=lo+Math.imul(al6,bl2)|0,mid=mid+Math.imul(al6,bh2)|0,mid=mid+Math.imul(ah6,bl2)|0,hi=hi+Math.imul(ah6,bh2)|0,lo=lo+Math.imul(al5,bl3)|0,mid=mid+Math.imul(al5,bh3)|0,mid=mid+Math.imul(ah5,bl3)|0,hi=hi+Math.imul(ah5,bh3)|0,lo=lo+Math.imul(al4,bl4)|0,mid=mid+Math.imul(al4,bh4)|0,mid=mid+Math.imul(ah4,bl4)|0,hi=hi+Math.imul(ah4,bh4)|0,lo=lo+Math.imul(al3,bl5)|0,mid=mid+Math.imul(al3,bh5)|0,mid=mid+Math.imul(ah3,bl5)|0,hi=hi+Math.imul(ah3,bh5)|0,lo=lo+Math.imul(al2,bl6)|0,mid=mid+Math.imul(al2,bh6)|0,mid=mid+Math.imul(ah2,bl6)|0,hi=hi+Math.imul(ah2,bh6)|0,lo=lo+Math.imul(al1,bl7)|0,mid=mid+Math.imul(al1,bh7)|0,mid=mid+Math.imul(ah1,bl7)|0,hi=hi+Math.imul(ah1,bh7)|0,lo=lo+Math.imul(al0,bl8)|0,mid=mid+Math.imul(al0,bh8)|0,mid=mid+Math.imul(ah0,bl8)|0,hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0,w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid=mid+Math.imul(ah9,bl0)|0,hi=Math.imul(ah9,bh0),lo=lo+Math.imul(al8,bl1)|0,mid=mid+Math.imul(al8,bh1)|0,mid=mid+Math.imul(ah8,bl1)|0,hi=hi+Math.imul(ah8,bh1)|0,lo=lo+Math.imul(al7,bl2)|0,mid=mid+Math.imul(al7,bh2)|0,mid=mid+Math.imul(ah7,bl2)|0,hi=hi+Math.imul(ah7,bh2)|0,lo=lo+Math.imul(al6,bl3)|0,mid=mid+Math.imul(al6,bh3)|0,mid=mid+Math.imul(ah6,bl3)|0,hi=hi+Math.imul(ah6,bh3)|0,lo=lo+Math.imul(al5,bl4)|0,mid=mid+Math.imul(al5,bh4)|0,mid=mid+Math.imul(ah5,bl4)|0,hi=hi+Math.imul(ah5,bh4)|0,lo=lo+Math.imul(al4,bl5)|0,mid=mid+Math.imul(al4,bh5)|0,mid=mid+Math.imul(ah4,bl5)|0,hi=hi+Math.imul(ah4,bh5)|0,lo=lo+Math.imul(al3,bl6)|0,mid=mid+Math.imul(al3,bh6)|0,mid=mid+Math.imul(ah3,bl6)|0,hi=hi+Math.imul(ah3,bh6)|0,lo=lo+Math.imul(al2,bl7)|0,mid=mid+Math.imul(al2,bh7)|0,mid=mid+Math.imul(ah2,bl7)|0,hi=hi+Math.imul(ah2,bh7)|0,lo=lo+Math.imul(al1,bl8)|0,mid=mid+Math.imul(al1,bh8)|0,mid=mid+Math.imul(ah1,bl8)|0,hi=hi+Math.imul(ah1,bh8)|0,lo=lo+Math.imul(al0,bl9)|0,mid=mid+Math.imul(al0,bh9)|0,mid=mid+Math.imul(ah0,bl9)|0,hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0,w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid=mid+Math.imul(ah9,bl1)|0,hi=Math.imul(ah9,bh1),lo=lo+Math.imul(al8,bl2)|0,mid=mid+Math.imul(al8,bh2)|0,mid=mid+Math.imul(ah8,bl2)|0,hi=hi+Math.imul(ah8,bh2)|0,lo=lo+Math.imul(al7,bl3)|0,mid=mid+Math.imul(al7,bh3)|0,mid=mid+Math.imul(ah7,bl3)|0,hi=hi+Math.imul(ah7,bh3)|0,lo=lo+Math.imul(al6,bl4)|0,mid=mid+Math.imul(al6,bh4)|0,mid=mid+Math.imul(ah6,bl4)|0,hi=hi+Math.imul(ah6,bh4)|0,lo=lo+Math.imul(al5,bl5)|0,mid=mid+Math.imul(al5,bh5)|0,mid=mid+Math.imul(ah5,bl5)|0,hi=hi+Math.imul(ah5,bh5)|0,lo=lo+Math.imul(al4,bl6)|0,mid=mid+Math.imul(al4,bh6)|0,mid=mid+Math.imul(ah4,bl6)|0,hi=hi+Math.imul(ah4,bh6)|0,lo=lo+Math.imul(al3,bl7)|0,mid=mid+Math.imul(al3,bh7)|0,mid=mid+Math.imul(ah3,bl7)|0,hi=hi+Math.imul(ah3,bh7)|0,lo=lo+Math.imul(al2,bl8)|0,mid=mid+Math.imul(al2,bh8)|0,mid=mid+Math.imul(ah2,bl8)|0,hi=hi+Math.imul(ah2,bh8)|0,lo=lo+Math.imul(al1,bl9)|0,mid=mid+Math.imul(al1,bh9)|0,mid=mid+Math.imul(ah1,bl9)|0,hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0,w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid=mid+Math.imul(ah9,bl2)|0,hi=Math.imul(ah9,bh2),lo=lo+Math.imul(al8,bl3)|0,mid=mid+Math.imul(al8,bh3)|0,mid=mid+Math.imul(ah8,bl3)|0,hi=hi+Math.imul(ah8,bh3)|0,lo=lo+Math.imul(al7,bl4)|0,mid=mid+Math.imul(al7,bh4)|0,mid=mid+Math.imul(ah7,bl4)|0,hi=hi+Math.imul(ah7,bh4)|0,lo=lo+Math.imul(al6,bl5)|0,mid=mid+Math.imul(al6,bh5)|0,mid=mid+Math.imul(ah6,bl5)|0,hi=hi+Math.imul(ah6,bh5)|0,lo=lo+Math.imul(al5,bl6)|0,mid=mid+Math.imul(al5,bh6)|0,mid=mid+Math.imul(ah5,bl6)|0,hi=hi+Math.imul(ah5,bh6)|0,lo=lo+Math.imul(al4,bl7)|0,mid=mid+Math.imul(al4,bh7)|0,mid=mid+Math.imul(ah4,bl7)|0,hi=hi+Math.imul(ah4,bh7)|0,lo=lo+Math.imul(al3,bl8)|0,mid=mid+Math.imul(al3,bh8)|0,mid=mid+Math.imul(ah3,bl8)|0,hi=hi+Math.imul(ah3,bh8)|0,lo=lo+Math.imul(al2,bl9)|0,mid=mid+Math.imul(al2,bh9)|0,mid=mid+Math.imul(ah2,bl9)|0,hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0,w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid=mid+Math.imul(ah9,bl3)|0,hi=Math.imul(ah9,bh3),lo=lo+Math.imul(al8,bl4)|0,mid=mid+Math.imul(al8,bh4)|0,mid=mid+Math.imul(ah8,bl4)|0,hi=hi+Math.imul(ah8,bh4)|0,lo=lo+Math.imul(al7,bl5)|0,mid=mid+Math.imul(al7,bh5)|0,mid=mid+Math.imul(ah7,bl5)|0,hi=hi+Math.imul(ah7,bh5)|0,lo=lo+Math.imul(al6,bl6)|0,mid=mid+Math.imul(al6,bh6)|0,mid=mid+Math.imul(ah6,bl6)|0,hi=hi+Math.imul(ah6,bh6)|0,lo=lo+Math.imul(al5,bl7)|0,mid=mid+Math.imul(al5,bh7)|0,mid=mid+Math.imul(ah5,bl7)|0,hi=hi+Math.imul(ah5,bh7)|0,lo=lo+Math.imul(al4,bl8)|0,mid=mid+Math.imul(al4,bh8)|0,mid=mid+Math.imul(ah4,bl8)|0,hi=hi+Math.imul(ah4,bh8)|0,lo=lo+Math.imul(al3,bl9)|0,mid=mid+Math.imul(al3,bh9)|0,mid=mid+Math.imul(ah3,bl9)|0,hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0,w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid=mid+Math.imul(ah9,bl4)|0,hi=Math.imul(ah9,bh4),lo=lo+Math.imul(al8,bl5)|0,mid=mid+Math.imul(al8,bh5)|0,mid=mid+Math.imul(ah8,bl5)|0, hi=hi+Math.imul(ah8,bh5)|0,lo=lo+Math.imul(al7,bl6)|0,mid=mid+Math.imul(al7,bh6)|0,mid=mid+Math.imul(ah7,bl6)|0,hi=hi+Math.imul(ah7,bh6)|0,lo=lo+Math.imul(al6,bl7)|0,mid=mid+Math.imul(al6,bh7)|0,mid=mid+Math.imul(ah6,bl7)|0,hi=hi+Math.imul(ah6,bh7)|0,lo=lo+Math.imul(al5,bl8)|0,mid=mid+Math.imul(al5,bh8)|0,mid=mid+Math.imul(ah5,bl8)|0,hi=hi+Math.imul(ah5,bh8)|0,lo=lo+Math.imul(al4,bl9)|0,mid=mid+Math.imul(al4,bh9)|0,mid=mid+Math.imul(ah4,bl9)|0,hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0,w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid=mid+Math.imul(ah9,bl5)|0,hi=Math.imul(ah9,bh5),lo=lo+Math.imul(al8,bl6)|0,mid=mid+Math.imul(al8,bh6)|0,mid=mid+Math.imul(ah8,bl6)|0,hi=hi+Math.imul(ah8,bh6)|0,lo=lo+Math.imul(al7,bl7)|0,mid=mid+Math.imul(al7,bh7)|0,mid=mid+Math.imul(ah7,bl7)|0,hi=hi+Math.imul(ah7,bh7)|0,lo=lo+Math.imul(al6,bl8)|0,mid=mid+Math.imul(al6,bh8)|0,mid=mid+Math.imul(ah6,bl8)|0,hi=hi+Math.imul(ah6,bh8)|0,lo=lo+Math.imul(al5,bl9)|0,mid=mid+Math.imul(al5,bh9)|0,mid=mid+Math.imul(ah5,bl9)|0,hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0,w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid=mid+Math.imul(ah9,bl6)|0,hi=Math.imul(ah9,bh6),lo=lo+Math.imul(al8,bl7)|0,mid=mid+Math.imul(al8,bh7)|0,mid=mid+Math.imul(ah8,bl7)|0,hi=hi+Math.imul(ah8,bh7)|0,lo=lo+Math.imul(al7,bl8)|0,mid=mid+Math.imul(al7,bh8)|0,mid=mid+Math.imul(ah7,bl8)|0,hi=hi+Math.imul(ah7,bh8)|0,lo=lo+Math.imul(al6,bl9)|0,mid=mid+Math.imul(al6,bh9)|0,mid=mid+Math.imul(ah6,bl9)|0,hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0,w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid=mid+Math.imul(ah9,bl7)|0,hi=Math.imul(ah9,bh7),lo=lo+Math.imul(al8,bl8)|0,mid=mid+Math.imul(al8,bh8)|0,mid=mid+Math.imul(ah8,bl8)|0,hi=hi+Math.imul(ah8,bh8)|0,lo=lo+Math.imul(al7,bl9)|0,mid=mid+Math.imul(al7,bh9)|0,mid=mid+Math.imul(ah7,bl9)|0,hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0,w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid=mid+Math.imul(ah9,bl8)|0,hi=Math.imul(ah9,bh8),lo=lo+Math.imul(al8,bl9)|0,mid=mid+Math.imul(al8,bh9)|0,mid=mid+Math.imul(ah8,bl9)|0,hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((8191&mid)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0,w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid=mid+Math.imul(ah9,bl9)|0,hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((8191&mid)<<13)|0;return c=(hi+(mid>>>13)|0)+(w18>>>26)|0,w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2,o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out};Math.imul||(comb10MulTo=smallMulTo),BN.prototype.mulTo=function(num,out){var len=this.length+num.length;return 10===this.length&&10===num.length?comb10MulTo(this,num,out):len<63?smallMulTo(this,num,out):len<1024?bigMulTo(this,num,out):jumboMulTo(this,num,out)},FFTM.prototype.makeRBT=function(N){for(var t=new Array(N),l=BN.prototype._countBits(N)-1,i=0;i>=1;return rb},FFTM.prototype.permute=function(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>=1)i++;return 1<>>=13,rws[2*i+1]=8191&carry,carry>>>=13;for(i=2*len;i>=26,carry+=w/67108864|0,carry+=lo>>>26,this.words[i]=67108863&lo}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.muln=function(num){return this.clone().imuln(num)},BN.prototype.sqr=function(){return this.mul(this)},BN.prototype.isqr=function(){return this.imul(this.clone())},BN.prototype.pow=function(num){var w=toBitArray(num);if(0===w.length)return new BN(1);for(var res=this,i=0;i=0);var i,r=bits%26,s=(bits-r)/26,carryMask=67108863>>>26-r<<26-r;if(0!==r){var carry=0;for(i=0;i>>26-r}carry&&(this.words[i]=carry,this.length++)}if(0!==s){for(i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(i=0;i=0);var h;h=hint?(hint-hint%26)/26:0;var r=bits%26,s=Math.min((bits-r)/26,this.length),mask=67108863^67108863>>>r<s)for(this.length-=s,i=0;i=0&&(0!==carry||i>=h);i--){var word=0|this.words[i];this.words[i]=carry<<26-r|word>>>r,carry=word&mask}return maskedWords&&0!==carry&&(maskedWords.words[maskedWords.length++]=carry),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function(bits,hint,extended){return assert(0===this.negative),this.iushrn(bits,hint,extended)},BN.prototype.shln=function(bits){return this.clone().ishln(bits)},BN.prototype.ushln=function(bits){return this.clone().iushln(bits)},BN.prototype.shrn=function(bits){return this.clone().ishrn(bits)},BN.prototype.ushrn=function(bits){return this.clone().iushrn(bits)},BN.prototype.testn=function(bit){assert("number"==typeof bit&&bit>=0);var r=bit%26,s=(bit-r)/26,q=1<=0);var r=bits%26,s=(bits-r)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=s)return this;if(0!==r&&s++,this.length=Math.min(s,this.length),0!==r){var mask=67108863^67108863>>>r<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function(num){if(assert("number"==typeof num),assert(num<67108864),num<0)return this.iaddn(-num);if(0!==this.negative)return this.negative=0,this.iaddn(num),this.negative=1,this;if(this.words[0]-=num,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i>26)-(right/67108864|0),this.words[i+shift]=67108863&w}for(;i>26,this.words[i+shift]=67108863&w;if(0===carry)return this.strip();for(assert(carry===-1),carry=0,i=0;i>26,this.words[i]=67108863&w;return this.negative=1,this.strip()},BN.prototype._wordDiv=function(num,mode){var shift=this.length-num.length,a=this.clone(),b=num,bhi=0|b.words[b.length-1];0!==(shift=26-this._countBits(bhi))&&(b=b.ushln(shift),a.iushln(shift),bhi=0|b.words[b.length-1]);var q,m=a.length-b.length;if("mod"!==mode){q=new BN(null),q.length=m+1,q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=67108864*(0|a.words[b.length+j])+(0|a.words[b.length+j-1]);for(qj=Math.min(qj/bhi|0,67108863),a._ishlnsubmul(b,qj,j);0!==a.negative;)qj--,a.negative=0,a._ishlnsubmul(b,1,j),a.isZero()||(a.negative^=1);q&&(q.words[j]=qj)}return q&&q.strip(),a.strip(),"div"!==mode&&0!==shift&&a.iushrn(shift),{div:q||null,mod:a}},BN.prototype.divmod=function(num,mode,positive){if(assert(!num.isZero()),this.isZero())return{div:new BN(0),mod:new BN(0)};var div,mod,res;return 0!==this.negative&&0===num.negative?(res=this.neg().divmod(num,mode),"mod"!==mode&&(div=res.div.neg()),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.iadd(num)),{div:div,mod:mod}):0===this.negative&&0!==num.negative?(res=this.divmod(num.neg(),mode),"mod"!==mode&&(div=res.div.neg()),{div:div,mod:res.mod}):0!=(this.negative&num.negative)?(res=this.neg().divmod(num.neg(),mode),"div"!==mode&&(mod=res.mod.neg(),positive&&0!==mod.negative&&mod.isub(num)),{div:res.div,mod:mod}):num.length>this.length||this.cmp(num)<0?{div:new BN(0),mod:this}:1===num.length?"div"===mode?{div:this.divn(num.words[0]),mod:null}:"mod"===mode?{div:null,mod:new BN(this.modn(num.words[0]))}:{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}:this._wordDiv(num,mode)},BN.prototype.div=function(num){return this.divmod(num,"div",!1).div},BN.prototype.mod=function(num){return this.divmod(num,"mod",!1).mod},BN.prototype.umod=function(num){return this.divmod(num,"mod",!0).mod},BN.prototype.divRound=function(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=0!==dm.div.negative?dm.mod.isub(num):dm.mod,half=num.ushrn(1),r2=num.andln(1),cmp=mod.cmp(half);return cmp<0||1===r2&&0===cmp?dm.div:0!==dm.div.negative?dm.div.isubn(1):dm.div.iaddn(1)},BN.prototype.modn=function(num){assert(num<=67108863);for(var p=(1<<26)%num,acc=0,i=this.length-1;i>=0;i--)acc=(p*acc+(0|this.words[i]))%num;return acc},BN.prototype.idivn=function(num){assert(num<=67108863);for(var carry=0,i=this.length-1;i>=0;i--){var w=(0|this.words[i])+67108864*carry;this.words[i]=w/num|0,carry=w%num}return this.strip()},BN.prototype.divn=function(num){return this.clone().idivn(num)},BN.prototype.egcd=function(p){assert(0===p.negative),assert(!p.isZero());var x=this,y=p.clone();x=0!==x.negative?x.umod(p):x.clone();for(var A=new BN(1),B=new BN(0),C=new BN(0),D=new BN(1),g=0;x.isEven()&&y.isEven();)x.iushrn(1),y.iushrn(1),++g;for(var yp=y.clone(),xp=x.clone();!x.isZero();){for(var i=0,im=1;0==(x.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(x.iushrn(i);i-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(yp),B.isub(xp)),A.iushrn(1),B.iushrn(1);for(var j=0,jm=1;0==(y.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(y.iushrn(j);j-- >0;)(C.isOdd()||D.isOdd())&&(C.iadd(yp),D.isub(xp)),C.iushrn(1),D.iushrn(1);x.cmp(y)>=0?(x.isub(y),A.isub(C),B.isub(D)):(y.isub(x),C.isub(A),D.isub(B))}return{a:C,b:D,gcd:y.iushln(g)}},BN.prototype._invmp=function(p){assert(0===p.negative),assert(!p.isZero());var a=this,b=p.clone();a=0!==a.negative?a.umod(p):a.clone();for(var x1=new BN(1),x2=new BN(0),delta=b.clone();a.cmpn(1)>0&&b.cmpn(1)>0;){for(var i=0,im=1;0==(a.words[0]&im)&&i<26;++i,im<<=1);if(i>0)for(a.iushrn(i);i-- >0;)x1.isOdd()&&x1.iadd(delta),x1.iushrn(1);for(var j=0,jm=1;0==(b.words[0]&jm)&&j<26;++j,jm<<=1);if(j>0)for(b.iushrn(j);j-- >0;)x2.isOdd()&&x2.iadd(delta),x2.iushrn(1);a.cmp(b)>=0?(a.isub(b),x1.isub(x2)):(b.isub(a),x2.isub(x1))}var res;return res=0===a.cmpn(1)?x1:x2,res.cmpn(0)<0&&res.iadd(p),res},BN.prototype.gcd=function(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone(),b=num.clone();a.negative=0,b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++)a.iushrn(1),b.iushrn(1);for(;;){for(;a.isEven();)a.iushrn(1);for(;b.isEven();)b.iushrn(1);var r=a.cmp(b);if(r<0){var t=a;a=b,b=t}else if(0===r||0===b.cmpn(1))break;a.isub(b)}return b.iushln(shift)},BN.prototype.invm=function(num){return this.egcd(num).a.umod(num)},BN.prototype.isEven=function(){return 0==(1&this.words[0])},BN.prototype.isOdd=function(){return 1==(1&this.words[0])},BN.prototype.andln=function(num){return this.words[0]&num},BN.prototype.bincn=function(bit){assert("number"==typeof bit);var r=bit%26,s=(bit-r)/26,q=1<>>26,w&=67108863,this.words[i]=w}return 0!==carry&&(this.words[i]=carry,this.length++),this},BN.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function(num){var negative=num<0;if(0!==this.negative&&!negative)return-1;if(0===this.negative&&negative)return 1;this.strip();var res;if(this.length>1)res=1;else{negative&&(num=-num),assert(num<=67108863,"Number is too big");var w=0|this.words[0];res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=0|this.words[i],b=0|num.words[i];if(a!==b){ab&&(res=1);break}}return res},BN.prototype.gtn=function(num){return 1===this.cmpn(num)},BN.prototype.gt=function(num){return 1===this.cmp(num)},BN.prototype.gten=function(num){return this.cmpn(num)>=0},BN.prototype.gte=function(num){return this.cmp(num)>=0},BN.prototype.ltn=function(num){return this.cmpn(num)===-1},BN.prototype.lt=function(num){return this.cmp(num)===-1},BN.prototype.lten=function(num){return this.cmpn(num)<=0},BN.prototype.lte=function(num){return this.cmp(num)<=0},BN.prototype.eqn=function(num){return 0===this.cmpn(num)},BN.prototype.eq=function(num){return 0===this.cmp(num)},BN.red=function(num){return new Red(num)},BN.prototype.toRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),ctx.convertTo(this)._forceRed(ctx)},BN.prototype.fromRed=function(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function(ctx){return this.red=ctx,this},BN.prototype.forceRed=function(ctx){return assert(!this.red,"Already a number in reduction context"),this._forceRed(ctx)},BN.prototype.redAdd=function(num){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,num)},BN.prototype.redIAdd=function(num){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,num)},BN.prototype.redSub=function(num){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,num)},BN.prototype.redISub=function(num){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,num)},BN.prototype.redShl=function(num){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,num)},BN.prototype.redMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.mul(this,num)},BN.prototype.redIMul=function(num){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,num),this.red.imul(this,num)},BN.prototype.redSqr=function(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function(num){return assert(this.red&&!num.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};MPrime.prototype._tmp=function(){var tmp=new BN(null);return tmp.words=new Array(Math.ceil(this.n/13)),tmp},MPrime.prototype.ireduce=function(num){var rlen,r=num;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function(input,out){input.iushrn(this.n,0,out)},MPrime.prototype.imulK=function(num){return num.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function(input,output){for(var outLen=Math.min(input.length,9),i=0;i>>22,prev=next}prev>>>=22,input.words[i-10]=prev,0===prev&&input.length>10?input.length-=10:input.length-=9},K256.prototype.imulK=function(num){num.words[num.length]=0,num.words[num.length+1]=0,num.length+=2;for(var lo=0,i=0;i>>=26,num.words[i]=lo,carry=hi}return 0!==carry&&(num.words[num.length++]=carry),num},BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if("k256"===name)prime=new K256;else if("p224"===name)prime=new P224;else if("p192"===name)prime=new P192;else{if("p25519"!==name)throw new Error("Unknown prime "+name);prime=new P25519}return primes[name]=prime,prime},Red.prototype._verify1=function(a){assert(0===a.negative,"red works only with positives"),assert(a.red,"red works only with red numbers")},Red.prototype._verify2=function(a,b){assert(0==(a.negative|b.negative),"red works only with positives"),assert(a.red&&a.red===b.red,"red works only with red numbers")},Red.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},Red.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Red.prototype.add=function(a,b){this._verify2(a,b);var res=a.add(b);return res.cmp(this.m)>=0&&res.isub(this.m),res._forceRed(this)},Red.prototype.iadd=function(a,b){this._verify2(a,b);var res=a.iadd(b);return res.cmp(this.m)>=0&&res.isub(this.m),res},Red.prototype.sub=function(a,b){this._verify2(a,b);var res=a.sub(b);return res.cmpn(0)<0&&res.iadd(this.m),res._forceRed(this)},Red.prototype.isub=function(a,b){this._verify2(a,b);var res=a.isub(b);return res.cmpn(0)<0&&res.iadd(this.m),res},Red.prototype.shl=function(a,num){return this._verify1(a),this.imod(a.ushln(num))},Red.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},Red.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},Red.prototype.isqr=function(a){return this.imul(a,a.clone())},Red.prototype.sqr=function(a){return this.mul(a,a)},Red.prototype.sqrt=function(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);if(assert(mod3%2==1),3===mod3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}for(var q=this.m.subn(1),s=0;!q.isZero()&&0===q.andln(1);)s++,q.iushrn(1);assert(!q.isZero());var one=new BN(1).toRed(this),nOne=one.redNeg(),lpow=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new BN(2*z*z).toRed(this);0!==this.pow(z,lpow).cmp(nOne);)z.redIAdd(nOne);for(var c=this.pow(z,q),r=this.pow(a,q.addn(1).iushrn(1)),t=this.pow(a,q),m=s;0!==t.cmp(one);){for(var tmp=t,i=0;0!==tmp.cmp(one);i++)tmp=tmp.redSqr();assert(i=0;i--){for(var word=num.words[i],j=start-1;j>=0;j--){var bit=word>>j&1;res!==wnd[0]&&(res=this.sqr(res)),0!==bit||0!==current?(current<<=1,current|=bit,(4===++currentLen||0===i&&0===j)&&(res=this.mul(res,wnd[current]),currentLen=0,current=0)):currentLen=0}start=26}return res},Red.prototype.convertTo=function(num){var r=num.umod(this.m);return r===num?r.clone():r},Red.prototype.convertFrom=function(num){var res=num.clone();return res.red=null,res},BN.mont=function(num){return new Mont(num)},inherits(Mont,Red),Mont.prototype.convertTo=function(num){return this.imod(num.ushln(this.shift))},Mont.prototype.convertFrom=function(num){var r=this.imod(num.mul(this.rinv));return r.red=null,r},Mont.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var t=a.imul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b),c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),u=t.isub(c).iushrn(this.shift),res=u;return u.cmp(this.m)>=0?res=u.isub(this.m):u.cmpn(0)<0&&(res=u.iadd(this.m)),res._forceRed(this)},Mont.prototype.invm=function(a){return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===module||module,this)}).call(exports,__webpack_require__(17)(module))},function(module,exports,__webpack_require__){function getCiphers(){return Object.keys(modes)}var ciphers=__webpack_require__(166);exports.createCipher=exports.Cipher=ciphers.createCipher,exports.createCipheriv=exports.Cipheriv=ciphers.createCipheriv;var deciphers=__webpack_require__(165);exports.createDecipher=exports.Decipher=deciphers.createDecipher,exports.createDecipheriv=exports.Decipheriv=deciphers.createDecipheriv;var modes=__webpack_require__(55);exports.listCiphers=exports.getCiphers=getCiphers},function(module,exports,__webpack_require__){(function(Buffer){function Decipher(mode,key,iv){if(!(this instanceof Decipher))return new Decipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._last=void 0,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function unpad(last){for(var padded=last[15],i=-1;++i16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out}else if(this.cache.length>=16)return out=this.cache.slice(0,16),this.cache=this.cache.slice(16),out;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};var modelist={ECB:__webpack_require__(86),CBC:__webpack_require__(82),CFB:__webpack_require__(83),CFB8:__webpack_require__(85),CFB1:__webpack_require__(84),OFB:__webpack_require__(87),CTR:__webpack_require__(38),GCM:__webpack_require__(38)};exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Cipher(mode,key,iv){if(!(this instanceof Cipher))return new Cipher(mode,key,iv);Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(key),this._prev=new Buffer(iv.length),iv.copy(this._prev),this._mode=mode,this._autopadding=!0}function Splitter(){if(!(this instanceof Splitter))return new Splitter;this.cache=new Buffer("")}function createCipheriv(suite,password,iv){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");if("string"==typeof iv&&(iv=new Buffer(iv)),"string"==typeof password&&(password=new Buffer(password)),password.length!==config.key/8)throw new TypeError("invalid key length "+password.length);if(iv.length!==config.iv)throw new TypeError("invalid iv length "+iv.length);return"stream"===config.type?new StreamCipher(modelist[config.mode],password,iv):"auth"===config.type?new AuthCipher(modelist[config.mode],password,iv):new Cipher(modelist[config.mode],password,iv)}function createCipher(suite,password){var config=modes[suite.toLowerCase()];if(!config)throw new TypeError("invalid suite type");var keys=ebtk(password,!1,config.key,config.iv);return createCipheriv(suite,keys.key,keys.iv)}var aes=__webpack_require__(37),Transform=__webpack_require__(14),inherits=__webpack_require__(2),modes=__webpack_require__(55),ebtk=__webpack_require__(90),StreamCipher=__webpack_require__(88),AuthCipher=__webpack_require__(81);inherits(Cipher,Transform),Cipher.prototype._update=function(data){this._cache.add(data);for(var chunk,thing,out=[];chunk=this._cache.get();)thing=this._mode.encrypt(this,chunk),out.push(thing);return Buffer.concat(out)},Cipher.prototype._final=function(){var chunk=this._cache.flush();if(this._autopadding)return chunk=this._mode.encrypt(this,chunk),this._cipher.scrub(),chunk;if("10101010101010101010101010101010"!==chunk.toString("hex"))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(setTo){return this._autopadding=!!setTo,this},Splitter.prototype.add=function(data){this.cache=Buffer.concat([this.cache,data])},Splitter.prototype.get=function(){if(this.cache.length>15){var out=this.cache.slice(0,16);return this.cache=this.cache.slice(16),out}return null},Splitter.prototype.flush=function(){for(var len=16-this.cache.length,padBuff=new Buffer(len),i=-1;++iuint_max||x<0?(x_pos=Math.abs(x)%uint_max,x<0?uint_max-x_pos:x_pos):x}function xor(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]}var zeros=new Buffer(16);zeros.fill(0),module.exports=GHASH,GHASH.prototype.ghash=function(block){for(var i=-1;++i0;j--)Vi[j]=Vi[j]>>>1|(1&Vi[j-1])<<31;Vi[0]=Vi[0]>>>1,lsb_Vi&&(Vi[0]=Vi[0]^225<<24)}this.state=fromArray(Zi)},GHASH.prototype.update=function(buf){this.cache=Buffer.concat([this.cache,buf]);for(var chunk;this.cache.length>=16;)chunk=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(chunk)},GHASH.prototype.final=function(abl,bl){return this.cache.length&&this.ghash(Buffer.concat([this.cache,zeros],16)),this.ghash(fromArray([0,abl,0,bl])),this.state};var uint_max=Math.pow(2,32)}).call(exports,__webpack_require__(0).Buffer)},function(module,exports){module.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(module,exports,__webpack_require__){(function(Buffer){function ConcatStream(opts,cb){if(!(this instanceof ConcatStream))return new ConcatStream(opts,cb);"function"==typeof opts&&(cb=opts,opts={}),opts||(opts={});var encoding=opts.encoding,shouldInferEncoding=!1;encoding?"u8"!==(encoding=String(encoding).toLowerCase())&&"uint8"!==encoding||(encoding="uint8array"):shouldInferEncoding=!0,Writable.call(this,{objectMode:!0}),this.encoding=encoding,this.shouldInferEncoding=shouldInferEncoding,cb&&this.on("finish",function(){cb(this.getBody())}),this.body=[]}function isArrayish(arr){return/Array\]$/.test(Object.prototype.toString.call(arr))}function isBufferish(p){return"string"==typeof p||isArrayish(p)||p&&"function"==typeof p.subarray}function stringConcat(parts){for(var strings=[],i=0;i>>2),i=0,j=0;iblocksize){key=("rmd160"===alg?new RIPEMD160:sha(alg)).update(key).digest()}else key.lengthblocksize?key=alg(key):key.lengththis._reseedInterval)throw new Error("Reseed is required");add&&0===add.length&&(add=void 0),add&&this._update(add);for(var temp=new Buffer(0);temp.length=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(data){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();return void 0!==encoding&&(digest=digest.toString(encoding)),digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var http=__webpack_require__(124),https=module.exports;for(var key in http)http.hasOwnProperty(key)&&(https[key]=http[key]);https.request=function(params,cb){return params||(params={}),params.scheme="https",params.protocol="https:",http.request.call(this,params,cb)}},function(module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias),value*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports){var indexOf=[].indexOf;module.exports=function(arr,obj){if(indexOf)return arr.indexOf(obj);for(var i=0;i0;i--)argv.push("0");sections.splice.apply(sections,argv)}for(result=buff||new Buffer(offset+16),i=0;i>8&255,result[offset++]=255&word}}if(!result)throw Error("Invalid ip address: "+ip);return result},ip.toString=function(buff,offset,length){offset=~~offset,length=length||buff.length-offset;var result=[];if(4===length){for(var i=0;i32?"ipv6":_normalizeFamily(family);var len=4;"ipv6"===family&&(len=16);for(var buff=new Buffer(len),i=0,n=buff.length;i>bits)}return ip.toString(buff)},ip.mask=function(addr,mask){addr=ip.toBuffer(addr),mask=ip.toBuffer(mask);var result=new Buffer(Math.max(addr.length,mask.length)),i=0;if(addr.length===mask.length)for(i=0;ia.length&&(buff=b,other=a);for(var offset=buff.length-other.length,i=offset;i>>0},ip.fromLong=function(ipl){return(ipl>>>24)+"."+(ipl>>16&255)+"."+(ipl>>8&255)+"."+(255&ipl)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(8),multibase=__webpack_require__(66),multicodec=__webpack_require__(67),codecs=__webpack_require__(29),codecVarints=__webpack_require__(46),multihash=__webpack_require__(8);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function Data(type,data){if(!(this instanceof Data))return new Data(type,data);if(types.indexOf(type)===-1)throw new Error("Type: "+type+" is not valid");this.type=type,this.data=data,this.blockSizes=[],this.addBlockSize=(size=>{this.blockSizes.push(size)}),this.removeBlockSize=(index=>{this.blockSizes.splice(index,1)}),this.fileSize=(()=>{if(!(dirTypes.indexOf(this.type)>=0)){let sum=0;return this.blockSizes.forEach(size=>{sum+=size}),data&&(sum+=data.length),sum}}),this.marshal=(()=>{let type;switch(this.type){case"raw":type=unixfsData.DataType.Raw;break;case"directory":type=unixfsData.DataType.Directory;break;case"file":type=unixfsData.DataType.File;break;case"metadata":type=unixfsData.DataType.Metadata;break;case"symlink":type=unixfsData.DataType.Symlink;break;case"hamt-sharded-directory":type=unixfsData.DataType.HAMTShard;break;default:throw new Error(`Unkown type: "${this.type}"`)}let fileSize=this.fileSize();return fileSize||(fileSize=void 0),unixfsData.encode({Type:type,Data:this.data,filesize:fileSize,blocksizes:this.blockSizes.length>0?this.blockSizes:void 0,hashType:this.hashType,fanout:this.fanout})})}const protobuf=__webpack_require__(32),pb=protobuf(__webpack_require__(186)),unixfsData=pb.Data,types=["raw","directory","file","metadata","symlink","hamt-sharded-directory"],dirTypes=["directory","hamt-sharded-directory"];Data.unmarshal=(marsheled=>{const decoded=unixfsData.decode(marsheled);decoded.Data||(decoded.Data=void 0);const obj=new Data(types[decoded.Type],decoded.Data);return obj.blockSizes=decoded.blocksizes,obj}),module.exports=Data},function(module,exports,__webpack_require__){"use strict";module.exports=`message Data { enum DataType { Raw = 0; Directory = 1; File = 2; Metadata = 3; Symlink = 4; HAMTShard = 5; } required DataType Type = 1; optional bytes Data = 2; optional uint64 filesize = 3; repeated uint64 blocksizes = 4; optional uint64 hashType = 5; optional uint64 fanout = 6; } message Metadata { required string MimeType = 1; }`},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const mh=__webpack_require__(8),multibase=__webpack_require__(66),multicodec=__webpack_require__(67),codecs=__webpack_require__(29),codecVarints=__webpack_require__(46),multihash=__webpack_require__(8);class CID{constructor(version,codec,multihash){if("string"==typeof version)if(multibase.isEncoded(version)){const cid=multibase.decode(version);this.version=parseInt(cid.slice(0,1).toString("hex"),16),this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=mh.fromB58String(version),this.version=0;else if(Buffer.isBuffer(version)){const firstByte=version.slice(0,1),v=parseInt(firstByte.toString("hex"),16);if(0===v||1===v){const cid=version;this.version=v,this.codec=multicodec.getCodec(cid.slice(1)),this.multihash=multicodec.rmPrefix(cid.slice(1))}else this.codec="dag-pb",this.multihash=version,this.version=0}else if("number"==typeof version){if("string"!=typeof codec)throw new Error("codec must be string");if(0!==version&&1!==version)throw new Error("version must be a number equal to 0 or 1");mh.validate(multihash),this.codec=codec,this.version=version,this.multihash=multihash}}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return Buffer.concat([Buffer("01","hex"),Buffer(codecVarints[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return Buffer.concat([new Buffer(`0${this.version}`,"hex"),codecVarints[this.codec],multihash.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new CID(0,this.codec,this.multihash)}toV1(){return new CID(1,this.codec,this.multihash)}toBaseEncodedString(base){switch(base=base||"base58btc",this.version){case 0:if("base58btc"!==base)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return mh.toB58String(this.multihash);case 1:return multibase.encode(base,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(other){return this.codec===other.codec&&this.version===other.version&&this.multihash.equals(other.multihash)}}CID.codecs=codecs,CID.isCID=(other=>{return"CID"===other.constructor.name}),module.exports=CID}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function create(name,size,multihash,callback){callback(null,new DAGLink(name,size,multihash))}const DAGLink=__webpack_require__(19);module.exports=create},function(module,exports,__webpack_require__){"use strict";function addLink(node,link,callback){const links=cloneLinks(node),data=cloneData(node);if(link.constructor&&"DAGLink"===link.constructor.name);else if(link.constructor&&"DAGNode"===link.constructor.name)link=toDAGLink(link);else{link.multihash=link.multihash||link.hash;try{link=new DAGLink(link.name,link.size,link.multihash)}catch(err){return callback(err)}}links.push(link),create(data,links,callback)}const dagNodeUtil=__webpack_require__(43),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,toDAGLink=dagNodeUtil.toDAGLink,DAGLink=__webpack_require__(19),create=__webpack_require__(42);module.exports=addLink},function(module,exports,__webpack_require__){"use strict";function clone(dagNode,callback){create(cloneData(dagNode),cloneLinks(dagNode),callback)}const dagNodeUtil=__webpack_require__(43),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(42);module.exports=clone},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function rmLink(dagNode,nameOrMultihash,callback){const data=cloneData(dagNode);let links=cloneLinks(dagNode);if("string"==typeof nameOrMultihash)links=links.filter(link=>link.name!==nameOrMultihash);else{if(!Buffer.isBuffer(nameOrMultihash))return callback(new Error("second arg needs to be a name or multihash"),null);links=links.filter(link=>!link.multihash.equals(nameOrMultihash))}create(data,links,callback)}const dagNodeUtil=__webpack_require__(43),cloneLinks=dagNodeUtil.cloneLinks,cloneData=dagNodeUtil.cloneData,create=__webpack_require__(42);module.exports=rmLink}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";module.exports=`// An IPFS MerkleDAG Link message PBLink { // multihash of the target object optional bytes Hash = 1; // utf string name. should be unique per object optional string Name = 2; // cumulative size of target object optional uint64 Tsize = 3; } // An IPFS MerkleDAG Node message PBNode { // refs to other objects repeated PBLink Links = 2; // opaque user data optional bytes Data = 1; }`},function(module,exports,__webpack_require__){"use strict";const waterfall=__webpack_require__(79),util=__webpack_require__(58);exports=module.exports,exports.multicodec="dag-pb",exports.resolve=((block,path,callback)=>{waterfall([cb=>util.deserialize(block.data,cb),(node,cb)=>{const split=path.split("/");if("Links"===split[0]){let remainderPath="";if(!split[1])return cb(null,{value:node.links.map(l=>l.toJSON()),remainderPath:""});const values={};node.links.forEach((l,i)=>{const link=l.toJSON();values[i]={hash:link.multihash,name:link.name,size:link.size},values[link.name]=link.multihash});let value=values[split[1]];"Hash"===split[2]?value={"/":value.hash}:"Tsize"===split[2]?value={"/":value.size}:"Name"===split[2]&&(value={"/":value.name}),remainderPath=split.slice(3).join("/"),cb(null,{value:value,remainderPath:remainderPath})}else"Data"===split[0]?cb(null,{value:node.data,remainderPath:""}):cb(new Error("path not available"))}],callback)}),exports.tree=((block,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options=options||{},util.deserialize(block.data,(err,node)=>{if(err)return callback(err);const paths=[];paths.push("Links"),node.links.forEach((link,i)=>{paths.push(`Links/${i}/Name`),paths.push(`Links/${i}/Tsize`),paths.push(`Links/${i}/Hash`)}),paths.push("Data"),callback(null,paths)})}),exports.isLink=((block,path,callback)=>{exports.resolve(block,path,(err,result)=>{return err?callback(err):result.remainderPath.length>0?callback(new Error("path out of scope")):void("object"==typeof result.value&&result.value["/"]?callback(null,result.value):callback(null,!1))})})},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,murmur3:34,blake2b:64,blake2s:65},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3",64:"blake2b",65:"blake2s"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,64:64,65:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function validate(multihash){if(!Buffer.isBuffer(multihash))throw new Error("multihash must be a Buffer");if(multihash.length<3)throw new Error("multihash too short. must be > 3 bytes.");if(multihash.length>129)throw new Error("multihash too long. must be < 129 bytes.");let code=multihash[0];if(!exports.isValidCode(code))throw new Error(`multihash unknown function code: 0x${code.toString(16)}`);if(multihash.slice(2).length!==multihash[1])throw new Error(`multihash length inconsistent: 0x${multihash.toString("hex")}`)}const bs58=__webpack_require__(10),cs=__webpack_require__(194);exports.toHexString=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return hash.toString("hex")},exports.fromHexString=function(hash){return new Buffer(hash,"hex")},exports.toB58String=function(hash){if(!Buffer.isBuffer(hash))throw new Error("must be passed a buffer");return bs58.encode(hash)},exports.fromB58String=function(hash){let encoded=hash;return Buffer.isBuffer(hash)&&(encoded=hash.toString()),new Buffer(bs58.decode(encoded))},exports.decode=function(buf){exports.validate(buf);const code=buf[0];return{code:code,name:cs.codes[code],length:buf[1],digest:buf.slice(2)}},exports.encode=function(digest,code,length){if(!digest||!code)throw new Error("multihash encode requires at least two args: digest, code");const hashfn=exports.coerceCode(code);if(!Buffer.isBuffer(digest))throw new Error("digest should be a Buffer");if(null==length&&(length=digest.length),length&&digest.length!==length)throw new Error("digest length should be equal to specified length.");if(length>127)throw new Error("multihash does not yet support digest lengths greater than 127 bytes.");return Buffer.concat([new Buffer([hashfn,length]),digest])},exports.coerceCode=function(name){let code=name;if("string"==typeof name){if(!cs.names[name])throw new Error(`Unrecognized hash function named: ${name}`);code=cs.names[name]}if("number"!=typeof code)throw new Error(`Hash function code should be a number. Got: ${code}`);if(!cs.codes[code]&&!exports.isAppCode(code))throw new Error(`Unrecognized function code: ${code}`);return code},exports.isAppCode=function(code){return code>0&&code<16},exports.isValidCode=function(code){return!!exports.isAppCode(code)||!!cs.codes[code]},exports.validate=validate,exports.prefix=function(multihash){return validate(multihash),multihash.slice(0,2)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function isProperty(str){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)}module.exports=isProperty},function(module,exports,__webpack_require__){(function(process,global){!function(){"use strict";function Keccak(bits,padding,outputBits){this.blocks=[],this.s=[],this.padding=padding,this.outputBits=outputBits,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(bits<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=outputBits>>5,this.extraBytes=(31&outputBits)>>3;for(var i=0;i<50;++i)this.s[i]=0}function Kmac(bits,padding,outputBits){Keccak.call(this,bits,padding,outputBits)}var root="object"==typeof window?window:{};!root.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(root=global);var COMMON_JS=!root.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,ARRAY_BUFFER=!root.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),SHAKE_PADDING=[31,7936,2031616,520093696],CSHAKE_PADDING=[4,1024,262144,67108864],KECCAK_PADDING=[1,256,65536,16777216],PADDING=[6,1536,393216,100663296],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],BITS=[224,256,384,512],SHAKE_BITS=[128,256],OUTPUT_TYPES=["hex","buffer","arrayBuffer","array"],CSHAKE_BYTEPAD={128:168,256:136};!root.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(obj){return"[object Array]"===Object.prototype.toString.call(obj)});for(var createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}},createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}},createCshakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits,n,s){return methods["cshake"+bits].update(message,outputBits,n,s)[outputType]()}},createKmacOutputMethod=function(bits,padding,outputType){return function(key,message,outputBits,s){return methods["kmac"+bits].update(key,message,outputBits,s)[outputType]()}},createOutputMethods=function(method,createMethod,bits,padding){for(var i=0;i>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|63&code)<=57344?(blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|63&code)<=byteCount){for(this.start=i-byteCount,this.block=blocks[blockCount],i=0;i>=8,o=255&x;o>0;)bytes.unshift(o),x>>=8,o=255&x,++n;return right?bytes.push(n):bytes.unshift(n),this.update(bytes),bytes.length},Keccak.prototype.encodeString=function(str){str=str||"";var notString="string"!=typeof str;notString&&str.constructor===root.ArrayBuffer&&(str=new Uint8Array(str));var length=str.length;if(notString&&("number"!=typeof length||!Array.isArray(str)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(str))))throw"input is invalid type";var bytes=0;if(notString)bytes=length;else for(var i=0;i=57344?bytes+=3:(code=65536+((1023&code)<<10|1023&str.charCodeAt(++i)),bytes+=4)}return bytes+=this.encode(8*bytes),this.update(str),bytes},Keccak.prototype.bytepad=function(strs,w){for(var bytes=this.encode(w),i=0;i>2]|=this.padding[3&i],this.lastByteIndex===this.byteCount)for(blocks[0]=blocks[blockCount],i=1;i>4&15]+HEX_CHARS[15&block]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15];j%blockCount==0&&(f(s),i=0)}return extraBytes&&(block=s[i],extraBytes>0&&(hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[15&block]),extraBytes>1&&(hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]),extraBytes>2&&(hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15])),hex},Keccak.prototype.arrayBuffer=function(){this.finalize();var buffer,blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks,extraBytes=this.extraBytes,i=0,j=0,bytes=this.outputBits>>3;buffer=extraBytes?new ArrayBuffer(outputBlocks+1<<2):new ArrayBuffer(bytes);for(var array=new Uint32Array(buffer);j>8&255,array[offset+2]=block>>16&255,array[offset+3]=block>>24&255;j%blockCount==0&&f(s)}return extraBytes&&(offset=j<<2,block=s[i],extraBytes>0&&(array[offset]=255&block),extraBytes>1&&(array[offset+1]=block>>8&255),extraBytes>2&&(array[offset+2]=block>>16&255)),array},Kmac.prototype=new Keccak,Kmac.prototype.finalize=function(){return this.encode(this.outputBits,!0),Keccak.prototype.finalize.call(this)};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2)c0=s[0]^s[10]^s[20]^s[30]^s[40],c1=s[1]^s[11]^s[21]^s[31]^s[41],c2=s[2]^s[12]^s[22]^s[32]^s[42],c3=s[3]^s[13]^s[23]^s[33]^s[43],c4=s[4]^s[14]^s[24]^s[34]^s[44],c5=s[5]^s[15]^s[25]^s[35]^s[45],c6=s[6]^s[16]^s[26]^s[36]^s[46],c7=s[7]^s[17]^s[27]^s[37]^s[47],c8=s[8]^s[18]^s[28]^s[38]^s[48],c9=s[9]^s[19]^s[29]^s[39]^s[49],h=c8^(c2<<1|c3>>>31),l=c9^(c3<<1|c2>>>31),s[0]^=h,s[1]^=l,s[10]^=h,s[11]^=l,s[20]^=h,s[21]^=l,s[30]^=h,s[31]^=l,s[40]^=h,s[41]^=l,h=c0^(c4<<1|c5>>>31),l=c1^(c5<<1|c4>>>31),s[2]^=h,s[3]^=l,s[12]^=h,s[13]^=l,s[22]^=h,s[23]^=l,s[32]^=h,s[33]^=l,s[42]^=h,s[43]^=l,h=c2^(c6<<1|c7>>>31),l=c3^(c7<<1|c6>>>31),s[4]^=h,s[5]^=l,s[14]^=h,s[15]^=l,s[24]^=h,s[25]^=l,s[34]^=h,s[35]^=l,s[44]^=h,s[45]^=l,h=c4^(c8<<1|c9>>>31),l=c5^(c9<<1|c8>>>31),s[6]^=h,s[7]^=l,s[16]^=h,s[17]^=l,s[26]^=h,s[27]^=l,s[36]^=h,s[37]^=l,s[46]^=h,s[47]^=l,h=c6^(c0<<1|c1>>>31),l=c7^(c1<<1|c0>>>31),s[8]^=h,s[9]^=l,s[18]^=h,s[19]^=l,s[28]^=h,s[29]^=l,s[38]^=h,s[39]^=l,s[48]^=h,s[49]^=l,b0=s[0],b1=s[1],b32=s[11]<<4|s[10]>>>28,b33=s[10]<<4|s[11]>>>28,b14=s[20]<<3|s[21]>>>29,b15=s[21]<<3|s[20]>>>29,b46=s[31]<<9|s[30]>>>23,b47=s[30]<<9|s[31]>>>23,b28=s[40]<<18|s[41]>>>14,b29=s[41]<<18|s[40]>>>14,b20=s[2]<<1|s[3]>>>31,b21=s[3]<<1|s[2]>>>31,b2=s[13]<<12|s[12]>>>20,b3=s[12]<<12|s[13]>>>20,b34=s[22]<<10|s[23]>>>22,b35=s[23]<<10|s[22]>>>22,b16=s[33]<<13|s[32]>>>19,b17=s[32]<<13|s[33]>>>19,b48=s[42]<<2|s[43]>>>30,b49=s[43]<<2|s[42]>>>30,b40=s[5]<<30|s[4]>>>2,b41=s[4]<<30|s[5]>>>2,b22=s[14]<<6|s[15]>>>26,b23=s[15]<<6|s[14]>>>26,b4=s[25]<<11|s[24]>>>21,b5=s[24]<<11|s[25]>>>21,b36=s[34]<<15|s[35]>>>17,b37=s[35]<<15|s[34]>>>17,b18=s[45]<<29|s[44]>>>3,b19=s[44]<<29|s[45]>>>3,b10=s[6]<<28|s[7]>>>4,b11=s[7]<<28|s[6]>>>4,b42=s[17]<<23|s[16]>>>9,b43=s[16]<<23|s[17]>>>9,b24=s[26]<<25|s[27]>>>7,b25=s[27]<<25|s[26]>>>7,b6=s[36]<<21|s[37]>>>11,b7=s[37]<<21|s[36]>>>11,b38=s[47]<<24|s[46]>>>8,b39=s[46]<<24|s[47]>>>8,b30=s[8]<<27|s[9]>>>5,b31=s[9]<<27|s[8]>>>5,b12=s[18]<<20|s[19]>>>12,b13=s[19]<<20|s[18]>>>12,b44=s[29]<<7|s[28]>>>25,b45=s[28]<<7|s[29]>>>25,b26=s[38]<<8|s[39]>>>24,b27=s[39]<<8|s[38]>>>24,b8=s[48]<<14|s[49]>>>18,b9=s[49]<<14|s[48]>>>18,s[0]=b0^~b2&b4,s[1]=b1^~b3&b5,s[10]=b10^~b12&b14,s[11]=b11^~b13&b15,s[20]=b20^~b22&b24,s[21]=b21^~b23&b25,s[30]=b30^~b32&b34,s[31]=b31^~b33&b35,s[40]=b40^~b42&b44,s[41]=b41^~b43&b45,s[2]=b2^~b4&b6,s[3]=b3^~b5&b7,s[12]=b12^~b14&b16,s[13]=b13^~b15&b17,s[22]=b22^~b24&b26,s[23]=b23^~b25&b27,s[32]=b32^~b34&b36,s[33]=b33^~b35&b37,s[42]=b42^~b44&b46,s[43]=b43^~b45&b47,s[4]=b4^~b6&b8,s[5]=b5^~b7&b9,s[14]=b14^~b16&b18,s[15]=b15^~b17&b19,s[24]=b24^~b26&b28,s[25]=b25^~b27&b29,s[34]=b34^~b36&b38,s[35]=b35^~b37&b39,s[44]=b44^~b46&b48,s[45]=b45^~b47&b49,s[6]=b6^~b8&b0,s[7]=b7^~b9&b1,s[16]=b16^~b18&b10,s[17]=b17^~b19&b11,s[26]=b26^~b28&b20,s[27]=b27^~b29&b21,s[36]=b36^~b38&b30,s[37]=b37^~b39&b31,s[46]=b46^~b48&b40,s[47]=b47^~b49&b41,s[8]=b8^~b0&b2,s[9]=b9^~b1&b3,s[18]=b18^~b10&b12,s[19]=b19^~b11&b13,s[28]=b28^~b20&b22,s[29]=b29^~b21&b23,s[38]=b38^~b30&b32,s[39]=b39^~b31&b33,s[48]=b48^~b40&b42,s[49]=b49^~b41&b43,s[0]^=RC[n],s[1]^=RC[n+1]};if(COMMON_JS)module.exports=methods;else for(var i=0;i=4.0.0",npm:">=3.0.0"},repository:{type:"git",url:"https://github.com/ipfs/js-ipfs-api"},devDependencies:{aegir:"^11.0.2",chai:"^4.1.1","dirty-chai":"^2.0.1","eslint-plugin-react":"^7.1.0",gulp:"^3.9.1",hapi:"^16.5.2","interface-ipfs-core":"~0.30.1","ipfsd-ctl":"~0.21.0","pre-commit":"^1.2.2","socket.io":"^2.0.3","socket.io-client":"^2.0.3","stream-equal":"^1.0.0"},"pre-commit":["lint","test"],keywords:["ipfs"],author:"Matt Bell ",contributors:["Alex Mingoia ","Connor Keenan ","Danny ","David Braun ","David Dias ","Fil ","Francisco Baio Dias ","Friedel Ziegelmayer ","Gavin McDermott ","Greenkeeper ","Haad ","Harlan T Wood ","Harlan T Wood ","Holodisc ","James Halliday ","Jason Carver ","Jason Papakostas ","Jeff Downie ","Jeromy ","Jeromy ","Joe Turgeon ","Juan Batiz-Benet ","Kevin Wang ","Kristoffer Ström ","Matt Bell ","Maxime Lathuilière ","Michael Muré ","Mitar ","Mithgol ","Nuno Nogueira ","Pedro Teixeira ","Richard Littauer ","Stephen Whitmore ","Tara Vancil ","Travis Person ","Victor Bjelkholm ","dmitriy ryajov ","elsehow ","ethers ","haad ","kumavis ","nginnever ","priecint ","samuli ","Łukasz Magiera ","ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ "],license:"MIT",bugs:{url:"https://github.com/ipfs/js-ipfs-api/issues"},homepage:"https://github.com/ipfs/js-ipfs-api"}},function(module,exports){function stringify(obj,replacer,spaces,cycleReplacer){return JSON.stringify(obj,serializer(replacer,cycleReplacer),spaces)}function serializer(replacer,cycleReplacer){var stack=[],keys=[];return null==cycleReplacer&&(cycleReplacer=function(key,value){return stack[0]===value?"[Circular ~]":"[Circular ~."+keys.slice(0,stack.indexOf(value)).join(".")+"]"}),function(key,value){if(stack.length>0){var thisPos=stack.indexOf(this);~thisPos?stack.splice(thisPos+1):stack.push(this),~thisPos?keys.splice(thisPos,1/0,key):keys.push(key),~stack.indexOf(value)&&(value=cycleReplacer.call(this,key,value))}else stack.push(value);return null==replacer?value:replacer.call(this,key,value)}}exports=module.exports=stringify,exports.getSerialize=serializer},function(module,exports,__webpack_require__){"use strict";const secp256k1=__webpack_require__(278),multihashing=__webpack_require__(30),setImmediate=__webpack_require__(54),HASH_ALGORITHM="sha2-256";module.exports=(randomBytes=>{function generateKey(callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let privateKey;do{privateKey=randomBytes(32)}while(!secp256k1.privateKeyVerify(privateKey));done(null,privateKey)}function hashAndSign(key,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{const sig=secp256k1.sign(digest,key),sigDER=secp256k1.signatureExport(sig.signature);return done(null,sigDER)}catch(err){done(err)}})}function hashAndVerify(key,sig,msg,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));multihashing.digest(msg,HASH_ALGORITHM,(err,digest)=>{if(err)return done(err);try{sig=secp256k1.signatureImport(sig);const valid=secp256k1.verify(digest,sig,key);return done(null,valid)}catch(err){done(err)}})}function compressPublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key");return secp256k1.publicKeyConvert(key,!0)}function decompressPublicKey(key){return secp256k1.publicKeyConvert(key,!1)}function validatePrivateKey(key){if(!secp256k1.privateKeyVerify(key))throw new Error("Invalid private key")}function validatePublicKey(key){if(!secp256k1.publicKeyVerify(key))throw new Error("Invalid public key")}function computePublicKey(privateKey){return validatePrivateKey(privateKey),secp256k1.publicKeyCreate(privateKey)}return{generateKey:generateKey,privateKeyLength:32,hashAndSign:hashAndSign,hashAndVerify:hashAndVerify,compressPublicKey:compressPublicKey,decompressPublicKey:decompressPublicKey,validatePrivateKey:validatePrivateKey,validatePublicKey:validatePublicKey,computePublicKey:computePublicKey}})},function(module,exports,__webpack_require__){"use strict";const multihashing=__webpack_require__(30);module.exports=((keysProtobuf,randomBytes,crypto)=>{function unmarshalSecp256k1PrivateKey(bytes,callback){callback(null,new Secp256k1PrivateKey(bytes),null)}function unmarshalSecp256k1PublicKey(bytes){return new Secp256k1PublicKey(bytes)}function generateKeyPair(_bits,callback){void 0===callback&&"function"==typeof _bits&&(callback=_bits),ensure(callback),crypto.generateKey((err,privateKeyBytes)=>{if(err)return callback(err);let privkey;try{privkey=new Secp256k1PrivateKey(privateKeyBytes)}catch(err){return callback(err)}callback(null,privkey)})}function ensure(callback){if("function"!=typeof callback)throw new Error("callback is required")}crypto=crypto||__webpack_require__(202)(randomBytes);class Secp256k1PublicKey{constructor(key){crypto.validatePublicKey(key),this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.compressPublicKey(this._key)}get bytes(){return keysProtobuf.PublicKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Secp256k1PrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey||crypto.computePublicKey(key),crypto.validatePrivateKey(this._key),crypto.validatePublicKey(this._publicKey)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){return new Secp256k1PublicKey(this._publicKey)}marshal(){return this._key}get bytes(){return keysProtobuf.PrivateKey.encode({Type:keysProtobuf.KeyType.Secp256k1,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}return{Secp256k1PublicKey:Secp256k1PublicKey,Secp256k1PrivateKey:Secp256k1PrivateKey,unmarshalSecp256k1PrivateKey:unmarshalSecp256k1PrivateKey,unmarshalSecp256k1PublicKey:unmarshalSecp256k1PublicKey,generateKeyPair:generateKeyPair}})},function(module,exports,__webpack_require__){"use strict";const crypto=__webpack_require__(164);module.exports={createCipheriv:crypto.createCipheriv,createDecipheriv:crypto.createDecipheriv}},function(module,exports,__webpack_require__){"use strict";const ciphers=__webpack_require__(204),CIPHER_MODES={16:"aes-128-ctr",32:"aes-256-ctr"};exports.create=function(key,iv,callback){const mode=CIPHER_MODES[key.length];if(!mode)return callback(new Error("Invalid key length"));const cipher=ciphers.createCipheriv(mode,key,iv),decipher=ciphers.createDecipheriv(mode,key,iv);callback(null,{encrypt(data,cb){cb(null,cipher.update(data))},decrypt(data,cb){cb(null,decipher.update(data))}})}},function(module,exports,__webpack_require__){"use strict";module.exports={SHA1:20,SHA256:32,SHA512:64}},function(module,exports,__webpack_require__){"use strict";const hmac=__webpack_require__(96),aes=__webpack_require__(205),keys=__webpack_require__(212);exports=module.exports,exports.aes=aes,exports.hmac=hmac,exports.keys=keys,exports.randomBytes=__webpack_require__(98)},function(module,exports,__webpack_require__){"use strict";function marshalPublicKey(jwk){const byteLen=curveLengths[jwk.crv];return Buffer.concat([Buffer.from([4]),toBn(jwk.x).toArrayLike(Buffer,"be",byteLen),toBn(jwk.y).toArrayLike(Buffer,"be",byteLen)],1+2*byteLen)}function unmarshalPublicKey(curve,key){const byteLen=curveLengths[curve];if(!key.slice(0,1).equals(Buffer.from([4])))throw new Error("Invalid key format");const x=new BN(key.slice(1,byteLen+1)),y=new BN(key.slice(1+byteLen));return{kty:"EC",crv:curve,x:toBase64(x,byteLen),y:toBase64(y,byteLen),ext:!0}}function unmarshalPrivateKey(curve,key){const result=unmarshalPublicKey(curve,key.public);return result.d=toBase64(new BN(key.private)),result}const webcrypto=__webpack_require__(61)(),nodeify=__webpack_require__(47),BN=__webpack_require__(18).bignum,Buffer=__webpack_require__(4).Buffer,util=__webpack_require__(99),toBase64=util.toBase64,toBn=util.toBn,bits={"P-256":256,"P-384":384,"P-521":521};exports.generateEphmeralKeyPair=function(curve,callback){nodeify(webcrypto.subtle.generateKey({name:"ECDH",namedCurve:curve},!0,["deriveBits"]).then(pair=>{const genSharedKey=(theirPub,forcePrivate,cb)=>{"function"==typeof forcePrivate&&(cb=forcePrivate,forcePrivate=void 0);let privateKey;privateKey=forcePrivate?webcrypto.subtle.importKey("jwk",unmarshalPrivateKey(curve,forcePrivate),{name:"ECDH",namedCurve:curve},!1,["deriveBits"]):Promise.resolve(pair.privateKey),nodeify(Promise.all([webcrypto.subtle.importKey("jwk",unmarshalPublicKey(curve,theirPub),{name:"ECDH",namedCurve:curve},!1,[]),privateKey]).then(keys=>webcrypto.subtle.deriveBits({name:"ECDH",namedCurve:curve,public:keys[0]},keys[1],bits[curve])).then(bits=>Buffer.from(bits)),cb)};return webcrypto.subtle.exportKey("jwk",pair.publicKey).then(publicKey=>{return{key:marshalPublicKey(publicKey),genSharedKey:genSharedKey}})}),callback)};const curveLengths={"P-256":32,"P-384":48,"P-521":66}},function(module,exports,__webpack_require__){"use strict";function unmarshalEd25519PrivateKey(bytes,callback){try{bytes=ensureKey(bytes,crypto.privateKeyLength+crypto.publicKeyLength)}catch(err){return callback(err)}callback(null,new Ed25519PrivateKey(bytes.slice(0,crypto.privateKeyLength),bytes.slice(crypto.privateKeyLength,bytes.length)))}function unmarshalEd25519PublicKey(bytes){return bytes=ensureKey(bytes,crypto.publicKeyLength),new Ed25519PublicKey(bytes)}function generateKeyPair(_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKey((err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function generateKeyPairFromSeed(seed,_bits,cb){void 0===cb&&"function"==typeof _bits&&(cb=_bits),crypto.generateKeyFromSeed(seed,(err,keys)=>{if(err)return cb(err);let privkey;try{privkey=new Ed25519PrivateKey(keys.secretKey,keys.publicKey)}catch(err){return void cb(err)}cb(null,privkey)})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}function ensureKey(key,length){if(Buffer.isBuffer(key)&&(key=new Uint8Array(key)),!(key instanceof Uint8Array)||key.length!==length)throw new Error("Key must be a Uint8Array or Buffer of length "+length);return key}const multihashing=__webpack_require__(30),protobuf=__webpack_require__(32),Buffer=__webpack_require__(4).Buffer,crypto=__webpack_require__(210),pbm=protobuf(__webpack_require__(60));class Ed25519PublicKey{constructor(key){this._key=ensureKey(key,crypto.publicKeyLength)}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return Buffer.from(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class Ed25519PrivateKey{constructor(key,publicKey){this._key=ensureKey(key,crypto.privateKeyLength),this._publicKey=ensureKey(publicKey,crypto.publicKeyLength)}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new Ed25519PublicKey(this._publicKey)}marshal(){return Buffer.concat([Buffer.from(this._key),Buffer.from(this._publicKey)])}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.Ed25519,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={Ed25519PublicKey:Ed25519PublicKey,Ed25519PrivateKey:Ed25519PrivateKey,unmarshalEd25519PrivateKey:unmarshalEd25519PrivateKey,unmarshalEd25519PublicKey:unmarshalEd25519PublicKey,generateKeyPair:generateKeyPair,generateKeyPairFromSeed:generateKeyPairFromSeed}},function(module,exports,__webpack_require__){"use strict";const nacl=__webpack_require__(300),setImmediate=__webpack_require__(54),Buffer=__webpack_require__(4).Buffer;exports.publicKeyLength=nacl.sign.publicKeyLength,exports.privateKeyLength=nacl.sign.secretKeyLength,exports.generateKey=function(callback){const done=(err,res)=>setImmediate(()=>{callback(err,res)});let keys;try{keys=nacl.sign.keyPair()}catch(err){return done(err)}done(null,keys)},exports.generateKeyFromSeed=function(seed,callback){const done=(err,res)=>setImmediate(()=>callback(err,res));let keys;try{keys=nacl.sign.keyPair.fromSeed(seed)}catch(err){return done(err)}done(null,keys)},exports.hashAndSign=function(key,msg,callback){setImmediate(()=>{callback(null,Buffer.from(nacl.sign.detached(msg,key)))})},exports.hashAndVerify=function(key,sig,msg,callback){setImmediate(()=>{callback(null,nacl.sign.detached.verify(msg,sig,key))})}},function(module,exports,__webpack_require__){"use strict";const ecdh=__webpack_require__(208);module.exports=((curve,callback)=>{ecdh.generateEphmeralKeyPair(curve,callback)})},function(module,exports,__webpack_require__){"use strict";function isValidKeyType(keyType){return void 0!==supportedKeys[keyType.toLowerCase()]}const protobuf=__webpack_require__(32),keysPBM=protobuf(__webpack_require__(60));exports=module.exports;const supportedKeys={rsa:__webpack_require__(214),ed25519:__webpack_require__(209),secp256k1:__webpack_require__(203)(keysPBM,__webpack_require__(98))};exports.supportedKeys=supportedKeys,exports.keysPBM=keysPBM,exports.keyStretcher=__webpack_require__(213),exports.generateEphemeralKeyPair=__webpack_require__(211),exports.generateKeyPair=((type,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];if(!key)return cb(new Error("invalid or unsupported key type"));key.generateKeyPair(bits,cb)}),exports.generateKeyPairFromSeed=((type,seed,bits,cb)=>{let key=supportedKeys[type.toLowerCase()];return key?"ed25519"!==type.toLowerCase()?cb(new Error("Seed key derivation is unimplemented for RSA or secp256k1")):void key.generateKeyPairFromSeed(seed,bits,cb):cb(new Error("invalid or unsupported key type"))}),exports.unmarshalPublicKey=(buf=>{const decoded=keysPBM.PublicKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPublicKey(decoded.Data);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PublicKey(decoded.Data);case keysPBM.KeyType.Secp256k1:if(supportedKeys.secp256k1)return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(decoded.Data);throw new Error("secp256k1 support requires libp2p-crypto-secp256k1 package");default:throw new Error("invalid or unsupported key type")}}),exports.marshalPublicKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes}),exports.unmarshalPrivateKey=((buf,callback)=>{const decoded=keysPBM.PrivateKey.decode(buf);switch(decoded.Type){case keysPBM.KeyType.RSA:return supportedKeys.rsa.unmarshalRsaPrivateKey(decoded.Data,callback);case keysPBM.KeyType.Ed25519:return supportedKeys.ed25519.unmarshalEd25519PrivateKey(decoded.Data,callback);case keysPBM.KeyType.Secp256k1:return supportedKeys.secp256k1?supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(decoded.Data,callback):callback(new Error("secp256k1 support requires libp2p-crypto-secp256k1 package"));default:callback(new Error("invalid or unsupported key type"))}}),exports.marshalPrivateKey=((key,type)=>{if(type=(type||"rsa").toLowerCase(),!isValidKeyType(type))throw new Error("invalid or unsupported key type");return key.bytes})},function(module,exports,__webpack_require__){"use strict";const whilst=__webpack_require__(155),Buffer=__webpack_require__(4).Buffer,hmac=__webpack_require__(96),cipherMap={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};module.exports=((cipherType,hash,secret,callback)=>{const cipher=cipherMap[cipherType];if(!cipher)return callback(new Error("unkown cipherType passed"));if(!hash)return callback(new Error("unkown hashType passed"));const cipherKeySize=cipher.keySize,ivSize=cipher.ivSize,seed=Buffer.from("key expansion"),resultLength=2*(ivSize+cipherKeySize+20);hmac.create(hash,secret,(err,m)=>{if(err)return callback(err);m.digest(seed,(err,a)=>{function stretch(cb){m.digest(Buffer.concat([a,seed]),(err,b)=>{if(err)return cb(err);let todo=b.length;j+todo>resultLength&&(todo=resultLength-j),result.push(b),j+=todo,m.digest(a,(err,_a)=>{if(err)return cb(err);a=_a,cb()})})}function finish(err){if(err)return callback(err);const half=resultLength/2,resultBuffer=Buffer.concat(result),r1=resultBuffer.slice(0,half),r2=resultBuffer.slice(half,resultLength),createKey=res=>({iv:res.slice(0,ivSize),cipherKey:res.slice(ivSize,ivSize+cipherKeySize),macKey:res.slice(ivSize+cipherKeySize)});callback(null,{k1:createKey(r1),k2:createKey(r2)})}if(err)return callback(err);let result=[],j=0;whilst(()=>j{if(err)return callback(err);callback(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function unmarshalRsaPublicKey(bytes){return new RsaPublicKey(crypto.utils.pkixToJwk(bytes))}function generateKeyPair(bits,cb){crypto.generateKey(bits,(err,keys)=>{if(err)return cb(err);cb(null,new RsaPrivateKey(keys.privateKey,keys.publicKey))})}function ensure(cb){if("function"!=typeof cb)throw new Error("callback is required")}const multihashing=__webpack_require__(30),protobuf=__webpack_require__(32),crypto=__webpack_require__(97),pbm=protobuf(__webpack_require__(60));class RsaPublicKey{constructor(key){this._key=key}verify(data,sig,callback){ensure(callback),crypto.hashAndVerify(this._key,sig,data,callback)}marshal(){return crypto.utils.jwkToPkix(this._key)}get bytes(){return pbm.PublicKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}encrypt(bytes){return this._key.encrypt(bytes,"RSAES-PKCS1-V1_5")}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}class RsaPrivateKey{constructor(key,publicKey){this._key=key,this._publicKey=publicKey}genSecret(){return crypto.getRandomValues(new Uint8Array(16))}sign(message,callback){ensure(callback),crypto.hashAndSign(this._key,message,callback)}get public(){if(!this._publicKey)throw new Error("public key not provided");return new RsaPublicKey(this._publicKey)}decrypt(msg,callback){crypto.decrypt(this._key,msg,callback)}marshal(){return crypto.utils.jwkToPkcs1(this._key)}get bytes(){return pbm.PrivateKey.encode({Type:pbm.KeyType.RSA,Data:this.marshal()})}equals(key){return this.bytes.equals(key.bytes)}hash(callback){ensure(callback),multihashing(this.bytes,"sha2-256",callback)}}module.exports={RsaPublicKey:RsaPublicKey,RsaPrivateKey:RsaPrivateKey,unmarshalRsaPublicKey:unmarshalRsaPublicKey,unmarshalRsaPrivateKey:unmarshalRsaPrivateKey,generateKeyPair:generateKeyPair}},function(module,exports,__webpack_require__){"use strict";const asn1=__webpack_require__(18),util=__webpack_require__(99),toBase64=util.toBase64,toBn=util.toBn,RSAPrivateKey=asn1.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),AlgorithmIdentifier=asn1.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid({"1.2.840.113549.1.1.1":"rsa"}),this.key("none").optional().null_(),this.key("curve").optional().objid(),this.key("params").optional().seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()))}),PublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier),this.key("subjectPublicKey").bitstr())}),RSAPublicKey=asn1.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});exports.pkcs1ToJwk=function(bytes){const asn1=RSAPrivateKey.decode(bytes,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),d:toBase64(asn1.privateExponent),p:toBase64(asn1.prime1),q:toBase64(asn1.prime2),dp:toBase64(asn1.exponent1),dq:toBase64(asn1.exponent2),qi:toBase64(asn1.coefficient),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkcs1=function(jwk){return RSAPrivateKey.encode({version:0,modulus:toBn(jwk.n),publicExponent:toBn(jwk.e),privateExponent:toBn(jwk.d),prime1:toBn(jwk.p),prime2:toBn(jwk.q),exponent1:toBn(jwk.dp),exponent2:toBn(jwk.dq),coefficient:toBn(jwk.qi)},"der")},exports.pkixToJwk=function(bytes){const ndata=PublicKey.decode(bytes,"der"),asn1=RSAPublicKey.decode(ndata.subjectPublicKey.data,"der");return{kty:"RSA",n:toBase64(asn1.modulus),e:toBase64(asn1.publicExponent),alg:"RS256",kid:"2011-04-29"}},exports.jwkToPkix=function(jwk){return PublicKey.encode({algorithm:{algorithm:"rsa",none:null},subjectPublicKey:{data:RSAPublicKey.encode({modulus:toBn(jwk.n),publicExponent:toBn(jwk.e)},"der")}},"der")}},function(module,exports,__webpack_require__){(function(global,module){function arrayFilter(array,predicate){for(var index=-1,length=array?array.length:0,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=function(eachFunc,fromRight){return function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=fromRight?length:-1,iterable=Object(collection);(fromRight?index--:++index-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=array?array.length:0;++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?data.push([key,value]):data[index][1]=value,this}function MapCache(entries){var index=-1,length=entries?entries.length:0;for(this.clear();++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++indexarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&UNORDERED_COMPARE_FLAG?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index-1&&value%1==0&&value-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return!!value&&("object"==type||"function"==type)}function isObjectLike(value){return!!value&&"object"==typeof value}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&objectToString.call(value)==symbolTag}function toString(value){return null==value?"":baseToString(value)}function get(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function identity(value){return value}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)} var LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",UNORDERED_COMPARE_FLAG=1,PARTIAL_COMPARE_FLAG=2,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,reLeadingDot=/^\./,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsUint=/^(?:0|[1-9]\d*)$/,typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags["[object WeakMap]"]=!1;var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding("util")}catch(e){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Symbol=root.Symbol,Uint8Array=root.Uint8Array,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&"[object Promise]"!=getTag(Promise.resolve())||Set&&getTag(new Set)!=setTag||WeakMap&&"[object WeakMap]"!=getTag(new WeakMap))&&(getTag=function(value){var result=objectToString.call(value),Ctor=result==objectTag?value.constructor:void 0,ctorString=Ctor?toSource(Ctor):void 0;if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return"[object Promise]";case setCtorString:return setTag;case weakMapCtorString:return"[object WeakMap]"}return result});var stringToPath=memoize(function(string){string=toString(string);var result=[];return reLeadingDot.test(string)&&result.push(""),string.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(match,number,quote,string){result.push(quote?string.replace(/\\(\\)?/g,"$1"):number||match)}),result});memoize.Cache=MapCache;var isArray=Array.isArray,isTypedArray=nodeIsTypedArray?function(func){return function(value){return func(value)}}(nodeIsTypedArray):baseIsTypedArray;module.exports=uniqBy}).call(exports,__webpack_require__(5),__webpack_require__(17)(module))},function(module,exports,__webpack_require__){function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value)!inherited&&!hasOwnProperty.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}var baseTimes=__webpack_require__(222),isArguments=__webpack_require__(231),isArray=__webpack_require__(103),isBuffer=__webpack_require__(232),isIndex=__webpack_require__(225),isTypedArray=__webpack_require__(234),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;module.exports=arrayLikeKeys},function(module,exports,__webpack_require__){function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag}var baseGetTag=__webpack_require__(63),isObjectLike=__webpack_require__(64),argsTag="[object Arguments]";module.exports=baseIsArguments},function(module,exports,__webpack_require__){function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]}var baseGetTag=__webpack_require__(63),isLength=__webpack_require__(104),isObjectLike=__webpack_require__(64),typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1,module.exports=baseIsTypedArray},function(module,exports,__webpack_require__){function baseKeys(object){if(!isPrototype(object))return nativeKeys(object);var result=[];for(var key in Object(object))hasOwnProperty.call(object,key)&&"constructor"!=key&&result.push(key);return result}var isPrototype=__webpack_require__(226),nativeKeys=__webpack_require__(227),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;module.exports=baseKeys},function(module,exports){function baseTimes(n,iteratee){for(var index=-1,result=Array(n);++index-1&&value%1==0&&value>>32-n}function fnF(a,b,c,d,m,k,s){return rotl(a+(b&c|~b&d)+m+k|0,s)+b|0}function fnG(a,b,c,d,m,k,s){return rotl(a+(b&d|c&~d)+m+k|0,s)+b|0}function fnH(a,b,c,d,m,k,s){return rotl(a+(b^c^d)+m+k|0,s)+b|0}function fnI(a,b,c,d,m,k,s){return rotl(a+(c^(b|~d))+m+k|0,s)+b|0}var inherits=__webpack_require__(2),HashBase=__webpack_require__(238),ARRAY16=new Array(16);inherits(MD5,HashBase),MD5.prototype._update=function(){for(var M=ARRAY16,i=0;i<16;++i)M[i]=this._block.readInt32LE(4*i);var a=this._a,b=this._b,c=this._c,d=this._d;a=fnF(a,b,c,d,M[0],3614090360,7),d=fnF(d,a,b,c,M[1],3905402710,12),c=fnF(c,d,a,b,M[2],606105819,17),b=fnF(b,c,d,a,M[3],3250441966,22),a=fnF(a,b,c,d,M[4],4118548399,7),d=fnF(d,a,b,c,M[5],1200080426,12),c=fnF(c,d,a,b,M[6],2821735955,17),b=fnF(b,c,d,a,M[7],4249261313,22),a=fnF(a,b,c,d,M[8],1770035416,7),d=fnF(d,a,b,c,M[9],2336552879,12),c=fnF(c,d,a,b,M[10],4294925233,17),b=fnF(b,c,d,a,M[11],2304563134,22),a=fnF(a,b,c,d,M[12],1804603682,7),d=fnF(d,a,b,c,M[13],4254626195,12),c=fnF(c,d,a,b,M[14],2792965006,17),b=fnF(b,c,d,a,M[15],1236535329,22),a=fnG(a,b,c,d,M[1],4129170786,5),d=fnG(d,a,b,c,M[6],3225465664,9),c=fnG(c,d,a,b,M[11],643717713,14),b=fnG(b,c,d,a,M[0],3921069994,20),a=fnG(a,b,c,d,M[5],3593408605,5),d=fnG(d,a,b,c,M[10],38016083,9),c=fnG(c,d,a,b,M[15],3634488961,14),b=fnG(b,c,d,a,M[4],3889429448,20),a=fnG(a,b,c,d,M[9],568446438,5),d=fnG(d,a,b,c,M[14],3275163606,9),c=fnG(c,d,a,b,M[3],4107603335,14),b=fnG(b,c,d,a,M[8],1163531501,20),a=fnG(a,b,c,d,M[13],2850285829,5),d=fnG(d,a,b,c,M[2],4243563512,9),c=fnG(c,d,a,b,M[7],1735328473,14),b=fnG(b,c,d,a,M[12],2368359562,20),a=fnH(a,b,c,d,M[5],4294588738,4),d=fnH(d,a,b,c,M[8],2272392833,11),c=fnH(c,d,a,b,M[11],1839030562,16),b=fnH(b,c,d,a,M[14],4259657740,23),a=fnH(a,b,c,d,M[1],2763975236,4),d=fnH(d,a,b,c,M[4],1272893353,11),c=fnH(c,d,a,b,M[7],4139469664,16),b=fnH(b,c,d,a,M[10],3200236656,23),a=fnH(a,b,c,d,M[13],681279174,4),d=fnH(d,a,b,c,M[0],3936430074,11),c=fnH(c,d,a,b,M[3],3572445317,16),b=fnH(b,c,d,a,M[6],76029189,23),a=fnH(a,b,c,d,M[9],3654602809,4),d=fnH(d,a,b,c,M[12],3873151461,11),c=fnH(c,d,a,b,M[15],530742520,16),b=fnH(b,c,d,a,M[2],3299628645,23),a=fnI(a,b,c,d,M[0],4096336452,6),d=fnI(d,a,b,c,M[7],1126891415,10),c=fnI(c,d,a,b,M[14],2878612391,15),b=fnI(b,c,d,a,M[5],4237533241,21),a=fnI(a,b,c,d,M[12],1700485571,6),d=fnI(d,a,b,c,M[3],2399980690,10),c=fnI(c,d,a,b,M[10],4293915773,15),b=fnI(b,c,d,a,M[1],2240044497,21),a=fnI(a,b,c,d,M[8],1873313359,6),d=fnI(d,a,b,c,M[15],4264355552,10),c=fnI(c,d,a,b,M[6],2734768916,15),b=fnI(b,c,d,a,M[13],1309151649,21),a=fnI(a,b,c,d,M[4],4149444226,6),d=fnI(d,a,b,c,M[11],3174756917,10),c=fnI(c,d,a,b,M[2],718787259,15),b=fnI(b,c,d,a,M[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+b|0,this._c=this._c+c|0,this._d=this._d+d|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var buffer=new Buffer(16);return buffer.writeInt32LE(this._a,0),buffer.writeInt32LE(this._b,4),buffer.writeInt32LE(this._c,8),buffer.writeInt32LE(this._d,12),buffer},module.exports=MD5}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function throwIfNotStringOrBuffer(val,prefix){if(!Buffer.isBuffer(val)&&"string"!=typeof val)throw new TypeError(prefix+" must be a string or a buffer")}function HashBase(blockSize){Transform.call(this),this._block=Buffer.allocUnsafe(blockSize),this._blockSize=blockSize,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}var Buffer=__webpack_require__(4).Buffer,Transform=__webpack_require__(16).Transform;__webpack_require__(2)(HashBase,Transform),HashBase.prototype._transform=function(chunk,encoding,callback){var error=null;try{this.update(chunk,encoding)}catch(err){error=err}callback(error)},HashBase.prototype._flush=function(callback){var error=null;try{this.push(this.digest())}catch(err){error=err}callback(error)},HashBase.prototype.update=function(data,encoding){if(throwIfNotStringOrBuffer(data,"Data"),this._finalized)throw new Error("Digest already called");Buffer.isBuffer(data)||(data=Buffer.from(data,encoding));for(var block=this._block,offset=0;this._blockOffset+data.length-offset>=this._blockSize;){for(var i=this._blockOffset;i0;++j)this._length[j]+=carry,(carry=this._length[j]/4294967296|0)>0&&(this._length[j]-=4294967296*carry);return this},HashBase.prototype._update=function(){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(encoding){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var digest=this._digest();void 0!==encoding&&(digest=digest.toString(encoding)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return digest},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase},function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}module.exports=assert,assert.equal=function(l,r,msg){if(l!=r)throw new Error(msg||"Assertion failed: "+l+" != "+r)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function stringToStringTuples(str){const tuples=[],parts=str.split("/").slice(1);if(1===parts.length&&""===parts[0])return[];for(let p=0;p=parts.length)throw ParseError("invalid address: "+str);tuples.push([part,parts[p]])}else tuples.push([part])}return tuples}function stringTuplesToString(tuples){const parts=[];return map(tuples,function(tup){const proto=protoFromTuple(tup);parts.push(proto.name),tup.length>1&&parts.push(tup[1])}),"/"+parts.join("/")}function stringTuplesToTuples(tuples){return map(tuples,function(tup){Array.isArray(tup)||(tup=[tup]);const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toBuffer(proto.code,tup[1])]:[proto.code]})}function tuplesToStringTuples(tuples){return map(tuples,function(tup){const proto=protoFromTuple(tup);return tup.length>1?[proto.code,convert.toString(proto.code,tup[1])]:[proto.code]})}function tuplesToBuffer(tuples){return fromBuffer(Buffer.concat(map(tuples,function(tup){const proto=protoFromTuple(tup);let buf=new Buffer(varint.encode(proto.code));return tup.length>1&&(buf=Buffer.concat([buf,tup[1]])),buf})))}function sizeForAddr(p,addr){if(p.size>0)return p.size/8;if(0===p.size)return 0;{const size=varint.decode(addr);return size+varint.decode.bytes}}function bufferToTuples(buf){const tuples=[];let i=0;for(;ibuf.length)throw ParseError("Invalid address buffer: "+buf.toString("hex"));tuples.push([code,addr])}else tuples.push([code]),i+=n}return tuples}function bufferToString(buf){return stringTuplesToString(tuplesToStringTuples(bufferToTuples(buf)))}function stringToBuffer(str){return str=cleanPath(str),tuplesToBuffer(stringTuplesToTuples(stringToStringTuples(str)))}function fromString(str){return stringToBuffer(str)}function fromBuffer(buf){const err=validateBuffer(buf);if(err)throw err;return new Buffer(buf)}function validateBuffer(buf){try{bufferToTuples(buf)}catch(err){return err}}function isValidBuffer(buf){return void 0===validateBuffer(buf)}function cleanPath(str){return"/"+filter(str.trim().split("/")).join("/")}function ParseError(str){return new Error("Error parsing address: "+str)}function protoFromTuple(tup){return protocols(tup[0])}const map=__webpack_require__(62),filter=__webpack_require__(216),convert=__webpack_require__(241),protocols=__webpack_require__(65),varint=__webpack_require__(12);module.exports={stringToStringTuples:stringToStringTuples,stringTuplesToString:stringTuplesToString,tuplesToStringTuples:tuplesToStringTuples,stringTuplesToTuples:stringTuplesToTuples,bufferToTuples:bufferToTuples,tuplesToBuffer:tuplesToBuffer,bufferToString:bufferToString,stringToBuffer:stringToBuffer,fromString:fromString,fromBuffer:fromBuffer,validateBuffer:validateBuffer,isValidBuffer:isValidBuffer,cleanPath:cleanPath,ParseError:ParseError,protoFromTuple:protoFromTuple,sizeForAddr:sizeForAddr}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function Convert(proto,a){return a instanceof Buffer?Convert.toString(proto,a):Convert.toBuffer(proto,a)}function port2buf(port){const buf=new Buffer(2);return buf.writeUInt16BE(port,0),buf}function buf2port(buf){return buf.readUInt16BE(0)}function str2buf(str){const buf=new Buffer(str),size=new Buffer(varint.encode(buf.length));return Buffer.concat([size,buf])}function buf2str(buf){const size=varint.decode(buf);if(buf=buf.slice(varint.decode.bytes),buf.length!==size)throw new Error("inconsistent lengths");return buf.toString()}function mh2buf(hash){const mh=new Buffer(bs58.decode(hash)),size=new Buffer(varint.encode(mh.length));return Buffer.concat([size,mh])}function buf2mh(buf){const size=varint.decode(buf),address=buf.slice(varint.decode.bytes);if(address.length!==size)throw new Error("inconsistent lengths");return bs58.encode(address)}const ip=__webpack_require__(183),protocols=__webpack_require__(65),bs58=__webpack_require__(10),varint=__webpack_require__(12);module.exports=Convert,Convert.toString=function(proto,buf){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toString(buf);case 6:case 17:case 33:case 132:return buf2port(buf);case 53:case 54:case 55:return buf2str(buf);case 421:return buf2mh(buf);default:return buf.toString("hex")}},Convert.toBuffer=function(proto,str){switch(proto=protocols(proto),proto.code){case 4:case 41:return ip.toBuffer(str);case 6:case 17:case 33:case 132:return port2buf(parseInt(str,10));case 53:case 54:case 55:return str2buf(str);case 421:return mh2buf(str);default:return new Buffer(str,"hex")}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){module.exports=function(ALPHABET){function encode(source){if(0===source.length)return"";for(var digits=[0],i=0;i0;)digits.push(carry%BASE),carry=carry/BASE|0}for(var string="",k=0;0===source[k]&&k=0;--q)string+=ALPHABET[digits[q]];return string}function decodeUnsafe(string){if(0===string.length)return Buffer.allocUnsafe(0);for(var bytes=[0],i=0;i>=8;for(;carry>0;)bytes.push(255&carry),carry>>=8}for(var k=0;string[k]===LEADER&&k{return prev[tupple[0]]=new Base(tupple[0],tupple[1],tupple[2],tupple[3]),prev},{}),codes=constants.reduce((prev,tupple)=>{return prev[tupple[1]]=names[tupple[0]],prev},{});module.exports={names:names,codes:codes}},function(module,exports,__webpack_require__){"use strict";const baseTable=__webpack_require__(29),nameTable={};module.exports=nameTable;for(let encodingName in baseTable){let code=baseTable[encodingName];nameTable[code.toString("hex")]=encodingName}},function(module,exports,__webpack_require__){"use strict";exports.names={sha1:17,"sha2-256":18,"sha2-512":19,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664},exports.codes={17:"sha1",18:"sha2-256",19:"sha2-512",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256"},exports.defaultLengths={17:20,18:32,19:64,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60, 45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const blake=__webpack_require__(162),toCallback=__webpack_require__(107).toCallback,blake2b={init:blake.blake2bInit,update:blake.blake2bUpdate,digest:blake.blake2bFinal},blake2s={init:blake.blake2sInit,update:blake.blake2sUpdate,digest:blake.blake2sFinal},makeB2Hash=(size,hf)=>toCallback(buf=>{const ctx=hf.init(size,null);return hf.update(ctx,buf),new Buffer(hf.digest(ctx))});module.exports=(table=>{for(let i=0;i<64;i++)table[45569+i]=makeB2Hash(i+1,blake2b);for(let i=0;i<32;i++)table[45633+i]=makeB2Hash(i+1,blake2s)})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function webCryptoHash(type){if(!webCrypto)throw new Error("Please use a browser with webcrypto support");return(data,callback)=>{const res=webCrypto.digest({name:type},data);if("function"!=typeof res.then)return res.onerror=(()=>{callback(`Error hashing data using ${type}`)}),void(res.oncomplete=(e=>{callback(null,e.target.result)}));nodeify(res.then(raw=>new Buffer(new Uint8Array(raw))),callback)}}function sha1(buf,callback){webCryptoHash("SHA-1")(buf,callback)}function sha2256(buf,callback){webCryptoHash("SHA-256")(buf,callback)}function sha2512(buf,callback){webCryptoHash("SHA-512")(buf,callback)}const nodeify=__webpack_require__(47),webCrypto=function(){return self.crypto?self.crypto.subtle||self.crypto.webkitSubtle:self.msCrypto?self.msCrypto.subtle:void 0}();module.exports={sha1:sha1,sha2256:sha2256,sha2512:sha2512}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const sha3=__webpack_require__(197),murmur3=__webpack_require__(252),utils=__webpack_require__(107),sha=__webpack_require__(249),toCallback=utils.toCallback,toBuf=utils.toBuf,fromString=utils.fromString,fromNumberTo32BitBuf=utils.fromNumberTo32BitBuf;module.exports={sha1:sha.sha1,sha2256:sha.sha2256,sha2512:sha.sha2512,sha3512:toCallback(toBuf(sha3.sha3_512)),sha3384:toCallback(toBuf(sha3.sha3_384)),sha3256:toCallback(toBuf(sha3.sha3_256)),sha3224:toCallback(toBuf(sha3.sha3_224)),shake128:toCallback(toBuf(sha3.shake_128,256)),shake256:toCallback(toBuf(sha3.shake_256,512)),keccak224:toCallback(toBuf(sha3.keccak_224)),keccak256:toCallback(toBuf(sha3.keccak_256)),keccak384:toCallback(toBuf(sha3.keccak_384)),keccak512:toCallback(toBuf(sha3.keccak_512)),murmur3128:toCallback(toBuf(fromString(murmur3.x64.hash128))),murmur332:toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),addBlake:__webpack_require__(248)}},function(module,exports,__webpack_require__){function Multipart(boundary){if(!this instanceof Multipart)return new Multipart(boundary);this.boundary=boundary||Math.random().toString(36).slice(2),Sandwich.call(this,{head:"--"+this.boundary+CRNL,tail:CRNL+"--"+this.boundary+"--",separator:CRNL+"--"+this.boundary+CRNL}),this._add=this.add,this.add=this.addPart}var Sandwich=__webpack_require__(277).SandwichStream,stream=__webpack_require__(16),inherits=__webpack_require__(2),isStream=__webpack_require__(93),CRNL="\r\n";module.exports=Multipart,inherits(Multipart,Sandwich),Multipart.prototype.addPart=function(part){part=part||{};var partStream=new stream.PassThrough;if(part.headers)for(var key in part.headers){var header=part.headers[key];partStream.write(key+": "+header+CRNL)}partStream.write(CRNL),isStream(part.body)?part.body.pipe(partStream):partStream.end(part.body),this._add(partStream)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(253)},function(module,exports,__webpack_require__){!function(root,undefined){"use strict";function _x86Multiply(m,n){return(65535&m)*n+(((m>>>16)*n&65535)<<16)}function _x86Rotl(m,n){return m<>>32-n}function _x86Fmix(h){return h^=h>>>16,h=_x86Multiply(h,2246822507),h^=h>>>13,h=_x86Multiply(h,3266489909),h^=h>>>16}function _x64Add(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]+n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]+n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]+n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]+n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Multiply(m,n){m=[m[0]>>>16,65535&m[0],m[1]>>>16,65535&m[1]],n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];var o=[0,0,0,0];return o[3]+=m[3]*n[3],o[2]+=o[3]>>>16,o[3]&=65535,o[2]+=m[2]*n[3],o[1]+=o[2]>>>16,o[2]&=65535,o[2]+=m[3]*n[2],o[1]+=o[2]>>>16,o[2]&=65535,o[1]+=m[1]*n[3],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[2]*n[2],o[0]+=o[1]>>>16,o[1]&=65535,o[1]+=m[3]*n[1],o[0]+=o[1]>>>16,o[1]&=65535,o[0]+=m[0]*n[3]+m[1]*n[2]+m[2]*n[1]+m[3]*n[0],o[0]&=65535,[o[0]<<16|o[1],o[2]<<16|o[3]]}function _x64Rotl(m,n){return n%=64,32===n?[m[1],m[0]]:n<32?[m[0]<>>32-n,m[1]<>>32-n]:(n-=32,[m[1]<>>32-n,m[0]<>>32-n])}function _x64LeftShift(m,n){return n%=64,0===n?m:n<32?[m[0]<>>32-n,m[1]<>>1]),h=_x64Multiply(h,[4283543511,3981806797]),h=_x64Xor(h,[0,h[0]>>>1]),h=_x64Multiply(h,[3301882366,444984403]),h=_x64Xor(h,[0,h[0]>>>1])}var library={version:"3.0.1",x86:{},x64:{}};library.x86.hash32=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%4,bytes=key.length-remainder,h1=seed,k1=0,c1=3432918353,c2=461845907,i=0;i>>0},library.x86.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=seed,h2=seed,h3=seed,h4=seed,k1=0,k2=0,k3=0,k4=0,c1=597399067,c2=2869860233,c3=951274213,c4=2716044179,i=0;i>>0).toString(16)).slice(-8)+("00000000"+(h2>>>0).toString(16)).slice(-8)+("00000000"+(h3>>>0).toString(16)).slice(-8)+("00000000"+(h4>>>0).toString(16)).slice(-8)},library.x64.hash128=function(key,seed){key=key||"",seed=seed||0;for(var remainder=key.length%16,bytes=key.length-remainder,h1=[0,seed],h2=[0,seed],k1=[0,0],k2=[0,0],c1=[2277735313,289559509],c2=[1291169091,658871167],i=0;i>>0).toString(16)).slice(-8)+("00000000"+(h1[1]>>>0).toString(16)).slice(-8)+("00000000"+(h2[0]>>>0).toString(16)).slice(-8)+("00000000"+(h2[1]>>>0).toString(16)).slice(-8)},void 0!==module&&module.exports&&(exports=module.exports=library),exports.murmurHash3=library}()},function(module,exports,__webpack_require__){(function(process){function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);return path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))},exports.relative=function(from,to){function trim(arr){for(var start=0;start=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;i{if("function"==typeof id)return callback=id,id=null,void Id.create((err,id)=>{if(err)return callback(err);callback(null,new PeerInfo(id))});callback(null,new PeerInfo(id))}),PeerInfo.isPeerInfo=(peerInfo=>{return Boolean("object"==typeof peerInfo&&peerInfo.id&&peerInfo.multiaddrs)}),module.exports=PeerInfo},function(module,exports,__webpack_require__){"use strict";const ensureMultiaddr=__webpack_require__(110).ensureMultiaddr,uniqBy=__webpack_require__(217);class MultiaddrSet{constructor(multiaddrs){this._multiaddrs=multiaddrs||[],this._observedMultiaddrs=[]}add(ma){ma=ensureMultiaddr(ma),this.has(ma)||this._multiaddrs.push(ma)}addSafe(ma){ma=ensureMultiaddr(ma),this._observedMultiaddrs.some((m,i)=>{if(m.equals(ma))return this.add(ma),this._observedMultiaddrs.splice(i,1),!0})||this._observedMultiaddrs.push(ma)}toArray(){return this._multiaddrs.slice()}get size(){return this._multiaddrs.length}forEach(fn){return this._multiaddrs.forEach(fn)}has(ma){return ma=ensureMultiaddr(ma),this._multiaddrs.some(m=>m.equals(ma))}delete(ma){ma=ensureMultiaddr(ma),this._multiaddrs.some((m,i)=>{if(m.equals(ma))return this._multiaddrs.splice(i,1),!0})}replace(existing,fresh){Array.isArray(existing)||(existing=[existing]),Array.isArray(fresh)||(fresh=[fresh]),existing.forEach(m=>this.delete(m)),fresh.forEach(m=>this.add(m))}clear(){this._multiaddrs=[]}distinct(){return uniqBy(this._multiaddrs,ma=>{return[ma.toOptions().port,ma.toOptions().transport].join()})}}module.exports=MultiaddrSet},function(module,exports,__webpack_require__){(function(process){function Promise(fn){function next(skipTimeout){waiting.length?(running=!0,waiting.shift()(skipTimeout||!1)):running=!1}function then(cb,eb){return new Promise(function(resolver){function done(skipTimeout){function timeoutDone(){var val;try{val=callback(value)}catch(ex){return resolver.reject(ex),next()}resolver.fulfill(val),next(!0)}var callback=isFulfilled?cb:eb;"function"==typeof callback?skipTimeout?timeoutDone():nextTick(timeoutDone):isFulfilled?(resolver.fulfill(value),next(skipTimeout)):(resolver.reject(value),next(skipTimeout))}waiting.push(done),isResolved&&!running&&next()})}if(!(this instanceof Promise))return"function"==typeof fn?new Promise(fn):defer();var value,isResolved=!1,isFulfilled=!1,waiting=[],running=!1;this.then=then,function(){function fulfill(val){isResolved||(isPromise(val)?val.then(fulfill,reject):(isResolved=isFulfilled=!0,value=val,next()))}function reject(err){isResolved||(isResolved=!0,isFulfilled=!1,value=err,next())}for(var resolver={fulfill:fulfill,reject:reject},i=0;i"!==tokens[0])throw new Error("Unexpected token in map type: "+tokens[0]);tokens.shift(),field.name=tokens.shift();break;case"repeated":case"required":case"optional":var t=tokens.shift();field.required="required"===t,field.repeated="repeated"===t,field.type=tokens.shift(),field.name=tokens.shift();break;case"[":field.options=onfieldoptions(tokens);break;case";":if(null===field.name)throw new Error("Missing field name");if(null===field.type)throw new Error("Missing type in message field: "+field.name);if(field.tag===-1)throw new Error("Missing tag number in message field: "+field.name);return tokens.shift(),field;default:throw new Error("Unexpected token in message field: "+tokens[0])}throw new Error("No ; found for message field")},onmessagebody=function(tokens){for(var body={enums:[],messages:[],fields:[],extends:[],extensions:null};tokens.length;)switch(tokens[0]){case"map":case"repeated":case"optional":case"required":body.fields.push(onfield(tokens));break;case"enum":body.enums.push(onenum(tokens));break;case"message":body.messages.push(onmessage(tokens));break;case"extensions":body.extensions=onextensions(tokens);break;case"oneof":tokens.shift();var name=tokens.shift();if("{"!==tokens[0])throw new Error("Unexpected token in oneof: "+tokens[0]);for(tokens.shift();"}"!==tokens[0];){tokens.unshift("optional");var field=onfield(tokens);field.oneof=name,body.fields.push(field)}tokens.shift();break;case"extend":body.extends.push(onextend(tokens));break;case";":tokens.shift();break;case"reserved":case"option":for(tokens.shift();";"!==tokens[0];)tokens.shift();break;default:tokens.unshift("optional"),body.fields.push(onfield(tokens))}return body},onextend=function(tokens){return{name:tokens[1],message:onmessage(tokens)}},onextensions=function(tokens){tokens.shift();var from=Number(tokens.shift());if(isNaN(from))throw new Error("Invalid from in extensions definition");if("to"!==tokens.shift())throw new Error("Expected keyword 'to' in extensions definition");var to=tokens.shift();if("max"===to&&(to=536870911),to=Number(to),isNaN(to))throw new Error("Invalid to in extensions definition");if(";"!==tokens.shift())throw new Error("Missing ; in extensions definition");return{from:from,to:to}},onmessage=function(tokens){tokens.shift();var lvl=1,body=[],msg={name:tokens.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("{"===tokens[0]?lvl++:"}"===tokens[0]&&lvl--,!lvl)return tokens.shift(),body=onmessagebody(body),msg.enums=body.enums,msg.messages=body.messages,msg.fields=body.fields,msg.extends=body.extends,msg.extensions=body.extensions,msg;body.push(tokens.shift())}if(lvl)throw new Error("No closing tag for message")},onpackagename=function(tokens){tokens.shift();var name=tokens.shift();if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),name},onsyntaxversion=function(tokens){if(tokens.shift(),"="!==tokens[0])throw new Error("Expected = but found "+tokens[0]);tokens.shift();var version=tokens.shift();switch(version){case'"proto2"':version=2;break;case'"proto3"':version=3;break;default:throw new Error("Expected protobuf syntax version but found "+version)}if(";"!==tokens[0])throw new Error("Expected ; but found "+tokens[0]);return tokens.shift(),version},onenumvalue=function(tokens){if(tokens.length<4)throw new Error("Invalid enum value: "+tokens.slice(0,3).join(" "));if("="!==tokens[1])throw new Error("Expected = but found "+tokens[1]);if(";"!==tokens[3]&&"["!==tokens[3])throw new Error("Expected ; or [ but found "+tokens[1]);var name=tokens.shift();tokens.shift();var val={value:null,options:{}};return val.value=Number(tokens.shift()),"["===tokens[0]&&(val.options=onfieldoptions(tokens)),tokens.shift(),{name:name,val:val}},onenum=function(tokens){tokens.shift();var options={},e={name:tokens.shift(),values:{},options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),e;if("option"!==tokens[0]){var val=onenumvalue(tokens);e.values[val.name]=val.val}else options=onoption(tokens),e.options[options.name]=options.value}throw new Error("No closing tag for enum")},onoption=function(tokens){for(var name=null,value=null;tokens.length;){if(";"===tokens[0])return tokens.shift(),{name:name,value:value};switch(tokens[0]){case"option":tokens.shift();var hasBracket="("===tokens[0];if(hasBracket&&tokens.shift(),name=tokens.shift(),hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}"."===tokens[0][0]&&(name+=tokens.shift());break;case"=":if(tokens.shift(),null===name)throw new Error("Expected key for option with value: "+tokens[0]);if(value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"optimize_for"===name&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value))throw new Error("Unexpected value for option optimize_for: "+value);"{"===value&&(value=onoptionMap(tokens));break;default:throw new Error("Unexpected token in option: "+tokens[0])}}},onoptionMap=function(tokens){for(var map={};tokens.length;){if("}"===tokens[0])return tokens.shift(),map;var hasBracket="("===tokens[0];hasBracket&&tokens.shift();var key=tokens.shift();if(hasBracket){if(")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);tokens.shift()}var value=null;switch(tokens[0]){case":":if(void 0!==map[key])throw new Error("Duplicate option map key "+key);tokens.shift(),value=function(value){return"true"===value||"false"!==value&&value.replace(/^"+|"+$/gm,"")}(tokens.shift()),"{"===value&&(value=onoptionMap(tokens)),map[key]=value;break;case"{":if(tokens.shift(),value=onoptionMap(tokens),void 0===map[key]&&(map[key]=[]),!Array.isArray(map[key]))throw new Error("Duplicate option map key "+key);map[key].push(value);break;default:throw new Error("Unexpected token in option map: "+tokens[0])}}throw new Error("No closing tag for option map")},onimport=function(tokens){tokens.shift();var file=tokens.shift().replace(/^"+|"+$/gm,"");if(";"!==tokens[0])throw new Error("Unexpected token: "+tokens[0]+'. Expected ";"');return tokens.shift(),file},onservice=function(tokens){tokens.shift();var service={name:tokens.shift(),methods:[],options:{}};if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),service;switch(tokens[0]){case"option":var opt=onoption(tokens);if(void 0!==service.options[opt.name])throw new Error("Duplicate option "+opt.name);service.options[opt.name]=opt.value;break;case"rpc":service.methods.push(onrpc(tokens));break;default:throw new Error("Unexpected token in service: "+tokens[0])}}throw new Error("No closing tag for service")},onrpc=function(tokens){tokens.shift();var rpc={name:tokens.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.client_streaming=!0),rpc.input_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),"returns"!==tokens[0])throw new Error("Expected returns but found "+tokens[0]);if(tokens.shift(),"("!==tokens[0])throw new Error("Expected ( but found "+tokens[0]);if(tokens.shift(),"stream"===tokens[0]&&(tokens.shift(),rpc.server_streaming=!0),rpc.output_type=tokens.shift(),")"!==tokens[0])throw new Error("Expected ) but found "+tokens[0]);if(tokens.shift(),";"===tokens[0])return tokens.shift(),rpc;if("{"!==tokens[0])throw new Error("Expected { but found "+tokens[0]);for(tokens.shift();tokens.length;){if("}"===tokens[0])return tokens.shift(),";"===tokens[0]&&tokens.shift(),rpc;if("option"!==tokens[0])throw new Error("Unexpected token in rpc options: "+tokens[0]);var opt=onoption(tokens);if(void 0!==rpc.options[opt.name])throw new Error("Duplicate option "+opt.name);rpc.options[opt.name]=opt.value}throw new Error("No closing tag for rpc")},parse=function(buf){for(var tokens=tokenize(buf.toString()),i=0;imsg.extensions.to)throw new Error(msg.name+" does not declare "+field.tag+" as an extension number");msg.fields.push(field)})})}),schema.messages.forEach(function(msg){msg.fields.forEach(function(field){function enumNameIsFieldType(en){return en.name===field.type}function enumNameIsNestedEnumName(en){return en.name===nestedEnumName}var fieldSplit,messageName,nestedEnumName,message;if(field.options&&"true"===field.options.packed&&PACKABLE_TYPES.indexOf(field.type)===-1){if(field.type.indexOf(".")===-1){if(msg.enums&&msg.enums.some(enumNameIsFieldType))return}else{if(fieldSplit=field.type.split("."),fieldSplit.length>2)throw new Error("what is this?");if(messageName=fieldSplit[0],nestedEnumName=fieldSplit[1],schema.messages.some(function(msg){if(msg.name===messageName)return message=msg,msg}),message&&message.enums&&message.enums.some(enumNameIsNestedEnumName))return}throw new Error("Fields of type "+field.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}})}),schema};module.exports=parse},function(module,exports){var onfield=function(f,result){var prefix=f.repeated?"repeated":f.required?"required":"optional";"map"===f.type&&(prefix="map<"+f.map.from+","+f.map.to+">"),f.oneof&&(prefix="");var opts=Object.keys(f.options||{}).map(function(key){return key+" = "+f.options[key]}).join(",");return opts&&(opts=" ["+opts+"]"),result.push((prefix?prefix+" ":"")+("map"===f.map?"":f.type+" ")+f.name+" = "+f.tag+opts+";"),result},onmessage=function(m,result){result.push("message "+m.name+" {"),m.enums||(m.enums=[]),m.enums.forEach(function(e){result.push(onenum(e,[]))}),m.messages||(m.messages=[]),m.messages.forEach(function(m){result.push(onmessage(m,[]))});var oneofs={};return m.fields||(m.fields=[]),m.fields.forEach(function(f){f.oneof?(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(onfield(f,[]))):result.push(onfield(f,[]))}),Object.keys(oneofs).forEach(function(n){oneofs[n].unshift("oneof "+n+" {"),oneofs[n].push("}"),result.push(oneofs[n])}),result.push("}",""),result},onenum=function(e,result){result.push("enum "+e.name+" {"),e.options||(e.options={});var options=onoption(e.options,[]);return options.length>1&&result.push(options.slice(0,-1)),Object.keys(e.values).map(function(v){var val=onenumvalue(e.values[v]);result.push([v+" = "+val+";"])}),result.push("}",""),result},onenumvalue=function(v,result){var opts=Object.keys(v.options||{}).map(function(key){return key+" = "+v.options[key]}).join(",") ;return opts&&(opts=" ["+opts+"]"),v.value+opts},onoption=function(o,result){var keys=Object.keys(o);return keys.forEach(function(option){var v=o[option];~option.indexOf(".")&&(option="("+option+")");var type=typeof v;"object"===type?(v=onoptionMap(v,[]),v.length&&result.push("option "+option+" = {",v,"};")):("string"===type&&"optimize_for"!==option&&(v='"'+v+'"'),result.push("option "+option+" = "+v+";"))}),keys.length>0&&result.push(""),result},onoptionMap=function(o,result){return Object.keys(o).forEach(function(k){var v=o[k],type=typeof v;"object"===type?Array.isArray(v)?v.forEach(function(v){v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")}):(v=onoptionMap(v,[]),v.length&&result.push(k+" {",v,"}")):("string"===type&&(v='"'+v+'"'),result.push(k+": "+v))}),result},onservices=function(s,result){return result.push("service "+s.name+" {"),s.options||(s.options={}),onoption(s.options,result),s.methods||(s.methods=[]),s.methods.forEach(function(m){result.push(onrpc(m,[]))}),result.push("}",""),result},onrpc=function(rpc,result){var def="rpc "+rpc.name+"(";rpc.client_streaming&&(def+="stream "),def+=rpc.input_type+") returns (",rpc.server_streaming&&(def+="stream "),def+=rpc.output_type+")",rpc.options||(rpc.options={});var options=onoption(rpc.options,[]);return options.length>1?result.push(def+" {",options.slice(0,-1),"}"):result.push(def+";"),result},indent=function(lvl){return function(line){return Array.isArray(line)?line.map(indent(lvl+" ")).join("\n"):lvl+line}};module.exports=function(schema){var result=[];return result.push('syntax = "proto'+schema.syntax+'";',""),schema.package&&result.push("package "+schema.package+";",""),schema.options||(schema.options={}),onoption(schema.options,result),schema.enums||(schema.enums=[]),schema.enums.forEach(function(e){onenum(e,result)}),schema.messages||(schema.messages=[]),schema.messages.forEach(function(m){onmessage(m,result)}),schema.services&&schema.services.forEach(function(s){onservices(s,result)}),result.map(indent("")).join("\n")}},function(module,exports){module.exports=function(sch){var noComments=function(line){var i=line.indexOf("//");return i>-1?line.slice(0,i):line},trim=function(line){return line.trim()};return sch.replace(/([;,{}\(\)=\:\[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(trim).filter(Boolean).map(noComments).map(trim).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter(function(){var inside=!1;return function(token){return"/*"===token?(inside=!0,!1):"*/"===token?(inside=!1,!1):!inside}}())}},function(module,exports,__webpack_require__){(function(Buffer){var encodings=__webpack_require__(263),varint=__webpack_require__(12),genobj=__webpack_require__(177),genfun=__webpack_require__(176),flatten=function(values){if(!values)return null;var result={};return Object.keys(values).forEach(function(k){result[k]=values[k].value}),result},skip=function(type,buffer,offset){switch(type){case 0:return varint.decode(buffer,offset),offset+varint.decode.bytes;case 1:return offset+8;case 2:var len=varint.decode(buffer,offset);return offset+varint.decode.bytes+len;case 3:case 4:throw new Error("Groups are not supported");case 5:return offset+4}throw new Error("Unknown wire type: "+type)},defined=function(val){return null!==val&&void 0!==val&&("number"!=typeof val||!isNaN(val))},isString=function(def){try{return!!def&&"string"==typeof JSON.parse(def)}catch(err){return!1}},defaultValue=function(f,def){if(f.map)return"{}";if(f.repeated)return"[]";switch(f.type){case"string":return isString(def)?def:'""';case"bool":return"true"===def?"true":"false";case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return""+Number(def||0);default:return"null"}};module.exports=function(schema,extraEncodings){var messages={},enums={},cache={},visit=function(schema,prefix){schema.enums&&schema.enums.forEach(function(e){e.id=prefix+(prefix?".":"")+e.name,enums[e.id]=e,visit(e,e.id)}),schema.messages&&schema.messages.forEach(function(m){m.id=prefix+(prefix?".":"")+m.name,messages[m.id]=m,m.fields.forEach(function(f){if(f.map){var name="Map_"+f.map.from+"_"+f.map.to,map={name:name,enums:[],messages:[],fields:[{name:"key",type:f.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:f.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:prefix+(prefix?".":"")+name};messages[map.id]||(messages[map.id]=map,schema.messages.push(map)),f.type=name,f.repeated=!0}}),visit(m,m.id)})};visit(schema,"");var compileEnum=function(e){var conditions=Object.keys(e.values).map(function(k){return"val !== "+parseInt(e.values[k].value,10)}).join(" && ");conditions||(conditions="true");var encode=genfun()("function encode (val, buf, offset) {")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("varint.encode(val, buf, offset)")("encode.bytes = varint.encode.bytes")("return buf")("}").toFunction({varint:varint}),decode=genfun()("function decode (buf, offset) {")("var val = varint.decode(buf, offset)")('if (%s) throw new Error("Invalid enum value: "+val)',conditions)("decode.bytes = varint.decode.bytes")("return val")("}").toFunction({varint:varint});return encodings.make(0,encode,decode,varint.encodingLength)},compileMessage=function(m,exports){m.messages.forEach(function(nested){exports[nested.name]=resolve(nested.name,m.id)}),m.enums.forEach(function(val){exports[val.name]=flatten(val.values)}),exports.type=2,exports.message=!0,exports.name=m.name;var oneofs={};m.fields.forEach(function(f){f.oneof&&(oneofs[f.oneof]||(oneofs[f.oneof]=[]),oneofs[f.oneof].push(f.name))});var enc=m.fields.map(function(f){return resolve(f.type,m.id)}),forEach=function(fn){for(var i=0;i 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,hl=varint.encodingLength(f.tag<<3|e.type);f.required?encodingLength("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encodingLength("if (defined(%s)) {",val),f.map&&(encodingLength()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed?(encodingLength()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("var len = enc[%d].encodingLength(%s)",i,val+"[i]")("packedLen += len"),e.message&&encodingLength("packedLen += varint.encodingLength(len)"),encodingLength("}")("if (packedLen) {")("length += %d + packedLen + varint.encodingLength(packedLen)",hl)("}")):(f.repeated&&(encodingLength("for (var i = 0; i < %s.length; i++) {",val),val+="[i]",encodingLength("if (!defined(%s)) continue",val)),encodingLength("var len = enc[%d].encodingLength(%s)",i,val),e.message&&encodingLength("length += varint.encodingLength(len)"),encodingLength("length += %d + len",hl),f.repeated&&encodingLength("}")),f.required||encodingLength("}")}),encodingLength()("return length")("}"),encodingLength=encodingLength.toFunction({defined:defined,varint:varint,enc:enc});var encode=genfun()("function encode (obj, buf, offset) {")("if (!offset) offset = 0")("if (!buf) buf = new Buffer(encodingLength(obj))")("var oldOffset = offset");Object.keys(oneofs).forEach(function(name){var msg=JSON.stringify("only one of the properties defined in oneof "+name+" can be set");encode("if ((%s) > 1) throw new Error(%s)",oneofs[name].map(function(prop){return"+defined("+genobj("obj",prop)+")"}).join(" + "),msg)}),forEach(function(e,f,val,i){f.required?encode("if (!defined(%s)) throw new Error(%s)",val,JSON.stringify(f.name+" is required")):encode("if (defined(%s)) {",val);var j,packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed,p=varint.encode(f.tag<<3|2),h=varint.encode(f.tag<<3|e.type);if(f.map&&(encode()("var tmp = Object.keys(%s)",val)("for (var i = 0; i < tmp.length; i++) {")("tmp[i] = {key: tmp[i], value: %s[tmp[i]]}",val)("}"),val="tmp"),packed){for(encode()("var packedLen = 0")("for (var i = 0; i < %s.length; i++) {",val)("if (!defined(%s)) continue",val+"[i]")("packedLen += enc[%d].encodingLength(%s)",i,val+"[i]")("}"),encode("if (packedLen) {"),j=0;j> 3")("switch (tag) {"),forEach(function(e,f,val,i){var packed=f.repeated&&f.options&&f.options.packed&&"false"!==f.options.packed;decode("case %d:",f.tag),f.oneof&&m.fields.forEach(function(otherField){otherField.oneof===f.oneof&&f.name!==otherField.name&&decode("delete %s",genobj("obj",otherField.name))}),packed&&decode()("var packedEnd = varint.decode(buf, offset)")("offset += varint.decode.bytes")("packedEnd += offset")("while (offset < packedEnd) {"),e.message?(decode("var len = varint.decode(buf, offset)"),decode("offset += varint.decode.bytes"),f.map?(decode("var tmp = enc[%d].decode(buf, offset, offset + len)",i),decode("%s[tmp.key] = tmp.value",val)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset, offset + len))",val,i):decode("%s = enc[%d].decode(buf, offset, offset + len)",val,i)):f.repeated?decode("%s.push(enc[%d].decode(buf, offset))",val,i):decode("%s = enc[%d].decode(buf, offset)",val,i),decode("offset += enc[%d].decode.bytes",i),packed&&decode("}"),f.required&&decode("found%d = true",i),decode("break")}),decode()("default:")("offset = skip(prefix & 7, buf, offset)")("}")("}")("}"),decode=decode.toFunction({varint:varint,skip:skip,enc:enc}),encode.bytes=decode.bytes=0,exports.buffer=!0,exports.encode=encode,exports.decode=decode,exports.encodingLength=encodingLength,exports},resolve=function(name,from,compile){if(extraEncodings&&extraEncodings[name])return extraEncodings[name];if(encodings[name])return encodings[name];var m=(from?from+"."+name:name).split(".").map(function(part,i,list){return list.slice(0,i).concat(name).join(".")}).reverse().reduce(function(result,id){return result||messages[id]||enums[id]},null);if(compile===!1)return m;if(!m)throw new Error("Could not resolve "+name);return m.values?compileEnum(m):cache[m.id]||compileMessage(m,cache[m.id]={})};return(schema.enums||[]).concat((schema.messages||[]).map(function(message){return resolve(message.id)}))}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){var varint=__webpack_require__(12),svarint=__webpack_require__(290),encoder=function(type,encode,decode,encodingLength){return encode.bytes=decode.bytes=0,{type:type,encode:encode,decode:decode,encodingLength:encodingLength}};exports.make=encoder,exports.bytes=function(tag){var bufferLength=function(val){return Buffer.isBuffer(val)?val.length:Buffer.byteLength(val)},encodingLength=function(val){var len=bufferLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=bufferLength(val);return varint.encode(len,buffer,offset),offset+=varint.encode.bytes,Buffer.isBuffer(val)?val.copy(buffer,offset):buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.slice(offset,offset+len);return offset+=val.length,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.string=function(){var encodingLength=function(val){var len=Buffer.byteLength(val);return varint.encodingLength(len)+len},encode=function(val,buffer,offset){var oldOffset=offset,len=Buffer.byteLength(val);return varint.encode(len,buffer,offset,"utf-8"),offset+=varint.encode.bytes,buffer.write(val,offset,len),offset+=len,encode.bytes=offset-oldOffset,buffer},decode=function(buffer,offset){var oldOffset=offset,len=varint.decode(buffer,offset);offset+=varint.decode.bytes;var val=buffer.toString("utf-8",offset,offset+len);return offset+=len,decode.bytes=offset-oldOffset,val};return encoder(2,encode,decode,encodingLength)}(),exports.bool=function(){var encodingLength=function(val){return 1},encode=function(val,buffer,offset){return buffer[offset]=val?1:0,encode.bytes=1,buffer},decode=function(buffer,offset){var bool=buffer[offset]>0;return decode.bytes=1,bool};return encoder(0,encode,decode,encodingLength)}(),exports.int32=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);return decode.bytes=varint.decode.bytes,val>2147483647?val-4294967296:val},encodingLength=function(val){return varint.encodingLength(val<0?val+4294967296:val)};return encoder(0,varint.encode,decode,encodingLength)}(),exports.int64=function(){var decode=function(buffer,offset){var val=varint.decode(buffer,offset);if(val>=Math.pow(2,63)){for(var limit=9;255===buffer[offset+limit-1];)limit--;limit=limit||9;var subset=new Buffer(limit);buffer.copy(subset,0,offset,offset+limit),subset[limit-1]=127&subset[limit-1],val=-1*varint.decode(subset,0),decode.bytes=10}else decode.bytes=varint.decode.bytes;return val},encode=function(val,buffer,offset){if(val<0){var last=offset+9;for(varint.encode(val*-1,buffer,offset),offset+=varint.encode.bytes-1,buffer[offset]=128|buffer[offset];offset1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,"."),result+map(string.split("."),fn).join(".")}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;counter=55296&&value<=56319&&counter65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return codePoint-48<10?codePoint-22:codePoint-65<26?codePoint-65:codePoint-97<26?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),basic<0&&(basic=0),j=0;j=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;index=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(digitfloor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;jmaxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias,!(q= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return punycode}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}()}).call(exports,__webpack_require__(17)(module),__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";var stringify=__webpack_require__(269),parse=__webpack_require__(268),formats=__webpack_require__(111);module.exports={formats:formats,parse:parse,stringify:stringify}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(69),has=Object.prototype.hasOwnProperty,defaults={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:utils.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},parseValues=function(str,options){for(var obj={},cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str,limit=options.parameterLimit===1/0?void 0:options.parameterLimit,parts=cleanStr.split(options.delimiter,limit),i=0;i=0&&options.parseArrays&&index<=options.arrayLimit?(obj=[],obj[index]=parseObject(chain,val,options)):obj[cleanRoot]=parseObject(chain,val,options)}return obj},parseKeys=function(givenKey,val,options){if(givenKey){var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey,brackets=/(\[[^[\]]*])/,child=/(\[[^[\]]*])/g,segment=brackets.exec(key),parent=segment?key.slice(0,segment.index):key,keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)&&!options.allowPrototypes)return;keys.push(parent)}for(var i=0;null!==(segment=child.exec(key))&&i0?prefix+joined:""}},function(module,exports,__webpack_require__){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;i=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},function(module,exports,__webpack_require__){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}()},function(module,exports,__webpack_require__){module.exports=__webpack_require__(7).PassThrough},function(module,exports,__webpack_require__){module.exports=__webpack_require__(70)},function(module,exports,__webpack_require__){function SandwichStream(options){Readable.call(this,options),options=options||{},this._streamsActive=!1,this._streamsAdded=!1,this._streams=[],this._currentStream=void 0,this._errorsEmitted=!1,options.head&&(this._head=options.head),options.tail&&(this._tail=options.tail),options.separator&&(this._separator=options.separator)}function sandwichStream(options){return new SandwichStream(options)}var Readable=__webpack_require__(16).Readable;__webpack_require__(16).PassThrough;SandwichStream.prototype=Object.create(Readable.prototype,{constructor:SandwichStream}),SandwichStream.prototype._read=function(){this._streamsActive||(this._streamsActive=!0,this._pushHead(),this._streamNextStream())},SandwichStream.prototype.add=function(newStream){if(this._streamsActive)throw new Error("SandwichStream error adding new stream while streaming");this._streamsAdded=!0,this._streams.push(newStream),newStream.on("error",this._substreamOnError.bind(this))},SandwichStream.prototype._substreamOnError=function(error){this._errorsEmitted=!0,this.emit("error",error)},SandwichStream.prototype._pushHead=function(){this._head&&this.push(this._head)},SandwichStream.prototype._streamNextStream=function(){this._nextStream()?this._bindCurrentStreamEvents():(this._pushTail(),this.push(null))},SandwichStream.prototype._nextStream=function(){return this._currentStream=this._streams.shift(),void 0!==this._currentStream},SandwichStream.prototype._bindCurrentStreamEvents=function(){this._currentStream.on("readable",this._currentStreamOnReadable.bind(this)),this._currentStream.on("end",this._currentStreamOnEnd.bind(this))},SandwichStream.prototype._currentStreamOnReadable=function(){this.push(this._currentStream.read()||"")},SandwichStream.prototype._currentStreamOnEnd=function(){this._pushSeparator(),this._streamNextStream()},SandwichStream.prototype._pushSeparator=function(){this._streams.length>0&&this._separator&&this.push(this._separator)},SandwichStream.prototype._pushTail=function(){this._tail&&this.push(this._tail)},sandwichStream.SandwichStream=SandwichStream,module.exports=sandwichStream},function(module,exports,__webpack_require__){"use strict";module.exports=__webpack_require__(281)(__webpack_require__(284))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var toString=Object.prototype.toString;exports.isArray=function(value,message){if(!Array.isArray(value))throw TypeError(message)},exports.isBoolean=function(value,message){if("[object Boolean]"!==toString.call(value))throw TypeError(message)},exports.isBuffer=function(value,message){if(!Buffer.isBuffer(value))throw TypeError(message)},exports.isFunction=function(value,message){if("[object Function]"!==toString.call(value))throw TypeError(message)},exports.isNumber=function(value,message){if("[object Number]"!==toString.call(value))throw TypeError(message)},exports.isObject=function(value,message){if("[object Object]"!==toString.call(value))throw TypeError(message)},exports.isBufferLength=function(buffer,length,message){if(buffer.length!==length)throw RangeError(message)},exports.isBufferLength2=function(buffer,length1,length2,message){if(buffer.length!==length1&&buffer.length!==length2)throw RangeError(message)},exports.isLengthGTZero=function(value,message){if(0===value.length)throw RangeError(message)},exports.isNumberInInterval=function(number,x,y,message){if(number<=x||number>=y)throw RangeError(message)}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(4).Buffer,bip66=__webpack_require__(158),EC_PRIVKEY_EXPORT_DER_COMPRESSED=Buffer.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED=Buffer.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),ZERO_BUFFER_32=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);exports.privateKeyExport=function(privateKey,publicKey,compressed){var result=Buffer.from(compressed?EC_PRIVKEY_EXPORT_DER_COMPRESSED:EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED);return privateKey.copy(result,compressed?8:9),publicKey.copy(result,compressed?181:214),result},exports.privateKeyImport=function(privateKey){var length=privateKey.length,index=0;if(!(length2||length1?privateKey[index+lenb-2]<<8:0);if(index+=lenb,!(length32||length1&&0===r[posR]&&!(128&r[posR+1]);--lenR,++posR);for(var s=Buffer.concat([Buffer.from([0]),sigObj.s]),lenS=33,posS=0;lenS>1&&0===s[posS]&&!(128&s[posS+1]);--lenS,++posS);return bip66.encode(r.slice(posR),s.slice(posS))},exports.signatureImport=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32);try{var sigObj=bip66.decode(sig);if(33===sigObj.r.length&&0===sigObj.r[0]&&(sigObj.r=sigObj.r.slice(1)),sigObj.r.length>32)throw new Error("R length is too long");if(33===sigObj.s.length&&0===sigObj.s[0]&&(sigObj.s=sigObj.s.slice(1)),sigObj.s.length>32)throw new Error("S length is too long")}catch(err){return}return sigObj.r.copy(r,32-sigObj.r.length),sigObj.s.copy(s,32-sigObj.s.length),{r:r,s:s}},exports.signatureImportLax=function(sig){var r=Buffer.from(ZERO_BUFFER_32),s=Buffer.from(ZERO_BUFFER_32),length=sig.length,index=0;if(48===sig[index++]){var lenbyte=sig[index++];if(!(128&lenbyte&&(index+=lenbyte-128)>length)&&2===sig[index++]){var rlen=sig[index++];if(128&rlen){if(lenbyte=rlen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(rlen=0;lenbyte>0;index+=1,lenbyte-=1)rlen=(rlen<<8)+sig[index]}if(!(rlen>length-index)){var rindex=index;if(index+=rlen,2===sig[index++]){var slen=sig[index++];if(128&slen){if(lenbyte=slen-128,index+lenbyte>length)return;for(;lenbyte>0&&0===sig[index];index+=1,lenbyte-=1);for(slen=0;lenbyte>0;index+=1,lenbyte-=1)slen=(slen<<8)+sig[index]}if(!(slen>length-index)){var sindex=index;for(index+=slen;rlen>0&&0===sig[rindex];rlen-=1,rindex+=1);if(!(rlen>32)){var rvalue=sig.slice(rindex,rindex+rlen);for(rvalue.copy(r,32-rvalue.length);slen>0&&0===sig[sindex];slen-=1,sindex+=1);if(!(slen>32)){var svalue=sig.slice(sindex,sindex+slen);return svalue.copy(s,32-svalue.length),{r:r,s:s}}}}}}}}}},function(module,exports,__webpack_require__){"use strict";function initCompressedValue(value,defaultValue){return void 0===value?defaultValue:(assert.isBoolean(value,messages.COMPRESSED_TYPE_INVALID),value)}var assert=__webpack_require__(279),der=__webpack_require__(280),messages=__webpack_require__(95);module.exports=function(secp256k1){return{privateKeyVerify:function(privateKey){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),32===privateKey.length&&secp256k1.privateKeyVerify(privateKey)},privateKeyExport:function(privateKey,compressed){assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0);var publicKey=secp256k1.privateKeyExport(privateKey,compressed);return der.privateKeyExport(privateKey,publicKey,compressed)},privateKeyImport:function(privateKey){if(assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),(privateKey=der.privateKeyImport(privateKey))&&32===privateKey.length&&secp256k1.privateKeyVerify(privateKey))return privateKey;throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyTweakAdd:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakAdd(privateKey,tweak)},privateKeyTweakMul:function(privateKey,tweak){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),secp256k1.privateKeyTweakMul(privateKey,tweak)},publicKeyCreate:function(privateKey,compressed){return assert.isBuffer(privateKey,messages.EC_PRIVATE_KEY_TYPE_INVALID),assert.isBufferLength(privateKey,32,messages.EC_PRIVATE_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyCreate(privateKey,compressed)},publicKeyConvert:function(publicKey,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyConvert(publicKey,compressed)},publicKeyVerify:function(publicKey){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),secp256k1.publicKeyVerify(publicKey)},publicKeyTweakAdd:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakAdd(publicKey,tweak,compressed)},publicKeyTweakMul:function(publicKey,tweak,compressed){return assert.isBuffer(publicKey,messages.EC_PUBLIC_KEY_TYPE_INVALID),assert.isBufferLength2(publicKey,33,65,messages.EC_PUBLIC_KEY_LENGTH_INVALID),assert.isBuffer(tweak,messages.TWEAK_TYPE_INVALID),assert.isBufferLength(tweak,32,messages.TWEAK_LENGTH_INVALID),compressed=initCompressedValue(compressed,!0),secp256k1.publicKeyTweakMul(publicKey,tweak,compressed)},publicKeyCombine:function(publicKeys,compressed){assert.isArray(publicKeys,messages.EC_PUBLIC_KEYS_TYPE_INVALID),assert.isLengthGTZero(publicKeys,messages.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i>>13,a1=0|a[1],al1=8191&a1,ah1=a1>>>13,a2=0|a[2],al2=8191&a2,ah2=a2>>>13,a3=0|a[3],al3=8191&a3,ah3=a3>>>13,a4=0|a[4],al4=8191&a4,ah4=a4>>>13,a5=0|a[5],al5=8191&a5,ah5=a5>>>13,a6=0|a[6],al6=8191&a6,ah6=a6>>>13,a7=0|a[7],al7=8191&a7,ah7=a7>>>13,a8=0|a[8],al8=8191&a8,ah8=a8>>>13,a9=0|a[9],al9=8191&a9,ah9=a9>>>13,b0=0|b[0],bl0=8191&b0,bh0=b0>>>13,b1=0|b[1],bl1=8191&b1,bh1=b1>>>13,b2=0|b[2],bl2=8191&b2,bh2=b2>>>13,b3=0|b[3],bl3=8191&b3,bh3=b3>>>13,b4=0|b[4],bl4=8191&b4,bh4=b4>>>13,b5=0|b[5],bl5=8191&b5,bh5=b5>>>13,b6=0|b[6],bl6=8191&b6,bh6=b6>>>13,b7=0|b[7],bl7=8191&b7,bh7=b7>>>13,b8=0|b[8],bl8=8191&b8,bh8=b8>>>13,b9=0|b[9],bl9=8191&b9,bh9=b9>>>13;out.length=19,lo=Math.imul(al0,bl0),mid=Math.imul(al0,bh0),mid+=Math.imul(ah0,bl0),hi=Math.imul(ah0,bh0);var w0=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w0>>>26),w0&=67108863,lo=Math.imul(al1,bl0),mid=Math.imul(al1,bh0),mid+=Math.imul(ah1,bl0),hi=Math.imul(ah1,bh0),lo+=Math.imul(al0,bl1),mid+=Math.imul(al0,bh1),mid+=Math.imul(ah0,bl1),hi+=Math.imul(ah0,bh1);var w1=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w1>>>26),w1&=67108863,lo=Math.imul(al2,bl0),mid=Math.imul(al2,bh0),mid+=Math.imul(ah2,bl0),hi=Math.imul(ah2,bh0),lo+=Math.imul(al1,bl1),mid+=Math.imul(al1,bh1),mid+=Math.imul(ah1,bl1),hi+=Math.imul(ah1,bh1),lo+=Math.imul(al0,bl2),mid+=Math.imul(al0,bh2),mid+=Math.imul(ah0,bl2),hi+=Math.imul(ah0,bh2);var w2=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w2>>>26),w2&=67108863,lo=Math.imul(al3,bl0),mid=Math.imul(al3,bh0),mid+=Math.imul(ah3,bl0),hi=Math.imul(ah3,bh0),lo+=Math.imul(al2,bl1),mid+=Math.imul(al2,bh1),mid+=Math.imul(ah2,bl1),hi+=Math.imul(ah2,bh1),lo+=Math.imul(al1,bl2),mid+=Math.imul(al1,bh2),mid+=Math.imul(ah1,bl2),hi+=Math.imul(ah1,bh2),lo+=Math.imul(al0,bl3),mid+=Math.imul(al0,bh3),mid+=Math.imul(ah0,bl3),hi+=Math.imul(ah0,bh3);var w3=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w3>>>26),w3&=67108863,lo=Math.imul(al4,bl0),mid=Math.imul(al4,bh0),mid+=Math.imul(ah4,bl0),hi=Math.imul(ah4,bh0),lo+=Math.imul(al3,bl1),mid+=Math.imul(al3,bh1),mid+=Math.imul(ah3,bl1),hi+=Math.imul(ah3,bh1),lo+=Math.imul(al2,bl2),mid+=Math.imul(al2,bh2),mid+=Math.imul(ah2,bl2),hi+=Math.imul(ah2,bh2),lo+=Math.imul(al1,bl3),mid+=Math.imul(al1,bh3),mid+=Math.imul(ah1,bl3),hi+=Math.imul(ah1,bh3),lo+=Math.imul(al0,bl4),mid+=Math.imul(al0,bh4),mid+=Math.imul(ah0,bl4),hi+=Math.imul(ah0,bh4);var w4=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w4>>>26),w4&=67108863,lo=Math.imul(al5,bl0),mid=Math.imul(al5,bh0),mid+=Math.imul(ah5,bl0),hi=Math.imul(ah5,bh0),lo+=Math.imul(al4,bl1),mid+=Math.imul(al4,bh1),mid+=Math.imul(ah4,bl1),hi+=Math.imul(ah4,bh1),lo+=Math.imul(al3,bl2),mid+=Math.imul(al3,bh2),mid+=Math.imul(ah3,bl2),hi+=Math.imul(ah3,bh2),lo+=Math.imul(al2,bl3),mid+=Math.imul(al2,bh3),mid+=Math.imul(ah2,bl3),hi+=Math.imul(ah2,bh3),lo+=Math.imul(al1,bl4),mid+=Math.imul(al1,bh4),mid+=Math.imul(ah1,bl4),hi+=Math.imul(ah1,bh4),lo+=Math.imul(al0,bl5),mid+=Math.imul(al0,bh5),mid+=Math.imul(ah0,bl5),hi+=Math.imul(ah0,bh5);var w5=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w5>>>26),w5&=67108863,lo=Math.imul(al6,bl0),mid=Math.imul(al6,bh0),mid+=Math.imul(ah6,bl0),hi=Math.imul(ah6,bh0),lo+=Math.imul(al5,bl1),mid+=Math.imul(al5,bh1),mid+=Math.imul(ah5,bl1),hi+=Math.imul(ah5,bh1),lo+=Math.imul(al4,bl2),mid+=Math.imul(al4,bh2),mid+=Math.imul(ah4,bl2),hi+=Math.imul(ah4,bh2),lo+=Math.imul(al3,bl3),mid+=Math.imul(al3,bh3),mid+=Math.imul(ah3,bl3),hi+=Math.imul(ah3,bh3),lo+=Math.imul(al2,bl4),mid+=Math.imul(al2,bh4),mid+=Math.imul(ah2,bl4),hi+=Math.imul(ah2,bh4),lo+=Math.imul(al1,bl5),mid+=Math.imul(al1,bh5),mid+=Math.imul(ah1,bl5),hi+=Math.imul(ah1,bh5),lo+=Math.imul(al0,bl6),mid+=Math.imul(al0,bh6),mid+=Math.imul(ah0,bl6),hi+=Math.imul(ah0,bh6);var w6=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w6>>>26),w6&=67108863,lo=Math.imul(al7,bl0),mid=Math.imul(al7,bh0),mid+=Math.imul(ah7,bl0),hi=Math.imul(ah7,bh0),lo+=Math.imul(al6,bl1),mid+=Math.imul(al6,bh1),mid+=Math.imul(ah6,bl1),hi+=Math.imul(ah6,bh1),lo+=Math.imul(al5,bl2),mid+=Math.imul(al5,bh2),mid+=Math.imul(ah5,bl2),hi+=Math.imul(ah5,bh2),lo+=Math.imul(al4,bl3),mid+=Math.imul(al4,bh3),mid+=Math.imul(ah4,bl3),hi+=Math.imul(ah4,bh3),lo+=Math.imul(al3,bl4),mid+=Math.imul(al3,bh4),mid+=Math.imul(ah3,bl4),hi+=Math.imul(ah3,bh4),lo+=Math.imul(al2,bl5),mid+=Math.imul(al2,bh5),mid+=Math.imul(ah2,bl5),hi+=Math.imul(ah2,bh5),lo+=Math.imul(al1,bl6),mid+=Math.imul(al1,bh6),mid+=Math.imul(ah1,bl6),hi+=Math.imul(ah1,bh6),lo+=Math.imul(al0,bl7),mid+=Math.imul(al0,bh7),mid+=Math.imul(ah0,bl7),hi+=Math.imul(ah0,bh7);var w7=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w7>>>26),w7&=67108863,lo=Math.imul(al8,bl0),mid=Math.imul(al8,bh0),mid+=Math.imul(ah8,bl0),hi=Math.imul(ah8,bh0),lo+=Math.imul(al7,bl1),mid+=Math.imul(al7,bh1),mid+=Math.imul(ah7,bl1),hi+=Math.imul(ah7,bh1),lo+=Math.imul(al6,bl2),mid+=Math.imul(al6,bh2),mid+=Math.imul(ah6,bl2),hi+=Math.imul(ah6,bh2),lo+=Math.imul(al5,bl3),mid+=Math.imul(al5,bh3),mid+=Math.imul(ah5,bl3),hi+=Math.imul(ah5,bh3),lo+=Math.imul(al4,bl4),mid+=Math.imul(al4,bh4),mid+=Math.imul(ah4,bl4),hi+=Math.imul(ah4,bh4),lo+=Math.imul(al3,bl5),mid+=Math.imul(al3,bh5),mid+=Math.imul(ah3,bl5),hi+=Math.imul(ah3,bh5),lo+=Math.imul(al2,bl6),mid+=Math.imul(al2,bh6),mid+=Math.imul(ah2,bl6),hi+=Math.imul(ah2,bh6),lo+=Math.imul(al1,bl7),mid+=Math.imul(al1,bh7),mid+=Math.imul(ah1,bl7),hi+=Math.imul(ah1,bh7),lo+=Math.imul(al0,bl8),mid+=Math.imul(al0,bh8),mid+=Math.imul(ah0,bl8),hi+=Math.imul(ah0,bh8);var w8=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w8>>>26),w8&=67108863,lo=Math.imul(al9,bl0),mid=Math.imul(al9,bh0),mid+=Math.imul(ah9,bl0),hi=Math.imul(ah9,bh0),lo+=Math.imul(al8,bl1),mid+=Math.imul(al8,bh1),mid+=Math.imul(ah8,bl1),hi+=Math.imul(ah8,bh1),lo+=Math.imul(al7,bl2),mid+=Math.imul(al7,bh2),mid+=Math.imul(ah7,bl2),hi+=Math.imul(ah7,bh2),lo+=Math.imul(al6,bl3),mid+=Math.imul(al6,bh3),mid+=Math.imul(ah6,bl3),hi+=Math.imul(ah6,bh3),lo+=Math.imul(al5,bl4),mid+=Math.imul(al5,bh4),mid+=Math.imul(ah5,bl4),hi+=Math.imul(ah5,bh4),lo+=Math.imul(al4,bl5),mid+=Math.imul(al4,bh5),mid+=Math.imul(ah4,bl5),hi+=Math.imul(ah4,bh5),lo+=Math.imul(al3,bl6),mid+=Math.imul(al3,bh6),mid+=Math.imul(ah3,bl6),hi+=Math.imul(ah3,bh6),lo+=Math.imul(al2,bl7),mid+=Math.imul(al2,bh7),mid+=Math.imul(ah2,bl7),hi+=Math.imul(ah2,bh7),lo+=Math.imul(al1,bl8),mid+=Math.imul(al1,bh8),mid+=Math.imul(ah1,bl8),hi+=Math.imul(ah1,bh8),lo+=Math.imul(al0,bl9),mid+=Math.imul(al0,bh9),mid+=Math.imul(ah0,bl9),hi+=Math.imul(ah0,bh9);var w9=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w9>>>26),w9&=67108863,lo=Math.imul(al9,bl1),mid=Math.imul(al9,bh1),mid+=Math.imul(ah9,bl1),hi=Math.imul(ah9,bh1),lo+=Math.imul(al8,bl2),mid+=Math.imul(al8,bh2),mid+=Math.imul(ah8,bl2),hi+=Math.imul(ah8,bh2),lo+=Math.imul(al7,bl3),mid+=Math.imul(al7,bh3),mid+=Math.imul(ah7,bl3),hi+=Math.imul(ah7,bh3),lo+=Math.imul(al6,bl4),mid+=Math.imul(al6,bh4),mid+=Math.imul(ah6,bl4),hi+=Math.imul(ah6,bh4),lo+=Math.imul(al5,bl5),mid+=Math.imul(al5,bh5),mid+=Math.imul(ah5,bl5),hi+=Math.imul(ah5,bh5),lo+=Math.imul(al4,bl6),mid+=Math.imul(al4,bh6),mid+=Math.imul(ah4,bl6),hi+=Math.imul(ah4,bh6),lo+=Math.imul(al3,bl7),mid+=Math.imul(al3,bh7),mid+=Math.imul(ah3,bl7),hi+=Math.imul(ah3,bh7),lo+=Math.imul(al2,bl8),mid+=Math.imul(al2,bh8),mid+=Math.imul(ah2,bl8),hi+=Math.imul(ah2,bh8),lo+=Math.imul(al1,bl9),mid+=Math.imul(al1,bh9),mid+=Math.imul(ah1,bl9),hi+=Math.imul(ah1,bh9);var w10=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w10>>>26),w10&=67108863,lo=Math.imul(al9,bl2),mid=Math.imul(al9,bh2),mid+=Math.imul(ah9,bl2),hi=Math.imul(ah9,bh2),lo+=Math.imul(al8,bl3),mid+=Math.imul(al8,bh3),mid+=Math.imul(ah8,bl3),hi+=Math.imul(ah8,bh3),lo+=Math.imul(al7,bl4),mid+=Math.imul(al7,bh4),mid+=Math.imul(ah7,bl4),hi+=Math.imul(ah7,bh4),lo+=Math.imul(al6,bl5),mid+=Math.imul(al6,bh5),mid+=Math.imul(ah6,bl5),hi+=Math.imul(ah6,bh5),lo+=Math.imul(al5,bl6),mid+=Math.imul(al5,bh6),mid+=Math.imul(ah5,bl6),hi+=Math.imul(ah5,bh6),lo+=Math.imul(al4,bl7),mid+=Math.imul(al4,bh7),mid+=Math.imul(ah4,bl7),hi+=Math.imul(ah4,bh7),lo+=Math.imul(al3,bl8),mid+=Math.imul(al3,bh8),mid+=Math.imul(ah3,bl8),hi+=Math.imul(ah3,bh8),lo+=Math.imul(al2,bl9),mid+=Math.imul(al2,bh9),mid+=Math.imul(ah2,bl9),hi+=Math.imul(ah2,bh9);var w11=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w11>>>26),w11&=67108863,lo=Math.imul(al9,bl3),mid=Math.imul(al9,bh3),mid+=Math.imul(ah9,bl3),hi=Math.imul(ah9,bh3),lo+=Math.imul(al8,bl4),mid+=Math.imul(al8,bh4),mid+=Math.imul(ah8,bl4),hi+=Math.imul(ah8,bh4),lo+=Math.imul(al7,bl5),mid+=Math.imul(al7,bh5),mid+=Math.imul(ah7,bl5),hi+=Math.imul(ah7,bh5),lo+=Math.imul(al6,bl6),mid+=Math.imul(al6,bh6),mid+=Math.imul(ah6,bl6),hi+=Math.imul(ah6,bh6),lo+=Math.imul(al5,bl7),mid+=Math.imul(al5,bh7),mid+=Math.imul(ah5,bl7),hi+=Math.imul(ah5,bh7),lo+=Math.imul(al4,bl8),mid+=Math.imul(al4,bh8),mid+=Math.imul(ah4,bl8),hi+=Math.imul(ah4,bh8),lo+=Math.imul(al3,bl9),mid+=Math.imul(al3,bh9),mid+=Math.imul(ah3,bl9),hi+=Math.imul(ah3,bh9);var w12=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w12>>>26),w12&=67108863,lo=Math.imul(al9,bl4),mid=Math.imul(al9,bh4),mid+=Math.imul(ah9,bl4),hi=Math.imul(ah9,bh4),lo+=Math.imul(al8,bl5),mid+=Math.imul(al8,bh5),mid+=Math.imul(ah8,bl5),hi+=Math.imul(ah8,bh5),lo+=Math.imul(al7,bl6),mid+=Math.imul(al7,bh6),mid+=Math.imul(ah7,bl6),hi+=Math.imul(ah7,bh6),lo+=Math.imul(al6,bl7),mid+=Math.imul(al6,bh7),mid+=Math.imul(ah6,bl7),hi+=Math.imul(ah6,bh7),lo+=Math.imul(al5,bl8),mid+=Math.imul(al5,bh8),mid+=Math.imul(ah5,bl8),hi+=Math.imul(ah5,bh8),lo+=Math.imul(al4,bl9),mid+=Math.imul(al4,bh9),mid+=Math.imul(ah4,bl9),hi+=Math.imul(ah4,bh9);var w13=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w13>>>26),w13&=67108863,lo=Math.imul(al9,bl5),mid=Math.imul(al9,bh5),mid+=Math.imul(ah9,bl5),hi=Math.imul(ah9,bh5),lo+=Math.imul(al8,bl6),mid+=Math.imul(al8,bh6),mid+=Math.imul(ah8,bl6),hi+=Math.imul(ah8,bh6),lo+=Math.imul(al7,bl7),mid+=Math.imul(al7,bh7),mid+=Math.imul(ah7,bl7),hi+=Math.imul(ah7,bh7),lo+=Math.imul(al6,bl8),mid+=Math.imul(al6,bh8),mid+=Math.imul(ah6,bl8),hi+=Math.imul(ah6,bh8),lo+=Math.imul(al5,bl9),mid+=Math.imul(al5,bh9),mid+=Math.imul(ah5,bl9),hi+=Math.imul(ah5,bh9);var w14=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w14>>>26),w14&=67108863,lo=Math.imul(al9,bl6),mid=Math.imul(al9,bh6),mid+=Math.imul(ah9,bl6),hi=Math.imul(ah9,bh6),lo+=Math.imul(al8,bl7),mid+=Math.imul(al8,bh7),mid+=Math.imul(ah8,bl7),hi+=Math.imul(ah8,bh7),lo+=Math.imul(al7,bl8),mid+=Math.imul(al7,bh8),mid+=Math.imul(ah7,bl8),hi+=Math.imul(ah7,bh8),lo+=Math.imul(al6,bl9),mid+=Math.imul(al6,bh9),mid+=Math.imul(ah6,bl9),hi+=Math.imul(ah6,bh9);var w15=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w15>>>26),w15&=67108863,lo=Math.imul(al9,bl7),mid=Math.imul(al9,bh7),mid+=Math.imul(ah9,bl7),hi=Math.imul(ah9,bh7),lo+=Math.imul(al8,bl8),mid+=Math.imul(al8,bh8),mid+=Math.imul(ah8,bl8),hi+=Math.imul(ah8,bh8),lo+=Math.imul(al7,bl9),mid+=Math.imul(al7,bh9),mid+=Math.imul(ah7,bl9),hi+=Math.imul(ah7,bh9);var w16=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w16>>>26),w16&=67108863,lo=Math.imul(al9,bl8),mid=Math.imul(al9,bh8),mid+=Math.imul(ah9,bl8),hi=Math.imul(ah9,bh8),lo+=Math.imul(al8,bl9),mid+=Math.imul(al8,bh9),mid+=Math.imul(ah8,bl9),hi+=Math.imul(ah8,bh9);var w17=c+lo+((8191&mid)<<13);c=hi+(mid>>>13)+(w17>>>26),w17&=67108863,lo=Math.imul(al9,bl9),mid=Math.imul(al9,bh9),mid+=Math.imul(ah9,bl9),hi=Math.imul(ah9,bh9);var w18=c+lo+((8191&mid)<<13);return c=hi+(mid>>>13)+(w18>>>26),w18&=67108863,o[0]=w0,o[1]=w1,o[2]=w2, o[3]=w3,o[4]=w4,o[5]=w5,o[6]=w6,o[7]=w7,o[8]=w8,o[9]=w9,o[10]=w10,o[11]=w11,o[12]=w12,o[13]=w13,o[14]=w14,o[15]=w15,o[16]=w16,o[17]=w17,o[18]=w18,0!==c&&(o[19]=c,out.length++),out}},function(module,exports,__webpack_require__){"use strict";function ECPointG(){this.x=BN.fromBuffer(Buffer.from("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","hex")),this.y=BN.fromBuffer(Buffer.from("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8","hex")),this.inf=!1,this._precompute()}var Buffer=__webpack_require__(4).Buffer,BN=__webpack_require__(50),ECPoint=__webpack_require__(120),ECJPoint=__webpack_require__(119);ECPointG.prototype._precompute=function(){for(var ecpoint=new ECPoint(this.x,this.y),points=new Array(1+Math.ceil(64.25)),acc=points[0]=ecpoint,i=1;i=j;k--)nafW=(nafW<<1)+naf[k];repr.push(nafW)}for(var a=new ECJPoint(null,null,null),b=new ECJPoint(null,null,null),i=I;i>0;i--){for(var jj=0;jj=0;i--){for(var k=0;i>=0&&(tmp[0]=0|naf[0][i],tmp[1]=0|naf[1][i],0===tmp[0]&&0===tmp[1]);++k,--i);if(i>=0&&(k+=1),acc=acc.dblp(k),i<0)break;for(var jj=0;jj<2;jj++){var p,z=tmp[jj];0!==z&&(z>0?p=wnd[jj][z>>1]:z<0&&(p=wnd[jj][-z>>1].neg()),acc=void 0===p.z?acc.mixedAdd(p):acc.add(p))}}return acc},module.exports=new ECPointG},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(4).Buffer,createHash=__webpack_require__(170),HmacDRBG=__webpack_require__(174),messages=__webpack_require__(95),BN=__webpack_require__(50),ECPoint=__webpack_require__(120),g=__webpack_require__(283);exports.privateKeyVerify=function(privateKey){var bn=BN.fromBuffer(privateKey);return!(bn.isOverflow()||bn.isZero())},exports.privateKeyExport=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return g.mul(d).toPublicKey(compressed)},exports.privateKeyTweakAdd=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(bn.iadd(BN.fromBuffer(privateKey)),bn.isOverflow()&&bn.isub(BN.n),bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return bn.toBuffer()},exports.privateKeyTweakMul=function(privateKey,tweak){var bn=BN.fromBuffer(tweak);if(bn.isOverflow()||bn.isZero())throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);var d=BN.fromBuffer(privateKey);return bn.umul(d).ureduce().toBuffer()},exports.publicKeyCreate=function(privateKey,compressed){var d=BN.fromBuffer(privateKey);if(d.isOverflow()||d.isZero())throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL);return g.mul(d).toPublicKey(compressed)},exports.publicKeyConvert=function(publicKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);return point.toPublicKey(compressed)},exports.publicKeyVerify=function(publicKey){return null!==ECPoint.fromPublicKey(publicKey)},exports.publicKeyTweakAdd=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return g.mul(tweak).add(point).toPublicKey(compressed)},exports.publicKeyTweakMul=function(publicKey,tweak,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);if(tweak=BN.fromBuffer(tweak),tweak.isOverflow()||tweak.isZero())throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return point.mul(tweak).toPublicKey(compressed)},exports.publicKeyCombine=function(publicKeys,compressed){for(var points=new Array(publicKeys.length),i=0;i=0)&&0===sigr.iadd(BN.psn).redMul(z2).ucmp(point.x)},exports.recover=function(message,signature,recovery,compressed){var sigr=BN.fromBuffer(signature.slice(0,32)),sigs=BN.fromBuffer(signature.slice(32,64));if(sigr.isOverflow()||sigs.isOverflow())throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL);do{if(sigr.isZero()||sigs.isZero())break;var kpx=sigr;if(recovery>>1){if(kpx.ucmp(BN.psn)>=0)break;kpx=sigr.add(BN.n)}var kpPublicKey=Buffer.concat([Buffer.from([2+(1&recovery)]),kpx.toBuffer()]),kp=ECPoint.fromPublicKey(kpPublicKey);if(null===kp)break;var rInv=sigr.uinvm(),s1=BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce(),s2=sigs.umul(rInv).ureduce();return ECPoint.fromECJPoint(g.mulAdd(s1,kp,s2)).toPublicKey(compressed)}while(!1);throw new Error(messages.ECDSA_RECOVER_FAIL)},exports.ecdh=function(publicKey,privateKey){var shared=exports.ecdhUnsafe(publicKey,privateKey,!0);return createHash("sha256").update(shared).digest()},exports.ecdhUnsafe=function(publicKey,privateKey,compressed){var point=ECPoint.fromPublicKey(publicKey);if(null===point)throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL);var scalar=BN.fromBuffer(privateKey);if(scalar.isOverflow()||scalar.isZero())throw new Error(messages.ECDH_FAIL);return point.mul(scalar).toPublicKey(compressed)}},function(module,exports,__webpack_require__){(function(global,process){!function(global,undefined){"use strict";function setImmediate(callback){"function"!=typeof callback&&(callback=new Function(""+callback));for(var args=new Array(arguments.length-1),i=0;i>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(2),Hash=__webpack_require__(21),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha,Hash),Sha.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=W[i-3]^W[i-8]^W[i-14]^W[i-16];for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha1(){this.init(),this._w=W,Hash.call(this,64,56)}function rotl1(num){return num<<1|num>>>31}function rotl5(num){return num<<5|num>>>27}function rotl30(num){return num<<30|num>>>2}function ft(s,b,c,d){return 0===s?b&c|~b&d:2===s?b&c|b&d|c&d:b^c^d}var inherits=__webpack_require__(2),Hash=__webpack_require__(21),K=[1518500249,1859775393,-1894007588,-899497514],W=new Array(80);inherits(Sha1,Hash),Sha1.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sha1.prototype._update=function(M){for(var W=this._w,a=0|this._a,b=0|this._b,c=0|this._c,d=0|this._d,e=0|this._e,i=0;i<16;++i)W[i]=M.readInt32BE(4*i);for(;i<80;++i)W[i]=rotl1(W[i-3]^W[i-8]^W[i-14]^W[i-16]);for(var j=0;j<80;++j){var s=~~(j/20),t=rotl5(a)+ft(s,b,c,d)+e+W[j]+K[s]|0;e=d,d=c,c=rotl30(b),b=a,a=t}this._a=a+this._a|0,this._b=b+this._b|0,this._c=c+this._c|0,this._d=d+this._d|0,this._e=e+this._e|0},Sha1.prototype._hash=function(){var H=new Buffer(20);return H.writeInt32BE(0|this._a,0),H.writeInt32BE(0|this._b,4),H.writeInt32BE(0|this._c,8),H.writeInt32BE(0|this._d,12),H.writeInt32BE(0|this._e,16),H},module.exports=Sha1}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha224(){this.init(),this._w=W,Hash.call(this,64,56)}var inherits=__webpack_require__(2),Sha256=__webpack_require__(122),Hash=__webpack_require__(21),W=new Array(64);inherits(Sha224,Sha256),Sha224.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Sha224.prototype._hash=function(){var H=new Buffer(28);return H.writeInt32BE(this._a,0),H.writeInt32BE(this._b,4),H.writeInt32BE(this._c,8),H.writeInt32BE(this._d,12),H.writeInt32BE(this._e,16),H.writeInt32BE(this._f,20),H.writeInt32BE(this._g,24),H},module.exports=Sha224}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){(function(Buffer){function Sha384(){this.init(),this._w=W,Hash.call(this,128,112)}var inherits=__webpack_require__(2),SHA512=__webpack_require__(123),Hash=__webpack_require__(21),W=new Array(160);inherits(Sha384,SHA512),Sha384.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},Sha384.prototype._hash=function(){function writeInt64BE(h,l,offset){H.writeInt32BE(h,offset),H.writeInt32BE(l,offset+4)}var H=new Buffer(48);return writeInt64BE(this._ah,this._al,0),writeInt64BE(this._bh,this._bl,8),writeInt64BE(this._ch,this._cl,16),writeInt64BE(this._dh,this._dl,24),writeInt64BE(this._eh,this._el,32),writeInt64BE(this._fh,this._fl,40),H},module.exports=Sha384}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var varint=__webpack_require__(12);exports.encode=function encode(v,b,o){v=v>=0?2*v:v*-2-1;var r=varint.encode(v,b,o);return encode.bytes=varint.encode.bytes,r},exports.decode=function decode(b,o){var v=varint.decode(b,o);return decode.bytes=varint.decode.bytes,1&v?(v+1)/-2:v/2},exports.encodingLength=function(v){return varint.encodingLength(v>=0?2*v:v*-2-1)}},function(module,exports,__webpack_require__){"use strict";function transform(chunk,enc,cb){if(this._last+=this._decoder.write(chunk),this._last.length>this.maxLength)return cb(new Error("maximum buffer reached"));var list=this._last.split(this.matcher);this._last=list.pop();for(var i=0;ilen&&(r=len),e>len&&(e=len),li=l,ri=r;;)if(liself._pos){var newData=response.substr(self._pos);if("x-user-defined"===self._charset){for(var buffer=new Buffer(newData.length),i=0;iself._pos&&(self.push(new Buffer(new Uint8Array(reader.result.slice(self._pos)))),self._pos=reader.result.byteLength)},reader.onload=function(){self.push(null)},reader.readAsArrayBuffer(response)}self._xhr.readyState===rStates.DONE&&"ms-stream"!==self._mode&&self.push(null)}}).call(exports,__webpack_require__(6),__webpack_require__(0).Buffer,__webpack_require__(5))},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var util=__webpack_require__(11),stream=__webpack_require__(16);module.exports.createReadStream=function(object,options){return new MultiStream(object,options)};var MultiStream=function(object,options){object instanceof Buffer||"string"==typeof object?(options=options||{},stream.Readable.call(this,{highWaterMark:options.highWaterMark,encoding:options.encoding})):stream.Readable.call(this,{objectMode:!0}),this._object=object};util.inherits(MultiStream,stream.Readable),MultiStream.prototype._read=function(){this.push(this._object),this._object=null}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){var util=__webpack_require__(11),bl=__webpack_require__(159),xtend=__webpack_require__(51),headers=__webpack_require__(126),Writable=__webpack_require__(7).Writable,PassThrough=__webpack_require__(7).PassThrough,noop=function(){},overflow=function(size){return(size&=511)&&512-size},emptyStream=function(self,offset){var s=new Source(self,offset);return s.end(),s},mixinPax=function(header,pax){return pax.path&&(header.name=pax.path),pax.linkpath&&(header.linkname=pax.linkpath),header.pax=pax,header},Source=function(self,offset){this._parent=self,this.offset=offset,PassThrough.call(this)};util.inherits(Source,PassThrough),Source.prototype.destroy=function(err){this._parent.destroy(err)};var Extract=function(opts){if(!(this instanceof Extract))return new Extract(opts);Writable.call(this,opts),this._offset=0,this._buffer=bl(),this._missing=0,this._onparse=noop,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var self=this,b=self._buffer,oncontinue=function(){self._continue()},onunlock=function(err){if(self._locked=!1,err)return self.destroy(err);self._stream||oncontinue()},onstreamend=function(){self._stream=null;var drain=overflow(self._header.size);drain?self._parse(drain,ondrain):self._parse(512,onheader),self._locked||oncontinue()},ondrain=function(){self._buffer.consume(overflow(self._header.size)),self._parse(512,onheader),oncontinue()},onpaxglobalheader=function(){var size=self._header.size;self._paxGlobal=headers.decodePax(b.slice(0,size)),b.consume(size),onstreamend()},onpaxheader=function(){var size=self._header.size;self._pax=headers.decodePax(b.slice(0,size)),self._paxGlobal&&(self._pax=xtend(self._paxGlobal,self._pax)),b.consume(size),onstreamend()},ongnulongpath=function(){var size=self._header.size;this._gnuLongPath=headers.decodeLongPath(b.slice(0,size)),b.consume(size),onstreamend()},ongnulonglinkpath=function(){var size=self._header.size;this._gnuLongLinkPath=headers.decodeLongPath(b.slice(0,size)),b.consume(size),onstreamend()},onheader=function(){var header,offset=self._offset;try{header=self._header=headers.decode(b.slice(0,512))}catch(err){self.emit("error",err)}return b.consume(512),header?"gnu-long-path"===header.type?(self._parse(header.size,ongnulongpath),void oncontinue()):"gnu-long-link-path"===header.type?(self._parse(header.size,ongnulonglinkpath),void oncontinue()):"pax-global-header"===header.type?(self._parse(header.size,onpaxglobalheader),void oncontinue()):"pax-header"===header.type?(self._parse(header.size,onpaxheader),void oncontinue()):(self._gnuLongPath&&(header.name=self._gnuLongPath,self._gnuLongPath=null),self._gnuLongLinkPath&&(header.linkname=self._gnuLongLinkPath,self._gnuLongLinkPath=null),self._pax&&(self._header=header=mixinPax(header,self._pax),self._pax=null),self._locked=!0,header.size&&"directory"!==header.type?(self._stream=new Source(self,offset),self.emit("entry",header,self._stream,onunlock),self._parse(header.size,onstreamend),void oncontinue()):(self._parse(512,onheader),void self.emit("entry",header,emptyStream(self,offset),onunlock))):(self._parse(512,onheader),void oncontinue())};this._parse(512,onheader)};util.inherits(Extract,Writable),Extract.prototype.destroy=function(err){this._destroyed||(this._destroyed=!0,err&&this.emit("error",err),this.emit("close"),this._stream&&this._stream.emit("close"))},Extract.prototype._parse=function(size,onparse){this._destroyed||(this._offset+=size,this._missing=size,this._onparse=onparse)},Extract.prototype._continue=function(){if(!this._destroyed){var cb=this._cb;this._cb=noop,this._overflow?this._write(this._overflow,void 0,cb):cb()}},Extract.prototype._write=function(data,enc,cb){if(!this._destroyed){var s=this._stream,b=this._buffer,missing=this._missing;if(data.lengthmissing&&(overflow=data.slice(missing),data=data.slice(0,missing)), s?s.end(data):b.append(data),this._overflow=overflow,this._onparse()}},module.exports=Extract},function(module,exports,__webpack_require__){exports.extract=__webpack_require__(296),exports.pack=__webpack_require__(298)},function(module,exports,__webpack_require__){(function(Buffer,process){function modeToType(mode){switch(mode&constants.S_IFMT){case constants.S_IFBLK:return"block-device";case constants.S_IFCHR:return"character-device";case constants.S_IFDIR:return"directory";case constants.S_IFIFO:return"fifo";case constants.S_IFLNK:return"symlink"}return"file"}var constants=__webpack_require__(198),eos=__webpack_require__(56),util=__webpack_require__(11),Readable=__webpack_require__(7).Readable,Writable=__webpack_require__(7).Writable,StringDecoder=__webpack_require__(31).StringDecoder,headers=__webpack_require__(126),DMODE=parseInt("755",8),FMODE=parseInt("644",8),END_OF_TAR=new Buffer(1024);END_OF_TAR.fill(0);var noop=function(){},overflow=function(self,size){(size&=511)&&self.push(END_OF_TAR.slice(0,512-size))},Sink=function(to){Writable.call(this),this.written=0,this._to=to,this._destroyed=!1};util.inherits(Sink,Writable),Sink.prototype._write=function(data,enc,cb){if(this.written+=data.length,this._to.push(data))return cb();this._to._drain=cb},Sink.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var LinkSink=function(){Writable.call(this),this.linkname="",this._decoder=new StringDecoder("utf-8"),this._destroyed=!1};util.inherits(LinkSink,Writable),LinkSink.prototype._write=function(data,enc,cb){this.linkname+=this._decoder.write(data),cb()},LinkSink.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Void=function(){Writable.call(this),this._destroyed=!1};util.inherits(Void,Writable),Void.prototype._write=function(data,enc,cb){cb(new Error("No body allowed for this entry"))},Void.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Pack=function(opts){if(!(this instanceof Pack))return new Pack(opts);Readable.call(this,opts),this._drain=noop,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};util.inherits(Pack,Readable),Pack.prototype.entry=function(header,buffer,callback){if(this._stream)throw new Error("already piping an entry");if(!this._finalized&&!this._destroyed){"function"==typeof buffer&&(callback=buffer,buffer=null),callback||(callback=noop);var self=this;if(header.size&&"symlink"!==header.type||(header.size=0),header.type||(header.type=modeToType(header.mode)),header.mode||(header.mode="directory"===header.type?DMODE:FMODE),header.uid||(header.uid=0),header.gid||(header.gid=0),header.mtime||(header.mtime=new Date),"string"==typeof buffer&&(buffer=new Buffer(buffer)),Buffer.isBuffer(buffer))return header.size=buffer.length,this._encode(header),this.push(buffer),overflow(self,header.size),process.nextTick(callback),new Void;if("symlink"===header.type&&!header.linkname){var linkSink=new LinkSink;return eos(linkSink,function(err){if(err)return self.destroy(),callback(err);header.linkname=linkSink.linkname,self._encode(header),callback()}),linkSink}if(this._encode(header),"file"!==header.type&&"contiguous-file"!==header.type)return process.nextTick(callback),new Void;var sink=new Sink(this);return this._stream=sink,eos(sink,function(err){return self._stream=null,err?(self.destroy(),callback(err)):sink.written!==header.size?(self.destroy(),callback(new Error("size mismatch"))):(overflow(self,header.size),self._finalizing&&self.finalize(),void callback())}),sink}},Pack.prototype.finalize=function(){if(this._stream)return void(this._finalizing=!0);this._finalized||(this._finalized=!0,this.push(END_OF_TAR),this.push(null))},Pack.prototype.destroy=function(err){this._destroyed||(this._destroyed=!0,err&&this.emit("error",err),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())},Pack.prototype._encode=function(header){if(!header.pax){var buf=headers.encode(header);if(buf)return void this.push(buf)}this._encodePax(header)},Pack.prototype._encodePax=function(header){var paxHeader=headers.encodePax({name:header.name,linkname:header.linkname,pax:header.pax}),newHeader={name:"PaxHeader",mode:header.mode,uid:header.uid,gid:header.gid,size:paxHeader.length,mtime:header.mtime,type:"pax-header",linkname:header.linkname&&"PaxHeader",uname:header.uname,gname:header.gname,devmajor:header.devmajor,devminor:header.devminor};this.push(headers.encode(newHeader)),this.push(paxHeader),overflow(this,paxHeader.length),newHeader.size=header.size,newHeader.type=header.type,this.push(headers.encode(newHeader))},Pack.prototype._read=function(n){var drain=this._drain;this._drain=noop,drain()},module.exports=Pack}).call(exports,__webpack_require__(0).Buffer,__webpack_require__(6))},function(module,exports,__webpack_require__){var Buffer=__webpack_require__(0).Buffer;module.exports=function(buf){if(buf instanceof Uint8Array){if(0===buf.byteOffset&&buf.byteLength===buf.buffer.byteLength)return buf.buffer;if("function"==typeof buf.buffer.slice)return buf.buffer.slice(buf.byteOffset,buf.byteOffset+buf.byteLength)}if(Buffer.isBuffer(buf)){for(var arrayCopy=new Uint8Array(buf.length),len=buf.length,i=0;i>24&255,x[i+1]=h>>16&255,x[i+2]=h>>8&255,x[i+3]=255&h,x[i+4]=l>>24&255,x[i+5]=l>>16&255,x[i+6]=l>>8&255,x[i+7]=255&l}function vn(x,xi,y,yi,n){var i,d=0;for(i=0;i>>8)-1}function crypto_verify_16(x,xi,y,yi){return vn(x,xi,y,yi,16)}function crypto_verify_32(x,xi,y,yi){return vn(x,xi,y,yi,32)}function core_salsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;x0=x0+j0|0,x1=x1+j1|0,x2=x2+j2|0,x3=x3+j3|0,x4=x4+j4|0,x5=x5+j5|0,x6=x6+j6|0,x7=x7+j7|0,x8=x8+j8|0,x9=x9+j9|0,x10=x10+j10|0,x11=x11+j11|0,x12=x12+j12|0,x13=x13+j13|0,x14=x14+j14|0,x15=x15+j15|0,o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x1>>>0&255,o[5]=x1>>>8&255,o[6]=x1>>>16&255,o[7]=x1>>>24&255,o[8]=x2>>>0&255,o[9]=x2>>>8&255,o[10]=x2>>>16&255,o[11]=x2>>>24&255,o[12]=x3>>>0&255,o[13]=x3>>>8&255,o[14]=x3>>>16&255,o[15]=x3>>>24&255,o[16]=x4>>>0&255,o[17]=x4>>>8&255,o[18]=x4>>>16&255,o[19]=x4>>>24&255,o[20]=x5>>>0&255,o[21]=x5>>>8&255,o[22]=x5>>>16&255,o[23]=x5>>>24&255,o[24]=x6>>>0&255,o[25]=x6>>>8&255,o[26]=x6>>>16&255,o[27]=x6>>>24&255,o[28]=x7>>>0&255,o[29]=x7>>>8&255,o[30]=x7>>>16&255,o[31]=x7>>>24&255,o[32]=x8>>>0&255,o[33]=x8>>>8&255,o[34]=x8>>>16&255,o[35]=x8>>>24&255,o[36]=x9>>>0&255,o[37]=x9>>>8&255,o[38]=x9>>>16&255,o[39]=x9>>>24&255,o[40]=x10>>>0&255,o[41]=x10>>>8&255,o[42]=x10>>>16&255,o[43]=x10>>>24&255,o[44]=x11>>>0&255,o[45]=x11>>>8&255,o[46]=x11>>>16&255,o[47]=x11>>>24&255,o[48]=x12>>>0&255,o[49]=x12>>>8&255,o[50]=x12>>>16&255,o[51]=x12>>>24&255,o[52]=x13>>>0&255,o[53]=x13>>>8&255,o[54]=x13>>>16&255,o[55]=x13>>>24&255,o[56]=x14>>>0&255,o[57]=x14>>>8&255,o[58]=x14>>>16&255,o[59]=x14>>>24&255,o[60]=x15>>>0&255,o[61]=x15>>>8&255,o[62]=x15>>>16&255,o[63]=x15>>>24&255}function core_hsalsa20(o,p,k,c){for(var u,j0=255&c[0]|(255&c[1])<<8|(255&c[2])<<16|(255&c[3])<<24,j1=255&k[0]|(255&k[1])<<8|(255&k[2])<<16|(255&k[3])<<24,j2=255&k[4]|(255&k[5])<<8|(255&k[6])<<16|(255&k[7])<<24,j3=255&k[8]|(255&k[9])<<8|(255&k[10])<<16|(255&k[11])<<24,j4=255&k[12]|(255&k[13])<<8|(255&k[14])<<16|(255&k[15])<<24,j5=255&c[4]|(255&c[5])<<8|(255&c[6])<<16|(255&c[7])<<24,j6=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,j7=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,j8=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,j9=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,j10=255&c[8]|(255&c[9])<<8|(255&c[10])<<16|(255&c[11])<<24,j11=255&k[16]|(255&k[17])<<8|(255&k[18])<<16|(255&k[19])<<24,j12=255&k[20]|(255&k[21])<<8|(255&k[22])<<16|(255&k[23])<<24,j13=255&k[24]|(255&k[25])<<8|(255&k[26])<<16|(255&k[27])<<24,j14=255&k[28]|(255&k[29])<<8|(255&k[30])<<16|(255&k[31])<<24,j15=255&c[12]|(255&c[13])<<8|(255&c[14])<<16|(255&c[15])<<24,x0=j0,x1=j1,x2=j2,x3=j3,x4=j4,x5=j5,x6=j6,x7=j7,x8=j8,x9=j9,x10=j10,x11=j11,x12=j12,x13=j13,x14=j14,x15=j15,i=0;i<20;i+=2)u=x0+x12|0,x4^=u<<7|u>>>25,u=x4+x0|0,x8^=u<<9|u>>>23,u=x8+x4|0,x12^=u<<13|u>>>19,u=x12+x8|0,x0^=u<<18|u>>>14,u=x5+x1|0,x9^=u<<7|u>>>25,u=x9+x5|0,x13^=u<<9|u>>>23,u=x13+x9|0,x1^=u<<13|u>>>19,u=x1+x13|0,x5^=u<<18|u>>>14,u=x10+x6|0,x14^=u<<7|u>>>25,u=x14+x10|0,x2^=u<<9|u>>>23,u=x2+x14|0,x6^=u<<13|u>>>19,u=x6+x2|0,x10^=u<<18|u>>>14,u=x15+x11|0,x3^=u<<7|u>>>25,u=x3+x15|0,x7^=u<<9|u>>>23,u=x7+x3|0,x11^=u<<13|u>>>19,u=x11+x7|0,x15^=u<<18|u>>>14,u=x0+x3|0,x1^=u<<7|u>>>25,u=x1+x0|0,x2^=u<<9|u>>>23,u=x2+x1|0,x3^=u<<13|u>>>19,u=x3+x2|0,x0^=u<<18|u>>>14,u=x5+x4|0,x6^=u<<7|u>>>25,u=x6+x5|0,x7^=u<<9|u>>>23,u=x7+x6|0,x4^=u<<13|u>>>19,u=x4+x7|0,x5^=u<<18|u>>>14,u=x10+x9|0,x11^=u<<7|u>>>25,u=x11+x10|0,x8^=u<<9|u>>>23,u=x8+x11|0,x9^=u<<13|u>>>19,u=x9+x8|0,x10^=u<<18|u>>>14,u=x15+x14|0,x12^=u<<7|u>>>25,u=x12+x15|0,x13^=u<<9|u>>>23,u=x13+x12|0,x14^=u<<13|u>>>19,u=x14+x13|0,x15^=u<<18|u>>>14;o[0]=x0>>>0&255,o[1]=x0>>>8&255,o[2]=x0>>>16&255,o[3]=x0>>>24&255,o[4]=x5>>>0&255,o[5]=x5>>>8&255,o[6]=x5>>>16&255,o[7]=x5>>>24&255,o[8]=x10>>>0&255,o[9]=x10>>>8&255,o[10]=x10>>>16&255,o[11]=x10>>>24&255,o[12]=x15>>>0&255,o[13]=x15>>>8&255,o[14]=x15>>>16&255,o[15]=x15>>>24&255,o[16]=x6>>>0&255,o[17]=x6>>>8&255,o[18]=x6>>>16&255,o[19]=x6>>>24&255,o[20]=x7>>>0&255,o[21]=x7>>>8&255,o[22]=x7>>>16&255,o[23]=x7>>>24&255,o[24]=x8>>>0&255,o[25]=x8>>>8&255,o[26]=x8>>>16&255,o[27]=x8>>>24&255,o[28]=x9>>>0&255,o[29]=x9>>>8&255,o[30]=x9>>>16&255,o[31]=x9>>>24&255}function crypto_core_salsa20(out,inp,k,c){core_salsa20(out,inp,k,c)}function crypto_core_hsalsa20(out,inp,k,c){core_hsalsa20(out,inp,k,c)}function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k){var u,i,z=new Uint8Array(16),x=new Uint8Array(64);for(i=0;i<16;i++)z[i]=0;for(i=0;i<8;i++)z[i]=n[i];for(;b>=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=m[mpos+i]^x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64,mpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i=64;){for(crypto_core_salsa20(x,z,k,sigma),i=0;i<64;i++)c[cpos+i]=x[i];for(u=1,i=8;i<16;i++)u=u+(255&z[i])|0,z[i]=255&u,u>>>=8;b-=64,cpos+=64}if(b>0)for(crypto_core_salsa20(x,z,k,sigma),i=0;i>16&1),m[i-1]&=65535;m[15]=t[15]-32767-(m[14]>>16&1),b=m[15]>>16&1,m[14]&=65535,sel25519(t,m,1-b)}for(i=0;i<16;i++)o[2*i]=255&t[i],o[2*i+1]=t[i]>>8}function neq25519(a,b){var c=new Uint8Array(32),d=new Uint8Array(32);return pack25519(c,a),pack25519(d,b),crypto_verify_32(c,0,d,0)}function par25519(a){var d=new Uint8Array(32);return pack25519(d,a),1&d[0]}function unpack25519(o,n){var i;for(i=0;i<16;i++)o[i]=n[2*i]+(n[2*i+1]<<8);o[15]&=32767}function A(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]+b[i]}function Z(o,a,b){for(var i=0;i<16;i++)o[i]=a[i]-b[i]}function M(o,a,b){var v,c,t0=0,t1=0,t2=0,t3=0,t4=0,t5=0,t6=0,t7=0,t8=0,t9=0,t10=0,t11=0,t12=0,t13=0,t14=0,t15=0,t16=0,t17=0,t18=0,t19=0,t20=0,t21=0,t22=0,t23=0,t24=0,t25=0,t26=0,t27=0,t28=0,t29=0,t30=0,b0=b[0],b1=b[1],b2=b[2],b3=b[3],b4=b[4],b5=b[5],b6=b[6],b7=b[7],b8=b[8],b9=b[9],b10=b[10],b11=b[11],b12=b[12],b13=b[13],b14=b[14],b15=b[15];v=a[0],t0+=v*b0,t1+=v*b1,t2+=v*b2,t3+=v*b3,t4+=v*b4,t5+=v*b5,t6+=v*b6,t7+=v*b7,t8+=v*b8,t9+=v*b9,t10+=v*b10,t11+=v*b11,t12+=v*b12,t13+=v*b13,t14+=v*b14,t15+=v*b15,v=a[1],t1+=v*b0,t2+=v*b1,t3+=v*b2,t4+=v*b3,t5+=v*b4,t6+=v*b5,t7+=v*b6,t8+=v*b7,t9+=v*b8,t10+=v*b9,t11+=v*b10,t12+=v*b11,t13+=v*b12,t14+=v*b13,t15+=v*b14,t16+=v*b15,v=a[2],t2+=v*b0,t3+=v*b1,t4+=v*b2,t5+=v*b3,t6+=v*b4,t7+=v*b5,t8+=v*b6,t9+=v*b7,t10+=v*b8,t11+=v*b9,t12+=v*b10,t13+=v*b11,t14+=v*b12,t15+=v*b13,t16+=v*b14,t17+=v*b15,v=a[3],t3+=v*b0,t4+=v*b1,t5+=v*b2,t6+=v*b3,t7+=v*b4,t8+=v*b5,t9+=v*b6,t10+=v*b7,t11+=v*b8,t12+=v*b9,t13+=v*b10,t14+=v*b11,t15+=v*b12,t16+=v*b13,t17+=v*b14,t18+=v*b15,v=a[4],t4+=v*b0,t5+=v*b1,t6+=v*b2,t7+=v*b3,t8+=v*b4,t9+=v*b5,t10+=v*b6,t11+=v*b7,t12+=v*b8,t13+=v*b9,t14+=v*b10,t15+=v*b11,t16+=v*b12,t17+=v*b13,t18+=v*b14,t19+=v*b15,v=a[5],t5+=v*b0,t6+=v*b1,t7+=v*b2,t8+=v*b3,t9+=v*b4,t10+=v*b5,t11+=v*b6,t12+=v*b7,t13+=v*b8,t14+=v*b9,t15+=v*b10,t16+=v*b11,t17+=v*b12,t18+=v*b13,t19+=v*b14,t20+=v*b15,v=a[6],t6+=v*b0,t7+=v*b1,t8+=v*b2,t9+=v*b3,t10+=v*b4,t11+=v*b5,t12+=v*b6,t13+=v*b7,t14+=v*b8,t15+=v*b9,t16+=v*b10,t17+=v*b11,t18+=v*b12,t19+=v*b13,t20+=v*b14,t21+=v*b15,v=a[7],t7+=v*b0,t8+=v*b1,t9+=v*b2,t10+=v*b3,t11+=v*b4,t12+=v*b5,t13+=v*b6,t14+=v*b7,t15+=v*b8,t16+=v*b9,t17+=v*b10,t18+=v*b11,t19+=v*b12,t20+=v*b13,t21+=v*b14,t22+=v*b15,v=a[8],t8+=v*b0,t9+=v*b1,t10+=v*b2,t11+=v*b3,t12+=v*b4,t13+=v*b5,t14+=v*b6,t15+=v*b7,t16+=v*b8,t17+=v*b9,t18+=v*b10,t19+=v*b11,t20+=v*b12,t21+=v*b13,t22+=v*b14,t23+=v*b15,v=a[9],t9+=v*b0,t10+=v*b1,t11+=v*b2,t12+=v*b3,t13+=v*b4,t14+=v*b5,t15+=v*b6,t16+=v*b7,t17+=v*b8,t18+=v*b9,t19+=v*b10,t20+=v*b11,t21+=v*b12,t22+=v*b13,t23+=v*b14,t24+=v*b15,v=a[10],t10+=v*b0,t11+=v*b1,t12+=v*b2,t13+=v*b3,t14+=v*b4,t15+=v*b5,t16+=v*b6,t17+=v*b7,t18+=v*b8,t19+=v*b9,t20+=v*b10,t21+=v*b11,t22+=v*b12,t23+=v*b13,t24+=v*b14,t25+=v*b15,v=a[11],t11+=v*b0,t12+=v*b1,t13+=v*b2,t14+=v*b3,t15+=v*b4,t16+=v*b5,t17+=v*b6,t18+=v*b7,t19+=v*b8,t20+=v*b9,t21+=v*b10,t22+=v*b11;t23+=v*b12,t24+=v*b13,t25+=v*b14,t26+=v*b15,v=a[12],t12+=v*b0,t13+=v*b1,t14+=v*b2,t15+=v*b3,t16+=v*b4,t17+=v*b5,t18+=v*b6,t19+=v*b7,t20+=v*b8,t21+=v*b9,t22+=v*b10,t23+=v*b11,t24+=v*b12,t25+=v*b13,t26+=v*b14,t27+=v*b15,v=a[13],t13+=v*b0,t14+=v*b1,t15+=v*b2,t16+=v*b3,t17+=v*b4,t18+=v*b5,t19+=v*b6,t20+=v*b7,t21+=v*b8,t22+=v*b9,t23+=v*b10,t24+=v*b11,t25+=v*b12,t26+=v*b13,t27+=v*b14,t28+=v*b15,v=a[14],t14+=v*b0,t15+=v*b1,t16+=v*b2,t17+=v*b3,t18+=v*b4,t19+=v*b5,t20+=v*b6,t21+=v*b7,t22+=v*b8,t23+=v*b9,t24+=v*b10,t25+=v*b11,t26+=v*b12,t27+=v*b13,t28+=v*b14,t29+=v*b15,v=a[15],t15+=v*b0,t16+=v*b1,t17+=v*b2,t18+=v*b3,t19+=v*b4,t20+=v*b5,t21+=v*b6,t22+=v*b7,t23+=v*b8,t24+=v*b9,t25+=v*b10,t26+=v*b11,t27+=v*b12,t28+=v*b13,t29+=v*b14,t30+=v*b15,t0+=38*t16,t1+=38*t17,t2+=38*t18,t3+=38*t19,t4+=38*t20,t5+=38*t21,t6+=38*t22,t7+=38*t23,t8+=38*t24,t9+=38*t25,t10+=38*t26,t11+=38*t27,t12+=38*t28,t13+=38*t29,t14+=38*t30,c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),c=1,v=t0+c+65535,c=Math.floor(v/65536),t0=v-65536*c,v=t1+c+65535,c=Math.floor(v/65536),t1=v-65536*c,v=t2+c+65535,c=Math.floor(v/65536),t2=v-65536*c,v=t3+c+65535,c=Math.floor(v/65536),t3=v-65536*c,v=t4+c+65535,c=Math.floor(v/65536),t4=v-65536*c,v=t5+c+65535,c=Math.floor(v/65536),t5=v-65536*c,v=t6+c+65535,c=Math.floor(v/65536),t6=v-65536*c,v=t7+c+65535,c=Math.floor(v/65536),t7=v-65536*c,v=t8+c+65535,c=Math.floor(v/65536),t8=v-65536*c,v=t9+c+65535,c=Math.floor(v/65536),t9=v-65536*c,v=t10+c+65535,c=Math.floor(v/65536),t10=v-65536*c,v=t11+c+65535,c=Math.floor(v/65536),t11=v-65536*c,v=t12+c+65535,c=Math.floor(v/65536),t12=v-65536*c,v=t13+c+65535,c=Math.floor(v/65536),t13=v-65536*c,v=t14+c+65535,c=Math.floor(v/65536),t14=v-65536*c,v=t15+c+65535,c=Math.floor(v/65536),t15=v-65536*c,t0+=c-1+37*(c-1),o[0]=t0,o[1]=t1,o[2]=t2,o[3]=t3,o[4]=t4,o[5]=t5,o[6]=t6,o[7]=t7,o[8]=t8,o[9]=t9,o[10]=t10,o[11]=t11,o[12]=t12;o[13]=t13,o[14]=t14,o[15]=t15}function S(o,a){M(o,a,a)}function inv25519(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=253;a>=0;a--)S(c,c),2!==a&&4!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function pow2523(o,i){var a,c=gf();for(a=0;a<16;a++)c[a]=i[a];for(a=250;a>=0;a--)S(c,c),1!==a&&M(c,c,i);for(a=0;a<16;a++)o[a]=c[a]}function crypto_scalarmult(q,n,p){var r,i,z=new Uint8Array(32),x=new Float64Array(80),a=gf(),b=gf(),c=gf(),d=gf(),e=gf(),f=gf();for(i=0;i<31;i++)z[i]=n[i];for(z[31]=127&n[31]|64,z[0]&=248,unpack25519(x,p),i=0;i<16;i++)b[i]=x[i],d[i]=a[i]=c[i]=0;for(a[0]=d[0]=1,i=254;i>=0;--i)r=z[i>>>3]>>>(7&i)&1,sel25519(a,b,r),sel25519(c,d,r),A(e,a,c),Z(a,a,c),A(c,b,d),Z(b,b,d),S(d,e),S(f,a),M(a,c,a),M(c,b,e),A(e,a,c),Z(a,a,c),S(b,a),Z(c,d,f),M(a,c,_121665),A(a,a,d),M(c,c,a),M(a,d,f),M(d,b,x),S(b,e),sel25519(a,b,r),sel25519(c,d,r);for(i=0;i<16;i++)x[i+16]=a[i],x[i+32]=c[i],x[i+48]=b[i],x[i+64]=d[i];var x32=x.subarray(32),x16=x.subarray(16);return inv25519(x32,x32),M(x16,x16,x32),pack25519(q,x16),0}function crypto_scalarmult_base(q,n){return crypto_scalarmult(q,n,_9)}function crypto_box_keypair(y,x){return randombytes(x,32),crypto_scalarmult_base(y,x)}function crypto_box_beforenm(k,y,x){var s=new Uint8Array(32);return crypto_scalarmult(s,x,y),crypto_core_hsalsa20(k,_0,s,sigma)}function crypto_box(c,m,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_afternm(c,m,d,n,k)}function crypto_box_open(m,c,d,n,y,x){var k=new Uint8Array(32);return crypto_box_beforenm(k,y,x),crypto_box_open_afternm(m,c,d,n,k)}function crypto_hashblocks_hl(hh,hl,m,n){for(var bh0,bh1,bh2,bh3,bh4,bh5,bh6,bh7,bl0,bl1,bl2,bl3,bl4,bl5,bl6,bl7,th,tl,i,j,h,l,a,b,c,d,wh=new Int32Array(16),wl=new Int32Array(16),ah0=hh[0],ah1=hh[1],ah2=hh[2],ah3=hh[3],ah4=hh[4],ah5=hh[5],ah6=hh[6],ah7=hh[7],al0=hl[0],al1=hl[1],al2=hl[2],al3=hl[3],al4=hl[4],al5=hl[5],al6=hl[6],al7=hl[7],pos=0;n>=128;){for(i=0;i<16;i++)j=8*i+pos,wh[i]=m[j+0]<<24|m[j+1]<<16|m[j+2]<<8|m[j+3],wl[i]=m[j+4]<<24|m[j+5]<<16|m[j+6]<<8|m[j+7];for(i=0;i<80;i++)if(bh0=ah0,bh1=ah1,bh2=ah2,bh3=ah3,bh4=ah4,bh5=ah5,bh6=ah6,bh7=ah7,bl0=al0,bl1=al1,bl2=al2,bl3=al3,bl4=al4,bl5=al5,bl6=al6,bl7=al7,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah4>>>14|al4<<18)^(ah4>>>18|al4<<14)^(al4>>>9|ah4<<23),l=(al4>>>14|ah4<<18)^(al4>>>18|ah4<<14)^(ah4>>>9|al4<<23),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah4&ah5^~ah4&ah6,l=al4&al5^~al4&al6,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=K[2*i],l=K[2*i+1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=wh[i%16],l=wl[i%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,th=65535&c|d<<16,tl=65535&a|b<<16,h=th,l=tl,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=(ah0>>>28|al0<<4)^(al0>>>2|ah0<<30)^(al0>>>7|ah0<<25),l=(al0>>>28|ah0<<4)^(ah0>>>2|al0<<30)^(ah0>>>7|al0<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,h=ah0&ah1^ah0&ah2^ah1&ah2,l=al0&al1^al0&al2^al1&al2,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh7=65535&c|d<<16,bl7=65535&a|b<<16,h=bh3,l=bl3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=th,l=tl,a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,bh3=65535&c|d<<16,bl3=65535&a|b<<16,ah1=bh0,ah2=bh1,ah3=bh2,ah4=bh3,ah5=bh4,ah6=bh5,ah7=bh6,ah0=bh7,al1=bl0,al2=bl1,al3=bl2,al4=bl3,al5=bl4,al6=bl5,al7=bl6,al0=bl7,i%16==15)for(j=0;j<16;j++)h=wh[j],l=wl[j],a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=wh[(j+9)%16],l=wl[(j+9)%16],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+1)%16],tl=wl[(j+1)%16],h=(th>>>1|tl<<31)^(th>>>8|tl<<24)^th>>>7,l=(tl>>>1|th<<31)^(tl>>>8|th<<24)^(tl>>>7|th<<25),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,th=wh[(j+14)%16],tl=wl[(j+14)%16],h=(th>>>19|tl<<13)^(tl>>>29|th<<3)^th>>>6,l=(tl>>>19|th<<13)^(th>>>29|tl<<3)^(tl>>>6|th<<26),a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,wh[j]=65535&c|d<<16,wl[j]=65535&a|b<<16;h=ah0,l=al0,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[0],l=hl[0],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[0]=ah0=65535&c|d<<16,hl[0]=al0=65535&a|b<<16,h=ah1,l=al1,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[1],l=hl[1],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[1]=ah1=65535&c|d<<16,hl[1]=al1=65535&a|b<<16,h=ah2,l=al2,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[2],l=hl[2],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[2]=ah2=65535&c|d<<16,hl[2]=al2=65535&a|b<<16,h=ah3,l=al3,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[3],l=hl[3],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[3]=ah3=65535&c|d<<16,hl[3]=al3=65535&a|b<<16,h=ah4,l=al4,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[4],l=hl[4],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[4]=ah4=65535&c|d<<16,hl[4]=al4=65535&a|b<<16,h=ah5,l=al5,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[5],l=hl[5],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[5]=ah5=65535&c|d<<16,hl[5]=al5=65535&a|b<<16,h=ah6,l=al6,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[6],l=hl[6],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[6]=ah6=65535&c|d<<16,hl[6]=al6=65535&a|b<<16,h=ah7,l=al7,a=65535&l,b=l>>>16,c=65535&h,d=h>>>16,h=hh[7],l=hl[7],a+=65535&l,b+=l>>>16,c+=65535&h,d+=h>>>16,b+=a>>>16,c+=b>>>16,d+=c>>>16,hh[7]=ah7=65535&c|d<<16,hl[7]=al7=65535&a|b<<16,pos+=128,n-=128}return n}function crypto_hash(out,m,n){var i,hh=new Int32Array(8),hl=new Int32Array(8),x=new Uint8Array(256),b=n;for(hh[0]=1779033703,hh[1]=3144134277,hh[2]=1013904242,hh[3]=2773480762,hh[4]=1359893119,hh[5]=2600822924,hh[6]=528734635,hh[7]=1541459225,hl[0]=4089235720,hl[1]=2227873595,hl[2]=4271175723,hl[3]=1595750129,hl[4]=2917565137,hl[5]=725511199,hl[6]=4215389547,hl[7]=327033209,crypto_hashblocks_hl(hh,hl,m,n),n%=128,i=0;i=0;--i)b=s[i/8|0]>>(7&i)&1,cswap(p,q,b),add(q,p),add(p,p),cswap(p,q,b)}function scalarbase(p,s){var q=[gf(),gf(),gf(),gf()];set25519(q[0],X),set25519(q[1],Y),set25519(q[2],gf1),M(q[3],X,Y),scalarmult(p,q,s)}function crypto_sign_keypair(pk,sk,seeded){var i,d=new Uint8Array(64),p=[gf(),gf(),gf(),gf()];for(seeded||randombytes(sk,32),crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64,scalarbase(p,d),pack(pk,p),i=0;i<32;i++)sk[i+32]=pk[i];return 0}function modL(r,x){var carry,i,j,k;for(i=63;i>=32;--i){for(carry=0,j=i-32,k=i-12;j>8,x[j]-=256*carry;x[j]+=carry,x[i]=0}for(carry=0,j=0;j<32;j++)x[j]+=carry-(x[31]>>4)*L[j],carry=x[j]>>8,x[j]&=255;for(j=0;j<32;j++)x[j]-=carry*L[j];for(i=0;i<32;i++)x[i+1]+=x[i]>>8,r[i]=255&x[i]}function reduce(r){var i,x=new Float64Array(64);for(i=0;i<64;i++)x[i]=r[i];for(i=0;i<64;i++)r[i]=0;modL(r,x)}function crypto_sign(sm,m,n,sk){var i,j,d=new Uint8Array(64),h=new Uint8Array(64),r=new Uint8Array(64),x=new Float64Array(64),p=[gf(),gf(),gf(),gf()];crypto_hash(d,sk,32),d[0]&=248,d[31]&=127,d[31]|=64;var smlen=n+64;for(i=0;i>7&&Z(r[0],gf0,r[0]),M(r[3],r[0],r[1]),0)}function crypto_sign_open(m,sm,n,pk){var i,t=new Uint8Array(32),h=new Uint8Array(64),p=[gf(),gf(),gf(),gf()],q=[gf(),gf(),gf(),gf()];if(-1,n<64)return-1;if(unpackneg(q,pk))return-1;for(i=0;i>>13|t1<<3),t2=255&key[4]|(255&key[5])<<8,this.r[2]=7939&(t1>>>10|t2<<6),t3=255&key[6]|(255&key[7])<<8,this.r[3]=8191&(t2>>>7|t3<<9),t4=255&key[8]|(255&key[9])<<8,this.r[4]=255&(t3>>>4|t4<<12),this.r[5]=t4>>>1&8190,t5=255&key[10]|(255&key[11])<<8,this.r[6]=8191&(t4>>>14|t5<<2),t6=255&key[12]|(255&key[13])<<8,this.r[7]=8065&(t5>>>11|t6<<5),t7=255&key[14]|(255&key[15])<<8,this.r[8]=8191&(t6>>>8|t7<<8),this.r[9]=t7>>>5&127,this.pad[0]=255&key[16]|(255&key[17])<<8,this.pad[1]=255&key[18]|(255&key[19])<<8,this.pad[2]=255&key[20]|(255&key[21])<<8,this.pad[3]=255&key[22]|(255&key[23])<<8,this.pad[4]=255&key[24]|(255&key[25])<<8,this.pad[5]=255&key[26]|(255&key[27])<<8,this.pad[6]=255&key[28]|(255&key[29])<<8,this.pad[7]=255&key[30]|(255&key[31])<<8};poly1305.prototype.blocks=function(m,mpos,bytes){for(var t0,t1,t2,t3,t4,t5,t6,t7,c,d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,hibit=this.fin?0:2048,h0=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],h7=this.h[7],h8=this.h[8],h9=this.h[9],r0=this.r[0],r1=this.r[1],r2=this.r[2],r3=this.r[3],r4=this.r[4],r5=this.r[5],r6=this.r[6],r7=this.r[7],r8=this.r[8],r9=this.r[9];bytes>=16;)t0=255&m[mpos+0]|(255&m[mpos+1])<<8,h0+=8191&t0,t1=255&m[mpos+2]|(255&m[mpos+3])<<8,h1+=8191&(t0>>>13|t1<<3),t2=255&m[mpos+4]|(255&m[mpos+5])<<8,h2+=8191&(t1>>>10|t2<<6),t3=255&m[mpos+6]|(255&m[mpos+7])<<8,h3+=8191&(t2>>>7|t3<<9),t4=255&m[mpos+8]|(255&m[mpos+9])<<8,h4+=8191&(t3>>>4|t4<<12),h5+=t4>>>1&8191,t5=255&m[mpos+10]|(255&m[mpos+11])<<8,h6+=8191&(t4>>>14|t5<<2),t6=255&m[mpos+12]|(255&m[mpos+13])<<8,h7+=8191&(t5>>>11|t6<<5),t7=255&m[mpos+14]|(255&m[mpos+15])<<8,h8+=8191&(t6>>>8|t7<<8),h9+=t7>>>5|hibit,c=0,d0=c,d0+=h0*r0,d0+=h1*(5*r9),d0+=h2*(5*r8), d0+=h3*(5*r7),d0+=h4*(5*r6),c=d0>>>13,d0&=8191,d0+=h5*(5*r5),d0+=h6*(5*r4),d0+=h7*(5*r3),d0+=h8*(5*r2),d0+=h9*(5*r1),c+=d0>>>13,d0&=8191,d1=c,d1+=h0*r1,d1+=h1*r0,d1+=h2*(5*r9),d1+=h3*(5*r8),d1+=h4*(5*r7),c=d1>>>13,d1&=8191,d1+=h5*(5*r6),d1+=h6*(5*r5),d1+=h7*(5*r4),d1+=h8*(5*r3),d1+=h9*(5*r2),c+=d1>>>13,d1&=8191,d2=c,d2+=h0*r2,d2+=h1*r1,d2+=h2*r0,d2+=h3*(5*r9),d2+=h4*(5*r8),c=d2>>>13,d2&=8191,d2+=h5*(5*r7),d2+=h6*(5*r6),d2+=h7*(5*r5),d2+=h8*(5*r4),d2+=h9*(5*r3),c+=d2>>>13,d2&=8191,d3=c,d3+=h0*r3,d3+=h1*r2,d3+=h2*r1,d3+=h3*r0,d3+=h4*(5*r9),c=d3>>>13,d3&=8191,d3+=h5*(5*r8),d3+=h6*(5*r7),d3+=h7*(5*r6),d3+=h8*(5*r5),d3+=h9*(5*r4),c+=d3>>>13,d3&=8191,d4=c,d4+=h0*r4,d4+=h1*r3,d4+=h2*r2,d4+=h3*r1,d4+=h4*r0,c=d4>>>13,d4&=8191,d4+=h5*(5*r9),d4+=h6*(5*r8),d4+=h7*(5*r7),d4+=h8*(5*r6),d4+=h9*(5*r5),c+=d4>>>13,d4&=8191,d5=c,d5+=h0*r5,d5+=h1*r4,d5+=h2*r3,d5+=h3*r2,d5+=h4*r1,c=d5>>>13,d5&=8191,d5+=h5*r0,d5+=h6*(5*r9),d5+=h7*(5*r8),d5+=h8*(5*r7),d5+=h9*(5*r6),c+=d5>>>13,d5&=8191,d6=c,d6+=h0*r6,d6+=h1*r5,d6+=h2*r4,d6+=h3*r3,d6+=h4*r2,c=d6>>>13,d6&=8191,d6+=h5*r1,d6+=h6*r0,d6+=h7*(5*r9),d6+=h8*(5*r8),d6+=h9*(5*r7),c+=d6>>>13,d6&=8191,d7=c,d7+=h0*r7,d7+=h1*r6,d7+=h2*r5,d7+=h3*r4,d7+=h4*r3,c=d7>>>13,d7&=8191,d7+=h5*r2,d7+=h6*r1,d7+=h7*r0,d7+=h8*(5*r9),d7+=h9*(5*r8),c+=d7>>>13,d7&=8191,d8=c,d8+=h0*r8,d8+=h1*r7,d8+=h2*r6,d8+=h3*r5,d8+=h4*r4,c=d8>>>13,d8&=8191,d8+=h5*r3,d8+=h6*r2,d8+=h7*r1,d8+=h8*r0,d8+=h9*(5*r9),c+=d8>>>13,d8&=8191,d9=c,d9+=h0*r9,d9+=h1*r8,d9+=h2*r7,d9+=h3*r6,d9+=h4*r5,c=d9>>>13,d9&=8191,d9+=h5*r4,d9+=h6*r3,d9+=h7*r2,d9+=h8*r1,d9+=h9*r0,c+=d9>>>13,d9&=8191,c=(c<<2)+c|0,c=c+d0|0,d0=8191&c,c>>>=13,d1+=c,h0=d0,h1=d1,h2=d2,h3=d3,h4=d4,h5=d5,h6=d6,h7=d7,h8=d8,h9=d9,mpos+=16,bytes-=16;this.h[0]=h0,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=h7,this.h[8]=h8,this.h[9]=h9},poly1305.prototype.finish=function(mac,macpos){var c,mask,f,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(c=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=c,c=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*c,c=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=c,c=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=c,g[0]=this.h[0]+5,c=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+c,c=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^c)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),f=this.h[0]+this.pad[0],this.h[0]=65535&f,i=1;i<8;i++)f=(this.h[i]+this.pad[i]|0)+(f>>>16)|0,this.h[i]=65535&f;mac[macpos+0]=this.h[0]>>>0&255,mac[macpos+1]=this.h[0]>>>8&255,mac[macpos+2]=this.h[1]>>>0&255,mac[macpos+3]=this.h[1]>>>8&255,mac[macpos+4]=this.h[2]>>>0&255,mac[macpos+5]=this.h[2]>>>8&255,mac[macpos+6]=this.h[3]>>>0&255,mac[macpos+7]=this.h[3]>>>8&255,mac[macpos+8]=this.h[4]>>>0&255,mac[macpos+9]=this.h[4]>>>8&255,mac[macpos+10]=this.h[5]>>>0&255,mac[macpos+11]=this.h[5]>>>8&255,mac[macpos+12]=this.h[6]>>>0&255,mac[macpos+13]=this.h[6]>>>8&255,mac[macpos+14]=this.h[7]>>>0&255,mac[macpos+15]=this.h[7]>>>8&255},poly1305.prototype.update=function(m,mpos,bytes){var i,want;if(this.leftover){for(want=16-this.leftover,want>bytes&&(want=bytes),i=0;i=16&&(want=bytes-bytes%16,this.blocks(m,mpos,want),mpos+=want,bytes-=want),bytes){for(i=0;i=0},nacl.sign.keyPair=function(){var pk=new Uint8Array(32),sk=new Uint8Array(64);return crypto_sign_keypair(pk,sk),{publicKey:pk,secretKey:sk}},nacl.sign.keyPair.fromSecretKey=function(secretKey){if(checkArrayTypes(),64!==secretKey.length)throw new Error("bad secret key size");for(var pk=new Uint8Array(32),i=0;iMAX_ARRAY_LENGTH)throw new RangeError("Array too large for polyfill");var i;for(i=0;i>s}function as_unsigned(value,bits){var s=32-bits;return value<>>s}function packI8(n){return[255&n]}function unpackI8(bytes){return as_signed(bytes[0],8)}function packU8(n){return[255&n]}function unpackU8(bytes){return as_unsigned(bytes[0],8)}function packU8Clamped(n){return n=round(Number(n)),[n<0?0:n>255?255:255&n]}function packI16(n){return[n>>8&255,255&n]}function unpackI16(bytes){return as_signed(bytes[0]<<8|bytes[1],16)}function packU16(n){return[n>>8&255,255&n]}function unpackU16(bytes){return as_unsigned(bytes[0]<<8|bytes[1],16)}function packI32(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]}function unpackI32(bytes){return as_signed(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packU32(n){return[n>>24&255,n>>16&255,n>>8&255,255&n]}function unpackU32(bytes){return as_unsigned(bytes[0]<<24|bytes[1]<<16|bytes[2]<<8|bytes[3],32)}function packIEEE754(v,ebits,fbits){function roundToEven(n){var w=floor(n),f=n-w;return f<.5?w:f>.5?w+1:w%2?w+1:w}var s,e,f,i,bits,str,bytes,bias=(1<=pow(2,1-bias)?(e=min(floor(log(v)/LN2),1023),f=roundToEven(v/pow(2,e)*pow(2,fbits)),f/pow(2,fbits)>=2&&(e+=1,f=1),e>bias?(e=(1<>=1;return bits.reverse(),str=bits.join(""),bias=(1<0?s*pow(2,e-bias)*(1+f/pow(2,fbits)):0!==f?s*pow(2,-(bias-1))*(f/pow(2,fbits)):s<0?-0:0}function unpackF64(b){return unpackIEEE754(b,11,52)}function packF64(v){return packIEEE754(v,11,52)}function unpackF32(b){return unpackIEEE754(b,8,23)}function packF32(v){return packIEEE754(v,8,23)}var defineProp,undefined=void 0,MAX_ARRAY_LENGTH=1e5,ECMAScript=function(){var opts=Object.prototype.toString,ophop=Object.prototype.hasOwnProperty;return{Class:function(v){return opts.call(v).replace(/^\[object *|\]$/g,"")},HasProperty:function(o,p){return p in o},HasOwnProperty:function(o,p){return ophop.call(o,p)},IsCallable:function(o){return"function"==typeof o},ToInt32:function(v){return v>>0},ToUint32:function(v){return v>>>0}}}(),LN2=Math.LN2,abs=Math.abs,floor=Math.floor,log=Math.log,min=Math.min,pow=Math.pow,round=Math.round;defineProp=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}()?Object.defineProperty:function(o,p,desc){if(!o===Object(o))throw new TypeError("Object.defineProperty called on non-object");return ECMAScript.HasProperty(desc,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(o,p,desc.get),ECMAScript.HasProperty(desc,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(o,p,desc.set),ECMAScript.HasProperty(desc,"value")&&(o[p]=desc.value),o};var getOwnPropNames=Object.getOwnPropertyNames||function(o){if(o!==Object(o))throw new TypeError("Object.getOwnPropertyNames called on non-object");var p,props=[];for(p in o)ECMAScript.HasOwnProperty(o,p)&&props.push(p);return props};!function(){function makeConstructor(bytesPerElement,pack,unpack){var ctor;return ctor=function(buffer,byteOffset,length){var array,sequence,i,s;if(arguments.length&&"number"!=typeof arguments[0])if("object"==typeof arguments[0]&&arguments[0].constructor===ctor)for(array=arguments[0],this.length=array.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new ArrayBuffer(this.byteLength),this.byteOffset=0,i=0;ithis.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=ECMAScript.ToUint32(length),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else for(sequence=arguments[0],this.length=ECMAScript.ToUint32(sequence.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new ArrayBuffer(this.byteLength),this.byteOffset=0,i=0;i=this.length)return undefined;var i,o,bytes=[];for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;i=this.length)return undefined;var i,o,bytes=this._pack(value);for(i=0,o=this.byteOffset+index*this.BYTES_PER_ELEMENT;ithis.length)throw new RangeError("Offset plus length of array is out of range");if(byteOffset=this.byteOffset+offset*this.BYTES_PER_ELEMENT,byteLength=array.length*this.BYTES_PER_ELEMENT,array.buffer===this.buffer){for(tmp=[],i=0,s=array.byteOffset;ithis.length)throw new RangeError("Offset plus length of array is out of range");for(i=0;imax?max:v}start=ECMAScript.ToInt32(start),end=ECMAScript.ToInt32(end),arguments.length<1&&(start=0),arguments.length<2&&(end=this.length),start<0&&(start=this.length+start),end<0&&(end=this.length+end),start=clamp(start,0,this.length),end=clamp(end,0,this.length);var len=end-start;return len<0&&(len=0),new this.constructor(this.buffer,this.byteOffset+start*this.BYTES_PER_ELEMENT,len)},ctor}var ArrayBuffer=function(length){if((length=ECMAScript.ToInt32(length))<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=length,this._bytes=[],this._bytes.length=length;var i;for(i=0;ithis.byteLength)throw new RangeError("Array index out of range");byteOffset+=this.byteOffset;var i,uint8Array=new exports.Uint8Array(this.buffer,byteOffset,arrayType.BYTES_PER_ELEMENT),bytes=[];for(i=0;ithis.byteLength)throw new RangeError("Array index out of range");var i,byteView,typeArray=new arrayType([value]),byteArray=new exports.Uint8Array(typeArray.buffer),bytes=[];for(i=0;ithis.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=ECMAScript.ToUint32(byteLength),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");configureProperties(this)};DataView.prototype.getUint8=makeGetter(exports.Uint8Array),DataView.prototype.getInt8=makeGetter(exports.Int8Array),DataView.prototype.getUint16=makeGetter(exports.Uint16Array),DataView.prototype.getInt16=makeGetter(exports.Int16Array),DataView.prototype.getUint32=makeGetter(exports.Uint32Array),DataView.prototype.getInt32=makeGetter(exports.Int32Array),DataView.prototype.getFloat32=makeGetter(exports.Float32Array),DataView.prototype.getFloat64=makeGetter(exports.Float64Array),DataView.prototype.setUint8=makeSetter(exports.Uint8Array),DataView.prototype.setInt8=makeSetter(exports.Int8Array),DataView.prototype.setUint16=makeSetter(exports.Uint16Array),DataView.prototype.setInt16=makeSetter(exports.Int16Array),DataView.prototype.setUint32=makeSetter(exports.Uint32Array),DataView.prototype.setInt32=makeSetter(exports.Int32Array),DataView.prototype.setFloat32=makeSetter(exports.Float32Array),DataView.prototype.setFloat64=makeSetter(exports.Float64Array),exports.DataView=exports.DataView||DataView}()},function(module,exports,__webpack_require__){"use strict";module.exports={isString:function(arg){return"string"==typeof arg},isObject:function(arg){return"object"==typeof arg&&null!==arg},isNull:function(arg){return null===arg},isNullOrUndefined:function(arg){return null==arg}}},function(module,exports,__webpack_require__){(function(global){function deprecate(fn,msg){function deprecated(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}if(config("noDeprecation"))return fn;var warned=!1;return deprecated}function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=deprecate}).call(exports,__webpack_require__(5))},function(module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}},function(module,exports){module.exports=function(arg){return arg&&"object"==typeof arg&&"function"==typeof arg.copy&&"function"==typeof arg.fill&&"function"==typeof arg.readUInt8}},function(module,exports){function read(buf,offset){var b,res=0,offset=offset||0,shift=0,counter=offset,l=buf.length;do{if(counter>=l)throw read.bytes=0,new RangeError("Could not decode varint");b=buf[counter++],res+=shift<28?(b&REST)<=MSB);return read.bytes=counter-offset,res}module.exports=read;var MSB=128,REST=127},function(module,exports){function encode(num,out,offset){out=out||[],offset=offset||0;for(var oldOffset=offset;num>=INT;)out[offset++]=255&num|MSB,num/=128;for(;num&MSBALL;)out[offset++]=255&num|MSB,num>>>=7;return out[offset]=0|num,encode.bytes=offset-oldOffset+1,out}module.exports=encode;var MSB=128,MSBALL=-128,INT=Math.pow(2,31)},function(module,exports){var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63);module.exports=function(value){return value2&&(prv=!0,info.shift());var jwk={ext:!0};switch(info[0][0]){case"1.2.840.113549.1.1.1":var rsaComp=["n","e","d","p","q","dp","dq","qi"],rsaKey=b2der(info[1]);prv&&rsaKey.shift();for(var i=0;i2&&(prv=!0,rsaKey.unshift(new Uint8Array([0]))),info[0][0]="1.2.840.113549.1.1.1",key=rsaKey;break;default:throw new TypeError("Unsupported key type")}return info.push(new Uint8Array(der2b(key)).buffer),prv?info.unshift(new Uint8Array([0])):info[1]={tag:3,value:info[1]},new Uint8Array(der2b(info)).buffer}function b2der(buf,ctx){if(buf instanceof ArrayBuffer&&(buf=new Uint8Array(buf)),ctx||(ctx={pos:0,end:buf.length}),ctx.end-ctx.pos<2||ctx.end>buf.length)throw new RangeError("Malformed DER");var tag=buf[ctx.pos++],len=buf[ctx.pos++];if(len>=128){if(len&=127,ctx.end-ctx.pos=128){var xlen=len,len=4;for(buf.splice(pos,0,xlen>>24&255,xlen>>16&255,xlen>>8&255,255&xlen);len>1&&!(xlen>>24);)xlen<<=8,len--;len<4&&buf.splice(pos,4-len),len|=128}return buf.splice(pos-2,2,tag,len),buf}function CryptoKey(key,alg,ext,use){Object.defineProperties(this,{_key:{value:key},type:{value:key.type,enumerable:!0},extractable:{value:void 0===ext?key.extractable:ext,enumerable:!0},algorithm:{value:void 0===alg?key.algorithm:alg,enumerable:!0},usages:{value:void 0===use?key.usages:use,enumerable:!0}})}function isPubKeyUse(u){return"verify"===u||"encrypt"===u||"wrapKey"===u}function isPrvKeyUse(u){return"sign"===u||"decrypt"===u||"unwrapKey"===u}if("function"!=typeof Promise)throw"Promise support required";var _crypto=global.crypto||global.msCrypto;if(_crypto){var _subtle=_crypto.subtle||_crypto.webkitSubtle;if(_subtle){var _Crypto=global.Crypto||_crypto.constructor||Object,_SubtleCrypto=global.SubtleCrypto||_subtle.constructor||Object,isEdge=(global.CryptoKey||global.Key||Object,global.navigator.userAgent.indexOf("Edge/")>-1),isIE=!!global.msCrypto&&!isEdge,isWebkit=!!_crypto.webkitSubtle;if(isIE||isWebkit){var oid2str={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},str2oid={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var ka,kx,ku,args=[].slice.call(arguments);switch(m){case"generateKey":ka=alg(a),kx=b,ku=c;break;case"importKey":ka=alg(c),kx=args[3],ku=args[4],"jwk"===a&&(b=b2jwk(b),b.alg||(b.alg=jwkAlg(ka)),b.key_ops||(b.key_ops="oct"!==b.kty?"d"in b?ku.filter(isPrvKeyUse):ku.filter(isPubKeyUse):ku.slice()),args[1]=jwk2b(b));break;case"unwrapKey":ka=args[4],kx=args[5],ku=args[6],args[2]=c._key}if("generateKey"===m&&"HMAC"===ka.name&&ka.hash)return ka.length=ka.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[ka.hash.name],_subtle.importKey("raw",_crypto.getRandomValues(new Uint8Array(ka.length+7>>3)),ka,kx,ku);if(isWebkit&&"generateKey"===m&&"RSASSA-PKCS1-v1_5"===ka.name&&(!ka.modulusLength||ka.modulusLength>=2048))return a=alg(a),a.name="RSAES-PKCS1-v1_5",delete a.hash,_subtle.generateKey(a,!0,["encrypt","decrypt"]).then(function(k){return Promise.all([_subtle.exportKey("jwk",k.publicKey),_subtle.exportKey("jwk",k.privateKey)])}).then(function(keys){return keys[0].alg=keys[1].alg=jwkAlg(ka),keys[0].key_ops=ku.filter(isPubKeyUse),keys[1].key_ops=ku.filter(isPrvKeyUse),Promise.all([_subtle.importKey("jwk",keys[0],ka,!0,keys[0].key_ops),_subtle.importKey("jwk",keys[1],ka,kx,keys[1].key_ops)])}).then(function(keys){return{publicKey:keys[0],privateKey:keys[1]}});if((isWebkit||isIE&&"SHA-1"===(ka.hash||{}).name)&&"importKey"===m&&"jwk"===a&&"HMAC"===ka.name&&"oct"===b.kty)return _subtle.importKey("raw",s2b(a2s(b.k)),c,args[3],args[4]);if(isWebkit&&"importKey"===m&&("spki"===a||"pkcs8"===a))return _subtle.importKey("jwk",pkcs2jwk(b),c,args[3],args[4]);if(isIE&&"unwrapKey"===m)return _subtle.decrypt(args[3],c,b).then(function(k){return _subtle.importKey(a,k,args[4],args[5],args[6])});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),op=op.then(function(k){return"HMAC"===ka.name&&(ka.length||(ka.length=8*k.algorithm.length)),0==ka.name.search("RSA")&&(ka.modulusLength||(ka.modulusLength=(k.publicKey||k).algorithm.modulusLength),ka.publicExponent||(ka.publicExponent=(k.publicKey||k).algorithm.publicExponent)),k=k.publicKey&&k.privateKey?{publicKey:new CryptoKey(k.publicKey,ka,kx,ku.filter(isPubKeyUse)),privateKey:new CryptoKey(k.privateKey,ka,kx,ku.filter(isPrvKeyUse))}:new CryptoKey(k,ka,kx,ku)})}}),["exportKey","wrapKey"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c){var args=[].slice.call(arguments);switch(m){case"exportKey":args[1]=b._key;break;case"wrapKey":args[1]=b._key,args[2]=c._key}if((isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"exportKey"===m&&"jwk"===a&&"HMAC"===b.algorithm.name&&(args[0]="raw"),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(args[0]="jwk"),isIE&&"wrapKey"===m)return _subtle.exportKey(a,b).then(function(k){return"jwk"===a&&(k=s2b(unescape(encodeURIComponent(JSON.stringify(b2jwk(k)))))),_subtle.encrypt(args[3],c,k)});var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})),"exportKey"===m&&"jwk"===a&&(op=op.then(function(k){return(isWebkit||isIE&&"SHA-1"===(b.algorithm.hash||{}).name)&&"HMAC"===b.algorithm.name?{kty:"oct",alg:jwkAlg(b.algorithm),key_ops:b.usages.slice(),ext:!0,k:s2a(b2s(k))}:(k=b2jwk(k),k.alg||(k.alg=jwkAlg(b.algorithm)),k.key_ops||(k.key_ops="public"===b.type?b.usages.filter(isPubKeyUse):"private"===b.type?b.usages.filter(isPrvKeyUse):b.usages.slice()),k)})),!isWebkit||"exportKey"!==m||"spki"!==a&&"pkcs8"!==a||(op=op.then(function(k){return k=jwk2pkcs(b2jwk(k))})),op}}),["encrypt","decrypt","sign","verify"].forEach(function(m){var _fn=_subtle[m];_subtle[m]=function(a,b,c,d){if(isIE&&(!c.byteLength||d&&!d.byteLength))throw new Error("Empy input is not allowed");var args=[].slice.call(arguments),ka=alg(a);if(isIE&&"decrypt"===m&&"AES-GCM"===ka.name){var tl=a.tagLength>>3;args[2]=(c.buffer||c).slice(0,c.byteLength-tl),a.tag=(c.buffer||c).slice(c.byteLength-tl)}args[1]=b._key;var op;try{op=_fn.apply(_subtle,args)}catch(e){return Promise.reject(e)}return isIE&&(op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){var r=r.target.result;if("encrypt"===m&&r instanceof AesGcmEncryptResult){var c=r.ciphertext,t=r.tag;r=new Uint8Array(c.byteLength+t.byteLength),r.set(new Uint8Array(c),0),r.set(new Uint8Array(t),c.byteLength),r=r.buffer}res(r)}})),op}}),isIE){var _digest=_subtle.digest;_subtle.digest=function(a,b){if(!b.byteLength)throw new Error("Empy input is not allowed");var op;try{op=_digest.call(_subtle,a,b)}catch(e){return Promise.reject(e)}return op=new Promise(function(res,rej){op.onabort=op.onerror=function(e){rej(e)},op.oncomplete=function(r){res(r.target.result)}})},global.crypto=Object.create(_crypto,{getRandomValues:{value:function(a){return _crypto.getRandomValues(a)}},subtle:{value:_subtle}}),global.CryptoKey=CryptoKey}isWebkit&&(_crypto.subtle=_subtle,global.Crypto=_Crypto,global.SubtleCrypto=_SubtleCrypto,global.CryptoKey=CryptoKey)}}}}},function(module,exports){function wrappy(fn,cb){function wrapper(){for(var args=new Array(arguments.length),i=0;i0)for(var i=0,l=arguments.length;i1)acc=initial;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");walker=this.head.next,acc=this.head.value}for(var i=0;null!==walker;i++)acc=fn(acc,walker.value,i),walker=walker.next;return acc},Yallist.prototype.reduceReverse=function(fn,initial){var acc,walker=this.tail;if(arguments.length>1)acc=initial;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");walker=this.tail.prev,acc=this.tail.value}for(var i=this.length-1;null!==walker;i--)acc=fn(acc,walker.value,i),walker=walker.prev;return acc},Yallist.prototype.toArray=function(){for(var arr=new Array(this.length),i=0,walker=this.head;null!==walker;i++)arr[i]=walker.value,walker=walker.next;return arr},Yallist.prototype.toArrayReverse=function(){for(var arr=new Array(this.length),i=0,walker=this.tail;null!==walker;i++)arr[i]=walker.value,walker=walker.prev;return arr},Yallist.prototype.slice=function(from,to){to=to||this.length,to<0&&(to+=this.length),(from=from||0)<0&&(from+=this.length);var ret=new Yallist;if(tothis.length&&(to=this.length);for(var i=0,walker=this.head;null!==walker&&ithis.length&&(to=this.length);for(var i=this.length,walker=this.tail;null!==walker&&i>to;i--)walker=walker.prev;for(;null!==walker&&i>from;i--,walker=walker.prev)ret.push(walker.value);return ret},Yallist.prototype.reverse=function(){for(var head=this.head,tail=this.tail,walker=head;null!==walker;walker=walker.prev){var p=walker.prev;walker.prev=walker.next,walker.next=p}return this.head=tail,this.tail=head,this}},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{wantlist:__webpack_require__(316)(send),stat:__webpack_require__(314)(send),unwant:__webpack_require__(315)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify(callback=>{send({path:"bitswap/stat"},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"bitswap/unwant",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify(callback=>{send({path:"bitswap/wantlist"},callback)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(1),Block=__webpack_require__(91),CID=__webpack_require__(39),streamToValue=__webpack_require__(9);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});let cid;try{if(CID.isCID(args))cid=args,args=cid.toBaseEncodedString();else if(Buffer.isBuffer(args))cid=new CID(args),args=cid.toBaseEncodedString();else{if("string"!=typeof args)return callback(new Error("invalid argument"));cid=new CID(args)}}catch(err){return callback(err)}const transform=(res,callback)=>{Buffer.isBuffer(res)?callback(null,new Block(res,cid)):streamToValue(res,(err,data)=>{if(err)return callback(err);callback(null,new Block(data,cid))})},request={path:"block/get",args:args,qs:opts};send.andTransform(request,transform,callback)})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{get:__webpack_require__(317)(send),stat:__webpack_require__(320)(send),put:__webpack_require__(319)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),Block=__webpack_require__(91),CID=__webpack_require__(39);module.exports=(send=>{return promisify((block,cid,callback)=>{if("function"==typeof cid&&(callback=cid,cid={}),Array.isArray(block)){const err=new Error("block.put() only accepts 1 file");return callback(err)}"object"==typeof block&&block.data&&(block=block.data);const request={path:"block/put",files:block},transform=(info,callback)=>{callback(null,new Block(block,new CID(info.Key)))};send.andTransform(request,transform,callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),CID=__webpack_require__(39),multihash=__webpack_require__(8);module.exports=(send=>{return promisify((args,opts,callback)=>{args&&CID.isCID(args)&&(args=multihash.toB58String(args.multihash)),"function"==typeof opts&&(callback=opts,opts={});const request={path:"block/stat",args:args,qs:opts},transform=(stats,callback)=>{callback(null,{key:stats.Key,size:stats.Size})};send.andTransform(request,transform,callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),args&&"object"==typeof args&&(opts=args,args=void 0),send({path:"bootstrap/add",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{add:__webpack_require__(321)(send),rm:__webpack_require__(324)(send),list:__webpack_require__(323)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"bootstrap/list",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),args&&"object"==typeof args&&(opts=args,args=void 0),send({path:"bootstrap/rm",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return promisify(callback=>{send({path:"commands"},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((key,callback)=>{if("function"==typeof key&&(callback=key,key=void 0),!key)return void send({path:"config/show",buffer:!0},callback);send({path:"config",args:key,buffer:!0},(err,response)=>{if(err)return callback(err);callback(null,response.Value)})})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{get:__webpack_require__(326)(send),set:__webpack_require__(329)(send),replace:__webpack_require__(328)(send)}})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const streamifier=__webpack_require__(295),promisify=__webpack_require__(1);module.exports=(send=>{return promisify((config,callback)=>{"object"==typeof config&&(config=streamifier.createReadStream(new Buffer(JSON.stringify(config)))),send({path:"config/replace",files:config,buffer:!0},callback)})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((key,value,opts,callback)=>{return"function"==typeof opts&&(callback=opts,opts={}),"string"!=typeof key?callback(new Error("Invalid key type")):"object"!=typeof value&&"boolean"!=typeof value&&"string"!=typeof value?callback(new Error("Invalid value type")):("object"==typeof value&&(value=JSON.stringify(value),opts={json:!0}),"boolean"==typeof value&&(value=value.toString(),opts={bool:!0}),void send({path:"config",args:[key,value],qs:opts,files:void 0,buffer:!0},callback))})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),streamToValue=__webpack_require__(9);module.exports=(send=>{return promisify((peerId,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),send.andTransform({path:"dht/findpeer",args:peerId,qs:opts},streamToValue,callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),streamToValue=__webpack_require__(9);module.exports=(send=>{return promisify((cid,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),send.andTransform({path:"dht/findprovs",args:cid,qs:opts},streamToValue,callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((key,opts,callback)=>{function handleResult(done,err,res){if(err)return done(err);if(!res)return done(new Error("empty response"));if(0===res.length)return done(new Error("no value returned for key"));if(Array.isArray(res)&&(res=res[0]),5===res.Type)done(null,res.Extra);else{let error=new Error("key was not found (type 6)");done(error)}}"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),send({path:"dht/get",args:key,qs:opts},handleResult.bind(null,callback))})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{get:__webpack_require__(332)(send),put:__webpack_require__(335)(send),findprovs:__webpack_require__(331)(send),findpeer:__webpack_require__(330)(send),provide:__webpack_require__(334)(send),query:__webpack_require__(336)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((cids,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),Array.isArray(cids)||(cids=[cids]),send({path:"dht/provide",args:cids,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((key,value,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),send({path:"dht/put",args:[key,value],qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),streamToValue=__webpack_require__(9);module.exports=(send=>{return promisify((peerId,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),send.andTransform({path:"dht/query",args:peerId,qs:opts},streamToValue,callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"diag/cmds",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{net:__webpack_require__(339)(send),sys:__webpack_require__(340)(send),cmds:__webpack_require__(337)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"diag/net",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"diag/sys",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"files/cp",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{add:__webpack_require__(52)(send),createAddStream:__webpack_require__(130)(send),get:__webpack_require__(131)(send),cat:__webpack_require__(129)(send),cp:__webpack_require__(341)(send),ls:__webpack_require__(343)(send),mkdir:__webpack_require__(344)(send),stat:__webpack_require__(348)(send),rm:__webpack_require__(347)(send),read:__webpack_require__(346)(send),write:__webpack_require__(349)(send),mv:__webpack_require__(345)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{return"function"==typeof opts&&(callback=opts,opts={}),send({path:"files/ls",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"files/mkdir",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&void 0===callback&&(callback=opts,opts={}),send({path:"files/mv",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"files/read",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((path,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),send({path:"files/rm",args:path,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"files/stat",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((pathDst,files,opts,callback)=>{"function"!=typeof opts||callback||(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),send({path:"files/write",args:pathDst,qs:opts,files:files},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts=void 0),send({path:"id",args:opts},(err,result)=>{if(err)return callback(err);callback(null,{id:result.ID,publicKey:result.PublicKey,addresses:result.Addresses,agentVersion:result.AgentVersion,protocolVersion:result.ProtocolVersion})})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"key/gen",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{gen:__webpack_require__(351)(send),list:__webpack_require__(353)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"key/list",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{tail:__webpack_require__(357)(send),ls:__webpack_require__(356)(send),level:__webpack_require__(355)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((subsystem,level,opts,callback)=>{return"function"==typeof opts&&(callback=opts,opts={}),"string"!=typeof subsystem?callback(new Error("Invalid subsystem type")):"string"!=typeof level?callback(new Error("Invalid level type")):void send({path:"log/level",args:[subsystem,level],qs:opts,files:void 0,buffer:!0},callback)})}) },function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify(callback=>{send({path:"log/ls"},(err,result)=>{if(err)return callback(err);callback(null,result.Strings)})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),pump=__webpack_require__(33),ndjson=__webpack_require__(108);module.exports=(send=>{return promisify(callback=>{return send({path:"log/tail"},(err,response)=>{if(err)return callback(err);callback(null,pump(response,ndjson.parse()))})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"ls",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return promisify((ipfs,ipns,callback)=>{"function"==typeof ipfs?(callback=ipfs,ipfs=null):"function"==typeof ipns&&(callback=ipns,ipns=null);const opts={};ipfs&&(opts.f=ipfs),ipns&&(opts.n=ipns),send({path:"mount",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{publish:__webpack_require__(361)(send),resolve:__webpack_require__(362)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"name/publish",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"name/resolve",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),cleanMultihash=__webpack_require__(13);module.exports=(send=>{const objectGet=__webpack_require__(34)(send);return promisify((multihash,dLink,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),opts||(opts={});try{multihash=cleanMultihash(multihash,opts)}catch(err){return callback(err)}send({path:"object/patch/add-link",args:[multihash,dLink.name,cleanMultihash(dLink.multihash)]},(err,result)=>{if(err)return callback(err);objectGet(result.Hash,{enc:"base58"},callback)})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),cleanMultihash=__webpack_require__(13);module.exports=(send=>{const objectGet=__webpack_require__(34)(send);return promisify((multihash,data,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),opts||(opts={});try{multihash=cleanMultihash(multihash,opts)}catch(err){return callback(err)}send({path:"object/patch/append-data",args:[multihash],files:data},(err,result)=>{if(err)return callback(err);objectGet(result.Hash,{enc:"base58"},callback)})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),streamToValue=__webpack_require__(9),cleanMultihash=__webpack_require__(13),LRU=__webpack_require__(45),lruOptions={max:128},cache=LRU(lruOptions);module.exports=(send=>{return promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options||(options={});try{multihash=cleanMultihash(multihash,options)}catch(err){return callback(err)}const node=cache.get(multihash);if(node)return callback(null,node.data);send({path:"object/data",args:multihash},(err,result)=>{if(err)return callback(err);"function"==typeof result.pipe?streamToValue(result,callback):callback(null,result)})})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{get:__webpack_require__(34)(send),put:__webpack_require__(369)(send),data:__webpack_require__(365)(send),links:__webpack_require__(367)(send),stat:__webpack_require__(372)(send),new:__webpack_require__(368)(send),patch:{addLink:__webpack_require__(363)(send),rmLink:__webpack_require__(370)(send),setData:__webpack_require__(371)(send),appendData:__webpack_require__(364)(send)}}})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(1),dagPB=__webpack_require__(27),DAGLink=dagPB.DAGLink,cleanMultihash=__webpack_require__(13),bs58=__webpack_require__(10),LRU=__webpack_require__(45),lruOptions={max:128},cache=LRU(lruOptions);module.exports=(send=>{return promisify((multihash,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options||(options={});try{multihash=cleanMultihash(multihash,options)}catch(err){return callback(err)}const node=cache.get(multihash);if(node)return callback(null,node.links);send({path:"object/links",args:multihash},(err,result)=>{if(err)return callback(err);let links=[];result.Links&&(links=result.Links.map(l=>{return new DAGLink(l.Name,l.Size,new Buffer(bs58.decode(l.Hash)))})),callback(null,links)})})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(1),dagPB=__webpack_require__(27),DAGNode=dagPB.DAGNode,Unixfs=__webpack_require__(185);module.exports=(send=>{return promisify((template,callback)=>{"function"==typeof template&&(callback=template,template=void 0),send({path:"object/new",args:template},(err,result)=>{if(err)return callback(err);let data;if(template){if("unixfs-dir"!==template)return callback(new Error("unkown template: "+template));data=new Unixfs("directory").marshal()}else data=new Buffer(0);DAGNode.create(data,(err,node)=>{return err?callback(err):node.toJSON().multihash!==result.Hash?(console.log(node.toJSON()),console.log(result),callback(new Error("multihashes do not match"))):void callback(null,node)})})})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(1),dagPB=__webpack_require__(27),DAGNode=dagPB.DAGNode,LRU=__webpack_require__(45),lruOptions={max:128},cache=LRU(lruOptions);module.exports=(send=>{return promisify((obj,options,callback)=>{"function"==typeof options&&(callback=options,options={}),options||(options={});let tmpObj={Data:null,Links:[]};if(Buffer.isBuffer(obj))options.enc||(tmpObj={Data:obj.toString(),Links:[]});else if(obj.multihash)tmpObj={Data:obj.data.toString(),Links:obj.links.map(l=>{const link=l.toJSON();return link.hash=link.multihash,link})};else{if("object"!=typeof obj)return callback(new Error("obj not recognized"));tmpObj.Data=obj.Data.toString(),tmpObj.Links=obj.Links}let buf;buf=Buffer.isBuffer(obj)&&options.enc?obj:new Buffer(JSON.stringify(tmpObj)),send({path:"object/put",qs:{inputenc:options.enc||"json"},files:buf},(err,result)=>{function next(){if(node.toJSON().multihash!==result.Hash){const err=new Error("multihashes do not match");return callback(err)}cache.set(result.Hash,node),callback(null,node)}if(err)return callback(err);Buffer.isBuffer(obj)&&(options.enc?"json"===options.enc&&(obj=JSON.parse(obj.toString())):obj={Data:obj,Links:[]});let node;if(!obj.multihash)return"protobuf"===options.enc?void dagPB.util.deserialize(obj,(err,_node)=>{if(err)return callback(err);node=_node,next()}):void DAGNode.create(new Buffer(obj.Data),obj.Links,(err,_node)=>{if(err)return callback(err);node=_node,next()});node=obj,next()})})})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),cleanMultihash=__webpack_require__(13);module.exports=(send=>{const objectGet=__webpack_require__(34)(send);return promisify((multihash,dLink,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),opts||(opts={});try{multihash=cleanMultihash(multihash,opts)}catch(err){return callback(err)}send({path:"object/patch/rm-link",args:[multihash,dLink.name]},(err,result)=>{if(err)return callback(err);objectGet(result.Hash,{enc:"base58"},callback)})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),cleanMultihash=__webpack_require__(13);module.exports=(send=>{const objectGet=__webpack_require__(34)(send);return promisify((multihash,data,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),opts||(opts={});try{multihash=cleanMultihash(multihash,opts)}catch(err){return callback(err)}send({path:"object/patch/set-data",args:[multihash],files:data},(err,result)=>{if(err)return callback(err);objectGet(result.Hash,{enc:"base58"},callback)})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),cleanMultihash=__webpack_require__(13);module.exports=(send=>{return promisify((multihash,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),opts||(opts={});try{multihash=cleanMultihash(multihash,opts)}catch(err){return callback(err)}send({path:"object/stat",args:multihash},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((hash,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts=null),send({path:"pin/add",args:hash,qs:opts},(err,res)=>{if(err)return callback(err);callback(null,res.Pins)})})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{add:__webpack_require__(373)(send),rm:__webpack_require__(376)(send),ls:__webpack_require__(375)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((hash,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),"object"==typeof hash&&(opts=hash,hash=void 0),"function"==typeof hash&&(callback=hash,hash=void 0,opts={}),send({path:"pin/ls",args:hash,qs:opts},(err,res)=>{if(err)return callback(err);callback(null,res.Keys)})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((hash,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts=null),send({path:"pin/rm",args:hash,qs:opts},(err,res)=>{if(err)return callback(err);callback(null,res.Pins)})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),moduleConfig=__webpack_require__(3),streamToValue=__webpack_require__(9);module.exports=(arg=>{const send=moduleConfig(arg);return promisify((id,callback)=>{const request={path:"ping",args:id,qs:{n:1}},transform=(res,callback)=>{streamToValue(res,(err,res)=>{if(err)return callback(err);callback(null,{Success:res[1].Success,Time:res[1].Time,Text:res[2].Text})})};send.andTransform(request,transform,callback)})})},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const promisify=__webpack_require__(1),EventEmitter=__webpack_require__(41),eos=__webpack_require__(56),isNode=__webpack_require__(40),PubsubMessageStream=__webpack_require__(395),stringlistToArray=__webpack_require__(398),moduleConfig=__webpack_require__(3),NotSupportedError=()=>new Error("pubsub is currently not supported when run in the browser");module.exports=(arg=>{function subscribe(topic,options,handler,callback){if(ps.on(topic,handler),subscriptions[topic])return callback();const request={path:"pubsub/sub",args:[topic],qs:{discover:options.discover}};subscriptions[topic]=send.andTransform(request,PubsubMessageStream.from,(err,stream)=>{if(err)return subscriptions[topic]=null,ps.removeListener(topic,handler),callback(err);stream.on("data",msg=>{ps.emit(topic,msg)}),stream.on("error",err=>{ps.emit("error",err)}),eos(stream,err=>{err&&ps.emit("error",err),subscriptions[topic]=null,ps.removeListener(topic,handler)}),callback()})}const send=moduleConfig(arg),ps=new EventEmitter,subscriptions={};return ps.id=Math.random(),{subscribe:(topic,options,handler,callback)=>{const defaultOptions={discover:!1};return"function"==typeof options&&(callback=handler,handler=options,options=defaultOptions),options||(options=defaultOptions),isNode?callback?void subscribe(topic,options,handler,callback):new Promise((resolve,reject)=>{subscribe(topic,options,handler,err=>{if(err)return reject(err);resolve()})}):callback?callback(NotSupportedError()):Promise.reject(NotSupportedError())},unsubscribe:(topic,handler)=>{if(!isNode)throw NotSupportedError();if(0===ps.listenerCount(topic)||!subscriptions[topic])throw new Error(`Not subscribed to '${topic}'`);ps.removeListener(topic,handler),0===ps.listenerCount(topic)&&(subscriptions[topic].abort(),subscriptions[topic]=null)},publish:promisify((topic,data,callback)=>{return isNode?Buffer.isBuffer(data)?void send({path:"pubsub/pub",args:[topic,data]},callback):callback(new Error("data must be a Buffer")):callback(NotSupportedError())}),ls:promisify(callback=>{if(!isNode)return callback(NotSupportedError());const request={path:"pubsub/ls"};send.andTransform(request,stringlistToArray,callback)}),peers:promisify((topic,callback)=>{if(!isNode)return callback(NotSupportedError());const request={path:"pubsub/peers",args:[topic]};send.andTransform(request,stringlistToArray,callback)}),setMaxListeners(n){return ps.setMaxListeners(n)}}})}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),streamToValue=__webpack_require__(9),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg),refs=promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const request={path:"refs",args:args,qs:opts};send.andTransform(request,streamToValue,callback)});return refs.local=promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const request={path:"refs/local",qs:opts};send.andTransform(request,streamToValue,callback)}),refs})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"repo/gc",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{gc:__webpack_require__(380)(send),stat:__webpack_require__(382)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"repo/stat",qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),PeerInfo=__webpack_require__(255),PeerId=__webpack_require__(68),multiaddr=__webpack_require__(20);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"swarm/addrs",qs:opts},(err,result)=>{if(err)return callback(err);callback(null,Object.keys(result.Addrs).map(id=>{const peerInfo=new PeerInfo(PeerId.createFromB58String(id));return result.Addrs[id].forEach(addr=>{peerInfo.multiaddrs.add(multiaddr(addr))}),peerInfo}))})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"swarm/connect",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1);module.exports=(send=>{return promisify((args,opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"swarm/disconnect",args:args,qs:opts},callback)})})},function(module,exports,__webpack_require__){"use strict";const moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{peers:__webpack_require__(388)(send),connect:__webpack_require__(384)(send),disconnect:__webpack_require__(385)(send),addrs:__webpack_require__(383)(send),localAddrs:__webpack_require__(387)(send)}})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),multiaddr=__webpack_require__(20);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"swarm/addrs/local",qs:opts},(err,result)=>{if(err)return callback(err);callback(null,result.Strings.map(addr=>{return multiaddr(addr)}))})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),multiaddr=__webpack_require__(20),PeerId=__webpack_require__(68);module.exports=(send=>{return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={});const verbose=opts.v||opts.verbose;send({path:"swarm/peers",qs:opts},(err,result)=>{if(err)return callback(err);result.Strings?callback(null,result.Strings.map(p=>{const res={};if(verbose){const parts=p.split(" ");res.addr=multiaddr(parts[0]),res.latency=parts[1]}else res.addr=multiaddr(p);return res.peer=PeerId.createFromB58String(res.addr.decapsulate("ipfs")),res})):result.Peers&&callback(null,result.Peers.map(p=>{const res={addr:multiaddr(p.Addr),peer:PeerId.createFromB58String(p.Peer),muxer:p.Muxer};return p.Latency&&(res.latency=p.Latency),p.Streams&&(res.streams=p.Streams),res}))})})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return{apply:promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"update",qs:opts},callback)}),check:promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"update/check",qs:opts},callback)}),log:promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"update/log",qs:opts},callback)})}})},function(module,exports,__webpack_require__){"use strict";const isNode=__webpack_require__(40),promisify=__webpack_require__(1),DAGNodeStream=__webpack_require__(72),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return promisify((path,opts,callback)=>{if("function"==typeof opts&&void 0===callback&&(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),!isNode)return callback(new Error("fsAdd does not work in the browser"));if("string"!=typeof path)return callback(new Error('"path" must be a string'));const request={path:"add",qs:opts,files:path},transform=(res,callback)=>DAGNodeStream.streamToValue(send,res,callback);send.andTransform(request,transform,callback)})})},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),once=__webpack_require__(48),parseUrl=__webpack_require__(128).parse,request=__webpack_require__(135),DAGNodeStream=__webpack_require__(72),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return promisify((url,opts,callback)=>{if("function"==typeof opts&&void 0===callback&&(callback=opts,opts={}),"function"==typeof opts&&"function"==typeof callback&&(callback=opts,opts={}),!validUrl(url))return callback(new Error('"url" param must be an http(s) url'));callback=once(callback),requestWithRedirect(url,opts,send,callback)})});const validUrl=url=>"string"==typeof url&&url.startsWith("http"),requestWithRedirect=(url,opts,send,callback)=>{request(parseUrl(url).protocol)(url,res=>{if(res.once("error",callback),res.statusCode>=400)return callback(new Error(`Failed to download with ${res.statusCode}`));const redirection=res.headers.location;if(res.statusCode>=300&&res.statusCode<400&&redirection){if(!validUrl(redirection))return callback(new Error("redirection url must be an http(s) url"));requestWithRedirect(redirection,opts,send,callback)}else{const params={path:"add",qs:opts,files:res},transform=(res,callback)=>DAGNodeStream.streamToValue(send,res,callback);send.andTransform(params,transform,callback)}}).end()}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){const DAGNode=__webpack_require__(27).DAGNode,parallel=__webpack_require__(154),streamToValue=__webpack_require__(9);module.exports=function(send,hash,callback){parallel([function(done){send({path:"object/get",args:hash},done)},function(done){send({path:"object/data",args:hash},done)}],function(err,res){if(err)return callback(err);var object=res[0],stream=res[1];Buffer.isBuffer(stream)?DAGNode.create(stream,object.Links,callback):streamToValue(stream,(err,data)=>{if(err)return callback(err);DAGNode.create(data,object.Links,callback)})})}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function headers(file){const name=file.path||"",header={"Content-Disposition":`file; filename="${name}"`};return file.dir||!file.content?header["Content-Type"]="application/x-directory":file.symlink?header["Content-Type"]="application/symlink":header["Content-Type"]="application/octet-stream",header}function strip(name,base){const smallBase=base.split("/").slice(0,-1).join("/")+"/";return name.replace(smallBase,"")}function loadPaths(opts,file){const path=__webpack_require__(254),fs=__webpack_require__(405),glob=__webpack_require__(406),followSymlinks=null==opts.followSymlinks||opts.followSymlinks;file=path.resolve(file);const stats=fs.statSync(file);if(stats.isDirectory()&&!opts.recursive)throw new Error("Can only add directories using --recursive");if(stats.isDirectory()&&opts.recursive){const globEscapedDir=escape(file)+(file.endsWith("/")?"":"/"),mg=new glob.sync.GlobSync(`${globEscapedDir}`+"**/*",{follow:followSymlinks,dot:opts.hidden,ignore:(opts.ignore||[]).map(function(ignoreGlob){return globEscapedDir+ignoreGlob})});return mg.found.map(name=>{return mg.symlinks[name]===!0?{path:strip(name,file),symlink:!0,dir:!1,content:fs.readlinkSync(name)}:"FILE"===mg.cache[name]?{path:strip(name,file),symlink:!1,dir:!1,content:fs.createReadStream(name)}:"DIR"===mg.cache[name]||mg.cache[name]instanceof Array?{path:strip(name,file),symlink:!1,dir:!0}:void 0}).filter(Boolean)}return{path:path.basename(file),content:fs.createReadStream(file)}}function getFilesStream(files,opts){if(!files)return null;const mp=new Multipart;return flatmap(files,file=>{if("string"==typeof file){if(!isNode)throw new Error("Can not add paths in node");return loadPaths(opts,file)}return file.path&&!file.content?(file.dir=!0,file):file.path&&(file.content||file.dir)?file:{path:"",symlink:!1,dir:!1,content:file}}).forEach(file=>{mp.addPart({headers:headers(file),body:file.content})}),mp}const isNode=__webpack_require__(40),Multipart=__webpack_require__(251),flatmap=__webpack_require__(175),escape=__webpack_require__(178);module.exports=getFilesStream},function(module,exports,__webpack_require__){"use strict";function requireCommands(){const cmds={add:__webpack_require__(52),cat:__webpack_require__(129),createAddStream:__webpack_require__(130),bitswap:__webpack_require__(313),block:__webpack_require__(318),bootstrap:__webpack_require__(322),commands:__webpack_require__(325),config:__webpack_require__(327),dht:__webpack_require__(333),diag:__webpack_require__(338),id:__webpack_require__(350),key:__webpack_require__(352),get:__webpack_require__(131),log:__webpack_require__(354),ls:__webpack_require__(358),mount:__webpack_require__(359),name:__webpack_require__(360),object:__webpack_require__(366),pin:__webpack_require__(374),ping:__webpack_require__(377),refs:__webpack_require__(379),repo:__webpack_require__(381),swarm:__webpack_require__(386),pubsub:__webpack_require__(378),update:__webpack_require__(389),version:__webpack_require__(400)};return cmds.files=function(send){return __webpack_require__(342)(send)},cmds.util=function(send){return{addFromFs:__webpack_require__(390)(send),addFromStream:__webpack_require__(52)(send),addFromURL:__webpack_require__(391)(send)}},cmds}function loadCommands(send){const files=requireCommands(),cmds={};return Object.keys(files).forEach(file=>{cmds[file]=files[file](send)}),cmds}module.exports=loadCommands},function(module,exports,__webpack_require__){"use strict";const TransformStream=__webpack_require__(7).Transform,PubsubMessage=__webpack_require__(396);class PubsubMessageStream extends TransformStream{constructor(options){const opts=Object.assign(options||{},{objectMode:!0});super(opts)}static from(inputStream,callback){let outputStream=inputStream.pipe(new PubsubMessageStream);inputStream.on("end",()=>outputStream.emit("end")),callback(null,outputStream)}_transform(obj,enc,callback){let msg;try{msg=PubsubMessage.deserialize(obj,"base64")}catch(err){return callback()}this.push(msg),callback()}}module.exports=PubsubMessageStream},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function deserializeFromJson(data){return deserializeFromBase64(JSON.parse(data))}function deserializeFromBase64(obj){if(!isPubsubMessage(obj))throw new Error(`Not a pubsub message`);return{from:bs58.encode(new Buffer(obj.from,"base64")).toString(),seqno:new Buffer(obj.seqno,"base64"),data:new Buffer(obj.data,"base64"),topicCIDs:obj.topicIDs||obj.topicCIDs}}function isPubsubMessage(obj){return obj&&obj.from&&obj.seqno&&obj.data&&(obj.topicIDs||obj.topicCIDs)}const bs58=__webpack_require__(10);module.exports={deserialize(data,enc){if("json"===(enc=enc?enc.toLowerCase():"json"))return deserializeFromJson(data);if("base64"===enc)return deserializeFromBase64(data);throw new Error(`Unsupported encoding: '${enc}'`)}}}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";(function(Buffer){function streamToJsonValue(res,cb){streamToValue(res,(err,data)=>{if(err)return cb(err);if(!data||0===data.length)return cb();Buffer.isBuffer(data)&&(data=data.toString());let res;try{res=JSON.parse(data)}catch(err){return cb(err)}cb(null,res)})}const streamToValue=__webpack_require__(9);module.exports=streamToJsonValue}).call(exports,__webpack_require__(0).Buffer)},function(module,exports,__webpack_require__){"use strict";function stringlistToArray(res,cb){cb(null,res.Strings||[])}module.exports=stringlistToArray},function(module,exports,__webpack_require__){"use strict";const pump=__webpack_require__(33),tar=__webpack_require__(297),ReadableStream=__webpack_require__(7).Readable;class ObjectsStreams extends ReadableStream{constructor(options){const opts=Object.assign(options||{},{objectMode:!0});super(opts)}_read(){}}const TarStreamToObjects=(inputStream,callback)=>{let outputStream=new ObjectsStreams,extractStream=tar.extract();extractStream.on("entry",(header,stream,next)=>{stream.on("end",next),"directory"!==header.type?outputStream.push({path:header.name,content:stream}):(outputStream.push({path:header.name}),stream.resume())}).on("finish",()=>outputStream.push(null)),pump(inputStream,extractStream),callback(null,outputStream)};module.exports=TarStreamToObjects},function(module,exports,__webpack_require__){"use strict";const promisify=__webpack_require__(1),moduleConfig=__webpack_require__(3);module.exports=(arg=>{const send=moduleConfig(arg);return promisify((opts,callback)=>{"function"==typeof opts&&(callback=opts,opts={}),send({path:"version",qs:opts},(err,result)=>{if(err)return callback(err);callback(null,{version:result.Version,commit:result.Commit,repo:result.Repo})})})})},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports){},function(module,exports,__webpack_require__){module.exports=__webpack_require__(136)}]);