dweb-transports/dist/dweb-transports-bundle.js

150 lines
3.0 MiB
JavaScript
Raw Normal View History

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=676)}([function(e,t,r){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var n=r(682),i=r(346),o=r(37);function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=c.prototype):(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?m(e,t,r,n):"string"==typeof t?p(e,t,r):b(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t,r,n){return h(t),t<=0?u(e,t):void 0!==r?"string"==typeof n?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}function d(e,t){if(h(t),e=u(e,t<0?0:0|y(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function p(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|_(t,r);e=u(e,n);var i=e.write(t,r);return i!==n&&(e=e.slice(0,i)),e}function g(e,t){var r=t.length<0?0:0|y(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function m(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=c.prototype):e=g(e,t),e}function b(e,t){if(c.isBuffer(t)){var r=0|y(t.length);return e=u(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?u(e,0):g(e,t);if("Buffer"===t.type&&o(t.data))return g(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function v(e){return+e!=e&&(e=0),c.alloc(+e)}function _(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(e).length;default:if(n)return J(e).length;t=(""+t).toLowerCase(),n=!0}}function w(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return L(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:k(e,t,r,n,
/** PROMISIFY CALLBACK-STYLE FUNCTIONS TO ES6 PROMISES
*
* EXAMPLE:
* const fn = promisify( (callback) => callback(null, "Hello world!") );
* fn((err, str) => console.log(str));
* fn().then((str) => console.log(str));
* //Both functions, will log 'Hello world!'
*
* Note: The function you pass, may have any arguments you want, but the latest
* have to be the callback, which you will call with: next(err, value)
*
* @param method: Function/Array/Map = The function(s) to promisify
* @param options: Map =
* "context" (default is function): The context which to apply the called function
* "replace" (default is falsy): When passed an array/map, if to replace the original object
*
* @return: A promise if passed a function, otherwise the object with the promises
*
* @license: MIT
* @version: 1.0.3
* @author: Manuel Di Iorio
**/
var n=function(e,t){return function(){var r=Array.prototype.slice.call(arguments),n=r.length-1,i=r&&r.length>0?r[n]:null,o="function"==typeof i?i:null;return o?e.apply(t,r):new Promise(function(n,i){r.push(function(e,t){if(e)return i(e);n(t)}),e.apply(t,r)})}};e.exports=function(e,t){t=t||{};var r=Object.prototype.toString.call(e);if("[object Object]"===r||"[object Array]"===r){var i=t.replace?e:{};for(var o in e)e.hasOwnProperty(o)&&(i[o]=n(e[o]));return i}return n(e,t.context||e)}},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){(function(e){function r(e){return Array.isArray?Array.isArray(e):"[object Array]"===m(e)}function n(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function s(e){return"number"==typeof e}function a(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function c(e){return void 0===e}function f(e){return"[object RegExp]"===m(e)}function h(e){return"object"==typeof e&&null!==e}function l(e){return"[object Date]"===m(e)}function d(e){return"[object Error]"===m(e)||e instanceof Error}function p(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function m(e){return Object.prototype.toString.call(e)}t.isArray=r,t.isBoolean=n,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=s,t.isString=a,t.isSymbol=u,t.isUndefined=c,t.isRegExp=f,t.isObject=h,t.isDate=l,t.isError=d,t.isFunction=p,t.isPrimitive=g,t.isBuffer=e.isBuffer}).call(this,r(0).Buffer)},function(e,t,r){(function(n){function i(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)}function s(...e){return"object"==typeof console&&console.log&&console.log(...e)}function a(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}}function u(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}function c(){try{return localStorage}catch(e){}}t.log=s,t.formatArgs=o,t.save=a,t.load=u,t.useColors=i,t.storage=c(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","
/**
* @license
* lodash 3.10.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -d -o ./index.js`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/(function(){var o,s="3.10.1",a=1,u=2,c=4,f=8,h=16,l=32,d=64,p=128,g=256,m=30,b="...",y=150,v=16,_=200,w=1,S=2,E="Expected a function",k="__lodash_placeholder__",x="[object Arguments]",C="[object Array]",A="[object Boolean]",I="[object Date]",T="[object Error]",O="[object Function]",R="[object Map]",B="[object Number]",P="[object Object]",M="[object RegExp]",N="[object Set]",L="[object String]",j="[object WeakMap]",D="[object ArrayBuffer]",F="[object Float32Array]",U="[object Float64Array]",q="[object Int8Array]",z="[object Int16Array]",H="[object Int32Array]",K="[object Uint8Array]",W="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",$=/\b__p \+= '';/g,Y=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39|#96);/g,Z=/[&<>"'`]/g,Q=RegExp(X.source),ee=RegExp(Z.source),te=/<%-([\s\S]+?)%>/g,re=/<%([\s\S]+?)%>/g,ne=/<%=([\s\S]+?)%>/g,ie=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,oe=/^\w*$/,se=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,ae=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,ue=RegExp(ae.source),ce=/[\u0300-\u036f\ufe20-\ufe23]/g,fe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,le=/\w*$/,de=/^0[xX]/,pe=/^\[object .+?Constructor\]$/,ge=/^\d+$/,me=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,be=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,ve=(_e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",we="[a-z\\xdf-\\xf6\\xf8-\\xff]+",RegExp(_e+"+(?="+_e+we+")|"+_e+"?"+we+"|"+_e+"+|[0-9]+","g")),_e,we,Se=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Ee=-1,ke={};ke[F]=ke[U]=ke[q]=ke[z]=ke[H]=ke[K]=ke[W]=ke[V]=ke[G]=!0,ke[x]=ke[C]=ke[D]=ke[A]=ke[I]=ke[T]=ke[O]=ke[R]=ke[B]=ke[P]=ke[M]=ke[N]=ke[L]=ke[j]=!1;var xe={};xe[x]=xe[C]=xe[D]=xe[A]=xe[I]=xe[F]=xe[U]=xe[q]=xe[z]=xe[H]=xe[B]=xe[P]=xe[M]=xe[L]=xe[K]=xe[W]=xe[V]=xe[G]=!0,xe[T]=xe[O]=xe[R]=xe[N]=xe[j]=!1;var Ce={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Ae={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Ie={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Te={function:!0,object:!0},Oe={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Be=Te[typeof t]&&t&&!t.nodeType&&t,Pe=Te[typeof e]&&e&&!e.nodeType&&e,Me=Be&&Pe&&"object"==typeof n&&n&&n.Object&&n,Ne=Te[typeof self]&&self&&self.Object&&self,Le=Te[typeof window]&&window&&window.Object&&window,je=Pe&&Pe.exports===Be&&Be,De=Me||Le!==(this&&this.window)&&Le||Ne||this;function Fe(e,t){if(e!==t){var r=null===e,n=e===o,i=e==e,s=null===t,a=t===o,u=t==t;if(e>t&&!s||!i||r&&!a&&u||n&&u)return 1;if(e<t&&!r||!u||s&&!n&&i||a&&i)return-1}return 0}function Ue(e,t,r){for(var n=e.length,i=r?n:-1;r?i--:++i<n;)if(t(e[i],i,e))return i;return-1}function qe(e,t,r){if(t!=t)return Ze(e,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function ze(e){return"function"==typeof e||!1}function He(e){return null==e?"":e+""}function Ke(e,t){for(var r=-1,n=e.length;++r<n&&t.indexOf(e.charAt(r))>-1;);return r}function We(e,t){for(var r=e.length;r--&&t.indexOf(e.charAt(r))>-1;);ret
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
2019-03-04 11:14:43 -08:00
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var o=r(53),s=Object.prototype.hasOwnProperty,a=Array.prototype.slice,u="foo"===function e(){}.name;function c(e){return Object.prototype.toString.call(e)}function f(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=e.exports=y,l=/\s*function\s+([^\(\s]*)\s*/;function d(e){if(o.isFunction(e)){if(u)return e.name;var t=e.toString(),r=t.match(l);return r&&r[1]}}function p(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(u||!o.isFunction(e))return o.inspect(e);var t=d(e),r=t?": "+t:"";return"[Function"+r+"]"}function m(e){return p(g(e.actual),128)+" "+e.operator+" "+p(g(e.expected),128)}function b(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function y(e,t){e||b(e,!0,t,"==",h.ok)}function v(e,t,r,s){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(o.isDate(e)&&o.isDate(t))return e.getTime()===t.getTime();if(o.isRegExp(e)&&o.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(f(e)&&f(t)&&c(e)===c(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;s=s||{actual:[],expected:[]};var a=s.actual.indexOf(e);return-1!==a&&a===s.expected.indexOf(t)||(s.actual.push(e),s.expected.push(t),w(e,t,r,s))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(o.isPrimitive(e)||o.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),s=_(t);if(i&&!s||!i&&s)return!1;if(i)return e=a.call(e),t=a.call(t),v(e,t,r);var u=C(e),c=C(t),f,h;if(u.length!==c.length)return!1;for(u.sort(),c.sort(),h=u.length-1;h>=0;h--)if(u[h]!==c[h])return!1;for(h=u.length-1;h>=0;h--)if(f=u[h],!v(e[f],t[f],r,n))return!1;return!0}function S(e,t,r){v(e,t,!0)&&b(e,t,r,"notDeepStrictEqual",S)}function E(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e){var t;try{e()}catch(e){t=e}return t}function x(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=k(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&b(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&o.isError(i),u=!e&&i&&!r;if((a&&s&&E(i,r)||u)&&b(i,r,"Got unwanted exception"+n),e&&i&&r&&!E(i,r)||!e&&i)throw i}h.AssertionError=function e(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=m(this),this.generatedMessage=!0);var r=t.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=d(r),s=i.indexOf("\n"+o);if(s>=0){var a=i.indexOf("\n",s+1);i=i.substring(a+1)}this.stack=i}}},o.inherits(h.AssertionError,Error),h.fail=b,h.ok=y,h.equal=function e(t,r,n){t!=r&&b(t,r,n,"==",h.equal)},h.notEqual=function e(t,r,n){t==r&&b(t,r,n,"!=",h.notEqual)},h.deepEqual=function e(t,r,n){v(t,r,!1)||b(t,r,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function e(t,r,n){v(t,r,!0)||b(t,r,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function e(t,r,n){v(t,r,!1)&&b(t,r,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=S,h.strictEqual=function e(t,r,n){t!==r&&b(t,r,n,"===",h.strictEq
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var n=r(33),i=r(34),o=r(35);function s(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=c.prototype):(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?m(e,t,r,n):"string"==typeof t?p(e,t,r):b(e,t)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t,r,n){return h(t),t<=0?u(e,t):void 0!==r?"string"==typeof n?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}function d(e,t){if(h(t),e=u(e,t<0?0:0|y(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function p(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|_(t,r);e=u(e,n);var i=e.write(t,r);return i!==n&&(e=e.slice(0,i)),e}function g(e,t){var r=t.length<0?0:0|y(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function m(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),c.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=c.prototype):e=g(e,t),e}function b(e,t){if(c.isBuffer(t)){var r=0|y(t.length);return e=u(e,r),0===e.length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||te(t.length)?u(e,0):g(e,t);if("Buffer"===t.type&&o(t.data))return g(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function v(e){return+e!=e&&(e=0),c.alloc(+e)}function _(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(e).length;default:if(n)return J(e).length;t=(""+t).toLowerCase(),n=!0}}function w(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return L(this,t,r);case"base64":return R(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:k(e,t,r,n,i)
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
2019-03-04 11:14:43 -08:00
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var o=r(16),s=Object.prototype.hasOwnProperty,a=Array.prototype.slice,u="foo"===function e(){}.name;function c(e){return Object.prototype.toString.call(e)}function f(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=e.exports=y,l=/\s*function\s+([^\(\s]*)\s*/;function d(e){if(o.isFunction(e)){if(u)return e.name;var t=e.toString(),r=t.match(l);return r&&r[1]}}function p(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(u||!o.isFunction(e))return o.inspect(e);var t=d(e),r=t?": "+t:"";return"[Function"+r+"]"}function m(e){return p(g(e.actual),128)+" "+e.operator+" "+p(g(e.expected),128)}function b(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function y(e,t){e||b(e,!0,t,"==",h.ok)}function v(e,t,r,s){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(o.isDate(e)&&o.isDate(t))return e.getTime()===t.getTime();if(o.isRegExp(e)&&o.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(f(e)&&f(t)&&c(e)===c(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;s=s||{actual:[],expected:[]};var a=s.actual.indexOf(e);return-1!==a&&a===s.expected.indexOf(t)||(s.actual.push(e),s.expected.push(t),w(e,t,r,s))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(o.isPrimitive(e)||o.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),s=_(t);if(i&&!s||!i&&s)return!1;if(i)return e=a.call(e),t=a.call(t),v(e,t,r);var u=C(e),c=C(t),f,h;if(u.length!==c.length)return!1;for(u.sort(),c.sort(),h=u.length-1;h>=0;h--)if(u[h]!==c[h])return!1;for(h=u.length-1;h>=0;h--)if(f=u[h],!v(e[f],t[f],r,n))return!1;return!0}function S(e,t,r){v(e,t,!0)&&b(e,t,r,"notDeepStrictEqual",S)}function E(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e){var t;try{e()}catch(e){t=e}return t}function x(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=k(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&b(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&o.isError(i),u=!e&&i&&!r;if((a&&s&&E(i,r)||u)&&b(i,r,"Got unwanted exception"+n),e&&i&&r&&!E(i,r)||!e&&i)throw i}h.AssertionError=function e(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=m(this),this.generatedMessage=!0);var r=t.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=d(r),s=i.indexOf("\n"+o);if(s>=0){var a=i.indexOf("\n",s+1);i=i.substring(a+1)}this.stack=i}}},o.inherits(h.AssertionError,Error),h.fail=b,h.ok=y,h.equal=function e(t,r,n){t!=r&&b(t,r,n,"==",h.equal)},h.notEqual=function e(t,r,n){t==r&&b(t,r,n,"!=",h.notEqual)},h.deepEqual=function e(t,r,n){v(t,r,!1)||b(t,r,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function e(t,r,n){v(t,r,!0)||b(t,r,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function e(t,r,n){v(t,r,!1)&&b(t,r,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=S,h.strictEqual=function e(t,r,n){t!==r&&b(t,r,n,"===",h.strictEq
/*!
* prr
* (c) 2013 Rod Vagg <rod@vagg.org>
* https://github.com/rvagg/prr
* License: MIT
*/
var n,i,o;n="prr",i=this,o=function(){var e="function"==typeof Object.defineProperty?function(e,t,r){return Object.defineProperty(e,t,r),e}:function(e,t,r){return e[t]=r.value,e},t=function(e,t){var r="object"==typeof t,n=!r&&"string"==typeof t,i=function(e){return r?!!t[e]:!!n&&t.indexOf(e[0])>-1};return{enumerable:i("enumerable"),configurable:i("configurable"),writable:i("writable"),value:e}},r=function(r,n,i,o){var s;if(o=t(i,o),"object"==typeof n){for(s in n)Object.hasOwnProperty.call(n,s)&&(o.value=n[s],e(r,s,o));return r}return e(r,n,o)};return r},e.exports?e.exports=o():i.prr=o()},function(e,t,r){"use strict";var n=r(272).AbstractLevelDOWN,i=r(272).AbstractChainedBatch,o=r(272).AbstractIterator,s=r(1),a=r(41),u=r(775),c=r(777).EncodingError;function f(e,t){if(!(this instanceof f))return new f(e,t);n.call(this,""),t=t||{},void 0===t.keyEncoding&&(t.keyEncoding="utf8"),void 0===t.valueEncoding&&(t.valueEncoding="utf8"),this.db=e,this.codec=new u(t)}function h(e,t){o.call(this,e),this.codec=e.codec,this.keys=t.keys,this.values=t.values,this.opts=this.codec.encodeLtgt(t),this.it=e.db.iterator(this.opts)}function l(e,t){i.call(this,e),this.codec=e.codec,this.batch=e.db.batch()}e.exports=f.default=f,s(f,n),f.prototype._serializeKey=f.prototype._serializeValue=function(e){return e},f.prototype._open=function(e,t){this.db.open(e,t)},f.prototype._close=function(e){this.db.close(e)},f.prototype._put=function(e,t,r,n){e=this.codec.encodeKey(e,r),t=this.codec.encodeValue(t,r),this.db.put(e,t,r,n)},f.prototype._get=function(e,t,r){var n=this;e=this.codec.encodeKey(e,t),t.asBuffer=this.codec.valueAsBuffer(t),this.db.get(e,t,function(e,i){if(e)return r(e);try{i=n.codec.decodeValue(i,t)}catch(e){return r(new c(e))}r(null,i)})},f.prototype._del=function(e,t,r){e=this.codec.encodeKey(e,t),this.db.del(e,t,r)},f.prototype._chainedBatch=function(){return new l(this)},f.prototype._batch=function(e,t,r){e=this.codec.encodeBatch(e,t),this.db.batch(e,t,r)},f.prototype._iterator=function(e){return e.keyAsBuffer=this.codec.keyAsBuffer(e),e.valueAsBuffer=this.codec.valueAsBuffer(e),new h(this,e)},f.prototype._setupIteratorOptions=function(e){return e=a(e),e.reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},f.prototype.approximateSize=function(e,t,r,n){return this.db.approximateSize(e,t,r,n)},s(h,o),h.prototype._next=function(e){var t=this;this.it.next(function(r,n,i){if(r)return e(r);try{n=t.keys&&void 0!==n?t.codec.decodeKey(n,t.opts):void 0,i=t.values&&void 0!==i?t.codec.decodeValue(i,t.opts):void 0}catch(r){return e(new c(r))}e(null,n,i)})},h.prototype._end=function(e){this.it.end(e)},s(l,i),l.prototype._put=function(e,t){e=this.codec.encodeKey(e),t=this.codec.encodeValue(t),this.batch.put(e,t)},l.prototype._del=function(e){e=this.codec.encodeKey(e),this.batch.del(e)},l.prototype._clear=function(){this.batch.clear()},l.prototype._write=function(e,t){this.batch.write(e,t)}},function(e,t,r){(function(t,n){var i=r(41),o=r(393),s=r(394),a=Object.prototype.hasOwnProperty,u="start end gt gte lt lte".split(" ");function c(e){if(!arguments.length||void 0===e)throw new Error("constructor requires at least a location argument");if("string"!=typeof e)throw new Error("constructor requires a location string argument");this.location=e,this.status="new"}function f(e){var t={};for(var r in e)a.call(e,r)&&(h(r)&&l(e[r])||(t[r]=e[r]));return t}function h(e){return-1!==u.indexOf(e)}function l(e){return""===e||null==e||d(e)}function d(e){return n.isBuffer(e)&&0===e.length}c.prototype.open=function(e,t){var r=this,n=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"!=typeof e&&(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,function(e){if(e)return r.status=n,t(e);r.status="open",t()})},c.prototype._open=function(e,r){t.nextTick(r)},c.prototype.close=function(e){var t=this,r=this.status;if("function"!=
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/
!function(){"use strict";var s="input is invalid type",a="finalize already called",u="object"==typeof window,c=u?window:{};c.JS_SHA3_NO_WINDOW&&(u=!1);var f=!u&&"object"==typeof self,h=!c.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node;h?c=i:f&&(c=self);var l=!c.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,d=r(413),p=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,g="0123456789abcdef".split(""),m=[31,7936,2031616,520093696],b=[4,1024,262144,67108864],y=[1,256,65536,16777216],v=[6,1536,393216,100663296],_=[0,8,16,24],w=[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],S=[224,256,384,512],E=[128,256],k=["hex","buffer","arrayBuffer","array","digest"],x={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!p||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var C=function(e,t,r){return function(n){return new K(e,t,e).update(n)[r]()}},A=function(e,t,r){return function(n,i){return new K(e,t,i).update(n)[r]()}},I=function(e,t,r){return function(t,n,i,o){return L["cshake"+e].update(t,n,i,o)[r]()}},T=function(e,t,r){return function(t,n,i,o){return L["kmac"+e].update(t,n,i,o)[r]()}},O=function(e,t,r,n){for(var i=0;i<k.length;++i){var o=k[i];e[o]=t(r,n,o)}return e},R=function(e,t){var r=C(e,t,"hex");return r.create=function(){return new K(e,t,e)},r.update=function(e){return r.create().update(e)},O(r,C,e,t)},B=function(e,t){var r=A(e,t,"hex");return r.create=function(r){return new K(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},O(r,A,e,t)},P=function(e,t){var r=x[e],n=I(e,t,"hex");return n.create=function(n,i,o){return i||o?new K(e,t,n).bytepad([i,o],r):L["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},O(n,I,e,t)},M=function(e,t){var r=x[e],n=T(e,t,"hex");return n.create=function(n,i,o){return new W(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},O(n,T,e,t)},N=[{name:"keccak",padding:y,bits:S,createMethod:R},{name:"sha3",padding:v,bits:S,createMethod:R},{name:"shake",padding:m,bits:E,createMethod:B},{name:"cshake",padding:b,bits:E,createMethod:P},{name:"kmac",padding:b,bits:E,createMethod:M}],L={},j=[],D=0;D<N.length;++D)for(var F=N[D],U=F.bits,q=0;q<U.length;++q){var z=F.name+"_"+U[q];if(j.push(z),L[z]=F.createMethod(U[q],F.padding),"sha3"!==F.name){var H=F.name+U[q];j.push(H),L[H]=L[z]}}function K(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function W(e,t,r){K.call(this,e,t,r)}K.prototype.update=function(e){if(this.finalized)throw new Error(a);var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(p&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||p&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}for(var n=this.blocks,i=this.byteCount,o=e.length,u=this.blockCount,c=0,f=this.s,h,l;c<o;){if(this.reset)for(this.reset=!1,n[0]=this.block,h=1;h<u+1;++h)n[h]=0;if(t)for(h=this.start;c<o&&h<i;++c)n[h>>2]|=e[c]<<_[3&h++];else for(h=this.start;c<o&&h<i;++c)l=e.charCodeAt(c),l<128?n[h>>2]|=l<<_[3&h++]:l<2048?(n[h>>2]|=(192|l>>6)<<_[3&h++],n[h>>2]|=(128|63&l)<<_[3&h++]):l<55296||l>=57344?(n[h>>2]|=(224|l>>12)<<_[3&h++],n[h>>2]|=(128|l>>6&63)<<_[3&h++],n[h>>2]|=(128|63&l)<<_[3&h++]):(l=65536+((1023&l)<<10|1023&e.charCodeAt(++c)),n[h>>2]|=(240|l>>18)<<_[3&h++],n[h>>2]|=(128|l>>12&63)<<_[3&h++],n[h>>2]|=(128|
//! stable.js 0.1.8, https://github.com/Two-Screen/stable
//! © 2018 Angry Bytes and contributors. MIT licensed.
var n,i;n=this,i=function(){"use strict";var e=function(e,r){return t(e.slice(),r)};function t(e,t){"function"!=typeof t&&(t=function(e,t){return String(e).localeCompare(t)});var n=e.length;if(n<=1)return e;for(var i=new Array(n),o=1;o<n;o*=2){r(e,t,o,i);var s=e;e=i,i=s}return e}e.inplace=function(e,n){var i=t(e,n);return i!==e&&r(i,null,e.length,e),e};var r=function(e,t,r,n){var i=e.length,o=0,s=2*r,a,u,c,f,h;for(a=0;a<i;a+=s)for(u=a+r,c=u+r,u>i&&(u=i),c>i&&(c=i),f=a,h=u;;)if(f<u&&h<c)t(e[f],e[h])<=0?n[o++]=e[f++]:n[o++]=e[h++];else if(f<u)n[o++]=e[f++];else{if(!(h<c))break;n[o++]=e[h++]}};return e},e.exports=i()},function(e,t,r){var n=r(812),i=r(814);e.exports=n,e.exports.parse=n,e.exports.stringify=i},function(e,t,r){var n=r(813),i=536870911,o=["int32","int64","uint32","uint64","sint32","sint64","bool","fixed64","sfixed64","double","fixed32","sfixed32","float"],s=function(e){for(var t={};e.length;)switch(e[0]){case"[":case",":e.shift();var r=e.shift();if("("===r&&(r=e.shift(),e.shift()),"="!==e[0])throw new Error("Unexpected token in field options: "+e[0]);if(e.shift(),"]"===e[0])throw new Error("Unexpected ] in field option");t[r]=e.shift();break;case"]":return e.shift(),t;default:throw new Error("Unexpected token in field options: "+e[0])}throw new Error("No closing tag for field options")},a=function(e){for(var t={name:null,type:null,tag:-1,map:null,oneof:null,required:!1,repeated:!1,options:{}};e.length;)switch(e[0]){case"=":e.shift(),t.tag=Number(e.shift());break;case"map":if(t.type="map",t.map={from:null,to:null},e.shift(),"<"!==e[0])throw new Error("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.from=e.shift(),","!==e[0])throw new Error("Unexpected token in map type: "+e[0]);if(e.shift(),t.map.to=e.shift(),">"!==e[0])throw new Error("Unexpected token in map type: "+e[0]);e.shift(),t.name=e.shift();break;case"repeated":case"required":case"optional":var r=e.shift();t.required="required"===r,t.repeated="repeated"===r,t.type=e.shift(),t.name=e.shift();break;case"[":t.options=s(e);break;case";":if(null===t.name)throw new Error("Missing field name");if(null===t.type)throw new Error("Missing type in message field: "+t.name);if(-1===t.tag)throw new Error("Missing tag number in message field: "+t.name);return e.shift(),t;default:throw new Error("Unexpected token in message field: "+e[0])}throw new Error("No ; found for message field")},u=function(e){for(var t={enums:[],messages:[],fields:[],extends:[],extensions:null};e.length;)switch(e[0]){case"map":case"repeated":case"optional":case"required":t.fields.push(a(e));break;case"enum":t.enums.push(g(e));break;case"message":t.messages.push(h(e));break;case"extensions":t.extensions=f(e);break;case"oneof":e.shift();var r=e.shift();if("{"!==e[0])throw new Error("Unexpected token in oneof: "+e[0]);for(e.shift();"}"!==e[0];){e.unshift("optional");var n=a(e);n.oneof=r,t.fields.push(n)}e.shift();break;case"extend":t.extends.push(c(e));break;case";":e.shift();break;case"reserved":case"option":for(e.shift();";"!==e[0];)e.shift();break;default:e.unshift("optional"),t.fields.push(a(e))}return t},c=function(e){var t={name:e[1],message:h(e)};return t},f=function(e){e.shift();var t=Number(e.shift());if(isNaN(t))throw new Error("Invalid from in extensions definition");if("to"!==e.shift())throw new Error("Expected keyword 'to' in extensions definition");var r=e.shift();if("max"===r&&(r=536870911),r=Number(r),isNaN(r))throw new Error("Invalid to in extensions definition");if(";"!==e.shift())throw new Error("Missing ; in extensions definition");return{from:t,to:r}},h=function(e){e.shift();var t=1,r=[],n={name:e.shift(),enums:[],extends:[],messages:[],fields:[]};if("{"!==e[0])throw new Error("Expected { but found "+e[0]);for(e.shift();e.length;){if("{"===e[0]?t++:"}"===e[0]&&t--,!t)return e.shift(),r=u(r),n.enums=r.enums,n.messages=r.messages,n.fields=r.fields,n.extends=r.extends,n.extensions=r.extensions,n;r.push(e.shift())}if(t)throw new Error("No closing tag for message")},l=function(e){e.shift();var t=e.shift();if(";"!==e[0])throw new Error("Expected ; but found "+e[0]);return e
/**
* @license
* Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(){var o,s="4.17.11",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",f="__lodash_hash_undefined__",h=500,l="__lodash_placeholder__",d=1,p=2,g=4,m=1,b=2,y=1,v=2,_=4,w=8,S=16,E=32,k=64,x=128,C=256,A=512,I=30,T="...",O=800,R=16,B=1,P=2,M=3,N=1/0,L=9007199254740991,j=1.7976931348623157e308,D=NaN,F=4294967295,U=F-1,q=F>>>1,z=[["ary",x],["bind",y],["bindKey",v],["curry",w],["curryRight",S],["flip",A],["partial",E],["partialRight",k],["rearg",C]],H="[object Arguments]",K="[object Array]",W="[object AsyncFunction]",V="[object Boolean]",G="[object Date]",$="[object DOMException]",Y="[object Error]",J="[object Function]",X="[object GeneratorFunction]",Z="[object Map]",Q="[object Number]",ee="[object Null]",te="[object Object]",re="[object Promise]",ne="[object Proxy]",ie="[object RegExp]",oe="[object Set]",se="[object String]",ae="[object Symbol]",ue="[object Undefined]",ce="[object WeakMap]",fe="[object WeakSet]",he="[object ArrayBuffer]",le="[object DataView]",de="[object Float32Array]",pe="[object Float64Array]",ge="[object Int8Array]",me="[object Int16Array]",be="[object Int32Array]",ye="[object Uint8Array]",ve="[object Uint8ClampedArray]",_e="[object Uint16Array]",we="[object Uint32Array]",Se=/\b__p \+= '';/g,Ee=/\b(__p \+=) '' \+/g,ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,Ce=/[&<>"']/g,Ae=RegExp(xe.source),Ie=RegExp(Ce.source),Te=/<%-([\s\S]+?)%>/g,Oe=/<%([\s\S]+?)%>/g,Re=/<%=([\s\S]+?)%>/g,Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pe=/^\w*$/,Me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ne=/[\\^$.*+?()[\]{}|]/g,Le=RegExp(Ne.source),je=/^\s+|\s+$/g,De=/^\s+/,Fe=/\s+$/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qe=/\{\n\/\* \[wrapped with (.+)\] \*/,ze=/,? & /,He=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ke=/\\(\\)?/g,We=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ve=/\w*$/,Ge=/^[-+]0x[0-9a-f]+$/i,$e=/^0b[01]+$/i,Ye=/^\[object .+?Constructor\]$/,Je=/^0o[0-7]+$/i,Xe=/^(?:0|[1-9]\d*)$/,Ze=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qe=/($^)/,et=/['\n\r\u2028\u2029\\]/g,tt="\\ud800-\\udfff",rt="\\u0300-\\u036f",nt="\\ufe20-\\ufe2f",it="\\u20d0-\\u20ff",ot="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",st="\\u2700-\\u27bf",at="a-z\\xdf-\\xf6\\xf8-\\xff",ut="\\xac\\xb1\\xd7\\xf7",ct="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ft="\\u2000-\\u206f",ht=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="A-Z\\xc0-\\xd6\\xd8-\\xde",dt="\\ufe0e\\ufe0f",pt=ut+ct+"\\u2000-\\u206f"+ht,gt="[']",mt="[\\ud800-\\udfff]",bt="["+pt+"]",yt="["+ot+"]",vt="\\d+",_t="[\\u2700-\\u27bf]",wt="["+at+"]",St="[^"+tt+pt+vt+st+at+lt+"]",Et="\\ud83c[\\udffb-\\udfff]",kt="(?:"+yt+"|"+Et+")",xt="[^\\ud800-\\udfff]",Ct="(?:\\ud83c[\\udde6-\\uddff]){2}",At="[\\ud800-\\udbff][\\udc00-\\udfff]",It="["+lt+"]",Tt="\\u200d",Ot="(?:"+wt+"|"+St+")",Rt="(?:"+It+"|"+St+")",Bt="(?:['](?:d|ll|m|re|s|t|ve))?",Pt="(?:['](?:D|LL|M|RE|S|T|VE))?",Mt=kt+"?",Nt="[\\ufe0e\\ufe0f]?",Lt="(?:\\u200d(?:"+[xt,Ct,At].join("|")+")"+Nt+Mt+")*",jt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ft=Nt+Mt+Lt,Ut="(?:"+[_t,Ct,At].join("|")+")"+Ft,qt="(?:"+[xt+yt+"?",yt,Ct,At,mt].join("|")+")",zt=RegExp("[']","g"),Ht=RegExp(yt,"g"),Kt=RegExp(Et+"(?="+Et+")|"+qt+Ft,"g"),Wt=RegExp([It+"?"+wt+"+"+Bt+"(?="+[bt,It,"$"].join("|")+")",Rt+"+"+Pt+"(?="+[bt,It+Ot,"$"].join("|")+")",It+"?"+Ot+"+"+Bt,It+"+"+Pt,Dt,jt,vt,Ut].join("|"),"g"),Vt=RegExp("["+Tt+tt+ot+dt+"]"),Gt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$t=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yt=-1,Jt={};J
/**
* Timestamp for 64-bit time_t, nanosecond precision and strftime
*
* @author Yusuke Kawasaki
* @license MIT
* @see https://github.com/kawanet/timestamp-nano
*/
var n=function(){e.exports=y;var t=86400,r=3200,n=146097*r/400,i=t*n,o=1e3*i,s=1e11*t,a=16777216,u=4294967296,c=1e6,f=1e9,h="000000000",l=Math.trunc||N,d=y.prototype;y.fromDate=C,y.fromInt64BE=P(0,1,2,3,0,4),y.fromInt64LE=P(3,2,1,0,4,0),y.fromString=x,y.fromTimeT=A,d.year=0,d.time=0,d.nano=0,d.addNano=E,d.getNano=k,d.getTimeT=T,d.getYear=v,d.toDate=w,d.toJSON=O,d.toString=R,d.writeInt64BE=B(0,1,2,3,0,4),d.writeInt64LE=B(3,2,1,0,4,0);var p="%Y-%m-%dT%H:%M:%S.%NZ",g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],b={"%":"%",F:"%Y-%m-%d",n:"\n",R:"%H:%M",T:"%H:%M:%S",t:"\t",X:"%T",Z:"GMT",z:"+0000"};return y;function y(e,t,r){var n=this;if(!(n instanceof y))return new y(e,t,r);n.time=+e||0,n.nano=+t||0,n.year=+r||0,_(n)}function v(){var e=this.toDate().getUTCFullYear();return e+this.year}function _(e){var t=e.year,n=e.time,i=e.nano,a,u;if(i<0||c<=i){var f=Math.floor(i/c);i-=f*c,n+=f,a=1}var h=t%r;if(n<-s||s<n||h){u=l(n/o),u&&(t+=u*r,n-=u*o);var d=S(n);d.setUTCFullYear(h+d.getUTCFullYear()),t-=h,n=+d,u=l(t/r);var p=n+u*o;u&&-s<=p&&p<=s&&(t-=u*r,n=p),a=1}return a&&(e.year=t,e.time=n,e.nano=i),e}function w(){var e=_(this);return S(e.time)}function S(e){var t=new Date(0);return t.setTime(e),t}function E(e){return this.nano+=+e||0,this}function k(){var e=_(this);return(e.time%1e3*c+ +e.nano+f)%f}function x(e){var t,r=new y;e+="";var n=e.replace(/^\s*[+\-]?\d+/,function(e){var t=+e,n=1970+(t-1970)%400;return r.year=t-n,n}).replace(/(?:Z|([+\-]\d{2}):?(\d{2}))$/,function(e,r,n){return r<0&&(n*=-1),t=6e4*(60*+r+ +n),""}).replace(/\.\d+$/,function(e){return r.nano=+(e+h).substr(1,9),""}).split(/\D+/);if(n.length>1?n[1]--:n[1]=0,r.time=t=Date.UTC.apply(Date,n)-(t||0),isNaN(t))throw new TypeError("Invalid Date");return _(r)}function C(e){return new y(+e)}function A(e){return I(e,0)}function I(e,t){t|=0,t*=u,e=+e||0;var n=l(t/i)+l(e/i),o=t%i+e%i,s=l(o/i);return s&&(n+=s,o-=s*i),new y(1e3*o,0,n*r)}function T(){var e=_(this),i=Math.floor(e.time/1e3),o=e.year;return o&&(i+=o*n*t/r),i}function O(){return this.toString().replace(/0{1,6}Z$/,"Z")}function R(e){var t=this,r=t.toDate(),n={H:c,L:l,M:f,N:d,S:h,Y:o,a:y,b:v,d:a,e:u,m:s};return i(e||p);function i(e){return e.replace(/%./g,function(e){var t=e[1],r=b[t],o=n[t];return r?i(r):o?o():e})}function o(){var e=t.getYear();return e>999999?"+"+e:e>9999?"+"+D(e,6):e>=0?D(e,4):e>=-999999?"-"+D(-e,6):e}function s(){return j(r.getUTCMonth()+1)}function a(){return j(r.getUTCDate())}function u(){return L(r.getUTCDate())}function c(){return j(r.getUTCHours())}function f(){return j(r.getUTCMinutes())}function h(){return j(r.getUTCSeconds())}function l(){return D(r.getUTCMilliseconds(),3)}function d(){return D(t.getNano(),9)}function y(){return m[r.getUTCDay()]}function v(){return g[r.getUTCMonth()]}}function B(e,i,o,s,a,c){return f;function f(e,i){var o=_(this);e||(e=new Array(8)),M(e,i|=0);var s=Math.floor(o.time/1e3),f=o.year*(n*t/r),d=l(f/u)+l(s/u),p=f%u+s%u,g=Math.floor(p/u);return g&&(d+=g,p-=g*u),h(e,i+a,d),h(e,i+c,p),e}function h(t,r,n){t[r+e]=n>>24&255,t[r+i]=n>>16&255,t[r+o]=n>>8&255,t[r+s]=255&n}}function P(e,t,r,n,i,o){return s;function s(e,t){M(e,t|=0);var r=u(e,t+i),n=u(e,t+o);return I(n,r)}function u(i,o){return i[o+e]*a+(i[o+t]<<16|i[o+r]<<8|i[o+n])}}function M(e,t){var r=e&&e.length;if(null==r)throw new TypeError("Invalid Buffer");if(r<t+8)throw new RangeError("Out of range")}function N(e){var t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}function L(e){return(e>9?"":" ")+(0|e)}function j(e){return(e>9?"":"0")+(0|e)}function D(e,t){return(h+(0|e)).substr(-t)}}()},function(e,t,r){"use strict";const n=r(60),i='\nmessage IpnsEntry {\n enum ValidityType {\n\t\tEOL = 0; // setting an EOL says "this record is valid until..."\n\t}\n\n required bytes value = 1;\n\trequired bytes signature = 2;\n\n\toptional ValidityType validityType = 3;\n\toptional bytes validity = 4;\n\n\toptional uint64 sequence = 5;\n\n\toptional uint64 ttl = 6;\n\n\t// in order for nodes to properly validate a record upon receipt, they need the p
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.7.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2017
* @license MIT
*/
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.7.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2017
* @license MIT
*/
!function(){"use strict";var s="input is invalid type",a="object"==typeof window,u=a?window:{};u.JS_SHA3_NO_WINDOW&&(a=!1);var c=!a&&"object"==typeof self,f=!u.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node;f?u=i:c&&(u=self);var h=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,l=r(413),d=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),g=[31,7936,2031616,520093696],m=[4,1024,262144,67108864],b=[1,256,65536,16777216],y=[6,1536,393216,100663296],v=[0,8,16,24],_=[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],w=[224,256,384,512],S=[128,256],E=["hex","buffer","arrayBuffer","array","digest"],k={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!d||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var x=function(e,t,r){return function(n){return new H(e,t,e).update(n)[r]()}},C=function(e,t,r){return function(n,i){return new H(e,t,i).update(n)[r]()}},A=function(e,t,r){return function(t,n,i,o){return N["cshake"+e].update(t,n,i,o)[r]()}},I=function(e,t,r){return function(t,n,i,o){return N["kmac"+e].update(t,n,i,o)[r]()}},T=function(e,t,r,n){for(var i=0;i<E.length;++i){var o=E[i];e[o]=t(r,n,o)}return e},O=function(e,t){var r=x(e,t,"hex");return r.create=function(){return new H(e,t,e)},r.update=function(e){return r.create().update(e)},T(r,x,e,t)},R=function(e,t){var r=C(e,t,"hex");return r.create=function(r){return new H(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},T(r,C,e,t)},B=function(e,t){var r=k[e],n=A(e,t,"hex");return n.create=function(n,i,o){return i||o?new H(e,t,n).bytepad([i,o],r):N["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},T(n,A,e,t)},P=function(e,t){var r=k[e],n=I(e,t,"hex");return n.create=function(n,i,o){return new K(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},T(n,I,e,t)},M=[{name:"keccak",padding:b,bits:w,createMethod:O},{name:"sha3",padding:y,bits:w,createMethod:O},{name:"shake",padding:g,bits:S,createMethod:R},{name:"cshake",padding:m,bits:S,createMethod:B},{name:"kmac",padding:m,bits:S,createMethod:P}],N={},L=[],j=0;j<M.length;++j)for(var D=M[j],F=D.bits,U=0;U<F.length;++U){var q=D.name+"_"+F[U];if(L.push(q),N[q]=D.createMethod(F[U],D.padding),"sha3"!==D.name){var z=D.name+F[U];L.push(z),N[z]=N[q]}}function H(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function K(e,t,r){H.call(this,e,t,r)}H.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw s;if(null===e)throw s;if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||d&&ArrayBuffer.isView(e)))throw s;t=!0}for(var n=this.blocks,i=this.byteCount,o=e.length,a=this.blockCount,u=0,c=this.s,f,h;u<o;){if(this.reset)for(this.reset=!1,n[0]=this.block,f=1;f<a+1;++f)n[f]=0;if(t)for(f=this.start;u<o&&f<i;++u)n[f>>2]|=e[u]<<v[3&f++];else for(f=this.start;u<o&&f<i;++u)h=e.charCodeAt(u),h<128?n[f>>2]|=h<<v[3&f++]:h<2048?(n[f>>2]|=(192|h>>6)<<v[3&f++],n[f>>2]|=(128|63&h)<<v[3&f++]):h<55296||h>=57344?(n[f>>2]|=(224|h>>12)<<v[3&f++],n[f>>2]|=(128|h>>6&63)<<v[3&f++],n[f>>2]|=(128|63&h)<<v[3&f++]):(h=65536+((1023&h)<<10|1023&e.charCodeAt(++u)),n[f>>2]|=(240|h>>18)<<v[3&f++],n[f>>2]|=(128|h>>12&63)<<v[3&f++],n[f>>2]|=(128|h>>6&63)<<v[3&f++],n[f>>2]|=(128|63&h)<<v[3&f++]);if(this.lastByteIndex=f,f>=i
/*! https://mths.be/utf8js v2.1.2 by @mathias */
var r=String.fromCharCode,n,i,o;function s(e){for(var t=[],r=0,n=e.length,i,o;r<n;)i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n?(o=e.charCodeAt(r++),56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)):t.push(i);return t}function a(e){for(var t=e.length,n=-1,i,o="";++n<t;)i=e[n],i>65535&&(i-=65536,o+=r(i>>>10&1023|55296),i=56320|1023&i),o+=r(i);return o}function u(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function c(e,t){return r(e>>t&63|128)}function f(e,t){if(0==(4294967168&e))return r(e);var n="";return 0==(4294965248&e)?n=r(e>>6&31|192):0==(4294901760&e)?(u(e,t)||(e=65533),n=r(e>>12&15|224),n+=c(e,6)):0==(4292870144&e)&&(n=r(e>>18&7|240),n+=c(e,12),n+=c(e,6)),n+=r(63&e|128),n}function h(e,t){t=t||{};for(var r=!1!==t.strict,n=s(e),i=n.length,o=-1,a,u="";++o<i;)a=n[o],u+=f(a,r);return u}function l(){if(o>=i)throw Error("Invalid byte index");var e=255&n[o];if(o++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function d(e){var t,r,s,a,c;if(o>i)throw Error("Invalid byte index");if(o==i)return!1;if(t=255&n[o],o++,0==(128&t))return t;if(192==(224&t)){if(r=l(),c=(31&t)<<6|r,c>=128)return c;throw Error("Invalid continuation byte")}if(224==(240&t)){if(r=l(),s=l(),c=(15&t)<<12|r<<6|s,c>=2048)return u(c,e)?c:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(r=l(),s=l(),a=l(),c=(7&t)<<18|r<<12|s<<6|a,c>=65536&&c<=1114111))return c;throw Error("Invalid UTF-8 detected")}function p(e,t){t=t||{};var r=!1!==t.strict;n=s(e),i=n.length,o=0;for(var u=[],c;!1!==(c=d(r));)u.push(c);return a(u)}e.exports={version:"2.1.2",encode:h,decode:p}},function(e,t){!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<e.length;n++)r[e.charCodeAt(n)]=n;t.encode=function(t){var r=new Uint8Array(t),n,i=r.length,o="";for(n=0;n<i;n+=3)o+=e[r[n]>>2],o+=e[(3&r[n])<<4|r[n+1]>>4],o+=e[(15&r[n+1])<<2|r[n+2]>>6],o+=e[63&r[n+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},t.decode=function(e){var t=.75*e.length,n=e.length,i,o=0,s,a,u,c;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);var f=new ArrayBuffer(t),h=new Uint8Array(f);for(i=0;i<n;i+=4)s=r[e.charCodeAt(i)],a=r[e.charCodeAt(i+1)],u=r[e.charCodeAt(i+2)],c=r[e.charCodeAt(i+3)],h[o++]=s<<2|a>>4,h[o++]=(15&a)<<4|u>>2,h[o++]=(3&u)<<6|63&c;return f}}()},function(e,t){var r=void 0!==r?r:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,n=function(){try{var e=new Blob(["hi"]);return 2===e.size}catch(e){return!1}}(),i=n&&function(){try{var e=new Blob([new Uint8Array([1,2])]);return 2===e.size}catch(e){return!1}}(),o=r&&r.prototype.append&&r.prototype.getBlob;function s(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var r=new Uint8Array(e.byteLength);r.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=r.buffer}return t}return e})}function a(e,t){t=t||{};var n=new r;return s(e).forEach(function(e){n.append(e)}),t.type?n.getBlob(t.type):n.getBlob()}function u(e,t){return new Blob(s(e),t||{})}"undefined"!=typeof Blob&&(a.prototype=Blob.prototype,u.prototype=Blob.prototype),e.exports=n?i?Blob:u:o?a:void 0},function(e,t,r){function n(e){var r=0,n;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}function i(e){var r;function i(){if(i.enabled){var e=i,n=+new Date,o=n-(r||n);e.diff=o,e.prev=r,e.curr=n,r=n;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var u=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;u++;var i=t.formatters[n];if("function"==typeof i){var o=s[u];r=i.call(e,o),s.splice(u,1),u--}return r}),t.formatArgs.call(e,s);var c=i.log||t.log||console.log.bind(console);c.apply(e,s)}}return i.namespace=e,i.enabled=t.enabled(e),i.useCo
/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
* @license MIT
*
* The MIT License (MIT)
*
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function r(e){return e instanceof t||e instanceof Date||e instanceof RegExp}function n(e){if(e instanceof t){var r=t.alloc?t.alloc(e.length):new t(e.length);return e.copy(r),r}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function i(e){var t=[];return e.forEach(function(e,o){"object"==typeof e&&null!==e?Array.isArray(e)?t[o]=i(e):r(e)?t[o]=n(e):t[o]=s({},e):t[o]=e}),t}function o(e,t){return"__proto__"===t?void 0:e[t]}var s=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),a,u,c;return t.forEach(function(t){"object"!=typeof t||null===t||Array.isArray(t)||Object.keys(t).forEach(function(c){return u=o(e,c),a=o(t,c),a===e?void 0:"object"!=typeof a||null===a?void(e[c]=a):Array.isArray(a)?void(e[c]=i(a)):r(a)?void(e[c]=n(a)):"object"!=typeof u||null===u||Array.isArray(u)?void(e[c]=s({},a)):void(e[c]=s(u,a))})}),e}}).call(this,r(0).Buffer)},function(e,t){e.exports=function(e){var t=!1,r=0;return function(){if(r=!0,!t){for(t=!0;r;)r=!1,e();t=!1}}}},function(e,t,r){"use strict";const n=r(11),i=r(32),o=r(44),s=r(234),a=i.DAGLink,u=i.DAGNode;e.exports=function e(t,r,i){return function(e,c){if(1===e.length&&e[0].single&&i.reduceSingleLeafToSelf){const r=e[0];return c(null,{size:r.size,leafSize:r.leafSize,multihash:r.multihash,path:t.path,name:r.name})}const f=new o("file"),h=e.map(e=>(f.addBlockSize(e.leafSize),new a(e.name,e.size,e.multihash)));n([e=>u.create(f.marshal(),h,e),(e,t)=>s(e,r,i,t)],(e,r)=>{if(e)return c(e);c(null,{size:r.node.size,leafSize:f.fileSize(),multihash:r.cid.buffer,path:t.path,name:""})})}}},function(e,t,r){"use strict";const n=r(12),i=r(80),o=r(31),s=r(63),a=r(229),u=r(310);e.exports=function(e,t){const r=a(),c=r.source,f=s();return n(c,u(1/0),i(e),o((e,t)=>{e?f.end(e):1===t.length?(f.push(t[0]),f.end()):t.length>1?f.end(new Error("expected a maximum of 1 roots and got "+t.length)):f.end()})),{sink:r.sink,source:f}}},function(e,t,r){"use strict";const n=r(1168),i={maxChildrenPerNode:174};e.exports=function(e,t){const r=Object.assign({},i,t);return n(e,r)}},function(e,t,r){"use strict";const n=r(12),i=r(40),o=r(80),s=r(31),a=r(63),u=r(229),c=r(310);e.exports=function e(t,r){const f=u(),h=f.source,l=a();function d(e,a){let u=e;function f(e,t){e?a(e):t.length>1?d(t,a):a(null,t)}Array.isArray(u)&&(u=i(u)),n(u,c(r.maxChildrenPerNode),o(t),s(f))}return d(h,(e,t)=>{e?l.end(e):1===t.length?(l.push(t[0]),l.end()):t.length>1?l.end(new Error("expected a maximum of 1 roots and got "+t.length)):l.end()}),{sink:f.sink,source:l}}},function(e,t,r){"use strict";const n=r(1170),i={maxChildrenPerNode:174,layerRepeat:4};e.exports=function(e,t){const r=Object.assign({},i,t);return n(e,r)}},function(e,t,r){"use strict";const n=r(12),i=r(80),o=r(31),s=r(63),a=r(310),u=r(229),c=r(175),f=r(233),h=r(524);e.exports=function e(t,r){const l=u(),d=s(),p=h(()=>{});let g=0;return n(l.source,p,m(0,-1),a(1/0),i(t),o((e,t)=>{e?d.end(e):1===t.length?(d.push(t[0]),d.end()):t.length>1?d.end(new Error("expected a maximum of 1 roots and got "+t.length)):d.end()})),{sink:l.sink,source:d};function m(e,u){let h=0,l=0,d,b=!1;const y=s();return{source:y,sink:f(v,null,1,w)};function v(r,u){let f=!1;const h=r[0];l&&!d&&(d=s(),n(d,m(e+1,l-1),c(function(e){this.queue(e)},function(e){e?this.emit("error",e):(f||(f=!0,g++,p.pause()),this.queue(null))}),a(1/0),i(t),o((e,t)=>{g--,e?y.end(e):(t.forEach(e=>{y.push(e)}),_())}))),d?d.push(h):(y.push(h),_()),u()}function _(){d=null,h++,(0===l&&h===r.maxChildrenPerNode||l>0&&h===r.layerRepeat)&&(h=0,l++),(!b&&u>=0&&l>u||b&&!g)&&(b=!0,y.end()),g||p.resume()}function w(e){e?y.end(e):d?b||(b=!0,d.end()):y.end()}}}},function(e,t,r){"use strict";(function(t){const n=r(134),i=r(267),o=r(11),s=r(200),a=r(233),u=r(63),c=r(1172),f=r(1173),h=r(311),l=r(1179);e.exports=p;const d={wrap:!1,shardSplitThreshold:1e3,onlyHash:!1};function p(e,r){const p=Object.assign({},d,r),g=s(y,1);let m=_(),b=c({path:"",root:!