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

129 lines
2.7 MiB
JavaScript
Raw Normal View History

2018-08-29 17:20:11 +10:00
!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=613)}([function(e,t,r){"use strict";(function(e){
2018-08-15 13:37:47 +10:00
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
2018-08-29 17:20:11 +10:00
var n=r(620),i=r(329),o=r(327);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 p(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?g(e,t,r,n):"string"==typeof t?d(e,t,r):m(e,t)}function l(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 h(e,t,r,n){return l(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 p(e,t){if(l(t),e=u(e,t<0?0:0|b(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(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 y(e,t){var r=t.length<0?0:0|b(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function g(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=y(e,t),e}function m(e,t){if(c.isBuffer(t)){var r=0|b(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):y(e,t);if("Buffer"===t.type&&o(t.data))return y(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function b(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 M(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return j(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(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 k(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:E(e,t,r,n
2018-08-15 13:37:47 +10:00
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
2018-08-29 17:20:11 +10: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(106),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 l=e.exports=b,h=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(o.isFunction(e)){if(u)return e.name;var t=e.toString(),r=t.match(h);return r&&r[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function y(e){if(u||!o.isFunction(e))return o.inspect(e);var t=p(e),r=t?": "+t:"";return"[Function"+r+"]"}function g(e){return d(y(e.actual),128)+" "+e.operator+" "+d(y(e.expected),128)}function m(e,t,r,n,i){throw new l.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function b(e,t){e||m(e,!0,t,"==",l.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=x(e),c=x(t),f,l;if(u.length!==c.length)return!1;for(u.sort(),c.sort(),l=u.length-1;l>=0;l--)if(u[l]!==c[l])return!1;for(l=u.length-1;l>=0;l--)if(f=u[l],!v(e[f],t[f],r,n))return!1;return!0}function S(e,t,r){v(e,t,!0)&&m(e,t,r,"notDeepStrictEqual",S)}function k(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 E(e){var t;try{e()}catch(e){t=e}return t}function A(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=E(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&m(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&o.isError(i),u=!e&&i&&!r;if((a&&s&&k(i,r)||u)&&m(i,r,"Got unwanted exception"+n),e&&i&&r&&!k(i,r)||!e&&i)throw i}l.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=g(this),this.generatedMessage=!0);var r=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=p(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(l.AssertionError,Error),l.fail=m,l.ok=b,l.equal=function e(t,r,n){t!=r&&m(t,r,n,"==",l.equal)},l.notEqual=function e(t,r,n){t==r&&m(t,r,n,"!=",l.notEqual)},l.deepEqual=function e(t,r,n){v(t,r,!1)||m(t,r,n,"deepEqual",l.deepEqual)},l.deepStrictEqual=function e(t,r,n){v(t,r,!0)||m(t,r,n,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function e(t,r,n){v(t,r,!1)&&m(t,r,n,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=S,l.strictEqual=function e(t,r,n){t!==r&&m(t,r,n,"===",l.strictE
2018-08-15 13:37:47 +10:00
/**
* @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>
2018-08-29 17:20:11 +10:00
*/(function(){var o,s="3.10.1",a=1,u=2,c=4,f=8,l=16,h=32,p=64,d=128,y=256,g=30,m="...",b=150,v=16,_=200,w=1,S=2,k="Expected a function",E="__lodash_placeholder__",A="[object Arguments]",x="[object Array]",I="[object Boolean]",T="[object Date]",B="[object Error]",C="[object Function]",P="[object Map]",O="[object Number]",R="[object Object]",N="[object RegExp]",L="[object Set]",j="[object String]",M="[object WeakMap]",K="[object ArrayBuffer]",D="[object Float32Array]",U="[object Float64Array]",F="[object Int8Array]",q="[object Int16Array]",H="[object Int32Array]",z="[object Uint8Array]",V="[object Uint8ClampedArray]",G="[object Uint16Array]",W="[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,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,pe=/^0[xX]/,de=/^\[object .+?Constructor\]$/,ye=/^\d+$/,ge=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,me=/($^)/,be=/['\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"],ke=-1,Ee={};Ee[D]=Ee[U]=Ee[F]=Ee[q]=Ee[H]=Ee[z]=Ee[V]=Ee[G]=Ee[W]=!0,Ee[A]=Ee[x]=Ee[K]=Ee[I]=Ee[T]=Ee[B]=Ee[C]=Ee[P]=Ee[O]=Ee[R]=Ee[N]=Ee[L]=Ee[j]=Ee[M]=!1;var Ae={};Ae[A]=Ae[x]=Ae[K]=Ae[I]=Ae[T]=Ae[D]=Ae[U]=Ae[F]=Ae[q]=Ae[H]=Ae[O]=Ae[R]=Ae[N]=Ae[j]=Ae[z]=Ae[V]=Ae[G]=Ae[W]=!0,Ae[B]=Ae[C]=Ae[P]=Ae[L]=Ae[M]=!1;var xe={"À":"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"},Ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Te={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Be={function:!0,object:!0},Ce={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"},Pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Oe=Be[typeof t]&&t&&!t.nodeType&&t,Re=Be[typeof e]&&e&&!e.nodeType&&e,Ne=Oe&&Re&&"object"==typeof n&&n&&n.Object&&n,Le=Be[typeof self]&&self&&self.Object&&self,je=Be[typeof window]&&window&&window.Object&&window,Me=Re&&Re.exports===Oe&&Oe,Ke=Ne||je!==(this&&this.window)&&je||Le||this;function De(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 Fe(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 qe(e){return"function"==typeof e||!1}function He(e){return null==e?"":e+""}function ze(e,t){for(var r=-1,n=e.length;++r<n&&t.indexOf(e.charAt(r))>-1;);return r}function Ve(e,t){for(var r=e.length;r--&&t.indexOf(e.charAt(r))>-1;);ret
2018-08-15 13:37:47 +10:00
/** 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
**/
2018-08-29 17:20:11 +10:00
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){e.exports={encode:r(630),decode:r(631),encodingLength:r(632)}},function(e,t,r){"use strict";(function(t){var n=r(0),i=r(13),o=r(30),s=r(20);function a(e,t){if(e.length!==t.length)return!1;for(var r=e.length,n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}e.exports={fill:function e(t,r){s.checkArgumentType(t,"Buffer","buffer"),s.checkArgumentType(r,"number","value");for(var n=t.length,i=0;i<n;i++)t[i]=r;return t},copy:function(e){var r=new t(e.length);return e.copy(r),r},isBuffer:function e(t){return n.Buffer.isBuffer(t)||t instanceof Uint8Array},emptyBuffer:function e(t){s.checkArgumentType(t,"number","bytes");for(var r=new n.Buffer(t),i=0;i<t;i++)r.write("\0",i);return r},concat:n.Buffer.concat,equals:a,equal:a,integerAsSingleByteBuffer:function e(t){return s.checkArgumentType(t,"number","integer"),new n.Buffer([255&t])},integerAsBuffer:function e(r){s.checkArgumentType(r,"number","integer");var n=[];return n.push(r>>24&255),n.push(r>>16&255),n.push(r>>8&255),n.push(255&r),new t(n)},integerFromBuffer:function e(t){return s.checkArgumentType(t,"Buffer","buffer"),t[0]<<24|t[1]<<16|t[2]<<8|t[3]},integerFromSingleByteBuffer:function e(t){return s.checkArgumentType(t,"Buffer","buffer"),t[0]},bufferToHex:function e(t){return s.checkArgumentType(t,"Buffer","buffer"),t.toString("hex")},reverse:function e(t){for(var r=new n.Buffer(t.length),i=0;i<t.length;i++)r[i]=t[t.length-i-1];return r},hexToBuffer:function e(t){return i(o.isHexa(t)),new n.Buffer(t,"hex")}},e.exports.NULL_HASH=e.exports.fill(new t(32),0),e.exports.EMPTY_BUFFER=new t(0)}).call(this,r(0).Buffer)},function(e,t,r){var n=r(394),i=r(230),o=n.tfJSON,s=n.TfTypeError,a=n.TfPropertyTypeError,u=n.tfSubError,c=n.getValueTypeName,f={arrayOf:function e(t){function r(e,r){return!!i.Array(e)&&(!i.Nil(e)&&e.every(function(e,n){try{return h(t,e,r)}catch(e){throw u(e,n)}}))}return t=l(t),r.toJSON=function(){return"["+o(t)+"]"},r},maybe:function e(t){function r(r,n){return i.Nil(r)||t(r,n,e)}return t=l(t),r.toJSON=function(){return"?"+o(t)},r},map:function e(t,r){function n(e,n){if(!i.Object(e))return!1;if(i.Nil(e))return!1;for(var o in e){try{r&&h(r,o,n)}catch(e){throw u(e,o,"key")}try{var s=e[o];h(t,s,n)}catch(e){throw u(e,o)}}return!0}return t=l(t),r&&(r=l(r)),n.toJSON=r?function(){return"{"+o(r)+": "+o(t)+"}"}:function(){return"{"+o(t)+"}"},n},object:function e(t){var r={};for(var n in t)r[n]=l(t[n]);function s(e,t){if(!i.Object(e))return!1;if(i.Nil(e))return!1;var n;try{for(n in r){var o=r[n],s=e[n];h(o,s,t)}}catch(e){throw u(e,n)}if(t)for(n in e)if(!r[n])throw new a(void 0,n);return!0}return s.toJSON=function(){return o(r)},s},oneOf:function e(){var t=[].slice.call(arguments).map(l);function r(e,r){return t.some(function(t){try{return h(t,e,r)}catch(e){return!1}})}return r.toJSON=function(){return t.map(o).join("|")},r},quacksLike:function e(t){function r(e){return t===c(e)}return r.toJSON=function(){return t},r},tuple:function e(){var t=[].slice.call(arguments).map(l);function r(e,r){return!i.Nil(e)&&(!i.Nil(e.length)&&((!r||e.length===t.length)&&t.every(function(t,n){try{return h(t,e[n],r)}catch(e){throw u(e,n)}})))}return r.toJSON=function(){return"("+t.map(o).join(", ")+")"},r},value:function e(t){function r(e){return e===t}return r.toJSON=function(){return t},r}};function l(e){return i.String(e)?"?"===e[0]?f.maybe(e.slice(1)):i[e]||f.quacksLike(e):e&&i.Object(e)?i.Array(e)?f.arrayOf(e[0]):f.object(e):i.Function(e)?e:f.value(e)}function h(e,t,r,n){if(i.Function(e)){if(e(t,r))return!0;throw new s(n||e,t)}return h(l(e),t,r)}for(var p in i)h[p]=i[p];for(p in f)h[p]=f[p];var d=r(
2018-08-15 13:37:47 +10:00
/**
* [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
2018-08-29 17:20:11 +10:00
*/
!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 l=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,h=r(725),p=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],g=[4,1024,262144,67108864],m=[1,256,65536,16777216],b=[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],k=["hex","buffer","arrayBuffer","array","digest"],E={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!p||!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 A=function(e,t,r){return function(n){return new H(e,t,e).update(n)[r]()}},x=function(e,t,r){return function(n,i){return new H(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]()}},B=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},C=function(e,t){var r=A(e,t,"hex");return r.create=function(){return new H(e,t,e)},r.update=function(e){return r.create().update(e)},B(r,A,e,t)},P=function(e,t){var r=x(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)},B(r,x,e,t)},O=function(e,t){var r=E[e],n=I(e,t,"hex");return n.create=function(n,i,o){return i||o?new H(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)},B(n,I,e,t)},R=function(e,t){var r=E[e],n=T(e,t,"hex");return n.create=function(n,i,o){return new z(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)},B(n,T,e,t)},N=[{name:"keccak",padding:m,bits:w,createMethod:C},{name:"sha3",padding:b,bits:w,createMethod:C},{name:"shake",padding:y,bits:S,createMethod:P},{name:"cshake",padding:g,bits:S,createMethod:O},{name:"kmac",padding:g,bits:S,createMethod:R}],L={},j=[],M=0;M<N.length;++M)for(var K=N[M],D=K.bits,U=0;U<D.length;++U){var F=K.name+"_"+D[U];if(j.push(F),L[F]=K.createMethod(D[U],K.padding),"sha3"!==K.name){var q=K.name+D[U];j.push(q),L[q]=L[F]}}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 z(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(p&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||p&&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,l;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)l=e.charCodeAt(u),l<128?n[f>>2]|=l<<v[3&f++]:l<2048?(n[f>>2]|=(192|l>>6)<<v[3&f++],n[f>>2]|=(128|63&l)<<v[3&f++]):l<55296||l>=57344?(n[f>>2]|=(224|l>>12)<<v[3&f++],n[f>>2]|=(128|l>>6&63)<<v[3&f++],n[f>>2]|=(128|63&l)<<v[3&f++]):(l=65536+((1023&l)<<10|1023&e.charCodeAt(++u)),n[f>>2]|=(240|l>>18)<<v[3&f++],n[f>>2]|=(128|l>>12&63)<<v[3&f++],n[f>>2]|=(128|l>>6&63)<<v[3&f++],n[f>>2]|=(128|63&l)<<v[3&f++]);if(this.lastByteIndex=f,f>=i
2018-08-15 13:37:47 +10:00
/**
* @file Web Cryptography API shim
* @author Artem S Vybornov <vybornov@gmail.com>
* @license MIT
*/
2018-08-29 17:20:11 +10:00
e.exports=function e(t){"use strict";if("function"!=typeof Promise)throw"Promise support required";var r=t.crypto||t.msCrypto;if(r){var n=r.subtle||r.webkitSubtle;if(n){var i=t.Crypto||r.constructor||Object,o=t.SubtleCrypto||n.constructor||Object,s=t.CryptoKey||t.Key||Object,a=t.navigator.userAgent.indexOf("Edge/")>-1,u=!!t.msCrypto&&!a,c=!r.subtle&&!!r.webkitSubtle;if(u||c){var f={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},l={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach(function(e){var t=n[e];n[e]=function(i,o,s){var a=[].slice.call(arguments),f,l,h,p;switch(e){case"generateKey":f=m(i),l=o,h=s;break;case"importKey":f=m(s),l=a[3],h=a[4],"jwk"===i&&(o=v(o),o.alg||(o.alg=b(f)),o.key_ops||(o.key_ops="oct"!==o.kty?"d"in o?h.filter(I):h.filter(x):h.slice()),a[1]=_(o));break;case"unwrapKey":f=a[4],l=a[5],h=a[6],a[2]=s._key}if("generateKey"===e&&"HMAC"===f.name&&f.hash)return f.length=f.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[f.hash.name],n.importKey("raw",r.getRandomValues(new Uint8Array(f.length+7>>3)),f,l,h);if(c&&"generateKey"===e&&"RSASSA-PKCS1-v1_5"===f.name&&(!f.modulusLength||f.modulusLength>=2048))return i=m(i),i.name="RSAES-PKCS1-v1_5",delete i.hash,n.generateKey(i,!0,["encrypt","decrypt"]).then(function(e){return Promise.all([n.exportKey("jwk",e.publicKey),n.exportKey("jwk",e.privateKey)])}).then(function(e){return e[0].alg=e[1].alg=b(f),e[0].key_ops=h.filter(x),e[1].key_ops=h.filter(I),Promise.all([n.importKey("jwk",e[0],f,!0,e[0].key_ops),n.importKey("jwk",e[1],f,l,e[1].key_ops)])}).then(function(e){return{publicKey:e[0],privateKey:e[1]}});if((c||u&&"SHA-1"===(f.hash||{}).name)&&"importKey"===e&&"jwk"===i&&"HMAC"===f.name&&"oct"===o.kty)return n.importKey("raw",y(d(o.k)),s,a[3],a[4]);if(c&&"importKey"===e&&("spki"===i||"pkcs8"===i))return n.importKey("jwk",w(o),s,a[3],a[4]);if(u&&"unwrapKey"===e)return n.decrypt(a[3],s,o).then(function(e){return n.importKey(i,e,a[4],a[5],a[6])});try{p=t.apply(n,a)}catch(e){return Promise.reject(e)}return u&&(p=new Promise(function(e,t){p.onabort=p.onerror=function(e){t(e)},p.oncomplete=function(t){e(t.target.result)}})),p=p.then(function(e){return"HMAC"===f.name&&(f.length||(f.length=8*e.algorithm.length)),0==f.name.search("RSA")&&(f.modulusLength||(f.modulusLength=(e.publicKey||e).algorithm.modulusLength),f.publicExponent||(f.publicExponent=(e.publicKey||e).algorithm.publicExponent)),e=e.publicKey&&e.privateKey?{publicKey:new A(e.publicKey,f,l,h.filter(x)),privateKey:new A(e.privateKey,f,l,h.filter(I))}:new A(e,f,l,h),e}),p}}),["exportKey","wrapKey"].forEach(function(e){var t=n[e];n[e]=function(r,i,o){var s=[].slice.call(arguments),a;switch(e){case"exportKey":s[1]=i._key;break;case"wrapKey":s[1]=i._key,s[2]=o._key}if((c||u&&"SHA-1"===(i.algorithm.hash||{}).name)&&"exportKey"===e&&"jwk"===r&&"HMAC"===i.algorithm.name&&(s[0]="raw"),!c||"exportKey"!==e||"spki"!==r&&"pkcs8"!==r||(s[0]="jwk"),u&&"wrapKey"===e)return n.exportKey(r,i).then(function(e){return"jwk"===r&&(e=y(unescape(encodeURIComponent(JSON.stringify(v(e)))))),n.encrypt(s[3],o,e)});try{a=t.apply(n,s)}catch(e){return Promise.reject(e)}return u&&(a=new Promise(function(e,t){a.onabort=a.onerror=function(e){t(e)},a.oncomplete=function(t){e(t.target.result)}})),"exportKey"===e&&"jwk"===r&&(a=a.then(function(e){return(c||u&&"SHA-1"===(i.algorithm.hash||{}).name)&&"HMAC"===i.algorithm.name?{kty:"oct",alg:b(i.algorithm),key_ops:i.usages.slice(),ext:!0,k:p(g(e))}:(e=v(e),e.alg||(e.alg=b(i.algorithm)),e.key_ops||(e.key_ops="public"===i.type?i.usages.filter(x):"private"===i.type?i.usages.filter(I):i.usages.slice()),e)})),!c||"exportKey"!==e||"spki"!==r&&"pkcs8"!==r||(a=a.then(function(e){return e=S(v(e)),e})),a}}),["encrypt","decrypt","sign","verify"].forEach(function(e){var t=n[e];n[e]=function(r,i,o,s){if(u&&(!o.byteLength||s&&!s.byteLength))throw new Error("Empy input is not allowed");var a=[].slice.call(arguments),c=m(r),f;if(u&&"decrypt"===e&&"AES-GCM"===c.name){var l=r.tagLength>>3;a[2]=(o.buffer||o).slice(0,o.byteLength-l),r.tag=(o.buffer||o).slice(o.byteLength-
2018-08-15 13:37:47 +10:00
/*!
* @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.
*/
2018-08-29 17:20:11 +10:00
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,r){"use strict";const n=r(79);function i(e){if("number"==typeof e){if(i.codes[e])return i.codes[e];throw new Error("no protocol with code: "+e)}if("string"==typeof e||e instanceof String){if(i.names[e])return i.names[e];throw new Error("no protocol with name: "+e)}throw new Error("invalid protocol id type: "+e)}const o=-1;function s(e,t,r,n){return{code:e,size:t,name:r,resolvable:Boolean(n)}}i.lengthPrefixedVarSize=o,i.V=o,i.table=[[4,32,"ip4"],[6,16,"tcp"],[17,16,"udp"],[33,16,"dccp"],[41,128,"ip6"],[54,o,"dns4","resolvable"],[55,o,"dns6","resolvable"],[56,o,"dnsaddr","resolvable"],[132,16,"sctp"],[302,0,"utp"],[421,i.lengthPrefixedVarSize,"ipfs"],[480,0,"http"],[443,0,"https"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[290,0,"p2p-circuit"]],i.names={},i.codes={},n(i.table,function(e){const t=s.apply(null,e);i.codes[t.code]=t,i.names[t.name]=t}),i.object=s,e.exports=i},function(e,t,r){"use strict";const n=r(5),i=r(37),o=r(46),s=r(41),a=r(220),u=r(13),c=r(55),f=r(1),l=r(107),h=r(8),p=r(991),d=r(992),y=r(993),g=r(994),m=r(997),b=r(998),v=r(999),_=r(1e3),w=r(1001),S=f("repo"),k=Number.MAX_SAFE_INTEGER,E={memory:r(490),fs:r(490)},A=r(1002).repoVersion;class x{constructor(e,t){u.equal(typeof e,"string","missing repoPath"),this.options=P(t),this.closed=!0,this.path=e,this._locker=this._getLocker(),this.root=p.create("root",this.path,this.options),this.version=d(this.root),this.config=y(this.root),this.spec=g(this.root),this.apiAddr=m(this.root)}init(e,t){S("initializing at: %s",this.path),i([e=>this.root.open(B(e)),t=>this.config.set(O(e),t),t=>this.spec.set(R(e),t),e=>this.version.set(A,e)],t)}open(e){this.closed?(S("opening at: %s",this.path),n([e=>this.root.open(B(e)),e=>this._isInitialized(e),e=>this._openLock(this.path,e),(e,t)=>{S("aquired repo.lock"),this.lockfile=e,t()},e=>{S("creating datastore"),this.datastore=p.create("datastore",c.join(this.path,"datastore"),this.options),S("creating blocks");const t=p.create("blocks",c.join(this.path,"blocks"),this.options);b(t,this.options.storageBackendOptions.blocks,e)},(e,t)=>{this.blocks=e,t()},e=>{S("creating keystore"),this.keys=p.create("keys",c.join(this.path,"keys"),this.options),e()},e=>{this.closed=!1,S("all opened"),e()}],t=>{t&&this.lockfile?this._closeLock(r=>{r?S("error removing lock",r):this.lockfile=null,e(t)}):e(t)})):setImmediate(()=>e(new Error("repo is already open")))}_getLocker(){return"string"==typeof this.options.lock?(u(E[this.options.lock],"Unknown lock type: "+this.options.lock),E[this.options.lock]):(u(this.options.lock,"No lock provided"),this.options.lock)}_openLock(e,t){this._locker.lock(e,(e,r)=>{if(e)return t(e,null);u.equal(typeof r.close,"function","Locks must have a close method"),t(null,r)})}_closeLock(e){if(this.lockfile)return this.lockfile.close(e);e()}_isLocked(e,t){if(this._locker)return this._locker.locked(e,t);t(null,!1)}_isInitialized(e){S("init check"),o({config:e=>this.config.exists(e),spec:e=>this.spe
2018-08-15 13:37:47 +10:00
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
2018-08-29 17:20:11 +10:00
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 p(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?g(e,t,r,n):"string"==typeof t?d(e,t,r):m(e,t)}function l(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 h(e,t,r,n){return l(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 p(e,t){if(l(t),e=u(e,t<0?0:0|b(t)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(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 y(e,t){var r=t.length<0?0:0|b(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function g(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=y(e,t),e}function m(e,t){if(c.isBuffer(t)){var r=0|b(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):y(e,t);if("Buffer"===t.type&&o(t.data))return y(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function b(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 M(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return L(this,t,r);case"latin1":case"binary":return j(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(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 k(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:E(e,t,r,n,i)
2018-08-15 13:37:47 +10:00
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
2018-08-29 17:20:11 +10: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 l=e.exports=b,h=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(o.isFunction(e)){if(u)return e.name;var t=e.toString(),r=t.match(h);return r&&r[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function y(e){if(u||!o.isFunction(e))return o.inspect(e);var t=p(e),r=t?": "+t:"";return"[Function"+r+"]"}function g(e){return d(y(e.actual),128)+" "+e.operator+" "+d(y(e.expected),128)}function m(e,t,r,n,i){throw new l.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function b(e,t){e||m(e,!0,t,"==",l.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=x(e),c=x(t),f,l;if(u.length!==c.length)return!1;for(u.sort(),c.sort(),l=u.length-1;l>=0;l--)if(u[l]!==c[l])return!1;for(l=u.length-1;l>=0;l--)if(f=u[l],!v(e[f],t[f],r,n))return!1;return!0}function S(e,t,r){v(e,t,!0)&&m(e,t,r,"notDeepStrictEqual",S)}function k(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 E(e){var t;try{e()}catch(e){t=e}return t}function A(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=E(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&m(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&o.isError(i),u=!e&&i&&!r;if((a&&s&&k(i,r)||u)&&m(i,r,"Got unwanted exception"+n),e&&i&&r&&!k(i,r)||!e&&i)throw i}l.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=g(this),this.generatedMessage=!0);var r=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=p(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(l.AssertionError,Error),l.fail=m,l.ok=b,l.equal=function e(t,r,n){t!=r&&m(t,r,n,"==",l.equal)},l.notEqual=function e(t,r,n){t==r&&m(t,r,n,"!=",l.notEqual)},l.deepEqual=function e(t,r,n){v(t,r,!1)||m(t,r,n,"deepEqual",l.deepEqual)},l.deepStrictEqual=function e(t,r,n){v(t,r,!0)||m(t,r,n,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function e(t,r,n){v(t,r,!1)&&m(t,r,n,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=S,l.strictEqual=function e(t,r,n){t!==r&&m(t,r,n,"===",l.strictEq
2018-08-15 13:37:47 +10:00
/*!
* prr
* (c) 2013 Rod Vagg <rod@vagg.org>
* https://github.com/rvagg/prr
* License: MIT
*/
2018-08-29 17:20:11 +10:00
var r,n,i;r="prr",n=this,i=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},void 0!==e&&e.exports?e.exports=i():n.prr=i()},function(e,t,r){"use strict";var n=r(223).AbstractLevelDOWN,i=r(223).AbstractChainedBatch,o=r(223).AbstractIterator,s=r(4),a=r(27),u=r(709),c=r(711).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 l(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 h(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 h(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 l(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(l,o),l.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)})},l.prototype._end=function(e){this.it.end(e)},s(h,i),h.prototype._put=function(e,t){e=this.codec.encodeKey(e),t=this.codec.encodeValue(t),this.batch.put(e,t)},h.prototype._del=function(e){e=this.codec.encodeKey(e),this.batch.del(e)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(e,t){this.batch.write(e,t)}},function(e,t,r){(function(t,n){var i=r(27),o=r(369),s=r(370),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)&&(l(r)&&h(e[r])||(t[r]=e[r]));return t}function l(e){return-1!==u.indexOf(e)}function h(e){return""===e||null==e||p(e)}function p(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(
2018-08-15 13:37:47 +10:00
//! stable.js 0.1.8, https://github.com/Two-Screen/stable
//! © 2018 Angry Bytes and contributors. MIT licensed.
2018-08-29 17:20:11 +10:00
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,l;for(a=0;a<i;a+=s)for(u=a+r,c=u+r,u>i&&(u=i),c>i&&(c=i),f=a,l=u;;)if(f<u&&l<c)t(e[f],e[l])<=0?n[o++]=e[f++]:n[o++]=e[l++];else if(f<u)n[o++]=e[f++];else{if(!(l<c))break;n[o++]=e[l++]}};return e},e.exports=i()},function(e,t,r){var n=r(734),i=r(736);e.exports=n,e.exports.parse=n,e.exports.stringify=i},function(e,t,r){var n=r(735),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(y(e));break;case"message":t.messages.push(l(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:l(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}},l=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")},h=function(e){e.shift();var t=e.shift();if(";"!==e[0])throw new Error("Expected ; but found "+e[0]);return e
2018-08-15 13:37:47 +10:00
/**
* @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
2018-08-29 17:20:11 +10:00
*/(function(){var o,s="4.17.10",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",f="__lodash_hash_undefined__",l=500,h="__lodash_placeholder__",p=1,d=2,y=4,g=1,m=2,b=1,v=2,_=4,w=8,S=16,k=32,E=64,A=128,x=256,I=512,T=30,B="...",C=800,P=16,O=1,R=2,N=3,L=1/0,j=9007199254740991,M=1.7976931348623157e308,K=NaN,D=4294967295,U=D-1,F=D>>>1,q=[["ary",A],["bind",b],["bindKey",v],["curry",w],["curryRight",S],["flip",I],["partial",k],["partialRight",E],["rearg",x]],H="[object Arguments]",z="[object Array]",V="[object AsyncFunction]",G="[object Boolean]",W="[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]",le="[object ArrayBuffer]",he="[object DataView]",pe="[object Float32Array]",de="[object Float64Array]",ye="[object Int8Array]",ge="[object Int16Array]",me="[object Int32Array]",be="[object Uint8Array]",ve="[object Uint8ClampedArray]",_e="[object Uint16Array]",we="[object Uint32Array]",Se=/\b__p \+= '';/g,ke=/\b(__p \+=) '' \+/g,Ee=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ae=/&(?:amp|lt|gt|quot|#39);/g,xe=/[&<>"']/g,Ie=RegExp(Ae.source),Te=RegExp(xe.source),Be=/<%-([\s\S]+?)%>/g,Ce=/<%([\s\S]+?)%>/g,Pe=/<%=([\s\S]+?)%>/g,Oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Re=/^\w*$/,Ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,je=RegExp(Le.source),Me=/^\s+|\s+$/g,Ke=/^\s+/,De=/\s+$/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fe=/\{\n\/\* \[wrapped with (.+)\] \*/,qe=/,? & /,He=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ze=/\\(\\)?/g,Ve=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,We=/^[-+]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",lt=" \\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",ht="A-Z\\xc0-\\xd6\\xd8-\\xde",pt="\\ufe0e\\ufe0f",dt=ut+ct+"\\u2000-\\u206f"+lt,yt="[']",gt="[\\ud800-\\udfff]",mt="["+dt+"]",bt="["+ot+"]",vt="\\d+",_t="[\\u2700-\\u27bf]",wt="["+at+"]",St="[^"+tt+dt+vt+st+at+ht+"]",kt="\\ud83c[\\udffb-\\udfff]",Et="(?:"+bt+"|"+kt+")",At="[^\\ud800-\\udfff]",xt="(?:\\ud83c[\\udde6-\\uddff]){2}",It="[\\ud800-\\udbff][\\udc00-\\udfff]",Tt="["+ht+"]",Bt="\\u200d",Ct="(?:"+wt+"|"+St+")",Pt="(?:"+Tt+"|"+St+")",Ot="(?:['](?:d|ll|m|re|s|t|ve))?",Rt="(?:['](?:D|LL|M|RE|S|T|VE))?",Nt=Et+"?",Lt="[\\ufe0e\\ufe0f]?",jt="(?:\\u200d(?:"+[At,xt,It].join("|")+")"+Lt+Nt+")*",Mt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Dt=Lt+Nt+jt,Ut="(?:"+[_t,xt,It].join("|")+")"+Dt,Ft="(?:"+[At+bt+"?",bt,xt,It,gt].join("|")+")",qt=RegExp("[']","g"),Ht=RegExp(bt,"g"),zt=RegExp(kt+"(?="+kt+")|"+Ft+Dt,"g"),Vt=RegExp([Tt+"?"+wt+"+"+Ot+"(?="+[mt,Tt,"$"].join("|")+")",Pt+"+"+Rt+"(?="+[mt,Tt+Ct,"$"].join("|")+")",Tt+"?"+Ct+"+"+Ot,Tt+"+"+Rt,Kt,Mt,vt,Ut].join("|"),"g"),Gt=RegExp("["+Bt+tt+ot+pt+"]"),Wt=/[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={};